twenty-sdk 0.2.4 → 0.3.0-alpha
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/ObjectRecordGroupByDateGranularity-CtpRADP1-Bft-VMSh.mjs +3151 -0
- package/dist/ObjectRecordGroupByDateGranularity-CtpRADP1-Duv5iOeZ.js +20 -0
- package/dist/application/define-app.d.ts +18 -0
- package/dist/application/functions/define-function.d.ts +28 -0
- package/dist/application/functions/function-config.d.ts +2 -0
- package/dist/application/functions/triggers/cron-payload-type.d.ts +1 -1
- package/dist/application/index.d.ts +5 -1
- package/dist/application/objects/define-object.d.ts +35 -0
- package/dist/application/roles/define-role.d.ts +26 -0
- package/dist/cli/commands/app-add.command.d.ts +2 -1
- package/dist/cli/utils/config-loader.d.ts +43 -0
- package/dist/cli/utils/display-entity-summary.d.ts +2 -0
- package/dist/cli/utils/display-errors.d.ts +2 -0
- package/dist/cli/utils/display-warnings.d.ts +2 -0
- package/dist/cli/utils/get-new-object-file-content.d.ts +9 -0
- package/dist/cli/utils/get-role-base-file.d.ts +4 -0
- package/dist/cli/utils/load-manifest.d.ts +37 -6
- package/dist/cli/utils/validate-manifest.d.ts +22 -0
- package/dist/cli.cjs +133 -79
- package/dist/cli.mjs +3317 -3162
- package/dist/index.cjs +2 -21
- package/dist/index.mjs +237 -3283
- package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-BwpmSE4s.js +1 -0
- package/dist/vendor/twenty-shared/{FieldMetadataDefaultValue-CJU0Y2Fi.mjs → ObjectRecordGroupByDateGranularity-CtpRADP1.mjs} +219 -217
- package/dist/vendor/twenty-shared/RatingValues-B_wgYyso.js +1 -0
- package/dist/vendor/twenty-shared/{RatingValues-4GPp8aN_.mjs → RatingValues-DNSj7xKA.mjs} +63 -5
- package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts +1 -0
- package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/application/index.d.ts +1 -1
- package/dist/vendor/twenty-shared/application/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/application/objectManifestType.d.ts +1 -1
- package/dist/vendor/twenty-shared/application/objectManifestType.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/application/serverlessFunctionManifestType.d.ts +12 -1
- package/dist/vendor/twenty-shared/application/serverlessFunctionManifestType.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/constants/GroupByDateGranularityThatRequireTimeZone.d.ts +4 -0
- package/dist/vendor/twenty-shared/constants/GroupByDateGranularityThatRequireTimeZone.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/constants/ViewGroupVisibleOptionsMax.d.ts +2 -0
- package/dist/vendor/twenty-shared/constants/ViewGroupVisibleOptionsMax.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/constants/index.d.ts +2 -0
- package/dist/vendor/twenty-shared/constants/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/constants.cjs +1 -1
- package/dist/vendor/twenty-shared/constants.mjs +34 -33
- package/dist/vendor/twenty-shared/index.cjs +1 -1
- package/dist/vendor/twenty-shared/index.d.ts +0 -1
- package/dist/vendor/twenty-shared/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/index.mjs +2 -5
- package/dist/vendor/twenty-shared/isValidCountryCode-DKpNbkXA.mjs +8533 -0
- package/dist/vendor/twenty-shared/isValidCountryCode-DgPRUhSL.js +4 -0
- package/dist/vendor/twenty-shared/metadata/MetadataValidationError.d.ts +2 -2
- package/dist/vendor/twenty-shared/metadata/MetadataValidationError.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts +4 -0
- package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/metadata.cjs +1 -1
- package/dist/vendor/twenty-shared/metadata.mjs +12 -8
- package/dist/vendor/twenty-shared/types/ArraySortDirection.d.ts +2 -0
- package/dist/vendor/twenty-shared/types/ArraySortDirection.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/types/CrudOperationType.d.ts +8 -0
- package/dist/vendor/twenty-shared/types/CrudOperationType.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/types/ExtractPropertiesThatEndsWithIds.d.ts +4 -0
- package/dist/vendor/twenty-shared/types/ExtractPropertiesThatEndsWithIds.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/types/RecordFilterValueDependencies.d.ts +1 -0
- package/dist/vendor/twenty-shared/types/RecordFilterValueDependencies.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types/SettingsPath.d.ts +3 -1
- package/dist/vendor/twenty-shared/types/SettingsPath.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types/ViewFilterOperand.d.ts +1 -1
- package/dist/vendor/twenty-shared/types/ViewFilterOperand.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types/index.d.ts +3 -0
- package/dist/vendor/twenty-shared/types/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/types.cjs +1 -1
- package/dist/vendor/twenty-shared/types.mjs +60 -59
- package/dist/vendor/twenty-shared/utils/array/{upsertIntoArrayOfObjectComparingId.d.ts → upsertIntoArrayOfObjectsComparingId.d.ts} +1 -1
- package/dist/vendor/twenty-shared/utils/array/upsertIntoArrayOfObjectsComparingId.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId.d.ts +6 -0
- package/dist/vendor/twenty-shared/utils/array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateAfter.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateAfter.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateBefore.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateBefore.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateBeforeOrEqual.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateBeforeOrEqual.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateInSameMonth.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateInSameMonth.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateInWeekend.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isPlainDateInWeekend.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/isSamePlainDate.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/isSamePlainDate.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/parseToPlainDateOrThrow.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/parseToPlainDateOrThrow.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/sortPlainDate.d.ts +5 -0
- package/dist/vendor/twenty-shared/utils/date/sortPlainDate.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/turnJSDateToPlainDate.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/turnJSDateToPlainDate.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/turnPlainDateIntoUserTimeZoneInstantString.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/turnPlainDateIntoUserTimeZoneInstantString.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/date/turnPlainDateToShiftedDateInSystemTimeZone.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/date/turnPlainDateToShiftedDateInSystemTimeZone.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/index.d.ts +3 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataNumericKind.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataNumericKind.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataSelectKind.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataSelectKind.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataTextKind.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataTextKind.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/types/DateTimePeriod.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/types/DateTimePeriod.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToDateTime.d.ts +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToDateTime.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToZonedDateTime.d.ts +5 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToZonedDateTime.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertCalendarStartDayNonIsoNumberToFirstDayOfTheWeek.d.ts +5 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertCalendarStartDayNonIsoNumberToFirstDayOfTheWeek.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertFirstDayOfTheWeekToCalendarStartDayNumber.d.ts +5 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertFirstDayOfTheWeekToCalendarStartDayNumber.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getFirstDayOfTheWeekAsISONumber.d.ts +4 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getFirstDayOfTheWeekAsISONumber.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getNextPeriodStart.d.ts +8 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getNextPeriodStart.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPeriodStart.d.ts +7 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPeriodStart.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/relativeDateFilterStringifiedSchema.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveDateTimeFilter.d.ts +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveDateTimeFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilter.d.ts +2 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilterStringified.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilter.d.ts +4 -3
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilterStringified.d.ts +5 -3
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilterStringified.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/subUnitFromZonedDateTime.d.ts +5 -0
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/subUnitFromZonedDateTime.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/utils/filter/turnRecordFilterIntoGqlOperationFilter.d.ts +1 -1
- package/dist/vendor/twenty-shared/utils/filter/turnRecordFilterIntoGqlOperationFilter.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/index.d.ts +24 -7
- package/dist/vendor/twenty-shared/utils/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils/url/lowercaseUrlOriginAndRemoveTrailingSlash.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/utils.cjs +2 -3
- package/dist/vendor/twenty-shared/utils.mjs +774 -2484
- package/dist/vendor/twenty-shared/workflow/constants/IfElseBranchPositionOffsets.d.ts +11 -0
- package/dist/vendor/twenty-shared/workflow/constants/IfElseBranchPositionOffsets.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow/index.d.ts +6 -0
- package/dist/vendor/twenty-shared/workflow/index.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/filter-action-settings-schema.d.ts +2 -5
- package/dist/vendor/twenty-shared/workflow/schemas/filter-action-settings-schema.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/http-request-action-schema.d.ts +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/http-request-action-settings-schema.d.ts +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-schema.d.ts +49 -0
- package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-schema.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-settings-schema.d.ts +43 -0
- package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-settings-schema.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow/schemas/step-filter-group-schema.d.ts +10 -0
- package/dist/vendor/twenty-shared/workflow/schemas/step-filter-group-schema.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow/schemas/step-filter-schema.d.ts +16 -0
- package/dist/vendor/twenty-shared/workflow/schemas/step-filter-schema.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts +46 -1
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts +46 -1
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts +46 -1
- package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts.map +1 -1
- package/dist/vendor/twenty-shared/workflow/types/StepIfElseBranch.d.ts +6 -0
- package/dist/vendor/twenty-shared/workflow/types/StepIfElseBranch.d.ts.map +1 -0
- package/dist/vendor/twenty-shared/workflow.cjs +3 -3
- package/dist/vendor/twenty-shared/workflow.mjs +199 -174
- package/package.json +3 -1
- package/dist/_commonjsHelpers-DKOUU3wS.js +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
- package/dist/cli/utils/get-object-decorated-class.d.ts +0 -4
- package/dist/vendor/twenty-shared/FieldMetadataDefaultValue-CmL_eyqR.js +0 -1
- package/dist/vendor/twenty-shared/LabelIdentifierFieldMetadataTypes-BaWEb4k0.js +0 -1
- package/dist/vendor/twenty-shared/LabelIdentifierFieldMetadataTypes-BzzhC1dx.mjs +0 -55
- package/dist/vendor/twenty-shared/RatingValues-CBa057Mi.js +0 -1
- package/dist/vendor/twenty-shared/isValidCountryCode-DNOavXY6.js +0 -4
- package/dist/vendor/twenty-shared/isValidCountryCode-QjE8dukS.mjs +0 -6850
- package/dist/vendor/twenty-shared/utils/array/upsertIntoArrayOfObjectComparingId.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getDateFromPlainDate.d.ts +0 -2
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getDateFromPlainDate.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getEndUnitOfDateTime.d.ts +0 -6
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getEndUnitOfDateTime.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPlainDateFromDate.d.ts +0 -2
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPlainDateFromDate.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getStartUnitOfDateTime.d.ts +0 -6
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/getStartUnitOfDateTime.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/shiftPointInTimeFromTimezoneDifferenceInMinutesWithSystemTimezone.d.ts +0 -2
- package/dist/vendor/twenty-shared/utils/filter/dates/utils/shiftPointInTimeFromTimezoneDifferenceInMinutesWithSystemTimezone.d.ts.map +0 -1
- package/dist/vendor/twenty-shared/utils/filter/utils/computeTimezoneDifferenceInMinutes.d.ts +0 -2
- package/dist/vendor/twenty-shared/utils/filter/utils/computeTimezoneDifferenceInMinutes.d.ts.map +0 -1
package/dist/cli.cjs
CHANGED
|
@@ -1,33 +1,82 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const
|
|
3
|
-
`),a=no.default(i),u=a[0].toUpperCase()+a.slice(1);return`import { Object } from 'twenty-sdk';
|
|
2
|
+
"use strict";const J0=require("chalk"),Ii=require("commander"),Q0=require("fs-extra"),z0=require("inquirer"),ke=require("path"),Y0=require("lodash.camelcase"),H0=require("lodash.kebabcase"),_i=require("uuid"),kn=require("./ObjectRecordGroupByDateGranularity-CtpRADP1-Duv5iOeZ.js"),K0=require("axios"),X0=require("graphql-sse"),Z0=require("os"),ev=require("fast-glob"),tv=require("jiti"),nv=require("url"),rv=require("jsonc-parser"),iv=require("chokidar"),sv=require("@genql/cli");var Xs=typeof document<"u"?document.currentScript:null;const vr=n=>n&&n.__esModule?n:{default:n};function xi(n){if(n&&n.__esModule)return n;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const F=vr(J0),Ie=xi(Q0),$n=vr(z0),yt=xi(ke),ov=vr(Y0),Ti=vr(H0),Zs=vr(K0),av=xi(Z0),uv=xi(iv),vt=process.env.INIT_CWD||process.cwd(),cv=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
${
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export default defineObject({
|
|
5
|
+
universalIdentifier: '${_i.v4()}',
|
|
6
|
+
nameSingular: '${n.nameSingular}',
|
|
7
|
+
namePlural: '${n.namePlural}',
|
|
8
|
+
labelSingular: '${n.labelSingular}',
|
|
9
|
+
labelPlural: '${n.labelPlural}',
|
|
10
|
+
icon: 'IconBox',
|
|
11
|
+
fields: [
|
|
12
|
+
// Add your fields here using defineField helper
|
|
13
|
+
// Example:
|
|
14
|
+
// {
|
|
15
|
+
// universalIdentifier: '...',
|
|
16
|
+
// type: FieldMetadataType.TEXT,
|
|
17
|
+
// name: 'description',
|
|
18
|
+
// label: 'Description',
|
|
19
|
+
// },
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
`,lv=({name:n,universalIdentifier:i=_i.v4()})=>{const r=Ti.default(n),a=_i.v4();return`import { defineFunction } from 'twenty-sdk';
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
// Handler function - rename and implement your logic
|
|
25
|
+
export const handler = async (params: {
|
|
12
26
|
a: string;
|
|
13
27
|
b: number;
|
|
14
28
|
}): Promise<{ message: string }> => {
|
|
15
29
|
const { a, b } = params;
|
|
16
30
|
|
|
17
|
-
//
|
|
18
|
-
// This is just an example
|
|
31
|
+
// Replace with your own logic
|
|
19
32
|
const message = \`Hello, input: \${a} and \${b}\`;
|
|
20
33
|
|
|
21
34
|
return { message };
|
|
22
35
|
};
|
|
23
36
|
|
|
24
|
-
export
|
|
37
|
+
export default defineFunction({
|
|
25
38
|
universalIdentifier: '${i}',
|
|
26
39
|
name: '${r}',
|
|
40
|
+
description: 'Add a description for your function',
|
|
27
41
|
timeoutSeconds: 5,
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
handler,
|
|
43
|
+
triggers: [
|
|
44
|
+
// Add your triggers here
|
|
45
|
+
// Route trigger example:
|
|
46
|
+
// {
|
|
47
|
+
// universalIdentifier: '${a}',
|
|
48
|
+
// type: 'route',
|
|
49
|
+
// path: '/${r}',
|
|
50
|
+
// httpMethod: 'POST',
|
|
51
|
+
// },
|
|
52
|
+
// Cron trigger example:
|
|
53
|
+
// {
|
|
54
|
+
// universalIdentifier: '...',
|
|
55
|
+
// type: 'cron',
|
|
56
|
+
// pattern: '0 0 * * *', // Daily at midnight
|
|
57
|
+
// },
|
|
58
|
+
// Database event trigger example:
|
|
59
|
+
// {
|
|
60
|
+
// universalIdentifier: '...',
|
|
61
|
+
// type: 'databaseEvent',
|
|
62
|
+
// eventName: 'objectName.created',
|
|
63
|
+
// },
|
|
64
|
+
],
|
|
65
|
+
});
|
|
66
|
+
`},fv=({name:n,universalIdentifier:i=_i.v4()})=>{const r=Ti.default(n);return`import { defineRole } from 'twenty-sdk';
|
|
67
|
+
|
|
68
|
+
export const ${r.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
69
|
+
'${i}';
|
|
30
70
|
|
|
71
|
+
export default defineRole({
|
|
72
|
+
universalIdentifier: ${r.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER,
|
|
73
|
+
label: '${n}',
|
|
74
|
+
description: 'Add a description for your role',
|
|
75
|
+
canReadAllObjectRecords: true,
|
|
76
|
+
canUpdateAllObjectRecords: true,
|
|
77
|
+
canSoftDeleteAllObjectRecords: true,
|
|
78
|
+
canDestroyAllObjectRecords: false,
|
|
79
|
+
});
|
|
31
80
|
`};var pr={exports:{}};/**
|
|
32
81
|
* @license
|
|
33
82
|
* Lodash <https://lodash.com/>
|
|
@@ -35,36 +84,36 @@ export const config: FunctionConfig = {
|
|
|
35
84
|
* Released under MIT license <https://lodash.com/license>
|
|
36
85
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
37
86
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
38
|
-
*/var iy=pr.exports,zu;function sy(){return zu||(zu=1,function(n,i){(function(){var r,a="4.17.21",u=200,p="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",_="Invalid `variable` option passed into `_.template`",N="__lodash_hash_undefined__",D=500,C="__lodash_placeholder__",J=1,Y=2,oe=4,V=1,we=2,pe=1,ve=2,en=4,_e=8,Ne=16,Re=32,ze=64,Ue=128,tn=256,A=512,G=30,Ye="...",Li=800,zc=16,mo=1,Yc=2,Hc=3,nn=1/0,$t=9007199254740991,Kc=17976931348623157e292,wr=NaN,_t=4294967295,Xc=_t-1,Zc=_t>>>1,el=[["ary",Ue],["bind",pe],["bindKey",ve],["curry",_e],["curryRight",Ne],["flip",A],["partial",Re],["partialRight",ze],["rearg",tn]],_n="[object Arguments]",Er="[object Array]",tl="[object AsyncFunction]",Vn="[object Boolean]",jn="[object Date]",nl="[object DOMException]",xr="[object Error]",Ar="[object Function]",yo="[object GeneratorFunction]",lt="[object Map]",qn="[object Number]",rl="[object Null]",Nt="[object Object]",vo="[object Promise]",il="[object Proxy]",Jn="[object RegExp]",ft="[object Set]",Qn="[object String]",Ir="[object Symbol]",sl="[object Undefined]",zn="[object WeakMap]",ol="[object WeakSet]",Yn="[object ArrayBuffer]",Tn="[object DataView]",Ci="[object Float32Array]",Ri="[object Float64Array]",Di="[object Int8Array]",Fi="[object Int16Array]",ki="[object Int32Array]",Ui="[object Uint8Array]",Pi="[object Uint8ClampedArray]",Mi="[object Uint16Array]",$i="[object Uint32Array]",al=/\b__p \+= '';/g,ul=/\b(__p \+=) '' \+/g,cl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_o=/&(?:amp|lt|gt|quot|#39);/g,To=/[&<>"']/g,ll=RegExp(_o.source),fl=RegExp(To.source),pl=/<%-([\s\S]+?)%>/g,hl=/<%([\s\S]+?)%>/g,wo=/<%=([\s\S]+?)%>/g,dl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gl=/^\w*$/,ml=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bi=/[\\^$.*+?()[\]{}|]/g,yl=RegExp(Bi.source),Gi=/^\s+/,vl=/\s/,_l=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tl=/\{\n\/\* \[wrapped with (.+)\] \*/,wl=/,? & /,El=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xl=/[()=,{}\[\]\/\s]/,Al=/\\(\\)?/g,Il=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Eo=/\w*$/,Nl=/^[-+]0x[0-9a-f]+$/i,Sl=/^0b[01]+$/i,bl=/^\[object .+?Constructor\]$/,Ol=/^0o[0-7]+$/i,Ll=/^(?:0|[1-9]\d*)$/,Cl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr=/($^)/,Rl=/['\n\r\u2028\u2029\\]/g,Sr="\\ud800-\\udfff",Dl="\\u0300-\\u036f",Fl="\\ufe20-\\ufe2f",kl="\\u20d0-\\u20ff",xo=Dl+Fl+kl,Ao="\\u2700-\\u27bf",Io="a-z\\xdf-\\xf6\\xf8-\\xff",Ul="\\xac\\xb1\\xd7\\xf7",Pl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ml="\\u2000-\\u206f",$l=" \\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",No="A-Z\\xc0-\\xd6\\xd8-\\xde",So="\\ufe0e\\ufe0f",bo=Ul+Pl+Ml+$l,Wi="['’]",Bl="["+Sr+"]",Oo="["+bo+"]",br="["+xo+"]",Lo="\\d+",Gl="["+Ao+"]",Co="["+Io+"]",Ro="[^"+Sr+bo+Lo+Ao+Io+No+"]",Vi="\\ud83c[\\udffb-\\udfff]",Wl="(?:"+br+"|"+Vi+")",Do="[^"+Sr+"]",ji="(?:\\ud83c[\\udde6-\\uddff]){2}",qi="[\\ud800-\\udbff][\\udc00-\\udfff]",wn="["+No+"]",Fo="\\u200d",ko="(?:"+Co+"|"+Ro+")",Vl="(?:"+wn+"|"+Ro+")",Uo="(?:"+Wi+"(?:d|ll|m|re|s|t|ve))?",Po="(?:"+Wi+"(?:D|LL|M|RE|S|T|VE))?",Mo=Wl+"?",$o="["+So+"]?",jl="(?:"+Fo+"(?:"+[Do,ji,qi].join("|")+")"+$o+Mo+")*",ql="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bo=$o+Mo+jl,Ql="(?:"+[Gl,ji,qi].join("|")+")"+Bo,zl="(?:"+[Do+br+"?",br,ji,qi,Bl].join("|")+")",Yl=RegExp(Wi,"g"),Hl=RegExp(br,"g"),Ji=RegExp(Vi+"(?="+Vi+")|"+zl+Bo,"g"),Kl=RegExp([wn+"?"+Co+"+"+Uo+"(?="+[Oo,wn,"$"].join("|")+")",Vl+"+"+Po+"(?="+[Oo,wn+ko,"$"].join("|")+")",wn+"?"+ko+"+"+Uo,wn+"+"+Po,Jl,ql,Lo,Ql].join("|"),"g"),Xl=RegExp("["+Fo+Sr+xo+So+"]"),Zl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ef=["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"],tf=-1,le={};le[Ci]=le[Ri]=le[Di]=le[Fi]=le[ki]=le[Ui]=le[Pi]=le[Mi]=le[$i]=!0,le[_n]=le[Er]=le[Yn]=le[Vn]=le[Tn]=le[jn]=le[xr]=le[Ar]=le[lt]=le[qn]=le[Nt]=le[Jn]=le[ft]=le[Qn]=le[zn]=!1;var ce={};ce[_n]=ce[Er]=ce[Yn]=ce[Tn]=ce[Vn]=ce[jn]=ce[Ci]=ce[Ri]=ce[Di]=ce[Fi]=ce[ki]=ce[lt]=ce[qn]=ce[Nt]=ce[Jn]=ce[ft]=ce[Qn]=ce[Ir]=ce[Ui]=ce[Pi]=ce[Mi]=ce[$i]=!0,ce[xr]=ce[Ar]=ce[zn]=!1;var nf={À:"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"},rf={"&":"&","<":"<",">":">",'"':""","'":"'"},sf={"&":"&","<":"<",">":">",""":'"',"'":"'"},of={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},af=parseFloat,uf=parseInt,Go=typeof di.commonjsGlobal=="object"&&di.commonjsGlobal&&di.commonjsGlobal.Object===Object&&di.commonjsGlobal,cf=typeof self=="object"&&self&&self.Object===Object&&self,Se=Go||cf||Function("return this")(),Qi=i&&!i.nodeType&&i,rn=Qi&&!0&&n&&!n.nodeType&&n,Wo=rn&&rn.exports===Qi,zi=Wo&&Go.process,He=function(){try{var g=rn&&rn.require&&rn.require("util").types;return g||zi&&zi.binding&&zi.binding("util")}catch{}}(),Vo=He&&He.isArrayBuffer,jo=He&&He.isDate,qo=He&&He.isMap,Jo=He&&He.isRegExp,Qo=He&&He.isSet,zo=He&&He.isTypedArray;function We(g,T,v){switch(v.length){case 0:return g.call(T);case 1:return g.call(T,v[0]);case 2:return g.call(T,v[0],v[1]);case 3:return g.call(T,v[0],v[1],v[2])}return g.apply(T,v)}function lf(g,T,v,O){for(var B=-1,te=g==null?0:g.length;++B<te;){var Ee=g[B];T(O,Ee,v(Ee),g)}return O}function Ke(g,T){for(var v=-1,O=g==null?0:g.length;++v<O&&T(g[v],v,g)!==!1;);return g}function ff(g,T){for(var v=g==null?0:g.length;v--&&T(g[v],v,g)!==!1;);return g}function Yo(g,T){for(var v=-1,O=g==null?0:g.length;++v<O;)if(!T(g[v],v,g))return!1;return!0}function Bt(g,T){for(var v=-1,O=g==null?0:g.length,B=0,te=[];++v<O;){var Ee=g[v];T(Ee,v,g)&&(te[B++]=Ee)}return te}function Or(g,T){var v=g==null?0:g.length;return!!v&&En(g,T,0)>-1}function Yi(g,T,v){for(var O=-1,B=g==null?0:g.length;++O<B;)if(v(T,g[O]))return!0;return!1}function fe(g,T){for(var v=-1,O=g==null?0:g.length,B=Array(O);++v<O;)B[v]=T(g[v],v,g);return B}function Gt(g,T){for(var v=-1,O=T.length,B=g.length;++v<O;)g[B+v]=T[v];return g}function Hi(g,T,v,O){var B=-1,te=g==null?0:g.length;for(O&&te&&(v=g[++B]);++B<te;)v=T(v,g[B],B,g);return v}function pf(g,T,v,O){var B=g==null?0:g.length;for(O&&B&&(v=g[--B]);B--;)v=T(v,g[B],B,g);return v}function Ki(g,T){for(var v=-1,O=g==null?0:g.length;++v<O;)if(T(g[v],v,g))return!0;return!1}var hf=Xi("length");function df(g){return g.split("")}function gf(g){return g.match(El)||[]}function Ho(g,T,v){var O;return v(g,function(B,te,Ee){if(T(B,te,Ee))return O=te,!1}),O}function Lr(g,T,v,O){for(var B=g.length,te=v+(O?1:-1);O?te--:++te<B;)if(T(g[te],te,g))return te;return-1}function En(g,T,v){return T===T?Sf(g,T,v):Lr(g,Ko,v)}function mf(g,T,v,O){for(var B=v-1,te=g.length;++B<te;)if(O(g[B],T))return B;return-1}function Ko(g){return g!==g}function Xo(g,T){var v=g==null?0:g.length;return v?es(g,T)/v:wr}function Xi(g){return function(T){return T==null?r:T[g]}}function Zi(g){return function(T){return g==null?r:g[T]}}function Zo(g,T,v,O,B){return B(g,function(te,Ee,ae){v=O?(O=!1,te):T(v,te,Ee,ae)}),v}function yf(g,T){var v=g.length;for(g.sort(T);v--;)g[v]=g[v].value;return g}function es(g,T){for(var v,O=-1,B=g.length;++O<B;){var te=T(g[O]);te!==r&&(v=v===r?te:v+te)}return v}function ts(g,T){for(var v=-1,O=Array(g);++v<g;)O[v]=T(v);return O}function vf(g,T){return fe(T,function(v){return[v,g[v]]})}function ea(g){return g&&g.slice(0,ia(g)+1).replace(Gi,"")}function Ve(g){return function(T){return g(T)}}function ns(g,T){return fe(T,function(v){return g[v]})}function Hn(g,T){return g.has(T)}function ta(g,T){for(var v=-1,O=g.length;++v<O&&En(T,g[v],0)>-1;);return v}function na(g,T){for(var v=g.length;v--&&En(T,g[v],0)>-1;);return v}function _f(g,T){for(var v=g.length,O=0;v--;)g[v]===T&&++O;return O}var Tf=Zi(nf),wf=Zi(rf);function Ef(g){return"\\"+of[g]}function xf(g,T){return g==null?r:g[T]}function xn(g){return Xl.test(g)}function Af(g){return Zl.test(g)}function If(g){for(var T,v=[];!(T=g.next()).done;)v.push(T.value);return v}function rs(g){var T=-1,v=Array(g.size);return g.forEach(function(O,B){v[++T]=[B,O]}),v}function ra(g,T){return function(v){return g(T(v))}}function Wt(g,T){for(var v=-1,O=g.length,B=0,te=[];++v<O;){var Ee=g[v];(Ee===T||Ee===C)&&(g[v]=C,te[B++]=v)}return te}function Cr(g){var T=-1,v=Array(g.size);return g.forEach(function(O){v[++T]=O}),v}function Nf(g){var T=-1,v=Array(g.size);return g.forEach(function(O){v[++T]=[O,O]}),v}function Sf(g,T,v){for(var O=v-1,B=g.length;++O<B;)if(g[O]===T)return O;return-1}function bf(g,T,v){for(var O=v+1;O--;)if(g[O]===T)return O;return O}function An(g){return xn(g)?Lf(g):hf(g)}function pt(g){return xn(g)?Cf(g):df(g)}function ia(g){for(var T=g.length;T--&&vl.test(g.charAt(T)););return T}var Of=Zi(sf);function Lf(g){for(var T=Ji.lastIndex=0;Ji.test(g);)++T;return T}function Cf(g){return g.match(Ji)||[]}function Rf(g){return g.match(Kl)||[]}var Df=function g(T){T=T==null?Se:In.defaults(Se.Object(),T,In.pick(Se,ef));var v=T.Array,O=T.Date,B=T.Error,te=T.Function,Ee=T.Math,ae=T.Object,is=T.RegExp,Ff=T.String,Xe=T.TypeError,Rr=v.prototype,kf=te.prototype,Nn=ae.prototype,Dr=T["__core-js_shared__"],Fr=kf.toString,se=Nn.hasOwnProperty,Uf=0,sa=function(){var e=/[^.]+$/.exec(Dr&&Dr.keys&&Dr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),kr=Nn.toString,Pf=Fr.call(ae),Mf=Se._,$f=is("^"+Fr.call(se).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ur=Wo?T.Buffer:r,Vt=T.Symbol,Pr=T.Uint8Array,oa=Ur?Ur.allocUnsafe:r,Mr=ra(ae.getPrototypeOf,ae),aa=ae.create,ua=Nn.propertyIsEnumerable,$r=Rr.splice,ca=Vt?Vt.isConcatSpreadable:r,Kn=Vt?Vt.iterator:r,sn=Vt?Vt.toStringTag:r,Br=function(){try{var e=ln(ae,"defineProperty");return e({},"",{}),e}catch{}}(),Bf=T.clearTimeout!==Se.clearTimeout&&T.clearTimeout,Gf=O&&O.now!==Se.Date.now&&O.now,Wf=T.setTimeout!==Se.setTimeout&&T.setTimeout,Gr=Ee.ceil,Wr=Ee.floor,ss=ae.getOwnPropertySymbols,Vf=Ur?Ur.isBuffer:r,la=T.isFinite,jf=Rr.join,qf=ra(ae.keys,ae),xe=Ee.max,Le=Ee.min,Jf=O.now,Qf=T.parseInt,fa=Ee.random,zf=Rr.reverse,os=ln(T,"DataView"),Xn=ln(T,"Map"),as=ln(T,"Promise"),Sn=ln(T,"Set"),Zn=ln(T,"WeakMap"),er=ln(ae,"create"),Vr=Zn&&new Zn,bn={},Yf=fn(os),Hf=fn(Xn),Kf=fn(as),Xf=fn(Sn),Zf=fn(Zn),jr=Vt?Vt.prototype:r,tr=jr?jr.valueOf:r,pa=jr?jr.toString:r;function l(e){if(de(e)&&!W(e)&&!(e instanceof H)){if(e instanceof Ze)return e;if(se.call(e,"__wrapped__"))return hu(e)}return new Ze(e)}var On=function(){function e(){}return function(t){if(!he(t))return{};if(aa)return aa(t);e.prototype=t;var s=new e;return e.prototype=r,s}}();function qr(){}function Ze(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}l.templateSettings={escape:pl,evaluate:hl,interpolate:wo,variable:"",imports:{_:l}},l.prototype=qr.prototype,l.prototype.constructor=l,Ze.prototype=On(qr.prototype),Ze.prototype.constructor=Ze;function H(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_t,this.__views__=[]}function ep(){var e=new H(this.__wrapped__);return e.__actions__=Pe(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pe(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pe(this.__views__),e}function tp(){if(this.__filtered__){var e=new H(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function np(){var e=this.__wrapped__.value(),t=this.__dir__,s=W(e),o=t<0,c=s?e.length:0,f=dh(0,c,this.__views__),h=f.start,d=f.end,m=d-h,w=o?d:h-1,E=this.__iteratees__,I=E.length,b=0,F=Le(m,this.__takeCount__);if(!s||!o&&c==m&&F==m)return Ua(e,this.__actions__);var U=[];e:for(;m--&&b<F;){w+=t;for(var q=-1,P=e[w];++q<I;){var z=E[q],X=z.iteratee,Je=z.type,ke=X(P);if(Je==Yc)P=ke;else if(!ke){if(Je==mo)continue e;break e}}U[b++]=P}return U}H.prototype=On(qr.prototype),H.prototype.constructor=H;function on(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function rp(){this.__data__=er?er(null):{},this.size=0}function ip(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function sp(e){var t=this.__data__;if(er){var s=t[e];return s===N?r:s}return se.call(t,e)?t[e]:r}function op(e){var t=this.__data__;return er?t[e]!==r:se.call(t,e)}function ap(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=er&&t===r?N:t,this}on.prototype.clear=rp,on.prototype.delete=ip,on.prototype.get=sp,on.prototype.has=op,on.prototype.set=ap;function St(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function up(){this.__data__=[],this.size=0}function cp(e){var t=this.__data__,s=Jr(t,e);if(s<0)return!1;var o=t.length-1;return s==o?t.pop():$r.call(t,s,1),--this.size,!0}function lp(e){var t=this.__data__,s=Jr(t,e);return s<0?r:t[s][1]}function fp(e){return Jr(this.__data__,e)>-1}function pp(e,t){var s=this.__data__,o=Jr(s,e);return o<0?(++this.size,s.push([e,t])):s[o][1]=t,this}St.prototype.clear=up,St.prototype.delete=cp,St.prototype.get=lp,St.prototype.has=fp,St.prototype.set=pp;function bt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function hp(){this.size=0,this.__data__={hash:new on,map:new(Xn||St),string:new on}}function dp(e){var t=ii(this,e).delete(e);return this.size-=t?1:0,t}function gp(e){return ii(this,e).get(e)}function mp(e){return ii(this,e).has(e)}function yp(e,t){var s=ii(this,e),o=s.size;return s.set(e,t),this.size+=s.size==o?0:1,this}bt.prototype.clear=hp,bt.prototype.delete=dp,bt.prototype.get=gp,bt.prototype.has=mp,bt.prototype.set=yp;function an(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new bt;++t<s;)this.add(e[t])}function vp(e){return this.__data__.set(e,N),this}function _p(e){return this.__data__.has(e)}an.prototype.add=an.prototype.push=vp,an.prototype.has=_p;function ht(e){var t=this.__data__=new St(e);this.size=t.size}function Tp(){this.__data__=new St,this.size=0}function wp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function Ep(e){return this.__data__.get(e)}function xp(e){return this.__data__.has(e)}function Ap(e,t){var s=this.__data__;if(s instanceof St){var o=s.__data__;if(!Xn||o.length<u-1)return o.push([e,t]),this.size=++s.size,this;s=this.__data__=new bt(o)}return s.set(e,t),this.size=s.size,this}ht.prototype.clear=Tp,ht.prototype.delete=wp,ht.prototype.get=Ep,ht.prototype.has=xp,ht.prototype.set=Ap;function ha(e,t){var s=W(e),o=!s&&pn(e),c=!s&&!o&&zt(e),f=!s&&!o&&!c&&Dn(e),h=s||o||c||f,d=h?ts(e.length,Ff):[],m=d.length;for(var w in e)(t||se.call(e,w))&&!(h&&(w=="length"||c&&(w=="offset"||w=="parent")||f&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||Rt(w,m)))&&d.push(w);return d}function da(e){var t=e.length;return t?e[vs(0,t-1)]:r}function Ip(e,t){return si(Pe(e),un(t,0,e.length))}function Np(e){return si(Pe(e))}function us(e,t,s){(s!==r&&!dt(e[t],s)||s===r&&!(t in e))&&Ot(e,t,s)}function nr(e,t,s){var o=e[t];(!(se.call(e,t)&&dt(o,s))||s===r&&!(t in e))&&Ot(e,t,s)}function Jr(e,t){for(var s=e.length;s--;)if(dt(e[s][0],t))return s;return-1}function Sp(e,t,s,o){return jt(e,function(c,f,h){t(o,c,s(c),h)}),o}function ga(e,t){return e&&wt(t,Ae(t),e)}function bp(e,t){return e&&wt(t,$e(t),e)}function Ot(e,t,s){t=="__proto__"&&Br?Br(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function cs(e,t){for(var s=-1,o=t.length,c=v(o),f=e==null;++s<o;)c[s]=f?r:Vs(e,t[s]);return c}function un(e,t,s){return e===e&&(s!==r&&(e=e<=s?e:s),t!==r&&(e=e>=t?e:t)),e}function et(e,t,s,o,c,f){var h,d=t&J,m=t&Y,w=t&oe;if(s&&(h=c?s(e,o,c,f):s(e)),h!==r)return h;if(!he(e))return e;var E=W(e);if(E){if(h=mh(e),!d)return Pe(e,h)}else{var I=Ce(e),b=I==Ar||I==yo;if(zt(e))return $a(e,d);if(I==Nt||I==_n||b&&!c){if(h=m||b?{}:iu(e),!d)return m?sh(e,bp(h,e)):ih(e,ga(h,e))}else{if(!ce[I])return c?e:{};h=yh(e,I,d)}}f||(f=new ht);var F=f.get(e);if(F)return F;f.set(e,h),Du(e)?e.forEach(function(P){h.add(et(P,t,s,P,e,f))}):Cu(e)&&e.forEach(function(P,z){h.set(z,et(P,t,s,z,e,f))});var U=w?m?Os:bs:m?$e:Ae,q=E?r:U(e);return Ke(q||e,function(P,z){q&&(z=P,P=e[z]),nr(h,z,et(P,t,s,z,e,f))}),h}function Op(e){var t=Ae(e);return function(s){return ma(s,e,t)}}function ma(e,t,s){var o=s.length;if(e==null)return!o;for(e=ae(e);o--;){var c=s[o],f=t[c],h=e[c];if(h===r&&!(c in e)||!f(h))return!1}return!0}function ya(e,t,s){if(typeof e!="function")throw new Xe(y);return cr(function(){e.apply(r,s)},t)}function rr(e,t,s,o){var c=-1,f=Or,h=!0,d=e.length,m=[],w=t.length;if(!d)return m;s&&(t=fe(t,Ve(s))),o?(f=Yi,h=!1):t.length>=u&&(f=Hn,h=!1,t=new an(t));e:for(;++c<d;){var E=e[c],I=s==null?E:s(E);if(E=o||E!==0?E:0,h&&I===I){for(var b=w;b--;)if(t[b]===I)continue e;m.push(E)}else f(t,I,o)||m.push(E)}return m}var jt=ja(Tt),va=ja(fs,!0);function Lp(e,t){var s=!0;return jt(e,function(o,c,f){return s=!!t(o,c,f),s}),s}function Qr(e,t,s){for(var o=-1,c=e.length;++o<c;){var f=e[o],h=t(f);if(h!=null&&(d===r?h===h&&!qe(h):s(h,d)))var d=h,m=f}return m}function Cp(e,t,s,o){var c=e.length;for(s=j(s),s<0&&(s=-s>c?0:c+s),o=o===r||o>c?c:j(o),o<0&&(o+=c),o=s>o?0:ku(o);s<o;)e[s++]=t;return e}function _a(e,t){var s=[];return jt(e,function(o,c,f){t(o,c,f)&&s.push(o)}),s}function be(e,t,s,o,c){var f=-1,h=e.length;for(s||(s=_h),c||(c=[]);++f<h;){var d=e[f];t>0&&s(d)?t>1?be(d,t-1,s,o,c):Gt(c,d):o||(c[c.length]=d)}return c}var ls=qa(),Ta=qa(!0);function Tt(e,t){return e&&ls(e,t,Ae)}function fs(e,t){return e&&Ta(e,t,Ae)}function zr(e,t){return Bt(t,function(s){return Dt(e[s])})}function cn(e,t){t=Jt(t,e);for(var s=0,o=t.length;e!=null&&s<o;)e=e[Et(t[s++])];return s&&s==o?e:r}function wa(e,t,s){var o=t(e);return W(e)?o:Gt(o,s(e))}function De(e){return e==null?e===r?sl:rl:sn&&sn in ae(e)?hh(e):Nh(e)}function ps(e,t){return e>t}function Rp(e,t){return e!=null&&se.call(e,t)}function Dp(e,t){return e!=null&&t in ae(e)}function Fp(e,t,s){return e>=Le(t,s)&&e<xe(t,s)}function hs(e,t,s){for(var o=s?Yi:Or,c=e[0].length,f=e.length,h=f,d=v(f),m=1/0,w=[];h--;){var E=e[h];h&&t&&(E=fe(E,Ve(t))),m=Le(E.length,m),d[h]=!s&&(t||c>=120&&E.length>=120)?new an(h&&E):r}E=e[0];var I=-1,b=d[0];e:for(;++I<c&&w.length<m;){var F=E[I],U=t?t(F):F;if(F=s||F!==0?F:0,!(b?Hn(b,U):o(w,U,s))){for(h=f;--h;){var q=d[h];if(!(q?Hn(q,U):o(e[h],U,s)))continue e}b&&b.push(U),w.push(F)}}return w}function kp(e,t,s,o){return Tt(e,function(c,f,h){t(o,s(c),f,h)}),o}function ir(e,t,s){t=Jt(t,e),e=uu(e,t);var o=e==null?e:e[Et(nt(t))];return o==null?r:We(o,e,s)}function Ea(e){return de(e)&&De(e)==_n}function Up(e){return de(e)&&De(e)==Yn}function Pp(e){return de(e)&&De(e)==jn}function sr(e,t,s,o,c){return e===t?!0:e==null||t==null||!de(e)&&!de(t)?e!==e&&t!==t:Mp(e,t,s,o,sr,c)}function Mp(e,t,s,o,c,f){var h=W(e),d=W(t),m=h?Er:Ce(e),w=d?Er:Ce(t);m=m==_n?Nt:m,w=w==_n?Nt:w;var E=m==Nt,I=w==Nt,b=m==w;if(b&&zt(e)){if(!zt(t))return!1;h=!0,E=!1}if(b&&!E)return f||(f=new ht),h||Dn(e)?tu(e,t,s,o,c,f):fh(e,t,m,s,o,c,f);if(!(s&V)){var F=E&&se.call(e,"__wrapped__"),U=I&&se.call(t,"__wrapped__");if(F||U){var q=F?e.value():e,P=U?t.value():t;return f||(f=new ht),c(q,P,s,o,f)}}return b?(f||(f=new ht),ph(e,t,s,o,c,f)):!1}function $p(e){return de(e)&&Ce(e)==lt}function ds(e,t,s,o){var c=s.length,f=c,h=!o;if(e==null)return!f;for(e=ae(e);c--;){var d=s[c];if(h&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<f;){d=s[c];var m=d[0],w=e[m],E=d[1];if(h&&d[2]){if(w===r&&!(m in e))return!1}else{var I=new ht;if(o)var b=o(w,E,m,e,t,I);if(!(b===r?sr(E,w,V|we,o,I):b))return!1}}return!0}function xa(e){if(!he(e)||wh(e))return!1;var t=Dt(e)?$f:bl;return t.test(fn(e))}function Bp(e){return de(e)&&De(e)==Jn}function Gp(e){return de(e)&&Ce(e)==ft}function Wp(e){return de(e)&&fi(e.length)&&!!le[De(e)]}function Aa(e){return typeof e=="function"?e:e==null?Be:typeof e=="object"?W(e)?Sa(e[0],e[1]):Na(e):Ju(e)}function gs(e){if(!ur(e))return qf(e);var t=[];for(var s in ae(e))se.call(e,s)&&s!="constructor"&&t.push(s);return t}function Vp(e){if(!he(e))return Ih(e);var t=ur(e),s=[];for(var o in e)o=="constructor"&&(t||!se.call(e,o))||s.push(o);return s}function ms(e,t){return e<t}function Ia(e,t){var s=-1,o=Me(e)?v(e.length):[];return jt(e,function(c,f,h){o[++s]=t(c,f,h)}),o}function Na(e){var t=Cs(e);return t.length==1&&t[0][2]?ou(t[0][0],t[0][1]):function(s){return s===e||ds(s,e,t)}}function Sa(e,t){return Ds(e)&&su(t)?ou(Et(e),t):function(s){var o=Vs(s,e);return o===r&&o===t?js(s,e):sr(t,o,V|we)}}function Yr(e,t,s,o,c){e!==t&&ls(t,function(f,h){if(c||(c=new ht),he(f))jp(e,t,h,s,Yr,o,c);else{var d=o?o(ks(e,h),f,h+"",e,t,c):r;d===r&&(d=f),us(e,h,d)}},$e)}function jp(e,t,s,o,c,f,h){var d=ks(e,s),m=ks(t,s),w=h.get(m);if(w){us(e,s,w);return}var E=f?f(d,m,s+"",e,t,h):r,I=E===r;if(I){var b=W(m),F=!b&&zt(m),U=!b&&!F&&Dn(m);E=m,b||F||U?W(d)?E=d:ge(d)?E=Pe(d):F?(I=!1,E=$a(m,!0)):U?(I=!1,E=Ba(m,!0)):E=[]:lr(m)||pn(m)?(E=d,pn(d)?E=Uu(d):(!he(d)||Dt(d))&&(E=iu(m))):I=!1}I&&(h.set(m,E),c(E,m,o,f,h),h.delete(m)),us(e,s,E)}function ba(e,t){var s=e.length;if(s)return t+=t<0?s:0,Rt(t,s)?e[t]:r}function Oa(e,t,s){t.length?t=fe(t,function(f){return W(f)?function(h){return cn(h,f.length===1?f[0]:f)}:f}):t=[Be];var o=-1;t=fe(t,Ve(k()));var c=Ia(e,function(f,h,d){var m=fe(t,function(w){return w(f)});return{criteria:m,index:++o,value:f}});return yf(c,function(f,h){return rh(f,h,s)})}function qp(e,t){return La(e,t,function(s,o){return js(e,o)})}function La(e,t,s){for(var o=-1,c=t.length,f={};++o<c;){var h=t[o],d=cn(e,h);s(d,h)&&or(f,Jt(h,e),d)}return f}function Jp(e){return function(t){return cn(t,e)}}function ys(e,t,s,o){var c=o?mf:En,f=-1,h=t.length,d=e;for(e===t&&(t=Pe(t)),s&&(d=fe(e,Ve(s)));++f<h;)for(var m=0,w=t[f],E=s?s(w):w;(m=c(d,E,m,o))>-1;)d!==e&&$r.call(d,m,1),$r.call(e,m,1);return e}function Ca(e,t){for(var s=e?t.length:0,o=s-1;s--;){var c=t[s];if(s==o||c!==f){var f=c;Rt(c)?$r.call(e,c,1):ws(e,c)}}return e}function vs(e,t){return e+Wr(fa()*(t-e+1))}function Qp(e,t,s,o){for(var c=-1,f=xe(Gr((t-e)/(s||1)),0),h=v(f);f--;)h[o?f:++c]=e,e+=s;return h}function _s(e,t){var s="";if(!e||t<1||t>$t)return s;do t%2&&(s+=e),t=Wr(t/2),t&&(e+=e);while(t);return s}function Q(e,t){return Us(au(e,t,Be),e+"")}function zp(e){return da(Fn(e))}function Yp(e,t){var s=Fn(e);return si(s,un(t,0,s.length))}function or(e,t,s,o){if(!he(e))return e;t=Jt(t,e);for(var c=-1,f=t.length,h=f-1,d=e;d!=null&&++c<f;){var m=Et(t[c]),w=s;if(m==="__proto__"||m==="constructor"||m==="prototype")return e;if(c!=h){var E=d[m];w=o?o(E,m,d):r,w===r&&(w=he(E)?E:Rt(t[c+1])?[]:{})}nr(d,m,w),d=d[m]}return e}var Ra=Vr?function(e,t){return Vr.set(e,t),e}:Be,Hp=Br?function(e,t){return Br(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:Be;function Kp(e){return si(Fn(e))}function tt(e,t,s){var o=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var f=v(c);++o<c;)f[o]=e[o+t];return f}function Xp(e,t){var s;return jt(e,function(o,c,f){return s=t(o,c,f),!s}),!!s}function Hr(e,t,s){var o=0,c=e==null?o:e.length;if(typeof t=="number"&&t===t&&c<=Zc){for(;o<c;){var f=o+c>>>1,h=e[f];h!==null&&!qe(h)&&(s?h<=t:h<t)?o=f+1:c=f}return c}return Ts(e,t,Be,s)}function Ts(e,t,s,o){var c=0,f=e==null?0:e.length;if(f===0)return 0;t=s(t);for(var h=t!==t,d=t===null,m=qe(t),w=t===r;c<f;){var E=Wr((c+f)/2),I=s(e[E]),b=I!==r,F=I===null,U=I===I,q=qe(I);if(h)var P=o||U;else w?P=U&&(o||b):d?P=U&&b&&(o||!F):m?P=U&&b&&!F&&(o||!q):F||q?P=!1:P=o?I<=t:I<t;P?c=E+1:f=E}return Le(f,Xc)}function Da(e,t){for(var s=-1,o=e.length,c=0,f=[];++s<o;){var h=e[s],d=t?t(h):h;if(!s||!dt(d,m)){var m=d;f[c++]=h===0?0:h}}return f}function Fa(e){return typeof e=="number"?e:qe(e)?wr:+e}function je(e){if(typeof e=="string")return e;if(W(e))return fe(e,je)+"";if(qe(e))return pa?pa.call(e):"";var t=e+"";return t=="0"&&1/e==-nn?"-0":t}function qt(e,t,s){var o=-1,c=Or,f=e.length,h=!0,d=[],m=d;if(s)h=!1,c=Yi;else if(f>=u){var w=t?null:ch(e);if(w)return Cr(w);h=!1,c=Hn,m=new an}else m=t?[]:d;e:for(;++o<f;){var E=e[o],I=t?t(E):E;if(E=s||E!==0?E:0,h&&I===I){for(var b=m.length;b--;)if(m[b]===I)continue e;t&&m.push(I),d.push(E)}else c(m,I,s)||(m!==d&&m.push(I),d.push(E))}return d}function ws(e,t){return t=Jt(t,e),e=uu(e,t),e==null||delete e[Et(nt(t))]}function ka(e,t,s,o){return or(e,t,s(cn(e,t)),o)}function Kr(e,t,s,o){for(var c=e.length,f=o?c:-1;(o?f--:++f<c)&&t(e[f],f,e););return s?tt(e,o?0:f,o?f+1:c):tt(e,o?f+1:0,o?c:f)}function Ua(e,t){var s=e;return s instanceof H&&(s=s.value()),Hi(t,function(o,c){return c.func.apply(c.thisArg,Gt([o],c.args))},s)}function Es(e,t,s){var o=e.length;if(o<2)return o?qt(e[0]):[];for(var c=-1,f=v(o);++c<o;)for(var h=e[c],d=-1;++d<o;)d!=c&&(f[c]=rr(f[c]||h,e[d],t,s));return qt(be(f,1),t,s)}function Pa(e,t,s){for(var o=-1,c=e.length,f=t.length,h={};++o<c;){var d=o<f?t[o]:r;s(h,e[o],d)}return h}function xs(e){return ge(e)?e:[]}function As(e){return typeof e=="function"?e:Be}function Jt(e,t){return W(e)?e:Ds(e,t)?[e]:pu(re(e))}var Zp=Q;function Qt(e,t,s){var o=e.length;return s=s===r?o:s,!t&&s>=o?e:tt(e,t,s)}var Ma=Bf||function(e){return Se.clearTimeout(e)};function $a(e,t){if(t)return e.slice();var s=e.length,o=oa?oa(s):new e.constructor(s);return e.copy(o),o}function Is(e){var t=new e.constructor(e.byteLength);return new Pr(t).set(new Pr(e)),t}function eh(e,t){var s=t?Is(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function th(e){var t=new e.constructor(e.source,Eo.exec(e));return t.lastIndex=e.lastIndex,t}function nh(e){return tr?ae(tr.call(e)):{}}function Ba(e,t){var s=t?Is(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function Ga(e,t){if(e!==t){var s=e!==r,o=e===null,c=e===e,f=qe(e),h=t!==r,d=t===null,m=t===t,w=qe(t);if(!d&&!w&&!f&&e>t||f&&h&&m&&!d&&!w||o&&h&&m||!s&&m||!c)return 1;if(!o&&!f&&!w&&e<t||w&&s&&c&&!o&&!f||d&&s&&c||!h&&c||!m)return-1}return 0}function rh(e,t,s){for(var o=-1,c=e.criteria,f=t.criteria,h=c.length,d=s.length;++o<h;){var m=Ga(c[o],f[o]);if(m){if(o>=d)return m;var w=s[o];return m*(w=="desc"?-1:1)}}return e.index-t.index}function Wa(e,t,s,o){for(var c=-1,f=e.length,h=s.length,d=-1,m=t.length,w=xe(f-h,0),E=v(m+w),I=!o;++d<m;)E[d]=t[d];for(;++c<h;)(I||c<f)&&(E[s[c]]=e[c]);for(;w--;)E[d++]=e[c++];return E}function Va(e,t,s,o){for(var c=-1,f=e.length,h=-1,d=s.length,m=-1,w=t.length,E=xe(f-d,0),I=v(E+w),b=!o;++c<E;)I[c]=e[c];for(var F=c;++m<w;)I[F+m]=t[m];for(;++h<d;)(b||c<f)&&(I[F+s[h]]=e[c++]);return I}function Pe(e,t){var s=-1,o=e.length;for(t||(t=v(o));++s<o;)t[s]=e[s];return t}function wt(e,t,s,o){var c=!s;s||(s={});for(var f=-1,h=t.length;++f<h;){var d=t[f],m=o?o(s[d],e[d],d,s,e):r;m===r&&(m=e[d]),c?Ot(s,d,m):nr(s,d,m)}return s}function ih(e,t){return wt(e,Rs(e),t)}function sh(e,t){return wt(e,nu(e),t)}function Xr(e,t){return function(s,o){var c=W(s)?lf:Sp,f=t?t():{};return c(s,e,k(o,2),f)}}function Ln(e){return Q(function(t,s){var o=-1,c=s.length,f=c>1?s[c-1]:r,h=c>2?s[2]:r;for(f=e.length>3&&typeof f=="function"?(c--,f):r,h&&Fe(s[0],s[1],h)&&(f=c<3?r:f,c=1),t=ae(t);++o<c;){var d=s[o];d&&e(t,d,o,f)}return t})}function ja(e,t){return function(s,o){if(s==null)return s;if(!Me(s))return e(s,o);for(var c=s.length,f=t?c:-1,h=ae(s);(t?f--:++f<c)&&o(h[f],f,h)!==!1;);return s}}function qa(e){return function(t,s,o){for(var c=-1,f=ae(t),h=o(t),d=h.length;d--;){var m=h[e?d:++c];if(s(f[m],m,f)===!1)break}return t}}function oh(e,t,s){var o=t&pe,c=ar(e);function f(){var h=this&&this!==Se&&this instanceof f?c:e;return h.apply(o?s:this,arguments)}return f}function Ja(e){return function(t){t=re(t);var s=xn(t)?pt(t):r,o=s?s[0]:t.charAt(0),c=s?Qt(s,1).join(""):t.slice(1);return o[e]()+c}}function Cn(e){return function(t){return Hi(ju(Vu(t).replace(Yl,"")),e,"")}}function ar(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 s=On(e.prototype),o=e.apply(s,t);return he(o)?o:s}}function ah(e,t,s){var o=ar(e);function c(){for(var f=arguments.length,h=v(f),d=f,m=Rn(c);d--;)h[d]=arguments[d];var w=f<3&&h[0]!==m&&h[f-1]!==m?[]:Wt(h,m);if(f-=w.length,f<s)return Ka(e,t,Zr,c.placeholder,r,h,w,r,r,s-f);var E=this&&this!==Se&&this instanceof c?o:e;return We(E,this,h)}return c}function Qa(e){return function(t,s,o){var c=ae(t);if(!Me(t)){var f=k(s,3);t=Ae(t),s=function(d){return f(c[d],d,c)}}var h=e(t,s,o);return h>-1?c[f?t[h]:h]:r}}function za(e){return Ct(function(t){var s=t.length,o=s,c=Ze.prototype.thru;for(e&&t.reverse();o--;){var f=t[o];if(typeof f!="function")throw new Xe(y);if(c&&!h&&ri(f)=="wrapper")var h=new Ze([],!0)}for(o=h?o:s;++o<s;){f=t[o];var d=ri(f),m=d=="wrapper"?Ls(f):r;m&&Fs(m[0])&&m[1]==(Ue|_e|Re|tn)&&!m[4].length&&m[9]==1?h=h[ri(m[0])].apply(h,m[3]):h=f.length==1&&Fs(f)?h[d]():h.thru(f)}return function(){var w=arguments,E=w[0];if(h&&w.length==1&&W(E))return h.plant(E).value();for(var I=0,b=s?t[I].apply(this,w):E;++I<s;)b=t[I].call(this,b);return b}})}function Zr(e,t,s,o,c,f,h,d,m,w){var E=t&Ue,I=t&pe,b=t&ve,F=t&(_e|Ne),U=t&A,q=b?r:ar(e);function P(){for(var z=arguments.length,X=v(z),Je=z;Je--;)X[Je]=arguments[Je];if(F)var ke=Rn(P),Qe=_f(X,ke);if(o&&(X=Wa(X,o,c,F)),f&&(X=Va(X,f,h,F)),z-=Qe,F&&z<w){var me=Wt(X,ke);return Ka(e,t,Zr,P.placeholder,s,X,me,d,m,w-z)}var gt=I?s:this,kt=b?gt[e]:e;return z=X.length,d?X=Sh(X,d):U&&z>1&&X.reverse(),E&&m<z&&(X.length=m),this&&this!==Se&&this instanceof P&&(kt=q||ar(kt)),kt.apply(gt,X)}return P}function Ya(e,t){return function(s,o){return kp(s,e,t(o),{})}}function ei(e,t){return function(s,o){var c;if(s===r&&o===r)return t;if(s!==r&&(c=s),o!==r){if(c===r)return o;typeof s=="string"||typeof o=="string"?(s=je(s),o=je(o)):(s=Fa(s),o=Fa(o)),c=e(s,o)}return c}}function Ns(e){return Ct(function(t){return t=fe(t,Ve(k())),Q(function(s){var o=this;return e(t,function(c){return We(c,o,s)})})})}function ti(e,t){t=t===r?" ":je(t);var s=t.length;if(s<2)return s?_s(t,e):t;var o=_s(t,Gr(e/An(t)));return xn(t)?Qt(pt(o),0,e).join(""):o.slice(0,e)}function uh(e,t,s,o){var c=t&pe,f=ar(e);function h(){for(var d=-1,m=arguments.length,w=-1,E=o.length,I=v(E+m),b=this&&this!==Se&&this instanceof h?f:e;++w<E;)I[w]=o[w];for(;m--;)I[w++]=arguments[++d];return We(b,c?s:this,I)}return h}function Ha(e){return function(t,s,o){return o&&typeof o!="number"&&Fe(t,s,o)&&(s=o=r),t=Ft(t),s===r?(s=t,t=0):s=Ft(s),o=o===r?t<s?1:-1:Ft(o),Qp(t,s,o,e)}}function ni(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=rt(t),s=rt(s)),e(t,s)}}function Ka(e,t,s,o,c,f,h,d,m,w){var E=t&_e,I=E?h:r,b=E?r:h,F=E?f:r,U=E?r:f;t|=E?Re:ze,t&=~(E?ze:Re),t&en||(t&=-4);var q=[e,t,c,F,I,U,b,d,m,w],P=s.apply(r,q);return Fs(e)&&cu(P,q),P.placeholder=o,lu(P,e,t)}function Ss(e){var t=Ee[e];return function(s,o){if(s=rt(s),o=o==null?0:Le(j(o),292),o&&la(s)){var c=(re(s)+"e").split("e"),f=t(c[0]+"e"+(+c[1]+o));return c=(re(f)+"e").split("e"),+(c[0]+"e"+(+c[1]-o))}return t(s)}}var ch=Sn&&1/Cr(new Sn([,-0]))[1]==nn?function(e){return new Sn(e)}:Ys;function Xa(e){return function(t){var s=Ce(t);return s==lt?rs(t):s==ft?Nf(t):vf(t,e(t))}}function Lt(e,t,s,o,c,f,h,d){var m=t&ve;if(!m&&typeof e!="function")throw new Xe(y);var w=o?o.length:0;if(w||(t&=-97,o=c=r),h=h===r?h:xe(j(h),0),d=d===r?d:j(d),w-=c?c.length:0,t&ze){var E=o,I=c;o=c=r}var b=m?r:Ls(e),F=[e,t,s,o,c,E,I,f,h,d];if(b&&Ah(F,b),e=F[0],t=F[1],s=F[2],o=F[3],c=F[4],d=F[9]=F[9]===r?m?0:e.length:xe(F[9]-w,0),!d&&t&(_e|Ne)&&(t&=-25),!t||t==pe)var U=oh(e,t,s);else t==_e||t==Ne?U=ah(e,t,d):(t==Re||t==(pe|Re))&&!c.length?U=uh(e,t,s,o):U=Zr.apply(r,F);var q=b?Ra:cu;return lu(q(U,F),e,t)}function Za(e,t,s,o){return e===r||dt(e,Nn[s])&&!se.call(o,s)?t:e}function eu(e,t,s,o,c,f){return he(e)&&he(t)&&(f.set(t,e),Yr(e,t,r,eu,f),f.delete(t)),e}function lh(e){return lr(e)?r:e}function tu(e,t,s,o,c,f){var h=s&V,d=e.length,m=t.length;if(d!=m&&!(h&&m>d))return!1;var w=f.get(e),E=f.get(t);if(w&&E)return w==t&&E==e;var I=-1,b=!0,F=s&we?new an:r;for(f.set(e,t),f.set(t,e);++I<d;){var U=e[I],q=t[I];if(o)var P=h?o(q,U,I,t,e,f):o(U,q,I,e,t,f);if(P!==r){if(P)continue;b=!1;break}if(F){if(!Ki(t,function(z,X){if(!Hn(F,X)&&(U===z||c(U,z,s,o,f)))return F.push(X)})){b=!1;break}}else if(!(U===q||c(U,q,s,o,f))){b=!1;break}}return f.delete(e),f.delete(t),b}function fh(e,t,s,o,c,f,h){switch(s){case Tn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Yn:return!(e.byteLength!=t.byteLength||!f(new Pr(e),new Pr(t)));case Vn:case jn:case qn:return dt(+e,+t);case xr:return e.name==t.name&&e.message==t.message;case Jn:case Qn:return e==t+"";case lt:var d=rs;case ft:var m=o&V;if(d||(d=Cr),e.size!=t.size&&!m)return!1;var w=h.get(e);if(w)return w==t;o|=we,h.set(e,t);var E=tu(d(e),d(t),o,c,f,h);return h.delete(e),E;case Ir:if(tr)return tr.call(e)==tr.call(t)}return!1}function ph(e,t,s,o,c,f){var h=s&V,d=bs(e),m=d.length,w=bs(t),E=w.length;if(m!=E&&!h)return!1;for(var I=m;I--;){var b=d[I];if(!(h?b in t:se.call(t,b)))return!1}var F=f.get(e),U=f.get(t);if(F&&U)return F==t&&U==e;var q=!0;f.set(e,t),f.set(t,e);for(var P=h;++I<m;){b=d[I];var z=e[b],X=t[b];if(o)var Je=h?o(X,z,b,t,e,f):o(z,X,b,e,t,f);if(!(Je===r?z===X||c(z,X,s,o,f):Je)){q=!1;break}P||(P=b=="constructor")}if(q&&!P){var ke=e.constructor,Qe=t.constructor;ke!=Qe&&"constructor"in e&&"constructor"in t&&!(typeof ke=="function"&&ke instanceof ke&&typeof Qe=="function"&&Qe instanceof Qe)&&(q=!1)}return f.delete(e),f.delete(t),q}function Ct(e){return Us(au(e,r,mu),e+"")}function bs(e){return wa(e,Ae,Rs)}function Os(e){return wa(e,$e,nu)}var Ls=Vr?function(e){return Vr.get(e)}:Ys;function ri(e){for(var t=e.name+"",s=bn[t],o=se.call(bn,t)?s.length:0;o--;){var c=s[o],f=c.func;if(f==null||f==e)return c.name}return t}function Rn(e){var t=se.call(l,"placeholder")?l:e;return t.placeholder}function k(){var e=l.iteratee||Qs;return e=e===Qs?Aa:e,arguments.length?e(arguments[0],arguments[1]):e}function ii(e,t){var s=e.__data__;return Th(t)?s[typeof t=="string"?"string":"hash"]:s.map}function Cs(e){for(var t=Ae(e),s=t.length;s--;){var o=t[s],c=e[o];t[s]=[o,c,su(c)]}return t}function ln(e,t){var s=xf(e,t);return xa(s)?s:r}function hh(e){var t=se.call(e,sn),s=e[sn];try{e[sn]=r;var o=!0}catch{}var c=kr.call(e);return o&&(t?e[sn]=s:delete e[sn]),c}var Rs=ss?function(e){return e==null?[]:(e=ae(e),Bt(ss(e),function(t){return ua.call(e,t)}))}:Hs,nu=ss?function(e){for(var t=[];e;)Gt(t,Rs(e)),e=Mr(e);return t}:Hs,Ce=De;(os&&Ce(new os(new ArrayBuffer(1)))!=Tn||Xn&&Ce(new Xn)!=lt||as&&Ce(as.resolve())!=vo||Sn&&Ce(new Sn)!=ft||Zn&&Ce(new Zn)!=zn)&&(Ce=function(e){var t=De(e),s=t==Nt?e.constructor:r,o=s?fn(s):"";if(o)switch(o){case Yf:return Tn;case Hf:return lt;case Kf:return vo;case Xf:return ft;case Zf:return zn}return t});function dh(e,t,s){for(var o=-1,c=s.length;++o<c;){var f=s[o],h=f.size;switch(f.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Le(t,e+h);break;case"takeRight":e=xe(e,t-h);break}}return{start:e,end:t}}function gh(e){var t=e.match(Tl);return t?t[1].split(wl):[]}function ru(e,t,s){t=Jt(t,e);for(var o=-1,c=t.length,f=!1;++o<c;){var h=Et(t[o]);if(!(f=e!=null&&s(e,h)))break;e=e[h]}return f||++o!=c?f:(c=e==null?0:e.length,!!c&&fi(c)&&Rt(h,c)&&(W(e)||pn(e)))}function mh(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&se.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function iu(e){return typeof e.constructor=="function"&&!ur(e)?On(Mr(e)):{}}function yh(e,t,s){var o=e.constructor;switch(t){case Yn:return Is(e);case Vn:case jn:return new o(+e);case Tn:return eh(e,s);case Ci:case Ri:case Di:case Fi:case ki:case Ui:case Pi:case Mi:case $i:return Ba(e,s);case lt:return new o;case qn:case Qn:return new o(e);case Jn:return th(e);case ft:return new o;case Ir:return nh(e)}}function vh(e,t){var s=t.length;if(!s)return e;var o=s-1;return t[o]=(s>1?"& ":"")+t[o],t=t.join(s>2?", ":" "),e.replace(_l,`{
|
|
87
|
+
*/var pv=pr.exports,Hu;function hv(){return Hu||(Hu=1,function(n,i){(function(){var r,a="4.17.21",u=200,p="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",I="Invalid `variable` option passed into `_.template`",N="__lodash_hash_undefined__",R=500,O="__lodash_placeholder__",M=1,Z=2,ce=4,W=1,Te=2,fe=1,ve=2,tn=4,ye=8,Ne=16,Re=32,Qe=64,Ue=128,nn=256,x=512,G=30,ze="...",Li=800,Zc=16,yo=1,el=2,tl=3,rn=1/0,Bt=9007199254740991,nl=17976931348623157e292,Er=NaN,Tt=4294967295,rl=Tt-1,il=Tt>>>1,sl=[["ary",Ue],["bind",fe],["bindKey",ve],["curry",ye],["curryRight",Ne],["flip",x],["partial",Re],["partialRight",Qe],["rearg",nn]],yn="[object Arguments]",Ir="[object Array]",ol="[object AsyncFunction]",Wn="[object Boolean]",jn="[object Date]",al="[object DOMException]",xr="[object Error]",Ar="[object Function]",_o="[object GeneratorFunction]",ct="[object Map]",qn="[object Number]",ul="[object Null]",bt="[object Object]",To="[object Promise]",cl="[object Proxy]",Jn="[object RegExp]",lt="[object Set]",Qn="[object String]",Nr="[object Symbol]",ll="[object Undefined]",zn="[object WeakMap]",fl="[object WeakSet]",Yn="[object ArrayBuffer]",_n="[object DataView]",Ri="[object Float32Array]",Ci="[object Float64Array]",Di="[object Int8Array]",Fi="[object Int16Array]",ki="[object Int32Array]",Ui="[object Uint8Array]",$i="[object Uint8ClampedArray]",Pi="[object Uint16Array]",Mi="[object Uint32Array]",pl=/\b__p \+= '';/g,hl=/\b(__p \+=) '' \+/g,dl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wo=/&(?:amp|lt|gt|quot|#39);/g,Eo=/[&<>"']/g,gl=RegExp(wo.source),ml=RegExp(Eo.source),vl=/<%-([\s\S]+?)%>/g,yl=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,_l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tl=/^\w*$/,wl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bi=/[\\^$.*+?()[\]{}|]/g,El=RegExp(Bi.source),Gi=/^\s+/,Il=/\s/,xl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Al=/\{\n\/\* \[wrapped with (.+)\] \*/,Nl=/,? & /,bl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Sl=/[()=,{}\[\]\/\s]/,Ol=/\\(\\)?/g,Ll=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xo=/\w*$/,Rl=/^[-+]0x[0-9a-f]+$/i,Cl=/^0b[01]+$/i,Dl=/^\[object .+?Constructor\]$/,Fl=/^0o[0-7]+$/i,kl=/^(?:0|[1-9]\d*)$/,Ul=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,br=/($^)/,$l=/['\n\r\u2028\u2029\\]/g,Sr="\\ud800-\\udfff",Pl="\\u0300-\\u036f",Ml="\\ufe20-\\ufe2f",Bl="\\u20d0-\\u20ff",Ao=Pl+Ml+Bl,No="\\u2700-\\u27bf",bo="a-z\\xdf-\\xf6\\xf8-\\xff",Gl="\\xac\\xb1\\xd7\\xf7",Vl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wl="\\u2000-\\u206f",jl=" \\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",So="A-Z\\xc0-\\xd6\\xd8-\\xde",Oo="\\ufe0e\\ufe0f",Lo=Gl+Vl+Wl+jl,Vi="['’]",ql="["+Sr+"]",Ro="["+Lo+"]",Or="["+Ao+"]",Co="\\d+",Jl="["+No+"]",Do="["+bo+"]",Fo="[^"+Sr+Lo+Co+No+bo+So+"]",Wi="\\ud83c[\\udffb-\\udfff]",Ql="(?:"+Or+"|"+Wi+")",ko="[^"+Sr+"]",ji="(?:\\ud83c[\\udde6-\\uddff]){2}",qi="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="["+So+"]",Uo="\\u200d",$o="(?:"+Do+"|"+Fo+")",zl="(?:"+Tn+"|"+Fo+")",Po="(?:"+Vi+"(?:d|ll|m|re|s|t|ve))?",Mo="(?:"+Vi+"(?:D|LL|M|RE|S|T|VE))?",Bo=Ql+"?",Go="["+Oo+"]?",Yl="(?:"+Uo+"(?:"+[ko,ji,qi].join("|")+")"+Go+Bo+")*",Hl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vo=Go+Bo+Yl,Xl="(?:"+[Jl,ji,qi].join("|")+")"+Vo,Zl="(?:"+[ko+Or+"?",Or,ji,qi,ql].join("|")+")",ef=RegExp(Vi,"g"),tf=RegExp(Or,"g"),Ji=RegExp(Wi+"(?="+Wi+")|"+Zl+Vo,"g"),nf=RegExp([Tn+"?"+Do+"+"+Po+"(?="+[Ro,Tn,"$"].join("|")+")",zl+"+"+Mo+"(?="+[Ro,Tn+$o,"$"].join("|")+")",Tn+"?"+$o+"+"+Po,Tn+"+"+Mo,Kl,Hl,Co,Xl].join("|"),"g"),rf=RegExp("["+Uo+Sr+Ao+Oo+"]"),sf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,of=["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"],af=-1,ue={};ue[Ri]=ue[Ci]=ue[Di]=ue[Fi]=ue[ki]=ue[Ui]=ue[$i]=ue[Pi]=ue[Mi]=!0,ue[yn]=ue[Ir]=ue[Yn]=ue[Wn]=ue[_n]=ue[jn]=ue[xr]=ue[Ar]=ue[ct]=ue[qn]=ue[bt]=ue[Jn]=ue[lt]=ue[Qn]=ue[zn]=!1;var ae={};ae[yn]=ae[Ir]=ae[Yn]=ae[_n]=ae[Wn]=ae[jn]=ae[Ri]=ae[Ci]=ae[Di]=ae[Fi]=ae[ki]=ae[ct]=ae[qn]=ae[bt]=ae[Jn]=ae[lt]=ae[Qn]=ae[Nr]=ae[Ui]=ae[$i]=ae[Pi]=ae[Mi]=!0,ae[xr]=ae[Ar]=ae[zn]=!1;var uf={À:"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"},cf={"&":"&","<":"<",">":">",'"':""","'":"'"},lf={"&":"&","<":"<",">":">",""":'"',"'":"'"},ff={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pf=parseFloat,hf=parseInt,Wo=typeof kn.commonjsGlobal=="object"&&kn.commonjsGlobal&&kn.commonjsGlobal.Object===Object&&kn.commonjsGlobal,df=typeof self=="object"&&self&&self.Object===Object&&self,be=Wo||df||Function("return this")(),Qi=i&&!i.nodeType&&i,sn=Qi&&!0&&n&&!n.nodeType&&n,jo=sn&&sn.exports===Qi,zi=jo&&Wo.process,Ye=function(){try{var g=sn&&sn.require&&sn.require("util").types;return g||zi&&zi.binding&&zi.binding("util")}catch{}}(),qo=Ye&&Ye.isArrayBuffer,Jo=Ye&&Ye.isDate,Qo=Ye&&Ye.isMap,zo=Ye&&Ye.isRegExp,Yo=Ye&&Ye.isSet,Ho=Ye&&Ye.isTypedArray;function Ge(g,_,y){switch(y.length){case 0:return g.call(_);case 1:return g.call(_,y[0]);case 2:return g.call(_,y[0],y[1]);case 3:return g.call(_,y[0],y[1],y[2])}return g.apply(_,y)}function gf(g,_,y,L){for(var B=-1,ee=g==null?0:g.length;++B<ee;){var we=g[B];_(L,we,y(we),g)}return L}function He(g,_){for(var y=-1,L=g==null?0:g.length;++y<L&&_(g[y],y,g)!==!1;);return g}function mf(g,_){for(var y=g==null?0:g.length;y--&&_(g[y],y,g)!==!1;);return g}function Ko(g,_){for(var y=-1,L=g==null?0:g.length;++y<L;)if(!_(g[y],y,g))return!1;return!0}function Gt(g,_){for(var y=-1,L=g==null?0:g.length,B=0,ee=[];++y<L;){var we=g[y];_(we,y,g)&&(ee[B++]=we)}return ee}function Lr(g,_){var y=g==null?0:g.length;return!!y&&wn(g,_,0)>-1}function Yi(g,_,y){for(var L=-1,B=g==null?0:g.length;++L<B;)if(y(_,g[L]))return!0;return!1}function le(g,_){for(var y=-1,L=g==null?0:g.length,B=Array(L);++y<L;)B[y]=_(g[y],y,g);return B}function Vt(g,_){for(var y=-1,L=_.length,B=g.length;++y<L;)g[B+y]=_[y];return g}function Hi(g,_,y,L){var B=-1,ee=g==null?0:g.length;for(L&&ee&&(y=g[++B]);++B<ee;)y=_(y,g[B],B,g);return y}function vf(g,_,y,L){var B=g==null?0:g.length;for(L&&B&&(y=g[--B]);B--;)y=_(y,g[B],B,g);return y}function Ki(g,_){for(var y=-1,L=g==null?0:g.length;++y<L;)if(_(g[y],y,g))return!0;return!1}var yf=Xi("length");function _f(g){return g.split("")}function Tf(g){return g.match(bl)||[]}function Xo(g,_,y){var L;return y(g,function(B,ee,we){if(_(B,ee,we))return L=ee,!1}),L}function Rr(g,_,y,L){for(var B=g.length,ee=y+(L?1:-1);L?ee--:++ee<B;)if(_(g[ee],ee,g))return ee;return-1}function wn(g,_,y){return _===_?Cf(g,_,y):Rr(g,Zo,y)}function wf(g,_,y,L){for(var B=y-1,ee=g.length;++B<ee;)if(L(g[B],_))return B;return-1}function Zo(g){return g!==g}function ea(g,_){var y=g==null?0:g.length;return y?es(g,_)/y:Er}function Xi(g){return function(_){return _==null?r:_[g]}}function Zi(g){return function(_){return g==null?r:g[_]}}function ta(g,_,y,L,B){return B(g,function(ee,we,se){y=L?(L=!1,ee):_(y,ee,we,se)}),y}function Ef(g,_){var y=g.length;for(g.sort(_);y--;)g[y]=g[y].value;return g}function es(g,_){for(var y,L=-1,B=g.length;++L<B;){var ee=_(g[L]);ee!==r&&(y=y===r?ee:y+ee)}return y}function ts(g,_){for(var y=-1,L=Array(g);++y<g;)L[y]=_(y);return L}function If(g,_){return le(_,function(y){return[y,g[y]]})}function na(g){return g&&g.slice(0,oa(g)+1).replace(Gi,"")}function Ve(g){return function(_){return g(_)}}function ns(g,_){return le(_,function(y){return g[y]})}function Hn(g,_){return g.has(_)}function ra(g,_){for(var y=-1,L=g.length;++y<L&&wn(_,g[y],0)>-1;);return y}function ia(g,_){for(var y=g.length;y--&&wn(_,g[y],0)>-1;);return y}function xf(g,_){for(var y=g.length,L=0;y--;)g[y]===_&&++L;return L}var Af=Zi(uf),Nf=Zi(cf);function bf(g){return"\\"+ff[g]}function Sf(g,_){return g==null?r:g[_]}function En(g){return rf.test(g)}function Of(g){return sf.test(g)}function Lf(g){for(var _,y=[];!(_=g.next()).done;)y.push(_.value);return y}function rs(g){var _=-1,y=Array(g.size);return g.forEach(function(L,B){y[++_]=[B,L]}),y}function sa(g,_){return function(y){return g(_(y))}}function Wt(g,_){for(var y=-1,L=g.length,B=0,ee=[];++y<L;){var we=g[y];(we===_||we===O)&&(g[y]=O,ee[B++]=y)}return ee}function Cr(g){var _=-1,y=Array(g.size);return g.forEach(function(L){y[++_]=L}),y}function Rf(g){var _=-1,y=Array(g.size);return g.forEach(function(L){y[++_]=[L,L]}),y}function Cf(g,_,y){for(var L=y-1,B=g.length;++L<B;)if(g[L]===_)return L;return-1}function Df(g,_,y){for(var L=y+1;L--;)if(g[L]===_)return L;return L}function In(g){return En(g)?kf(g):yf(g)}function ft(g){return En(g)?Uf(g):_f(g)}function oa(g){for(var _=g.length;_--&&Il.test(g.charAt(_)););return _}var Ff=Zi(lf);function kf(g){for(var _=Ji.lastIndex=0;Ji.test(g);)++_;return _}function Uf(g){return g.match(Ji)||[]}function $f(g){return g.match(nf)||[]}var Pf=function g(_){_=_==null?be:xn.defaults(be.Object(),_,xn.pick(be,of));var y=_.Array,L=_.Date,B=_.Error,ee=_.Function,we=_.Math,se=_.Object,is=_.RegExp,Mf=_.String,Ke=_.TypeError,Dr=y.prototype,Bf=ee.prototype,An=se.prototype,Fr=_["__core-js_shared__"],kr=Bf.toString,ie=An.hasOwnProperty,Gf=0,aa=function(){var e=/[^.]+$/.exec(Fr&&Fr.keys&&Fr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ur=An.toString,Vf=kr.call(se),Wf=be._,jf=is("^"+kr.call(ie).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$r=jo?_.Buffer:r,jt=_.Symbol,Pr=_.Uint8Array,ua=$r?$r.allocUnsafe:r,Mr=sa(se.getPrototypeOf,se),ca=se.create,la=An.propertyIsEnumerable,Br=Dr.splice,fa=jt?jt.isConcatSpreadable:r,Kn=jt?jt.iterator:r,on=jt?jt.toStringTag:r,Gr=function(){try{var e=fn(se,"defineProperty");return e({},"",{}),e}catch{}}(),qf=_.clearTimeout!==be.clearTimeout&&_.clearTimeout,Jf=L&&L.now!==be.Date.now&&L.now,Qf=_.setTimeout!==be.setTimeout&&_.setTimeout,Vr=we.ceil,Wr=we.floor,ss=se.getOwnPropertySymbols,zf=$r?$r.isBuffer:r,pa=_.isFinite,Yf=Dr.join,Hf=sa(se.keys,se),Ee=we.max,Oe=we.min,Kf=L.now,Xf=_.parseInt,ha=we.random,Zf=Dr.reverse,os=fn(_,"DataView"),Xn=fn(_,"Map"),as=fn(_,"Promise"),Nn=fn(_,"Set"),Zn=fn(_,"WeakMap"),er=fn(se,"create"),jr=Zn&&new Zn,bn={},ep=pn(os),tp=pn(Xn),np=pn(as),rp=pn(Nn),ip=pn(Zn),qr=jt?jt.prototype:r,tr=qr?qr.valueOf:r,da=qr?qr.toString:r;function l(e){if(he(e)&&!V(e)&&!(e instanceof z)){if(e instanceof Xe)return e;if(ie.call(e,"__wrapped__"))return gu(e)}return new Xe(e)}var Sn=function(){function e(){}return function(t){if(!pe(t))return{};if(ca)return ca(t);e.prototype=t;var s=new e;return e.prototype=r,s}}();function Jr(){}function Xe(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}l.templateSettings={escape:vl,evaluate:yl,interpolate:Io,variable:"",imports:{_:l}},l.prototype=Jr.prototype,l.prototype.constructor=l,Xe.prototype=Sn(Jr.prototype),Xe.prototype.constructor=Xe;function z(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Tt,this.__views__=[]}function sp(){var e=new z(this.__wrapped__);return e.__actions__=$e(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=$e(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=$e(this.__views__),e}function op(){if(this.__filtered__){var e=new z(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function ap(){var e=this.__wrapped__.value(),t=this.__dir__,s=V(e),o=t<0,c=s?e.length:0,f=_h(0,c,this.__views__),h=f.start,d=f.end,m=d-h,T=o?d:h-1,w=this.__iteratees__,A=w.length,S=0,D=Oe(m,this.__takeCount__);if(!s||!o&&c==m&&D==m)return Pa(e,this.__actions__);var U=[];e:for(;m--&&S<D;){T+=t;for(var q=-1,$=e[T];++q<A;){var Q=w[q],H=Q.iteratee,qe=Q.type,Fe=H($);if(qe==el)$=Fe;else if(!Fe){if(qe==yo)continue e;break e}}U[S++]=$}return U}z.prototype=Sn(Jr.prototype),z.prototype.constructor=z;function an(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function up(){this.__data__=er?er(null):{},this.size=0}function cp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function lp(e){var t=this.__data__;if(er){var s=t[e];return s===N?r:s}return ie.call(t,e)?t[e]:r}function fp(e){var t=this.__data__;return er?t[e]!==r:ie.call(t,e)}function pp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=er&&t===r?N:t,this}an.prototype.clear=up,an.prototype.delete=cp,an.prototype.get=lp,an.prototype.has=fp,an.prototype.set=pp;function St(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function hp(){this.__data__=[],this.size=0}function dp(e){var t=this.__data__,s=Qr(t,e);if(s<0)return!1;var o=t.length-1;return s==o?t.pop():Br.call(t,s,1),--this.size,!0}function gp(e){var t=this.__data__,s=Qr(t,e);return s<0?r:t[s][1]}function mp(e){return Qr(this.__data__,e)>-1}function vp(e,t){var s=this.__data__,o=Qr(s,e);return o<0?(++this.size,s.push([e,t])):s[o][1]=t,this}St.prototype.clear=hp,St.prototype.delete=dp,St.prototype.get=gp,St.prototype.has=mp,St.prototype.set=vp;function Ot(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function yp(){this.size=0,this.__data__={hash:new an,map:new(Xn||St),string:new an}}function _p(e){var t=si(this,e).delete(e);return this.size-=t?1:0,t}function Tp(e){return si(this,e).get(e)}function wp(e){return si(this,e).has(e)}function Ep(e,t){var s=si(this,e),o=s.size;return s.set(e,t),this.size+=s.size==o?0:1,this}Ot.prototype.clear=yp,Ot.prototype.delete=_p,Ot.prototype.get=Tp,Ot.prototype.has=wp,Ot.prototype.set=Ep;function un(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Ot;++t<s;)this.add(e[t])}function Ip(e){return this.__data__.set(e,N),this}function xp(e){return this.__data__.has(e)}un.prototype.add=un.prototype.push=Ip,un.prototype.has=xp;function pt(e){var t=this.__data__=new St(e);this.size=t.size}function Ap(){this.__data__=new St,this.size=0}function Np(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function bp(e){return this.__data__.get(e)}function Sp(e){return this.__data__.has(e)}function Op(e,t){var s=this.__data__;if(s instanceof St){var o=s.__data__;if(!Xn||o.length<u-1)return o.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ot(o)}return s.set(e,t),this.size=s.size,this}pt.prototype.clear=Ap,pt.prototype.delete=Np,pt.prototype.get=bp,pt.prototype.has=Sp,pt.prototype.set=Op;function ga(e,t){var s=V(e),o=!s&&hn(e),c=!s&&!o&&Yt(e),f=!s&&!o&&!c&&Cn(e),h=s||o||c||f,d=h?ts(e.length,Mf):[],m=d.length;for(var T in e)(t||ie.call(e,T))&&!(h&&(T=="length"||c&&(T=="offset"||T=="parent")||f&&(T=="buffer"||T=="byteLength"||T=="byteOffset")||Dt(T,m)))&&d.push(T);return d}function ma(e){var t=e.length;return t?e[ys(0,t-1)]:r}function Lp(e,t){return oi($e(e),cn(t,0,e.length))}function Rp(e){return oi($e(e))}function us(e,t,s){(s!==r&&!ht(e[t],s)||s===r&&!(t in e))&&Lt(e,t,s)}function nr(e,t,s){var o=e[t];(!(ie.call(e,t)&&ht(o,s))||s===r&&!(t in e))&&Lt(e,t,s)}function Qr(e,t){for(var s=e.length;s--;)if(ht(e[s][0],t))return s;return-1}function Cp(e,t,s,o){return qt(e,function(c,f,h){t(o,c,s(c),h)}),o}function va(e,t){return e&&Et(t,xe(t),e)}function Dp(e,t){return e&&Et(t,Me(t),e)}function Lt(e,t,s){t=="__proto__"&&Gr?Gr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function cs(e,t){for(var s=-1,o=t.length,c=y(o),f=e==null;++s<o;)c[s]=f?r:Ws(e,t[s]);return c}function cn(e,t,s){return e===e&&(s!==r&&(e=e<=s?e:s),t!==r&&(e=e>=t?e:t)),e}function Ze(e,t,s,o,c,f){var h,d=t&M,m=t&Z,T=t&ce;if(s&&(h=c?s(e,o,c,f):s(e)),h!==r)return h;if(!pe(e))return e;var w=V(e);if(w){if(h=wh(e),!d)return $e(e,h)}else{var A=Le(e),S=A==Ar||A==_o;if(Yt(e))return Ga(e,d);if(A==bt||A==yn||S&&!c){if(h=m||S?{}:ou(e),!d)return m?lh(e,Dp(h,e)):ch(e,va(h,e))}else{if(!ae[A])return c?e:{};h=Eh(e,A,d)}}f||(f=new pt);var D=f.get(e);if(D)return D;f.set(e,h),ku(e)?e.forEach(function($){h.add(Ze($,t,s,$,e,f))}):Du(e)&&e.forEach(function($,Q){h.set(Q,Ze($,t,s,Q,e,f))});var U=T?m?Os:Ss:m?Me:xe,q=w?r:U(e);return He(q||e,function($,Q){q&&(Q=$,$=e[Q]),nr(h,Q,Ze($,t,s,Q,e,f))}),h}function Fp(e){var t=xe(e);return function(s){return ya(s,e,t)}}function ya(e,t,s){var o=s.length;if(e==null)return!o;for(e=se(e);o--;){var c=s[o],f=t[c],h=e[c];if(h===r&&!(c in e)||!f(h))return!1}return!0}function _a(e,t,s){if(typeof e!="function")throw new Ke(v);return cr(function(){e.apply(r,s)},t)}function rr(e,t,s,o){var c=-1,f=Lr,h=!0,d=e.length,m=[],T=t.length;if(!d)return m;s&&(t=le(t,Ve(s))),o?(f=Yi,h=!1):t.length>=u&&(f=Hn,h=!1,t=new un(t));e:for(;++c<d;){var w=e[c],A=s==null?w:s(w);if(w=o||w!==0?w:0,h&&A===A){for(var S=T;S--;)if(t[S]===A)continue e;m.push(w)}else f(t,A,o)||m.push(w)}return m}var qt=Ja(wt),Ta=Ja(fs,!0);function kp(e,t){var s=!0;return qt(e,function(o,c,f){return s=!!t(o,c,f),s}),s}function zr(e,t,s){for(var o=-1,c=e.length;++o<c;){var f=e[o],h=t(f);if(h!=null&&(d===r?h===h&&!je(h):s(h,d)))var d=h,m=f}return m}function Up(e,t,s,o){var c=e.length;for(s=j(s),s<0&&(s=-s>c?0:c+s),o=o===r||o>c?c:j(o),o<0&&(o+=c),o=s>o?0:$u(o);s<o;)e[s++]=t;return e}function wa(e,t){var s=[];return qt(e,function(o,c,f){t(o,c,f)&&s.push(o)}),s}function Se(e,t,s,o,c){var f=-1,h=e.length;for(s||(s=xh),c||(c=[]);++f<h;){var d=e[f];t>0&&s(d)?t>1?Se(d,t-1,s,o,c):Vt(c,d):o||(c[c.length]=d)}return c}var ls=Qa(),Ea=Qa(!0);function wt(e,t){return e&&ls(e,t,xe)}function fs(e,t){return e&&Ea(e,t,xe)}function Yr(e,t){return Gt(t,function(s){return Ft(e[s])})}function ln(e,t){t=Qt(t,e);for(var s=0,o=t.length;e!=null&&s<o;)e=e[It(t[s++])];return s&&s==o?e:r}function Ia(e,t,s){var o=t(e);return V(e)?o:Vt(o,s(e))}function Ce(e){return e==null?e===r?ll:ul:on&&on in se(e)?yh(e):Rh(e)}function ps(e,t){return e>t}function $p(e,t){return e!=null&&ie.call(e,t)}function Pp(e,t){return e!=null&&t in se(e)}function Mp(e,t,s){return e>=Oe(t,s)&&e<Ee(t,s)}function hs(e,t,s){for(var o=s?Yi:Lr,c=e[0].length,f=e.length,h=f,d=y(f),m=1/0,T=[];h--;){var w=e[h];h&&t&&(w=le(w,Ve(t))),m=Oe(w.length,m),d[h]=!s&&(t||c>=120&&w.length>=120)?new un(h&&w):r}w=e[0];var A=-1,S=d[0];e:for(;++A<c&&T.length<m;){var D=w[A],U=t?t(D):D;if(D=s||D!==0?D:0,!(S?Hn(S,U):o(T,U,s))){for(h=f;--h;){var q=d[h];if(!(q?Hn(q,U):o(e[h],U,s)))continue e}S&&S.push(U),T.push(D)}}return T}function Bp(e,t,s,o){return wt(e,function(c,f,h){t(o,s(c),f,h)}),o}function ir(e,t,s){t=Qt(t,e),e=lu(e,t);var o=e==null?e:e[It(tt(t))];return o==null?r:Ge(o,e,s)}function xa(e){return he(e)&&Ce(e)==yn}function Gp(e){return he(e)&&Ce(e)==Yn}function Vp(e){return he(e)&&Ce(e)==jn}function sr(e,t,s,o,c){return e===t?!0:e==null||t==null||!he(e)&&!he(t)?e!==e&&t!==t:Wp(e,t,s,o,sr,c)}function Wp(e,t,s,o,c,f){var h=V(e),d=V(t),m=h?Ir:Le(e),T=d?Ir:Le(t);m=m==yn?bt:m,T=T==yn?bt:T;var w=m==bt,A=T==bt,S=m==T;if(S&&Yt(e)){if(!Yt(t))return!1;h=!0,w=!1}if(S&&!w)return f||(f=new pt),h||Cn(e)?ru(e,t,s,o,c,f):mh(e,t,m,s,o,c,f);if(!(s&W)){var D=w&&ie.call(e,"__wrapped__"),U=A&&ie.call(t,"__wrapped__");if(D||U){var q=D?e.value():e,$=U?t.value():t;return f||(f=new pt),c(q,$,s,o,f)}}return S?(f||(f=new pt),vh(e,t,s,o,c,f)):!1}function jp(e){return he(e)&&Le(e)==ct}function ds(e,t,s,o){var c=s.length,f=c,h=!o;if(e==null)return!f;for(e=se(e);c--;){var d=s[c];if(h&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<f;){d=s[c];var m=d[0],T=e[m],w=d[1];if(h&&d[2]){if(T===r&&!(m in e))return!1}else{var A=new pt;if(o)var S=o(T,w,m,e,t,A);if(!(S===r?sr(w,T,W|Te,o,A):S))return!1}}return!0}function Aa(e){if(!pe(e)||Nh(e))return!1;var t=Ft(e)?jf:Dl;return t.test(pn(e))}function qp(e){return he(e)&&Ce(e)==Jn}function Jp(e){return he(e)&&Le(e)==lt}function Qp(e){return he(e)&&pi(e.length)&&!!ue[Ce(e)]}function Na(e){return typeof e=="function"?e:e==null?Be:typeof e=="object"?V(e)?Oa(e[0],e[1]):Sa(e):zu(e)}function gs(e){if(!ur(e))return Hf(e);var t=[];for(var s in se(e))ie.call(e,s)&&s!="constructor"&&t.push(s);return t}function zp(e){if(!pe(e))return Lh(e);var t=ur(e),s=[];for(var o in e)o=="constructor"&&(t||!ie.call(e,o))||s.push(o);return s}function ms(e,t){return e<t}function ba(e,t){var s=-1,o=Pe(e)?y(e.length):[];return qt(e,function(c,f,h){o[++s]=t(c,f,h)}),o}function Sa(e){var t=Rs(e);return t.length==1&&t[0][2]?uu(t[0][0],t[0][1]):function(s){return s===e||ds(s,e,t)}}function Oa(e,t){return Ds(e)&&au(t)?uu(It(e),t):function(s){var o=Ws(s,e);return o===r&&o===t?js(s,e):sr(t,o,W|Te)}}function Hr(e,t,s,o,c){e!==t&&ls(t,function(f,h){if(c||(c=new pt),pe(f))Yp(e,t,h,s,Hr,o,c);else{var d=o?o(ks(e,h),f,h+"",e,t,c):r;d===r&&(d=f),us(e,h,d)}},Me)}function Yp(e,t,s,o,c,f,h){var d=ks(e,s),m=ks(t,s),T=h.get(m);if(T){us(e,s,T);return}var w=f?f(d,m,s+"",e,t,h):r,A=w===r;if(A){var S=V(m),D=!S&&Yt(m),U=!S&&!D&&Cn(m);w=m,S||D||U?V(d)?w=d:de(d)?w=$e(d):D?(A=!1,w=Ga(m,!0)):U?(A=!1,w=Va(m,!0)):w=[]:lr(m)||hn(m)?(w=d,hn(d)?w=Pu(d):(!pe(d)||Ft(d))&&(w=ou(m))):A=!1}A&&(h.set(m,w),c(w,m,o,f,h),h.delete(m)),us(e,s,w)}function La(e,t){var s=e.length;if(s)return t+=t<0?s:0,Dt(t,s)?e[t]:r}function Ra(e,t,s){t.length?t=le(t,function(f){return V(f)?function(h){return ln(h,f.length===1?f[0]:f)}:f}):t=[Be];var o=-1;t=le(t,Ve(k()));var c=ba(e,function(f,h,d){var m=le(t,function(T){return T(f)});return{criteria:m,index:++o,value:f}});return Ef(c,function(f,h){return uh(f,h,s)})}function Hp(e,t){return Ca(e,t,function(s,o){return js(e,o)})}function Ca(e,t,s){for(var o=-1,c=t.length,f={};++o<c;){var h=t[o],d=ln(e,h);s(d,h)&&or(f,Qt(h,e),d)}return f}function Kp(e){return function(t){return ln(t,e)}}function vs(e,t,s,o){var c=o?wf:wn,f=-1,h=t.length,d=e;for(e===t&&(t=$e(t)),s&&(d=le(e,Ve(s)));++f<h;)for(var m=0,T=t[f],w=s?s(T):T;(m=c(d,w,m,o))>-1;)d!==e&&Br.call(d,m,1),Br.call(e,m,1);return e}function Da(e,t){for(var s=e?t.length:0,o=s-1;s--;){var c=t[s];if(s==o||c!==f){var f=c;Dt(c)?Br.call(e,c,1):ws(e,c)}}return e}function ys(e,t){return e+Wr(ha()*(t-e+1))}function Xp(e,t,s,o){for(var c=-1,f=Ee(Vr((t-e)/(s||1)),0),h=y(f);f--;)h[o?f:++c]=e,e+=s;return h}function _s(e,t){var s="";if(!e||t<1||t>Bt)return s;do t%2&&(s+=e),t=Wr(t/2),t&&(e+=e);while(t);return s}function J(e,t){return Us(cu(e,t,Be),e+"")}function Zp(e){return ma(Dn(e))}function eh(e,t){var s=Dn(e);return oi(s,cn(t,0,s.length))}function or(e,t,s,o){if(!pe(e))return e;t=Qt(t,e);for(var c=-1,f=t.length,h=f-1,d=e;d!=null&&++c<f;){var m=It(t[c]),T=s;if(m==="__proto__"||m==="constructor"||m==="prototype")return e;if(c!=h){var w=d[m];T=o?o(w,m,d):r,T===r&&(T=pe(w)?w:Dt(t[c+1])?[]:{})}nr(d,m,T),d=d[m]}return e}var Fa=jr?function(e,t){return jr.set(e,t),e}:Be,th=Gr?function(e,t){return Gr(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:Be;function nh(e){return oi(Dn(e))}function et(e,t,s){var o=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var f=y(c);++o<c;)f[o]=e[o+t];return f}function rh(e,t){var s;return qt(e,function(o,c,f){return s=t(o,c,f),!s}),!!s}function Kr(e,t,s){var o=0,c=e==null?o:e.length;if(typeof t=="number"&&t===t&&c<=il){for(;o<c;){var f=o+c>>>1,h=e[f];h!==null&&!je(h)&&(s?h<=t:h<t)?o=f+1:c=f}return c}return Ts(e,t,Be,s)}function Ts(e,t,s,o){var c=0,f=e==null?0:e.length;if(f===0)return 0;t=s(t);for(var h=t!==t,d=t===null,m=je(t),T=t===r;c<f;){var w=Wr((c+f)/2),A=s(e[w]),S=A!==r,D=A===null,U=A===A,q=je(A);if(h)var $=o||U;else T?$=U&&(o||S):d?$=U&&S&&(o||!D):m?$=U&&S&&!D&&(o||!q):D||q?$=!1:$=o?A<=t:A<t;$?c=w+1:f=w}return Oe(f,rl)}function ka(e,t){for(var s=-1,o=e.length,c=0,f=[];++s<o;){var h=e[s],d=t?t(h):h;if(!s||!ht(d,m)){var m=d;f[c++]=h===0?0:h}}return f}function Ua(e){return typeof e=="number"?e:je(e)?Er:+e}function We(e){if(typeof e=="string")return e;if(V(e))return le(e,We)+"";if(je(e))return da?da.call(e):"";var t=e+"";return t=="0"&&1/e==-rn?"-0":t}function Jt(e,t,s){var o=-1,c=Lr,f=e.length,h=!0,d=[],m=d;if(s)h=!1,c=Yi;else if(f>=u){var T=t?null:dh(e);if(T)return Cr(T);h=!1,c=Hn,m=new un}else m=t?[]:d;e:for(;++o<f;){var w=e[o],A=t?t(w):w;if(w=s||w!==0?w:0,h&&A===A){for(var S=m.length;S--;)if(m[S]===A)continue e;t&&m.push(A),d.push(w)}else c(m,A,s)||(m!==d&&m.push(A),d.push(w))}return d}function ws(e,t){return t=Qt(t,e),e=lu(e,t),e==null||delete e[It(tt(t))]}function $a(e,t,s,o){return or(e,t,s(ln(e,t)),o)}function Xr(e,t,s,o){for(var c=e.length,f=o?c:-1;(o?f--:++f<c)&&t(e[f],f,e););return s?et(e,o?0:f,o?f+1:c):et(e,o?f+1:0,o?c:f)}function Pa(e,t){var s=e;return s instanceof z&&(s=s.value()),Hi(t,function(o,c){return c.func.apply(c.thisArg,Vt([o],c.args))},s)}function Es(e,t,s){var o=e.length;if(o<2)return o?Jt(e[0]):[];for(var c=-1,f=y(o);++c<o;)for(var h=e[c],d=-1;++d<o;)d!=c&&(f[c]=rr(f[c]||h,e[d],t,s));return Jt(Se(f,1),t,s)}function Ma(e,t,s){for(var o=-1,c=e.length,f=t.length,h={};++o<c;){var d=o<f?t[o]:r;s(h,e[o],d)}return h}function Is(e){return de(e)?e:[]}function xs(e){return typeof e=="function"?e:Be}function Qt(e,t){return V(e)?e:Ds(e,t)?[e]:du(ne(e))}var ih=J;function zt(e,t,s){var o=e.length;return s=s===r?o:s,!t&&s>=o?e:et(e,t,s)}var Ba=qf||function(e){return be.clearTimeout(e)};function Ga(e,t){if(t)return e.slice();var s=e.length,o=ua?ua(s):new e.constructor(s);return e.copy(o),o}function As(e){var t=new e.constructor(e.byteLength);return new Pr(t).set(new Pr(e)),t}function sh(e,t){var s=t?As(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function oh(e){var t=new e.constructor(e.source,xo.exec(e));return t.lastIndex=e.lastIndex,t}function ah(e){return tr?se(tr.call(e)):{}}function Va(e,t){var s=t?As(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function Wa(e,t){if(e!==t){var s=e!==r,o=e===null,c=e===e,f=je(e),h=t!==r,d=t===null,m=t===t,T=je(t);if(!d&&!T&&!f&&e>t||f&&h&&m&&!d&&!T||o&&h&&m||!s&&m||!c)return 1;if(!o&&!f&&!T&&e<t||T&&s&&c&&!o&&!f||d&&s&&c||!h&&c||!m)return-1}return 0}function uh(e,t,s){for(var o=-1,c=e.criteria,f=t.criteria,h=c.length,d=s.length;++o<h;){var m=Wa(c[o],f[o]);if(m){if(o>=d)return m;var T=s[o];return m*(T=="desc"?-1:1)}}return e.index-t.index}function ja(e,t,s,o){for(var c=-1,f=e.length,h=s.length,d=-1,m=t.length,T=Ee(f-h,0),w=y(m+T),A=!o;++d<m;)w[d]=t[d];for(;++c<h;)(A||c<f)&&(w[s[c]]=e[c]);for(;T--;)w[d++]=e[c++];return w}function qa(e,t,s,o){for(var c=-1,f=e.length,h=-1,d=s.length,m=-1,T=t.length,w=Ee(f-d,0),A=y(w+T),S=!o;++c<w;)A[c]=e[c];for(var D=c;++m<T;)A[D+m]=t[m];for(;++h<d;)(S||c<f)&&(A[D+s[h]]=e[c++]);return A}function $e(e,t){var s=-1,o=e.length;for(t||(t=y(o));++s<o;)t[s]=e[s];return t}function Et(e,t,s,o){var c=!s;s||(s={});for(var f=-1,h=t.length;++f<h;){var d=t[f],m=o?o(s[d],e[d],d,s,e):r;m===r&&(m=e[d]),c?Lt(s,d,m):nr(s,d,m)}return s}function ch(e,t){return Et(e,Cs(e),t)}function lh(e,t){return Et(e,iu(e),t)}function Zr(e,t){return function(s,o){var c=V(s)?gf:Cp,f=t?t():{};return c(s,e,k(o,2),f)}}function On(e){return J(function(t,s){var o=-1,c=s.length,f=c>1?s[c-1]:r,h=c>2?s[2]:r;for(f=e.length>3&&typeof f=="function"?(c--,f):r,h&&De(s[0],s[1],h)&&(f=c<3?r:f,c=1),t=se(t);++o<c;){var d=s[o];d&&e(t,d,o,f)}return t})}function Ja(e,t){return function(s,o){if(s==null)return s;if(!Pe(s))return e(s,o);for(var c=s.length,f=t?c:-1,h=se(s);(t?f--:++f<c)&&o(h[f],f,h)!==!1;);return s}}function Qa(e){return function(t,s,o){for(var c=-1,f=se(t),h=o(t),d=h.length;d--;){var m=h[e?d:++c];if(s(f[m],m,f)===!1)break}return t}}function fh(e,t,s){var o=t&fe,c=ar(e);function f(){var h=this&&this!==be&&this instanceof f?c:e;return h.apply(o?s:this,arguments)}return f}function za(e){return function(t){t=ne(t);var s=En(t)?ft(t):r,o=s?s[0]:t.charAt(0),c=s?zt(s,1).join(""):t.slice(1);return o[e]()+c}}function Ln(e){return function(t){return Hi(Ju(qu(t).replace(ef,"")),e,"")}}function ar(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 s=Sn(e.prototype),o=e.apply(s,t);return pe(o)?o:s}}function ph(e,t,s){var o=ar(e);function c(){for(var f=arguments.length,h=y(f),d=f,m=Rn(c);d--;)h[d]=arguments[d];var T=f<3&&h[0]!==m&&h[f-1]!==m?[]:Wt(h,m);if(f-=T.length,f<s)return Za(e,t,ei,c.placeholder,r,h,T,r,r,s-f);var w=this&&this!==be&&this instanceof c?o:e;return Ge(w,this,h)}return c}function Ya(e){return function(t,s,o){var c=se(t);if(!Pe(t)){var f=k(s,3);t=xe(t),s=function(d){return f(c[d],d,c)}}var h=e(t,s,o);return h>-1?c[f?t[h]:h]:r}}function Ha(e){return Ct(function(t){var s=t.length,o=s,c=Xe.prototype.thru;for(e&&t.reverse();o--;){var f=t[o];if(typeof f!="function")throw new Ke(v);if(c&&!h&&ii(f)=="wrapper")var h=new Xe([],!0)}for(o=h?o:s;++o<s;){f=t[o];var d=ii(f),m=d=="wrapper"?Ls(f):r;m&&Fs(m[0])&&m[1]==(Ue|ye|Re|nn)&&!m[4].length&&m[9]==1?h=h[ii(m[0])].apply(h,m[3]):h=f.length==1&&Fs(f)?h[d]():h.thru(f)}return function(){var T=arguments,w=T[0];if(h&&T.length==1&&V(w))return h.plant(w).value();for(var A=0,S=s?t[A].apply(this,T):w;++A<s;)S=t[A].call(this,S);return S}})}function ei(e,t,s,o,c,f,h,d,m,T){var w=t&Ue,A=t&fe,S=t&ve,D=t&(ye|Ne),U=t&x,q=S?r:ar(e);function $(){for(var Q=arguments.length,H=y(Q),qe=Q;qe--;)H[qe]=arguments[qe];if(D)var Fe=Rn($),Je=xf(H,Fe);if(o&&(H=ja(H,o,c,D)),f&&(H=qa(H,f,h,D)),Q-=Je,D&&Q<T){var ge=Wt(H,Fe);return Za(e,t,ei,$.placeholder,s,H,ge,d,m,T-Q)}var dt=A?s:this,Ut=S?dt[e]:e;return Q=H.length,d?H=Ch(H,d):U&&Q>1&&H.reverse(),w&&m<Q&&(H.length=m),this&&this!==be&&this instanceof $&&(Ut=q||ar(Ut)),Ut.apply(dt,H)}return $}function Ka(e,t){return function(s,o){return Bp(s,e,t(o),{})}}function ti(e,t){return function(s,o){var c;if(s===r&&o===r)return t;if(s!==r&&(c=s),o!==r){if(c===r)return o;typeof s=="string"||typeof o=="string"?(s=We(s),o=We(o)):(s=Ua(s),o=Ua(o)),c=e(s,o)}return c}}function Ns(e){return Ct(function(t){return t=le(t,Ve(k())),J(function(s){var o=this;return e(t,function(c){return Ge(c,o,s)})})})}function ni(e,t){t=t===r?" ":We(t);var s=t.length;if(s<2)return s?_s(t,e):t;var o=_s(t,Vr(e/In(t)));return En(t)?zt(ft(o),0,e).join(""):o.slice(0,e)}function hh(e,t,s,o){var c=t&fe,f=ar(e);function h(){for(var d=-1,m=arguments.length,T=-1,w=o.length,A=y(w+m),S=this&&this!==be&&this instanceof h?f:e;++T<w;)A[T]=o[T];for(;m--;)A[T++]=arguments[++d];return Ge(S,c?s:this,A)}return h}function Xa(e){return function(t,s,o){return o&&typeof o!="number"&&De(t,s,o)&&(s=o=r),t=kt(t),s===r?(s=t,t=0):s=kt(s),o=o===r?t<s?1:-1:kt(o),Xp(t,s,o,e)}}function ri(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=nt(t),s=nt(s)),e(t,s)}}function Za(e,t,s,o,c,f,h,d,m,T){var w=t&ye,A=w?h:r,S=w?r:h,D=w?f:r,U=w?r:f;t|=w?Re:Qe,t&=~(w?Qe:Re),t&tn||(t&=-4);var q=[e,t,c,D,A,U,S,d,m,T],$=s.apply(r,q);return Fs(e)&&fu($,q),$.placeholder=o,pu($,e,t)}function bs(e){var t=we[e];return function(s,o){if(s=nt(s),o=o==null?0:Oe(j(o),292),o&&pa(s)){var c=(ne(s)+"e").split("e"),f=t(c[0]+"e"+(+c[1]+o));return c=(ne(f)+"e").split("e"),+(c[0]+"e"+(+c[1]-o))}return t(s)}}var dh=Nn&&1/Cr(new Nn([,-0]))[1]==rn?function(e){return new Nn(e)}:Ys;function eu(e){return function(t){var s=Le(t);return s==ct?rs(t):s==lt?Rf(t):If(t,e(t))}}function Rt(e,t,s,o,c,f,h,d){var m=t&ve;if(!m&&typeof e!="function")throw new Ke(v);var T=o?o.length:0;if(T||(t&=-97,o=c=r),h=h===r?h:Ee(j(h),0),d=d===r?d:j(d),T-=c?c.length:0,t&Qe){var w=o,A=c;o=c=r}var S=m?r:Ls(e),D=[e,t,s,o,c,w,A,f,h,d];if(S&&Oh(D,S),e=D[0],t=D[1],s=D[2],o=D[3],c=D[4],d=D[9]=D[9]===r?m?0:e.length:Ee(D[9]-T,0),!d&&t&(ye|Ne)&&(t&=-25),!t||t==fe)var U=fh(e,t,s);else t==ye||t==Ne?U=ph(e,t,d):(t==Re||t==(fe|Re))&&!c.length?U=hh(e,t,s,o):U=ei.apply(r,D);var q=S?Fa:fu;return pu(q(U,D),e,t)}function tu(e,t,s,o){return e===r||ht(e,An[s])&&!ie.call(o,s)?t:e}function nu(e,t,s,o,c,f){return pe(e)&&pe(t)&&(f.set(t,e),Hr(e,t,r,nu,f),f.delete(t)),e}function gh(e){return lr(e)?r:e}function ru(e,t,s,o,c,f){var h=s&W,d=e.length,m=t.length;if(d!=m&&!(h&&m>d))return!1;var T=f.get(e),w=f.get(t);if(T&&w)return T==t&&w==e;var A=-1,S=!0,D=s&Te?new un:r;for(f.set(e,t),f.set(t,e);++A<d;){var U=e[A],q=t[A];if(o)var $=h?o(q,U,A,t,e,f):o(U,q,A,e,t,f);if($!==r){if($)continue;S=!1;break}if(D){if(!Ki(t,function(Q,H){if(!Hn(D,H)&&(U===Q||c(U,Q,s,o,f)))return D.push(H)})){S=!1;break}}else if(!(U===q||c(U,q,s,o,f))){S=!1;break}}return f.delete(e),f.delete(t),S}function mh(e,t,s,o,c,f,h){switch(s){case _n:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Yn:return!(e.byteLength!=t.byteLength||!f(new Pr(e),new Pr(t)));case Wn:case jn:case qn:return ht(+e,+t);case xr:return e.name==t.name&&e.message==t.message;case Jn:case Qn:return e==t+"";case ct:var d=rs;case lt:var m=o&W;if(d||(d=Cr),e.size!=t.size&&!m)return!1;var T=h.get(e);if(T)return T==t;o|=Te,h.set(e,t);var w=ru(d(e),d(t),o,c,f,h);return h.delete(e),w;case Nr:if(tr)return tr.call(e)==tr.call(t)}return!1}function vh(e,t,s,o,c,f){var h=s&W,d=Ss(e),m=d.length,T=Ss(t),w=T.length;if(m!=w&&!h)return!1;for(var A=m;A--;){var S=d[A];if(!(h?S in t:ie.call(t,S)))return!1}var D=f.get(e),U=f.get(t);if(D&&U)return D==t&&U==e;var q=!0;f.set(e,t),f.set(t,e);for(var $=h;++A<m;){S=d[A];var Q=e[S],H=t[S];if(o)var qe=h?o(H,Q,S,t,e,f):o(Q,H,S,e,t,f);if(!(qe===r?Q===H||c(Q,H,s,o,f):qe)){q=!1;break}$||($=S=="constructor")}if(q&&!$){var Fe=e.constructor,Je=t.constructor;Fe!=Je&&"constructor"in e&&"constructor"in t&&!(typeof Fe=="function"&&Fe instanceof Fe&&typeof Je=="function"&&Je instanceof Je)&&(q=!1)}return f.delete(e),f.delete(t),q}function Ct(e){return Us(cu(e,r,yu),e+"")}function Ss(e){return Ia(e,xe,Cs)}function Os(e){return Ia(e,Me,iu)}var Ls=jr?function(e){return jr.get(e)}:Ys;function ii(e){for(var t=e.name+"",s=bn[t],o=ie.call(bn,t)?s.length:0;o--;){var c=s[o],f=c.func;if(f==null||f==e)return c.name}return t}function Rn(e){var t=ie.call(l,"placeholder")?l:e;return t.placeholder}function k(){var e=l.iteratee||Qs;return e=e===Qs?Na:e,arguments.length?e(arguments[0],arguments[1]):e}function si(e,t){var s=e.__data__;return Ah(t)?s[typeof t=="string"?"string":"hash"]:s.map}function Rs(e){for(var t=xe(e),s=t.length;s--;){var o=t[s],c=e[o];t[s]=[o,c,au(c)]}return t}function fn(e,t){var s=Sf(e,t);return Aa(s)?s:r}function yh(e){var t=ie.call(e,on),s=e[on];try{e[on]=r;var o=!0}catch{}var c=Ur.call(e);return o&&(t?e[on]=s:delete e[on]),c}var Cs=ss?function(e){return e==null?[]:(e=se(e),Gt(ss(e),function(t){return la.call(e,t)}))}:Hs,iu=ss?function(e){for(var t=[];e;)Vt(t,Cs(e)),e=Mr(e);return t}:Hs,Le=Ce;(os&&Le(new os(new ArrayBuffer(1)))!=_n||Xn&&Le(new Xn)!=ct||as&&Le(as.resolve())!=To||Nn&&Le(new Nn)!=lt||Zn&&Le(new Zn)!=zn)&&(Le=function(e){var t=Ce(e),s=t==bt?e.constructor:r,o=s?pn(s):"";if(o)switch(o){case ep:return _n;case tp:return ct;case np:return To;case rp:return lt;case ip:return zn}return t});function _h(e,t,s){for(var o=-1,c=s.length;++o<c;){var f=s[o],h=f.size;switch(f.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Oe(t,e+h);break;case"takeRight":e=Ee(e,t-h);break}}return{start:e,end:t}}function Th(e){var t=e.match(Al);return t?t[1].split(Nl):[]}function su(e,t,s){t=Qt(t,e);for(var o=-1,c=t.length,f=!1;++o<c;){var h=It(t[o]);if(!(f=e!=null&&s(e,h)))break;e=e[h]}return f||++o!=c?f:(c=e==null?0:e.length,!!c&&pi(c)&&Dt(h,c)&&(V(e)||hn(e)))}function wh(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&ie.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function ou(e){return typeof e.constructor=="function"&&!ur(e)?Sn(Mr(e)):{}}function Eh(e,t,s){var o=e.constructor;switch(t){case Yn:return As(e);case Wn:case jn:return new o(+e);case _n:return sh(e,s);case Ri:case Ci:case Di:case Fi:case ki:case Ui:case $i:case Pi:case Mi:return Va(e,s);case ct:return new o;case qn:case Qn:return new o(e);case Jn:return oh(e);case lt:return new o;case Nr:return ah(e)}}function Ih(e,t){var s=t.length;if(!s)return e;var o=s-1;return t[o]=(s>1?"& ":"")+t[o],t=t.join(s>2?", ":" "),e.replace(xl,`{
|
|
39
88
|
/* [wrapped with `+t+`] */
|
|
40
|
-
`)}function _h(e){return W(e)||pn(e)||!!(ca&&e&&e[ca])}function Rt(e,t){var s=typeof e;return t=t??$t,!!t&&(s=="number"||s!="symbol"&&Ll.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e,t,s){if(!he(s))return!1;var o=typeof t;return(o=="number"?Me(s)&&Rt(t,s.length):o=="string"&&t in s)?dt(s[t],e):!1}function Ds(e,t){if(W(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||qe(e)?!0:gl.test(e)||!dl.test(e)||t!=null&&e in ae(t)}function Th(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fs(e){var t=ri(e),s=l[t];if(typeof s!="function"||!(t in H.prototype))return!1;if(e===s)return!0;var o=Ls(s);return!!o&&e===o[0]}function wh(e){return!!sa&&sa in e}var Eh=Dr?Dt:Ks;function ur(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Nn;return e===s}function su(e){return e===e&&!he(e)}function ou(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==r||e in ae(s))}}function xh(e){var t=ci(e,function(o){return s.size===D&&s.clear(),o}),s=t.cache;return t}function Ah(e,t){var s=e[1],o=t[1],c=s|o,f=c<(pe|ve|Ue),h=o==Ue&&s==_e||o==Ue&&s==tn&&e[7].length<=t[8]||o==(Ue|tn)&&t[7].length<=t[8]&&s==_e;if(!(f||h))return e;o&pe&&(e[2]=t[2],c|=s&pe?0:en);var d=t[3];if(d){var m=e[3];e[3]=m?Wa(m,d,t[4]):d,e[4]=m?Wt(e[3],C):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?Va(m,d,t[6]):d,e[6]=m?Wt(e[5],C):t[6]),d=t[7],d&&(e[7]=d),o&Ue&&(e[8]=e[8]==null?t[8]:Le(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Ih(e){var t=[];if(e!=null)for(var s in ae(e))t.push(s);return t}function Nh(e){return kr.call(e)}function au(e,t,s){return t=xe(t===r?e.length-1:t,0),function(){for(var o=arguments,c=-1,f=xe(o.length-t,0),h=v(f);++c<f;)h[c]=o[t+c];c=-1;for(var d=v(t+1);++c<t;)d[c]=o[c];return d[t]=s(h),We(e,this,d)}}function uu(e,t){return t.length<2?e:cn(e,tt(t,0,-1))}function Sh(e,t){for(var s=e.length,o=Le(t.length,s),c=Pe(e);o--;){var f=t[o];e[o]=Rt(f,s)?c[f]:r}return e}function ks(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var cu=fu(Ra),cr=Wf||function(e,t){return Se.setTimeout(e,t)},Us=fu(Hp);function lu(e,t,s){var o=t+"";return Us(e,vh(o,bh(gh(o),s)))}function fu(e){var t=0,s=0;return function(){var o=Jf(),c=zc-(o-s);if(s=o,c>0){if(++t>=Li)return arguments[0]}else t=0;return e.apply(r,arguments)}}function si(e,t){var s=-1,o=e.length,c=o-1;for(t=t===r?o:t;++s<t;){var f=vs(s,c),h=e[f];e[f]=e[s],e[s]=h}return e.length=t,e}var pu=xh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ml,function(s,o,c,f){t.push(c?f.replace(Al,"$1"):o||s)}),t});function Et(e){if(typeof e=="string"||qe(e))return e;var t=e+"";return t=="0"&&1/e==-nn?"-0":t}function fn(e){if(e!=null){try{return Fr.call(e)}catch{}try{return e+""}catch{}}return""}function bh(e,t){return Ke(el,function(s){var o="_."+s[0];t&s[1]&&!Or(e,o)&&e.push(o)}),e.sort()}function hu(e){if(e instanceof H)return e.clone();var t=new Ze(e.__wrapped__,e.__chain__);return t.__actions__=Pe(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Oh(e,t,s){(s?Fe(e,t,s):t===r)?t=1:t=xe(j(t),0);var o=e==null?0:e.length;if(!o||t<1)return[];for(var c=0,f=0,h=v(Gr(o/t));c<o;)h[f++]=tt(e,c,c+=t);return h}function Lh(e){for(var t=-1,s=e==null?0:e.length,o=0,c=[];++t<s;){var f=e[t];f&&(c[o++]=f)}return c}function Ch(){var e=arguments.length;if(!e)return[];for(var t=v(e-1),s=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Gt(W(s)?Pe(s):[s],be(t,1))}var Rh=Q(function(e,t){return ge(e)?rr(e,be(t,1,ge,!0)):[]}),Dh=Q(function(e,t){var s=nt(t);return ge(s)&&(s=r),ge(e)?rr(e,be(t,1,ge,!0),k(s,2)):[]}),Fh=Q(function(e,t){var s=nt(t);return ge(s)&&(s=r),ge(e)?rr(e,be(t,1,ge,!0),r,s):[]});function kh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),tt(e,t<0?0:t,o)):[]}function Uh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,tt(e,0,t<0?0:t)):[]}function Ph(e,t){return e&&e.length?Kr(e,k(t,3),!0,!0):[]}function Mh(e,t){return e&&e.length?Kr(e,k(t,3),!0):[]}function $h(e,t,s,o){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Fe(e,t,s)&&(s=0,o=c),Cp(e,t,s,o)):[]}function du(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=xe(o+c,0)),Lr(e,k(t,3),c)}function gu(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o-1;return s!==r&&(c=j(s),c=s<0?xe(o+c,0):Le(c,o-1)),Lr(e,k(t,3),c,!0)}function mu(e){var t=e==null?0:e.length;return t?be(e,1):[]}function Bh(e){var t=e==null?0:e.length;return t?be(e,nn):[]}function Gh(e,t){var s=e==null?0:e.length;return s?(t=t===r?1:j(t),be(e,t)):[]}function Wh(e){for(var t=-1,s=e==null?0:e.length,o={};++t<s;){var c=e[t];o[c[0]]=c[1]}return o}function yu(e){return e&&e.length?e[0]:r}function Vh(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=xe(o+c,0)),En(e,t,c)}function jh(e){var t=e==null?0:e.length;return t?tt(e,0,-1):[]}var qh=Q(function(e){var t=fe(e,xs);return t.length&&t[0]===e[0]?hs(t):[]}),Jh=Q(function(e){var t=nt(e),s=fe(e,xs);return t===nt(s)?t=r:s.pop(),s.length&&s[0]===e[0]?hs(s,k(t,2)):[]}),Qh=Q(function(e){var t=nt(e),s=fe(e,xs);return t=typeof t=="function"?t:r,t&&s.pop(),s.length&&s[0]===e[0]?hs(s,r,t):[]});function zh(e,t){return e==null?"":jf.call(e,t)}function nt(e){var t=e==null?0:e.length;return t?e[t-1]:r}function Yh(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o;return s!==r&&(c=j(s),c=c<0?xe(o+c,0):Le(c,o-1)),t===t?bf(e,t,c):Lr(e,Ko,c,!0)}function Hh(e,t){return e&&e.length?ba(e,j(t)):r}var Kh=Q(vu);function vu(e,t){return e&&e.length&&t&&t.length?ys(e,t):e}function Xh(e,t,s){return e&&e.length&&t&&t.length?ys(e,t,k(s,2)):e}function Zh(e,t,s){return e&&e.length&&t&&t.length?ys(e,t,r,s):e}var ed=Ct(function(e,t){var s=e==null?0:e.length,o=cs(e,t);return Ca(e,fe(t,function(c){return Rt(c,s)?+c:c}).sort(Ga)),o});function td(e,t){var s=[];if(!(e&&e.length))return s;var o=-1,c=[],f=e.length;for(t=k(t,3);++o<f;){var h=e[o];t(h,o,e)&&(s.push(h),c.push(o))}return Ca(e,c),s}function Ps(e){return e==null?e:zf.call(e)}function nd(e,t,s){var o=e==null?0:e.length;return o?(s&&typeof s!="number"&&Fe(e,t,s)?(t=0,s=o):(t=t==null?0:j(t),s=s===r?o:j(s)),tt(e,t,s)):[]}function rd(e,t){return Hr(e,t)}function id(e,t,s){return Ts(e,t,k(s,2))}function sd(e,t){var s=e==null?0:e.length;if(s){var o=Hr(e,t);if(o<s&&dt(e[o],t))return o}return-1}function od(e,t){return Hr(e,t,!0)}function ad(e,t,s){return Ts(e,t,k(s,2),!0)}function ud(e,t){var s=e==null?0:e.length;if(s){var o=Hr(e,t,!0)-1;if(dt(e[o],t))return o}return-1}function cd(e){return e&&e.length?Da(e):[]}function ld(e,t){return e&&e.length?Da(e,k(t,2)):[]}function fd(e){var t=e==null?0:e.length;return t?tt(e,1,t):[]}function pd(e,t,s){return e&&e.length?(t=s||t===r?1:j(t),tt(e,0,t<0?0:t)):[]}function hd(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,tt(e,t<0?0:t,o)):[]}function dd(e,t){return e&&e.length?Kr(e,k(t,3),!1,!0):[]}function gd(e,t){return e&&e.length?Kr(e,k(t,3)):[]}var md=Q(function(e){return qt(be(e,1,ge,!0))}),yd=Q(function(e){var t=nt(e);return ge(t)&&(t=r),qt(be(e,1,ge,!0),k(t,2))}),vd=Q(function(e){var t=nt(e);return t=typeof t=="function"?t:r,qt(be(e,1,ge,!0),r,t)});function _d(e){return e&&e.length?qt(e):[]}function Td(e,t){return e&&e.length?qt(e,k(t,2)):[]}function wd(e,t){return t=typeof t=="function"?t:r,e&&e.length?qt(e,r,t):[]}function Ms(e){if(!(e&&e.length))return[];var t=0;return e=Bt(e,function(s){if(ge(s))return t=xe(s.length,t),!0}),ts(t,function(s){return fe(e,Xi(s))})}function _u(e,t){if(!(e&&e.length))return[];var s=Ms(e);return t==null?s:fe(s,function(o){return We(t,r,o)})}var Ed=Q(function(e,t){return ge(e)?rr(e,t):[]}),xd=Q(function(e){return Es(Bt(e,ge))}),Ad=Q(function(e){var t=nt(e);return ge(t)&&(t=r),Es(Bt(e,ge),k(t,2))}),Id=Q(function(e){var t=nt(e);return t=typeof t=="function"?t:r,Es(Bt(e,ge),r,t)}),Nd=Q(Ms);function Sd(e,t){return Pa(e||[],t||[],nr)}function bd(e,t){return Pa(e||[],t||[],or)}var Od=Q(function(e){var t=e.length,s=t>1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,_u(e,s)});function Tu(e){var t=l(e);return t.__chain__=!0,t}function Ld(e,t){return t(e),e}function oi(e,t){return t(e)}var Cd=Ct(function(e){var t=e.length,s=t?e[0]:0,o=this.__wrapped__,c=function(f){return cs(f,e)};return t>1||this.__actions__.length||!(o instanceof H)||!Rt(s)?this.thru(c):(o=o.slice(s,+s+(t?1:0)),o.__actions__.push({func:oi,args:[c],thisArg:r}),new Ze(o,this.__chain__).thru(function(f){return t&&!f.length&&f.push(r),f}))});function Rd(){return Tu(this)}function Dd(){return new Ze(this.value(),this.__chain__)}function Fd(){this.__values__===r&&(this.__values__=Fu(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function kd(){return this}function Ud(e){for(var t,s=this;s instanceof qr;){var o=hu(s);o.__index__=0,o.__values__=r,t?c.__wrapped__=o:t=o;var c=o;s=s.__wrapped__}return c.__wrapped__=e,t}function Pd(){var e=this.__wrapped__;if(e instanceof H){var t=e;return this.__actions__.length&&(t=new H(this)),t=t.reverse(),t.__actions__.push({func:oi,args:[Ps],thisArg:r}),new Ze(t,this.__chain__)}return this.thru(Ps)}function Md(){return Ua(this.__wrapped__,this.__actions__)}var $d=Xr(function(e,t,s){se.call(e,s)?++e[s]:Ot(e,s,1)});function Bd(e,t,s){var o=W(e)?Yo:Lp;return s&&Fe(e,t,s)&&(t=r),o(e,k(t,3))}function Gd(e,t){var s=W(e)?Bt:_a;return s(e,k(t,3))}var Wd=Qa(du),Vd=Qa(gu);function jd(e,t){return be(ai(e,t),1)}function qd(e,t){return be(ai(e,t),nn)}function Jd(e,t,s){return s=s===r?1:j(s),be(ai(e,t),s)}function wu(e,t){var s=W(e)?Ke:jt;return s(e,k(t,3))}function Eu(e,t){var s=W(e)?ff:va;return s(e,k(t,3))}var Qd=Xr(function(e,t,s){se.call(e,s)?e[s].push(t):Ot(e,s,[t])});function zd(e,t,s,o){e=Me(e)?e:Fn(e),s=s&&!o?j(s):0;var c=e.length;return s<0&&(s=xe(c+s,0)),pi(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&En(e,t,s)>-1}var Yd=Q(function(e,t,s){var o=-1,c=typeof t=="function",f=Me(e)?v(e.length):[];return jt(e,function(h){f[++o]=c?We(t,h,s):ir(h,t,s)}),f}),Hd=Xr(function(e,t,s){Ot(e,s,t)});function ai(e,t){var s=W(e)?fe:Ia;return s(e,k(t,3))}function Kd(e,t,s,o){return e==null?[]:(W(t)||(t=t==null?[]:[t]),s=o?r:s,W(s)||(s=s==null?[]:[s]),Oa(e,t,s))}var Xd=Xr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Zd(e,t,s){var o=W(e)?Hi:Zo,c=arguments.length<3;return o(e,k(t,4),s,c,jt)}function eg(e,t,s){var o=W(e)?pf:Zo,c=arguments.length<3;return o(e,k(t,4),s,c,va)}function tg(e,t){var s=W(e)?Bt:_a;return s(e,li(k(t,3)))}function ng(e){var t=W(e)?da:zp;return t(e)}function rg(e,t,s){(s?Fe(e,t,s):t===r)?t=1:t=j(t);var o=W(e)?Ip:Yp;return o(e,t)}function ig(e){var t=W(e)?Np:Kp;return t(e)}function sg(e){if(e==null)return 0;if(Me(e))return pi(e)?An(e):e.length;var t=Ce(e);return t==lt||t==ft?e.size:gs(e).length}function og(e,t,s){var o=W(e)?Ki:Xp;return s&&Fe(e,t,s)&&(t=r),o(e,k(t,3))}var ag=Q(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Fe(e,t[0],t[1])?t=[]:s>2&&Fe(t[0],t[1],t[2])&&(t=[t[0]]),Oa(e,be(t,1),[])}),ui=Gf||function(){return Se.Date.now()};function ug(e,t){if(typeof t!="function")throw new Xe(y);return e=j(e),function(){if(--e<1)return t.apply(this,arguments)}}function xu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Lt(e,Ue,r,r,r,r,t)}function Au(e,t){var s;if(typeof t!="function")throw new Xe(y);return e=j(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var $s=Q(function(e,t,s){var o=pe;if(s.length){var c=Wt(s,Rn($s));o|=Re}return Lt(e,o,t,s,c)}),Iu=Q(function(e,t,s){var o=pe|ve;if(s.length){var c=Wt(s,Rn(Iu));o|=Re}return Lt(t,o,e,s,c)});function Nu(e,t,s){t=s?r:t;var o=Lt(e,_e,r,r,r,r,r,t);return o.placeholder=Nu.placeholder,o}function Su(e,t,s){t=s?r:t;var o=Lt(e,Ne,r,r,r,r,r,t);return o.placeholder=Su.placeholder,o}function bu(e,t,s){var o,c,f,h,d,m,w=0,E=!1,I=!1,b=!0;if(typeof e!="function")throw new Xe(y);t=rt(t)||0,he(s)&&(E=!!s.leading,I="maxWait"in s,f=I?xe(rt(s.maxWait)||0,t):f,b="trailing"in s?!!s.trailing:b);function F(me){var gt=o,kt=c;return o=c=r,w=me,h=e.apply(kt,gt),h}function U(me){return w=me,d=cr(z,t),E?F(me):h}function q(me){var gt=me-m,kt=me-w,Qu=t-gt;return I?Le(Qu,f-kt):Qu}function P(me){var gt=me-m,kt=me-w;return m===r||gt>=t||gt<0||I&&kt>=f}function z(){var me=ui();if(P(me))return X(me);d=cr(z,q(me))}function X(me){return d=r,b&&o?F(me):(o=c=r,h)}function Je(){d!==r&&Ma(d),w=0,o=m=c=d=r}function ke(){return d===r?h:X(ui())}function Qe(){var me=ui(),gt=P(me);if(o=arguments,c=this,m=me,gt){if(d===r)return U(m);if(I)return Ma(d),d=cr(z,t),F(m)}return d===r&&(d=cr(z,t)),h}return Qe.cancel=Je,Qe.flush=ke,Qe}var cg=Q(function(e,t){return ya(e,1,t)}),lg=Q(function(e,t,s){return ya(e,rt(t)||0,s)});function fg(e){return Lt(e,A)}function ci(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Xe(y);var s=function(){var o=arguments,c=t?t.apply(this,o):o[0],f=s.cache;if(f.has(c))return f.get(c);var h=e.apply(this,o);return s.cache=f.set(c,h)||f,h};return s.cache=new(ci.Cache||bt),s}ci.Cache=bt;function li(e){if(typeof e!="function")throw new Xe(y);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)}}function pg(e){return Au(2,e)}var hg=Zp(function(e,t){t=t.length==1&&W(t[0])?fe(t[0],Ve(k())):fe(be(t,1),Ve(k()));var s=t.length;return Q(function(o){for(var c=-1,f=Le(o.length,s);++c<f;)o[c]=t[c].call(this,o[c]);return We(e,this,o)})}),Bs=Q(function(e,t){var s=Wt(t,Rn(Bs));return Lt(e,Re,r,t,s)}),Ou=Q(function(e,t){var s=Wt(t,Rn(Ou));return Lt(e,ze,r,t,s)}),dg=Ct(function(e,t){return Lt(e,tn,r,r,r,t)});function gg(e,t){if(typeof e!="function")throw new Xe(y);return t=t===r?t:j(t),Q(e,t)}function mg(e,t){if(typeof e!="function")throw new Xe(y);return t=t==null?0:xe(j(t),0),Q(function(s){var o=s[t],c=Qt(s,0,t);return o&&Gt(c,o),We(e,this,c)})}function yg(e,t,s){var o=!0,c=!0;if(typeof e!="function")throw new Xe(y);return he(s)&&(o="leading"in s?!!s.leading:o,c="trailing"in s?!!s.trailing:c),bu(e,t,{leading:o,maxWait:t,trailing:c})}function vg(e){return xu(e,1)}function _g(e,t){return Bs(As(t),e)}function Tg(){if(!arguments.length)return[];var e=arguments[0];return W(e)?e:[e]}function wg(e){return et(e,oe)}function Eg(e,t){return t=typeof t=="function"?t:r,et(e,oe,t)}function xg(e){return et(e,J|oe)}function Ag(e,t){return t=typeof t=="function"?t:r,et(e,J|oe,t)}function Ig(e,t){return t==null||ma(e,t,Ae(t))}function dt(e,t){return e===t||e!==e&&t!==t}var Ng=ni(ps),Sg=ni(function(e,t){return e>=t}),pn=Ea(function(){return arguments}())?Ea:function(e){return de(e)&&se.call(e,"callee")&&!ua.call(e,"callee")},W=v.isArray,bg=Vo?Ve(Vo):Up;function Me(e){return e!=null&&fi(e.length)&&!Dt(e)}function ge(e){return de(e)&&Me(e)}function Og(e){return e===!0||e===!1||de(e)&&De(e)==Vn}var zt=Vf||Ks,Lg=jo?Ve(jo):Pp;function Cg(e){return de(e)&&e.nodeType===1&&!lr(e)}function Rg(e){if(e==null)return!0;if(Me(e)&&(W(e)||typeof e=="string"||typeof e.splice=="function"||zt(e)||Dn(e)||pn(e)))return!e.length;var t=Ce(e);if(t==lt||t==ft)return!e.size;if(ur(e))return!gs(e).length;for(var s in e)if(se.call(e,s))return!1;return!0}function Dg(e,t){return sr(e,t)}function Fg(e,t,s){s=typeof s=="function"?s:r;var o=s?s(e,t):r;return o===r?sr(e,t,r,s):!!o}function Gs(e){if(!de(e))return!1;var t=De(e);return t==xr||t==nl||typeof e.message=="string"&&typeof e.name=="string"&&!lr(e)}function kg(e){return typeof e=="number"&&la(e)}function Dt(e){if(!he(e))return!1;var t=De(e);return t==Ar||t==yo||t==tl||t==il}function Lu(e){return typeof e=="number"&&e==j(e)}function fi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$t}function he(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function de(e){return e!=null&&typeof e=="object"}var Cu=qo?Ve(qo):$p;function Ug(e,t){return e===t||ds(e,t,Cs(t))}function Pg(e,t,s){return s=typeof s=="function"?s:r,ds(e,t,Cs(t),s)}function Mg(e){return Ru(e)&&e!=+e}function $g(e){if(Eh(e))throw new B(p);return xa(e)}function Bg(e){return e===null}function Gg(e){return e==null}function Ru(e){return typeof e=="number"||de(e)&&De(e)==qn}function lr(e){if(!de(e)||De(e)!=Nt)return!1;var t=Mr(e);if(t===null)return!0;var s=se.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&Fr.call(s)==Pf}var Ws=Jo?Ve(Jo):Bp;function Wg(e){return Lu(e)&&e>=-$t&&e<=$t}var Du=Qo?Ve(Qo):Gp;function pi(e){return typeof e=="string"||!W(e)&&de(e)&&De(e)==Qn}function qe(e){return typeof e=="symbol"||de(e)&&De(e)==Ir}var Dn=zo?Ve(zo):Wp;function Vg(e){return e===r}function jg(e){return de(e)&&Ce(e)==zn}function qg(e){return de(e)&&De(e)==ol}var Jg=ni(ms),Qg=ni(function(e,t){return e<=t});function Fu(e){if(!e)return[];if(Me(e))return pi(e)?pt(e):Pe(e);if(Kn&&e[Kn])return If(e[Kn]());var t=Ce(e),s=t==lt?rs:t==ft?Cr:Fn;return s(e)}function Ft(e){if(!e)return e===0?e:0;if(e=rt(e),e===nn||e===-nn){var t=e<0?-1:1;return t*Kc}return e===e?e:0}function j(e){var t=Ft(e),s=t%1;return t===t?s?t-s:t:0}function ku(e){return e?un(j(e),0,_t):0}function rt(e){if(typeof e=="number")return e;if(qe(e))return wr;if(he(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=he(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ea(e);var s=Sl.test(e);return s||Ol.test(e)?uf(e.slice(2),s?2:8):Nl.test(e)?wr:+e}function Uu(e){return wt(e,$e(e))}function zg(e){return e?un(j(e),-$t,$t):e===0?e:0}function re(e){return e==null?"":je(e)}var Yg=Ln(function(e,t){if(ur(t)||Me(t)){wt(t,Ae(t),e);return}for(var s in t)se.call(t,s)&&nr(e,s,t[s])}),Pu=Ln(function(e,t){wt(t,$e(t),e)}),hi=Ln(function(e,t,s,o){wt(t,$e(t),e,o)}),Hg=Ln(function(e,t,s,o){wt(t,Ae(t),e,o)}),Kg=Ct(cs);function Xg(e,t){var s=On(e);return t==null?s:ga(s,t)}var Zg=Q(function(e,t){e=ae(e);var s=-1,o=t.length,c=o>2?t[2]:r;for(c&&Fe(t[0],t[1],c)&&(o=1);++s<o;)for(var f=t[s],h=$e(f),d=-1,m=h.length;++d<m;){var w=h[d],E=e[w];(E===r||dt(E,Nn[w])&&!se.call(e,w))&&(e[w]=f[w])}return e}),em=Q(function(e){return e.push(r,eu),We(Mu,r,e)});function tm(e,t){return Ho(e,k(t,3),Tt)}function nm(e,t){return Ho(e,k(t,3),fs)}function rm(e,t){return e==null?e:ls(e,k(t,3),$e)}function im(e,t){return e==null?e:Ta(e,k(t,3),$e)}function sm(e,t){return e&&Tt(e,k(t,3))}function om(e,t){return e&&fs(e,k(t,3))}function am(e){return e==null?[]:zr(e,Ae(e))}function um(e){return e==null?[]:zr(e,$e(e))}function Vs(e,t,s){var o=e==null?r:cn(e,t);return o===r?s:o}function cm(e,t){return e!=null&&ru(e,t,Rp)}function js(e,t){return e!=null&&ru(e,t,Dp)}var lm=Ya(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=kr.call(t)),e[t]=s},Js(Be)),fm=Ya(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=kr.call(t)),se.call(e,t)?e[t].push(s):e[t]=[s]},k),pm=Q(ir);function Ae(e){return Me(e)?ha(e):gs(e)}function $e(e){return Me(e)?ha(e,!0):Vp(e)}function hm(e,t){var s={};return t=k(t,3),Tt(e,function(o,c,f){Ot(s,t(o,c,f),o)}),s}function dm(e,t){var s={};return t=k(t,3),Tt(e,function(o,c,f){Ot(s,c,t(o,c,f))}),s}var gm=Ln(function(e,t,s){Yr(e,t,s)}),Mu=Ln(function(e,t,s,o){Yr(e,t,s,o)}),mm=Ct(function(e,t){var s={};if(e==null)return s;var o=!1;t=fe(t,function(f){return f=Jt(f,e),o||(o=f.length>1),f}),wt(e,Os(e),s),o&&(s=et(s,J|Y|oe,lh));for(var c=t.length;c--;)ws(s,t[c]);return s});function ym(e,t){return $u(e,li(k(t)))}var vm=Ct(function(e,t){return e==null?{}:qp(e,t)});function $u(e,t){if(e==null)return{};var s=fe(Os(e),function(o){return[o]});return t=k(t),La(e,s,function(o,c){return t(o,c[0])})}function _m(e,t,s){t=Jt(t,e);var o=-1,c=t.length;for(c||(c=1,e=r);++o<c;){var f=e==null?r:e[Et(t[o])];f===r&&(o=c,f=s),e=Dt(f)?f.call(e):f}return e}function Tm(e,t,s){return e==null?e:or(e,t,s)}function wm(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:or(e,t,s,o)}var Bu=Xa(Ae),Gu=Xa($e);function Em(e,t,s){var o=W(e),c=o||zt(e)||Dn(e);if(t=k(t,4),s==null){var f=e&&e.constructor;c?s=o?new f:[]:he(e)?s=Dt(f)?On(Mr(e)):{}:s={}}return(c?Ke:Tt)(e,function(h,d,m){return t(s,h,d,m)}),s}function xm(e,t){return e==null?!0:ws(e,t)}function Am(e,t,s){return e==null?e:ka(e,t,As(s))}function Im(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:ka(e,t,As(s),o)}function Fn(e){return e==null?[]:ns(e,Ae(e))}function Nm(e){return e==null?[]:ns(e,$e(e))}function Sm(e,t,s){return s===r&&(s=t,t=r),s!==r&&(s=rt(s),s=s===s?s:0),t!==r&&(t=rt(t),t=t===t?t:0),un(rt(e),t,s)}function bm(e,t,s){return t=Ft(t),s===r?(s=t,t=0):s=Ft(s),e=rt(e),Fp(e,t,s)}function Om(e,t,s){if(s&&typeof s!="boolean"&&Fe(e,t,s)&&(t=s=r),s===r&&(typeof t=="boolean"?(s=t,t=r):typeof e=="boolean"&&(s=e,e=r)),e===r&&t===r?(e=0,t=1):(e=Ft(e),t===r?(t=e,e=0):t=Ft(t)),e>t){var o=e;e=t,t=o}if(s||e%1||t%1){var c=fa();return Le(e+c*(t-e+af("1e-"+((c+"").length-1))),t)}return vs(e,t)}var Lm=Cn(function(e,t,s){return t=t.toLowerCase(),e+(s?Wu(t):t)});function Wu(e){return qs(re(e).toLowerCase())}function Vu(e){return e=re(e),e&&e.replace(Cl,Tf).replace(Hl,"")}function Cm(e,t,s){e=re(e),t=je(t);var o=e.length;s=s===r?o:un(j(s),0,o);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function Rm(e){return e=re(e),e&&fl.test(e)?e.replace(To,wf):e}function Dm(e){return e=re(e),e&&yl.test(e)?e.replace(Bi,"\\$&"):e}var Fm=Cn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),km=Cn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Um=Ja("toLowerCase");function Pm(e,t,s){e=re(e),t=j(t);var o=t?An(e):0;if(!t||o>=t)return e;var c=(t-o)/2;return ti(Wr(c),s)+e+ti(Gr(c),s)}function Mm(e,t,s){e=re(e),t=j(t);var o=t?An(e):0;return t&&o<t?e+ti(t-o,s):e}function $m(e,t,s){e=re(e),t=j(t);var o=t?An(e):0;return t&&o<t?ti(t-o,s)+e:e}function Bm(e,t,s){return s||t==null?t=0:t&&(t=+t),Qf(re(e).replace(Gi,""),t||0)}function Gm(e,t,s){return(s?Fe(e,t,s):t===r)?t=1:t=j(t),_s(re(e),t)}function Wm(){var e=arguments,t=re(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Vm=Cn(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function jm(e,t,s){return s&&typeof s!="number"&&Fe(e,t,s)&&(t=s=r),s=s===r?_t:s>>>0,s?(e=re(e),e&&(typeof t=="string"||t!=null&&!Ws(t))&&(t=je(t),!t&&xn(e))?Qt(pt(e),0,s):e.split(t,s)):[]}var qm=Cn(function(e,t,s){return e+(s?" ":"")+qs(t)});function Jm(e,t,s){return e=re(e),s=s==null?0:un(j(s),0,e.length),t=je(t),e.slice(s,s+t.length)==t}function Qm(e,t,s){var o=l.templateSettings;s&&Fe(e,t,s)&&(t=r),e=re(e),t=hi({},t,o,Za);var c=hi({},t.imports,o.imports,Za),f=Ae(c),h=ns(c,f),d,m,w=0,E=t.interpolate||Nr,I="__p += '",b=is((t.escape||Nr).source+"|"+E.source+"|"+(E===wo?Il:Nr).source+"|"+(t.evaluate||Nr).source+"|$","g"),F="//# sourceURL="+(se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tf+"]")+`
|
|
41
|
-
`;e.replace(
|
|
42
|
-
__e(`+
|
|
43
|
-
'`),
|
|
44
|
-
`+
|
|
45
|
-
__p += '`),
|
|
46
|
-
((__t = (`+
|
|
47
|
-
'`),
|
|
48
|
-
`;var U=
|
|
49
|
-
`+
|
|
89
|
+
`)}function xh(e){return V(e)||hn(e)||!!(fa&&e&&e[fa])}function Dt(e,t){var s=typeof e;return t=t??Bt,!!t&&(s=="number"||s!="symbol"&&kl.test(e))&&e>-1&&e%1==0&&e<t}function De(e,t,s){if(!pe(s))return!1;var o=typeof t;return(o=="number"?Pe(s)&&Dt(t,s.length):o=="string"&&t in s)?ht(s[t],e):!1}function Ds(e,t){if(V(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||je(e)?!0:Tl.test(e)||!_l.test(e)||t!=null&&e in se(t)}function Ah(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fs(e){var t=ii(e),s=l[t];if(typeof s!="function"||!(t in z.prototype))return!1;if(e===s)return!0;var o=Ls(s);return!!o&&e===o[0]}function Nh(e){return!!aa&&aa in e}var bh=Fr?Ft:Ks;function ur(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||An;return e===s}function au(e){return e===e&&!pe(e)}function uu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==r||e in se(s))}}function Sh(e){var t=li(e,function(o){return s.size===R&&s.clear(),o}),s=t.cache;return t}function Oh(e,t){var s=e[1],o=t[1],c=s|o,f=c<(fe|ve|Ue),h=o==Ue&&s==ye||o==Ue&&s==nn&&e[7].length<=t[8]||o==(Ue|nn)&&t[7].length<=t[8]&&s==ye;if(!(f||h))return e;o&fe&&(e[2]=t[2],c|=s&fe?0:tn);var d=t[3];if(d){var m=e[3];e[3]=m?ja(m,d,t[4]):d,e[4]=m?Wt(e[3],O):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?qa(m,d,t[6]):d,e[6]=m?Wt(e[5],O):t[6]),d=t[7],d&&(e[7]=d),o&Ue&&(e[8]=e[8]==null?t[8]:Oe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Lh(e){var t=[];if(e!=null)for(var s in se(e))t.push(s);return t}function Rh(e){return Ur.call(e)}function cu(e,t,s){return t=Ee(t===r?e.length-1:t,0),function(){for(var o=arguments,c=-1,f=Ee(o.length-t,0),h=y(f);++c<f;)h[c]=o[t+c];c=-1;for(var d=y(t+1);++c<t;)d[c]=o[c];return d[t]=s(h),Ge(e,this,d)}}function lu(e,t){return t.length<2?e:ln(e,et(t,0,-1))}function Ch(e,t){for(var s=e.length,o=Oe(t.length,s),c=$e(e);o--;){var f=t[o];e[o]=Dt(f,s)?c[f]:r}return e}function ks(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var fu=hu(Fa),cr=Qf||function(e,t){return be.setTimeout(e,t)},Us=hu(th);function pu(e,t,s){var o=t+"";return Us(e,Ih(o,Dh(Th(o),s)))}function hu(e){var t=0,s=0;return function(){var o=Kf(),c=Zc-(o-s);if(s=o,c>0){if(++t>=Li)return arguments[0]}else t=0;return e.apply(r,arguments)}}function oi(e,t){var s=-1,o=e.length,c=o-1;for(t=t===r?o:t;++s<t;){var f=ys(s,c),h=e[f];e[f]=e[s],e[s]=h}return e.length=t,e}var du=Sh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wl,function(s,o,c,f){t.push(c?f.replace(Ol,"$1"):o||s)}),t});function It(e){if(typeof e=="string"||je(e))return e;var t=e+"";return t=="0"&&1/e==-rn?"-0":t}function pn(e){if(e!=null){try{return kr.call(e)}catch{}try{return e+""}catch{}}return""}function Dh(e,t){return He(sl,function(s){var o="_."+s[0];t&s[1]&&!Lr(e,o)&&e.push(o)}),e.sort()}function gu(e){if(e instanceof z)return e.clone();var t=new Xe(e.__wrapped__,e.__chain__);return t.__actions__=$e(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Fh(e,t,s){(s?De(e,t,s):t===r)?t=1:t=Ee(j(t),0);var o=e==null?0:e.length;if(!o||t<1)return[];for(var c=0,f=0,h=y(Vr(o/t));c<o;)h[f++]=et(e,c,c+=t);return h}function kh(e){for(var t=-1,s=e==null?0:e.length,o=0,c=[];++t<s;){var f=e[t];f&&(c[o++]=f)}return c}function Uh(){var e=arguments.length;if(!e)return[];for(var t=y(e-1),s=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Vt(V(s)?$e(s):[s],Se(t,1))}var $h=J(function(e,t){return de(e)?rr(e,Se(t,1,de,!0)):[]}),Ph=J(function(e,t){var s=tt(t);return de(s)&&(s=r),de(e)?rr(e,Se(t,1,de,!0),k(s,2)):[]}),Mh=J(function(e,t){var s=tt(t);return de(s)&&(s=r),de(e)?rr(e,Se(t,1,de,!0),r,s):[]});function Bh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),et(e,t<0?0:t,o)):[]}function Gh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,et(e,0,t<0?0:t)):[]}function Vh(e,t){return e&&e.length?Xr(e,k(t,3),!0,!0):[]}function Wh(e,t){return e&&e.length?Xr(e,k(t,3),!0):[]}function jh(e,t,s,o){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&De(e,t,s)&&(s=0,o=c),Up(e,t,s,o)):[]}function mu(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=Ee(o+c,0)),Rr(e,k(t,3),c)}function vu(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o-1;return s!==r&&(c=j(s),c=s<0?Ee(o+c,0):Oe(c,o-1)),Rr(e,k(t,3),c,!0)}function yu(e){var t=e==null?0:e.length;return t?Se(e,1):[]}function qh(e){var t=e==null?0:e.length;return t?Se(e,rn):[]}function Jh(e,t){var s=e==null?0:e.length;return s?(t=t===r?1:j(t),Se(e,t)):[]}function Qh(e){for(var t=-1,s=e==null?0:e.length,o={};++t<s;){var c=e[t];o[c[0]]=c[1]}return o}function _u(e){return e&&e.length?e[0]:r}function zh(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=Ee(o+c,0)),wn(e,t,c)}function Yh(e){var t=e==null?0:e.length;return t?et(e,0,-1):[]}var Hh=J(function(e){var t=le(e,Is);return t.length&&t[0]===e[0]?hs(t):[]}),Kh=J(function(e){var t=tt(e),s=le(e,Is);return t===tt(s)?t=r:s.pop(),s.length&&s[0]===e[0]?hs(s,k(t,2)):[]}),Xh=J(function(e){var t=tt(e),s=le(e,Is);return t=typeof t=="function"?t:r,t&&s.pop(),s.length&&s[0]===e[0]?hs(s,r,t):[]});function Zh(e,t){return e==null?"":Yf.call(e,t)}function tt(e){var t=e==null?0:e.length;return t?e[t-1]:r}function ed(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o;return s!==r&&(c=j(s),c=c<0?Ee(o+c,0):Oe(c,o-1)),t===t?Df(e,t,c):Rr(e,Zo,c,!0)}function td(e,t){return e&&e.length?La(e,j(t)):r}var nd=J(Tu);function Tu(e,t){return e&&e.length&&t&&t.length?vs(e,t):e}function rd(e,t,s){return e&&e.length&&t&&t.length?vs(e,t,k(s,2)):e}function id(e,t,s){return e&&e.length&&t&&t.length?vs(e,t,r,s):e}var sd=Ct(function(e,t){var s=e==null?0:e.length,o=cs(e,t);return Da(e,le(t,function(c){return Dt(c,s)?+c:c}).sort(Wa)),o});function od(e,t){var s=[];if(!(e&&e.length))return s;var o=-1,c=[],f=e.length;for(t=k(t,3);++o<f;){var h=e[o];t(h,o,e)&&(s.push(h),c.push(o))}return Da(e,c),s}function $s(e){return e==null?e:Zf.call(e)}function ad(e,t,s){var o=e==null?0:e.length;return o?(s&&typeof s!="number"&&De(e,t,s)?(t=0,s=o):(t=t==null?0:j(t),s=s===r?o:j(s)),et(e,t,s)):[]}function ud(e,t){return Kr(e,t)}function cd(e,t,s){return Ts(e,t,k(s,2))}function ld(e,t){var s=e==null?0:e.length;if(s){var o=Kr(e,t);if(o<s&&ht(e[o],t))return o}return-1}function fd(e,t){return Kr(e,t,!0)}function pd(e,t,s){return Ts(e,t,k(s,2),!0)}function hd(e,t){var s=e==null?0:e.length;if(s){var o=Kr(e,t,!0)-1;if(ht(e[o],t))return o}return-1}function dd(e){return e&&e.length?ka(e):[]}function gd(e,t){return e&&e.length?ka(e,k(t,2)):[]}function md(e){var t=e==null?0:e.length;return t?et(e,1,t):[]}function vd(e,t,s){return e&&e.length?(t=s||t===r?1:j(t),et(e,0,t<0?0:t)):[]}function yd(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,et(e,t<0?0:t,o)):[]}function _d(e,t){return e&&e.length?Xr(e,k(t,3),!1,!0):[]}function Td(e,t){return e&&e.length?Xr(e,k(t,3)):[]}var wd=J(function(e){return Jt(Se(e,1,de,!0))}),Ed=J(function(e){var t=tt(e);return de(t)&&(t=r),Jt(Se(e,1,de,!0),k(t,2))}),Id=J(function(e){var t=tt(e);return t=typeof t=="function"?t:r,Jt(Se(e,1,de,!0),r,t)});function xd(e){return e&&e.length?Jt(e):[]}function Ad(e,t){return e&&e.length?Jt(e,k(t,2)):[]}function Nd(e,t){return t=typeof t=="function"?t:r,e&&e.length?Jt(e,r,t):[]}function Ps(e){if(!(e&&e.length))return[];var t=0;return e=Gt(e,function(s){if(de(s))return t=Ee(s.length,t),!0}),ts(t,function(s){return le(e,Xi(s))})}function wu(e,t){if(!(e&&e.length))return[];var s=Ps(e);return t==null?s:le(s,function(o){return Ge(t,r,o)})}var bd=J(function(e,t){return de(e)?rr(e,t):[]}),Sd=J(function(e){return Es(Gt(e,de))}),Od=J(function(e){var t=tt(e);return de(t)&&(t=r),Es(Gt(e,de),k(t,2))}),Ld=J(function(e){var t=tt(e);return t=typeof t=="function"?t:r,Es(Gt(e,de),r,t)}),Rd=J(Ps);function Cd(e,t){return Ma(e||[],t||[],nr)}function Dd(e,t){return Ma(e||[],t||[],or)}var Fd=J(function(e){var t=e.length,s=t>1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,wu(e,s)});function Eu(e){var t=l(e);return t.__chain__=!0,t}function kd(e,t){return t(e),e}function ai(e,t){return t(e)}var Ud=Ct(function(e){var t=e.length,s=t?e[0]:0,o=this.__wrapped__,c=function(f){return cs(f,e)};return t>1||this.__actions__.length||!(o instanceof z)||!Dt(s)?this.thru(c):(o=o.slice(s,+s+(t?1:0)),o.__actions__.push({func:ai,args:[c],thisArg:r}),new Xe(o,this.__chain__).thru(function(f){return t&&!f.length&&f.push(r),f}))});function $d(){return Eu(this)}function Pd(){return new Xe(this.value(),this.__chain__)}function Md(){this.__values__===r&&(this.__values__=Uu(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Bd(){return this}function Gd(e){for(var t,s=this;s instanceof Jr;){var o=gu(s);o.__index__=0,o.__values__=r,t?c.__wrapped__=o:t=o;var c=o;s=s.__wrapped__}return c.__wrapped__=e,t}function Vd(){var e=this.__wrapped__;if(e instanceof z){var t=e;return this.__actions__.length&&(t=new z(this)),t=t.reverse(),t.__actions__.push({func:ai,args:[$s],thisArg:r}),new Xe(t,this.__chain__)}return this.thru($s)}function Wd(){return Pa(this.__wrapped__,this.__actions__)}var jd=Zr(function(e,t,s){ie.call(e,s)?++e[s]:Lt(e,s,1)});function qd(e,t,s){var o=V(e)?Ko:kp;return s&&De(e,t,s)&&(t=r),o(e,k(t,3))}function Jd(e,t){var s=V(e)?Gt:wa;return s(e,k(t,3))}var Qd=Ya(mu),zd=Ya(vu);function Yd(e,t){return Se(ui(e,t),1)}function Hd(e,t){return Se(ui(e,t),rn)}function Kd(e,t,s){return s=s===r?1:j(s),Se(ui(e,t),s)}function Iu(e,t){var s=V(e)?He:qt;return s(e,k(t,3))}function xu(e,t){var s=V(e)?mf:Ta;return s(e,k(t,3))}var Xd=Zr(function(e,t,s){ie.call(e,s)?e[s].push(t):Lt(e,s,[t])});function Zd(e,t,s,o){e=Pe(e)?e:Dn(e),s=s&&!o?j(s):0;var c=e.length;return s<0&&(s=Ee(c+s,0)),hi(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&wn(e,t,s)>-1}var eg=J(function(e,t,s){var o=-1,c=typeof t=="function",f=Pe(e)?y(e.length):[];return qt(e,function(h){f[++o]=c?Ge(t,h,s):ir(h,t,s)}),f}),tg=Zr(function(e,t,s){Lt(e,s,t)});function ui(e,t){var s=V(e)?le:ba;return s(e,k(t,3))}function ng(e,t,s,o){return e==null?[]:(V(t)||(t=t==null?[]:[t]),s=o?r:s,V(s)||(s=s==null?[]:[s]),Ra(e,t,s))}var rg=Zr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function ig(e,t,s){var o=V(e)?Hi:ta,c=arguments.length<3;return o(e,k(t,4),s,c,qt)}function sg(e,t,s){var o=V(e)?vf:ta,c=arguments.length<3;return o(e,k(t,4),s,c,Ta)}function og(e,t){var s=V(e)?Gt:wa;return s(e,fi(k(t,3)))}function ag(e){var t=V(e)?ma:Zp;return t(e)}function ug(e,t,s){(s?De(e,t,s):t===r)?t=1:t=j(t);var o=V(e)?Lp:eh;return o(e,t)}function cg(e){var t=V(e)?Rp:nh;return t(e)}function lg(e){if(e==null)return 0;if(Pe(e))return hi(e)?In(e):e.length;var t=Le(e);return t==ct||t==lt?e.size:gs(e).length}function fg(e,t,s){var o=V(e)?Ki:rh;return s&&De(e,t,s)&&(t=r),o(e,k(t,3))}var pg=J(function(e,t){if(e==null)return[];var s=t.length;return s>1&&De(e,t[0],t[1])?t=[]:s>2&&De(t[0],t[1],t[2])&&(t=[t[0]]),Ra(e,Se(t,1),[])}),ci=Jf||function(){return be.Date.now()};function hg(e,t){if(typeof t!="function")throw new Ke(v);return e=j(e),function(){if(--e<1)return t.apply(this,arguments)}}function Au(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Rt(e,Ue,r,r,r,r,t)}function Nu(e,t){var s;if(typeof t!="function")throw new Ke(v);return e=j(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var Ms=J(function(e,t,s){var o=fe;if(s.length){var c=Wt(s,Rn(Ms));o|=Re}return Rt(e,o,t,s,c)}),bu=J(function(e,t,s){var o=fe|ve;if(s.length){var c=Wt(s,Rn(bu));o|=Re}return Rt(t,o,e,s,c)});function Su(e,t,s){t=s?r:t;var o=Rt(e,ye,r,r,r,r,r,t);return o.placeholder=Su.placeholder,o}function Ou(e,t,s){t=s?r:t;var o=Rt(e,Ne,r,r,r,r,r,t);return o.placeholder=Ou.placeholder,o}function Lu(e,t,s){var o,c,f,h,d,m,T=0,w=!1,A=!1,S=!0;if(typeof e!="function")throw new Ke(v);t=nt(t)||0,pe(s)&&(w=!!s.leading,A="maxWait"in s,f=A?Ee(nt(s.maxWait)||0,t):f,S="trailing"in s?!!s.trailing:S);function D(ge){var dt=o,Ut=c;return o=c=r,T=ge,h=e.apply(Ut,dt),h}function U(ge){return T=ge,d=cr(Q,t),w?D(ge):h}function q(ge){var dt=ge-m,Ut=ge-T,Yu=t-dt;return A?Oe(Yu,f-Ut):Yu}function $(ge){var dt=ge-m,Ut=ge-T;return m===r||dt>=t||dt<0||A&&Ut>=f}function Q(){var ge=ci();if($(ge))return H(ge);d=cr(Q,q(ge))}function H(ge){return d=r,S&&o?D(ge):(o=c=r,h)}function qe(){d!==r&&Ba(d),T=0,o=m=c=d=r}function Fe(){return d===r?h:H(ci())}function Je(){var ge=ci(),dt=$(ge);if(o=arguments,c=this,m=ge,dt){if(d===r)return U(m);if(A)return Ba(d),d=cr(Q,t),D(m)}return d===r&&(d=cr(Q,t)),h}return Je.cancel=qe,Je.flush=Fe,Je}var dg=J(function(e,t){return _a(e,1,t)}),gg=J(function(e,t,s){return _a(e,nt(t)||0,s)});function mg(e){return Rt(e,x)}function li(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Ke(v);var s=function(){var o=arguments,c=t?t.apply(this,o):o[0],f=s.cache;if(f.has(c))return f.get(c);var h=e.apply(this,o);return s.cache=f.set(c,h)||f,h};return s.cache=new(li.Cache||Ot),s}li.Cache=Ot;function fi(e){if(typeof e!="function")throw new Ke(v);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)}}function vg(e){return Nu(2,e)}var yg=ih(function(e,t){t=t.length==1&&V(t[0])?le(t[0],Ve(k())):le(Se(t,1),Ve(k()));var s=t.length;return J(function(o){for(var c=-1,f=Oe(o.length,s);++c<f;)o[c]=t[c].call(this,o[c]);return Ge(e,this,o)})}),Bs=J(function(e,t){var s=Wt(t,Rn(Bs));return Rt(e,Re,r,t,s)}),Ru=J(function(e,t){var s=Wt(t,Rn(Ru));return Rt(e,Qe,r,t,s)}),_g=Ct(function(e,t){return Rt(e,nn,r,r,r,t)});function Tg(e,t){if(typeof e!="function")throw new Ke(v);return t=t===r?t:j(t),J(e,t)}function wg(e,t){if(typeof e!="function")throw new Ke(v);return t=t==null?0:Ee(j(t),0),J(function(s){var o=s[t],c=zt(s,0,t);return o&&Vt(c,o),Ge(e,this,c)})}function Eg(e,t,s){var o=!0,c=!0;if(typeof e!="function")throw new Ke(v);return pe(s)&&(o="leading"in s?!!s.leading:o,c="trailing"in s?!!s.trailing:c),Lu(e,t,{leading:o,maxWait:t,trailing:c})}function Ig(e){return Au(e,1)}function xg(e,t){return Bs(xs(t),e)}function Ag(){if(!arguments.length)return[];var e=arguments[0];return V(e)?e:[e]}function Ng(e){return Ze(e,ce)}function bg(e,t){return t=typeof t=="function"?t:r,Ze(e,ce,t)}function Sg(e){return Ze(e,M|ce)}function Og(e,t){return t=typeof t=="function"?t:r,Ze(e,M|ce,t)}function Lg(e,t){return t==null||ya(e,t,xe(t))}function ht(e,t){return e===t||e!==e&&t!==t}var Rg=ri(ps),Cg=ri(function(e,t){return e>=t}),hn=xa(function(){return arguments}())?xa:function(e){return he(e)&&ie.call(e,"callee")&&!la.call(e,"callee")},V=y.isArray,Dg=qo?Ve(qo):Gp;function Pe(e){return e!=null&&pi(e.length)&&!Ft(e)}function de(e){return he(e)&&Pe(e)}function Fg(e){return e===!0||e===!1||he(e)&&Ce(e)==Wn}var Yt=zf||Ks,kg=Jo?Ve(Jo):Vp;function Ug(e){return he(e)&&e.nodeType===1&&!lr(e)}function $g(e){if(e==null)return!0;if(Pe(e)&&(V(e)||typeof e=="string"||typeof e.splice=="function"||Yt(e)||Cn(e)||hn(e)))return!e.length;var t=Le(e);if(t==ct||t==lt)return!e.size;if(ur(e))return!gs(e).length;for(var s in e)if(ie.call(e,s))return!1;return!0}function Pg(e,t){return sr(e,t)}function Mg(e,t,s){s=typeof s=="function"?s:r;var o=s?s(e,t):r;return o===r?sr(e,t,r,s):!!o}function Gs(e){if(!he(e))return!1;var t=Ce(e);return t==xr||t==al||typeof e.message=="string"&&typeof e.name=="string"&&!lr(e)}function Bg(e){return typeof e=="number"&&pa(e)}function Ft(e){if(!pe(e))return!1;var t=Ce(e);return t==Ar||t==_o||t==ol||t==cl}function Cu(e){return typeof e=="number"&&e==j(e)}function pi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Bt}function pe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function he(e){return e!=null&&typeof e=="object"}var Du=Qo?Ve(Qo):jp;function Gg(e,t){return e===t||ds(e,t,Rs(t))}function Vg(e,t,s){return s=typeof s=="function"?s:r,ds(e,t,Rs(t),s)}function Wg(e){return Fu(e)&&e!=+e}function jg(e){if(bh(e))throw new B(p);return Aa(e)}function qg(e){return e===null}function Jg(e){return e==null}function Fu(e){return typeof e=="number"||he(e)&&Ce(e)==qn}function lr(e){if(!he(e)||Ce(e)!=bt)return!1;var t=Mr(e);if(t===null)return!0;var s=ie.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&kr.call(s)==Vf}var Vs=zo?Ve(zo):qp;function Qg(e){return Cu(e)&&e>=-Bt&&e<=Bt}var ku=Yo?Ve(Yo):Jp;function hi(e){return typeof e=="string"||!V(e)&&he(e)&&Ce(e)==Qn}function je(e){return typeof e=="symbol"||he(e)&&Ce(e)==Nr}var Cn=Ho?Ve(Ho):Qp;function zg(e){return e===r}function Yg(e){return he(e)&&Le(e)==zn}function Hg(e){return he(e)&&Ce(e)==fl}var Kg=ri(ms),Xg=ri(function(e,t){return e<=t});function Uu(e){if(!e)return[];if(Pe(e))return hi(e)?ft(e):$e(e);if(Kn&&e[Kn])return Lf(e[Kn]());var t=Le(e),s=t==ct?rs:t==lt?Cr:Dn;return s(e)}function kt(e){if(!e)return e===0?e:0;if(e=nt(e),e===rn||e===-rn){var t=e<0?-1:1;return t*nl}return e===e?e:0}function j(e){var t=kt(e),s=t%1;return t===t?s?t-s:t:0}function $u(e){return e?cn(j(e),0,Tt):0}function nt(e){if(typeof e=="number")return e;if(je(e))return Er;if(pe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=na(e);var s=Cl.test(e);return s||Fl.test(e)?hf(e.slice(2),s?2:8):Rl.test(e)?Er:+e}function Pu(e){return Et(e,Me(e))}function Zg(e){return e?cn(j(e),-Bt,Bt):e===0?e:0}function ne(e){return e==null?"":We(e)}var em=On(function(e,t){if(ur(t)||Pe(t)){Et(t,xe(t),e);return}for(var s in t)ie.call(t,s)&&nr(e,s,t[s])}),Mu=On(function(e,t){Et(t,Me(t),e)}),di=On(function(e,t,s,o){Et(t,Me(t),e,o)}),tm=On(function(e,t,s,o){Et(t,xe(t),e,o)}),nm=Ct(cs);function rm(e,t){var s=Sn(e);return t==null?s:va(s,t)}var im=J(function(e,t){e=se(e);var s=-1,o=t.length,c=o>2?t[2]:r;for(c&&De(t[0],t[1],c)&&(o=1);++s<o;)for(var f=t[s],h=Me(f),d=-1,m=h.length;++d<m;){var T=h[d],w=e[T];(w===r||ht(w,An[T])&&!ie.call(e,T))&&(e[T]=f[T])}return e}),sm=J(function(e){return e.push(r,nu),Ge(Bu,r,e)});function om(e,t){return Xo(e,k(t,3),wt)}function am(e,t){return Xo(e,k(t,3),fs)}function um(e,t){return e==null?e:ls(e,k(t,3),Me)}function cm(e,t){return e==null?e:Ea(e,k(t,3),Me)}function lm(e,t){return e&&wt(e,k(t,3))}function fm(e,t){return e&&fs(e,k(t,3))}function pm(e){return e==null?[]:Yr(e,xe(e))}function hm(e){return e==null?[]:Yr(e,Me(e))}function Ws(e,t,s){var o=e==null?r:ln(e,t);return o===r?s:o}function dm(e,t){return e!=null&&su(e,t,$p)}function js(e,t){return e!=null&&su(e,t,Pp)}var gm=Ka(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=Ur.call(t)),e[t]=s},Js(Be)),mm=Ka(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=Ur.call(t)),ie.call(e,t)?e[t].push(s):e[t]=[s]},k),vm=J(ir);function xe(e){return Pe(e)?ga(e):gs(e)}function Me(e){return Pe(e)?ga(e,!0):zp(e)}function ym(e,t){var s={};return t=k(t,3),wt(e,function(o,c,f){Lt(s,t(o,c,f),o)}),s}function _m(e,t){var s={};return t=k(t,3),wt(e,function(o,c,f){Lt(s,c,t(o,c,f))}),s}var Tm=On(function(e,t,s){Hr(e,t,s)}),Bu=On(function(e,t,s,o){Hr(e,t,s,o)}),wm=Ct(function(e,t){var s={};if(e==null)return s;var o=!1;t=le(t,function(f){return f=Qt(f,e),o||(o=f.length>1),f}),Et(e,Os(e),s),o&&(s=Ze(s,M|Z|ce,gh));for(var c=t.length;c--;)ws(s,t[c]);return s});function Em(e,t){return Gu(e,fi(k(t)))}var Im=Ct(function(e,t){return e==null?{}:Hp(e,t)});function Gu(e,t){if(e==null)return{};var s=le(Os(e),function(o){return[o]});return t=k(t),Ca(e,s,function(o,c){return t(o,c[0])})}function xm(e,t,s){t=Qt(t,e);var o=-1,c=t.length;for(c||(c=1,e=r);++o<c;){var f=e==null?r:e[It(t[o])];f===r&&(o=c,f=s),e=Ft(f)?f.call(e):f}return e}function Am(e,t,s){return e==null?e:or(e,t,s)}function Nm(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:or(e,t,s,o)}var Vu=eu(xe),Wu=eu(Me);function bm(e,t,s){var o=V(e),c=o||Yt(e)||Cn(e);if(t=k(t,4),s==null){var f=e&&e.constructor;c?s=o?new f:[]:pe(e)?s=Ft(f)?Sn(Mr(e)):{}:s={}}return(c?He:wt)(e,function(h,d,m){return t(s,h,d,m)}),s}function Sm(e,t){return e==null?!0:ws(e,t)}function Om(e,t,s){return e==null?e:$a(e,t,xs(s))}function Lm(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:$a(e,t,xs(s),o)}function Dn(e){return e==null?[]:ns(e,xe(e))}function Rm(e){return e==null?[]:ns(e,Me(e))}function Cm(e,t,s){return s===r&&(s=t,t=r),s!==r&&(s=nt(s),s=s===s?s:0),t!==r&&(t=nt(t),t=t===t?t:0),cn(nt(e),t,s)}function Dm(e,t,s){return t=kt(t),s===r?(s=t,t=0):s=kt(s),e=nt(e),Mp(e,t,s)}function Fm(e,t,s){if(s&&typeof s!="boolean"&&De(e,t,s)&&(t=s=r),s===r&&(typeof t=="boolean"?(s=t,t=r):typeof e=="boolean"&&(s=e,e=r)),e===r&&t===r?(e=0,t=1):(e=kt(e),t===r?(t=e,e=0):t=kt(t)),e>t){var o=e;e=t,t=o}if(s||e%1||t%1){var c=ha();return Oe(e+c*(t-e+pf("1e-"+((c+"").length-1))),t)}return ys(e,t)}var km=Ln(function(e,t,s){return t=t.toLowerCase(),e+(s?ju(t):t)});function ju(e){return qs(ne(e).toLowerCase())}function qu(e){return e=ne(e),e&&e.replace(Ul,Af).replace(tf,"")}function Um(e,t,s){e=ne(e),t=We(t);var o=e.length;s=s===r?o:cn(j(s),0,o);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function $m(e){return e=ne(e),e&&ml.test(e)?e.replace(Eo,Nf):e}function Pm(e){return e=ne(e),e&&El.test(e)?e.replace(Bi,"\\$&"):e}var Mm=Ln(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Bm=Ln(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Gm=za("toLowerCase");function Vm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;if(!t||o>=t)return e;var c=(t-o)/2;return ni(Wr(c),s)+e+ni(Vr(c),s)}function Wm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;return t&&o<t?e+ni(t-o,s):e}function jm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;return t&&o<t?ni(t-o,s)+e:e}function qm(e,t,s){return s||t==null?t=0:t&&(t=+t),Xf(ne(e).replace(Gi,""),t||0)}function Jm(e,t,s){return(s?De(e,t,s):t===r)?t=1:t=j(t),_s(ne(e),t)}function Qm(){var e=arguments,t=ne(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var zm=Ln(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function Ym(e,t,s){return s&&typeof s!="number"&&De(e,t,s)&&(t=s=r),s=s===r?Tt:s>>>0,s?(e=ne(e),e&&(typeof t=="string"||t!=null&&!Vs(t))&&(t=We(t),!t&&En(e))?zt(ft(e),0,s):e.split(t,s)):[]}var Hm=Ln(function(e,t,s){return e+(s?" ":"")+qs(t)});function Km(e,t,s){return e=ne(e),s=s==null?0:cn(j(s),0,e.length),t=We(t),e.slice(s,s+t.length)==t}function Xm(e,t,s){var o=l.templateSettings;s&&De(e,t,s)&&(t=r),e=ne(e),t=di({},t,o,tu);var c=di({},t.imports,o.imports,tu),f=xe(c),h=ns(c,f),d,m,T=0,w=t.interpolate||br,A="__p += '",S=is((t.escape||br).source+"|"+w.source+"|"+(w===Io?Ll:br).source+"|"+(t.evaluate||br).source+"|$","g"),D="//# sourceURL="+(ie.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++af+"]")+`
|
|
90
|
+
`;e.replace(S,function($,Q,H,qe,Fe,Je){return H||(H=qe),A+=e.slice(T,Je).replace($l,bf),Q&&(d=!0,A+=`' +
|
|
91
|
+
__e(`+Q+`) +
|
|
92
|
+
'`),Fe&&(m=!0,A+=`';
|
|
93
|
+
`+Fe+`;
|
|
94
|
+
__p += '`),H&&(A+=`' +
|
|
95
|
+
((__t = (`+H+`)) == null ? '' : __t) +
|
|
96
|
+
'`),T=Je+$.length,$}),A+=`';
|
|
97
|
+
`;var U=ie.call(t,"variable")&&t.variable;if(!U)A=`with (obj) {
|
|
98
|
+
`+A+`
|
|
50
99
|
}
|
|
51
|
-
`;else if(
|
|
100
|
+
`;else if(Sl.test(U))throw new B(I);A=(m?A.replace(pl,""):A).replace(hl,"$1").replace(dl,"$1;"),A="function("+(U||"obj")+`) {
|
|
52
101
|
`+(U?"":`obj || (obj = {});
|
|
53
102
|
`)+"var __t, __p = ''"+(d?", __e = _.escape":"")+(m?`, __j = Array.prototype.join;
|
|
54
103
|
function print() { __p += __j.call(arguments, '') }
|
|
55
104
|
`:`;
|
|
56
|
-
`)+
|
|
57
|
-
}`;var q=qu(function(){return te(f,F+"return "+I).apply(r,h)});if(q.source=I,Gs(q))throw q;return q}function zm(e){return re(e).toLowerCase()}function Ym(e){return re(e).toUpperCase()}function Hm(e,t,s){if(e=re(e),e&&(s||t===r))return ea(e);if(!e||!(t=je(t)))return e;var o=pt(e),c=pt(t),f=ta(o,c),h=na(o,c)+1;return Qt(o,f,h).join("")}function Km(e,t,s){if(e=re(e),e&&(s||t===r))return e.slice(0,ia(e)+1);if(!e||!(t=je(t)))return e;var o=pt(e),c=na(o,pt(t))+1;return Qt(o,0,c).join("")}function Xm(e,t,s){if(e=re(e),e&&(s||t===r))return e.replace(Gi,"");if(!e||!(t=je(t)))return e;var o=pt(e),c=ta(o,pt(t));return Qt(o,c).join("")}function Zm(e,t){var s=G,o=Ye;if(he(t)){var c="separator"in t?t.separator:c;s="length"in t?j(t.length):s,o="omission"in t?je(t.omission):o}e=re(e);var f=e.length;if(xn(e)){var h=pt(e);f=h.length}if(s>=f)return e;var d=s-An(o);if(d<1)return o;var m=h?Qt(h,0,d).join(""):e.slice(0,d);if(c===r)return m+o;if(h&&(d+=m.length-d),Ws(c)){if(e.slice(d).search(c)){var w,E=m;for(c.global||(c=is(c.source,re(Eo.exec(c))+"g")),c.lastIndex=0;w=c.exec(E);)var I=w.index;m=m.slice(0,I===r?d:I)}}else if(e.indexOf(je(c),d)!=d){var b=m.lastIndexOf(c);b>-1&&(m=m.slice(0,b))}return m+o}function e0(e){return e=re(e),e&&ll.test(e)?e.replace(_o,Of):e}var t0=Cn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),qs=Ja("toUpperCase");function ju(e,t,s){return e=re(e),t=s?r:t,t===r?Af(e)?Rf(e):gf(e):e.match(t)||[]}var qu=Q(function(e,t){try{return We(e,r,t)}catch(s){return Gs(s)?s:new B(s)}}),n0=Ct(function(e,t){return Ke(t,function(s){s=Et(s),Ot(e,s,$s(e[s],e))}),e});function r0(e){var t=e==null?0:e.length,s=k();return e=t?fe(e,function(o){if(typeof o[1]!="function")throw new Xe(y);return[s(o[0]),o[1]]}):[],Q(function(o){for(var c=-1;++c<t;){var f=e[c];if(We(f[0],this,o))return We(f[1],this,o)}})}function i0(e){return Op(et(e,J))}function Js(e){return function(){return e}}function s0(e,t){return e==null||e!==e?t:e}var o0=za(),a0=za(!0);function Be(e){return e}function Qs(e){return Aa(typeof e=="function"?e:et(e,J))}function u0(e){return Na(et(e,J))}function c0(e,t){return Sa(e,et(t,J))}var l0=Q(function(e,t){return function(s){return ir(s,e,t)}}),f0=Q(function(e,t){return function(s){return ir(e,s,t)}});function zs(e,t,s){var o=Ae(t),c=zr(t,o);s==null&&!(he(t)&&(c.length||!o.length))&&(s=t,t=e,e=this,c=zr(t,Ae(t)));var f=!(he(s)&&"chain"in s)||!!s.chain,h=Dt(e);return Ke(c,function(d){var m=t[d];e[d]=m,h&&(e.prototype[d]=function(){var w=this.__chain__;if(f||w){var E=e(this.__wrapped__),I=E.__actions__=Pe(this.__actions__);return I.push({func:m,args:arguments,thisArg:e}),E.__chain__=w,E}return m.apply(e,Gt([this.value()],arguments))})}),e}function p0(){return Se._===this&&(Se._=Mf),this}function Ys(){}function h0(e){return e=j(e),Q(function(t){return ba(t,e)})}var d0=Ns(fe),g0=Ns(Yo),m0=Ns(Ki);function Ju(e){return Ds(e)?Xi(Et(e)):Jp(e)}function y0(e){return function(t){return e==null?r:cn(e,t)}}var v0=Ha(),_0=Ha(!0);function Hs(){return[]}function Ks(){return!1}function T0(){return{}}function w0(){return""}function E0(){return!0}function x0(e,t){if(e=j(e),e<1||e>$t)return[];var s=_t,o=Le(e,_t);t=k(t),e-=_t;for(var c=ts(o,t);++s<e;)t(s);return c}function A0(e){return W(e)?fe(e,Et):qe(e)?[e]:Pe(pu(re(e)))}function I0(e){var t=++Uf;return re(e)+t}var N0=ei(function(e,t){return e+t},0),S0=Ss("ceil"),b0=ei(function(e,t){return e/t},1),O0=Ss("floor");function L0(e){return e&&e.length?Qr(e,Be,ps):r}function C0(e,t){return e&&e.length?Qr(e,k(t,2),ps):r}function R0(e){return Xo(e,Be)}function D0(e,t){return Xo(e,k(t,2))}function F0(e){return e&&e.length?Qr(e,Be,ms):r}function k0(e,t){return e&&e.length?Qr(e,k(t,2),ms):r}var U0=ei(function(e,t){return e*t},1),P0=Ss("round"),M0=ei(function(e,t){return e-t},0);function $0(e){return e&&e.length?es(e,Be):0}function B0(e,t){return e&&e.length?es(e,k(t,2)):0}return l.after=ug,l.ary=xu,l.assign=Yg,l.assignIn=Pu,l.assignInWith=hi,l.assignWith=Hg,l.at=Kg,l.before=Au,l.bind=$s,l.bindAll=n0,l.bindKey=Iu,l.castArray=Tg,l.chain=Tu,l.chunk=Oh,l.compact=Lh,l.concat=Ch,l.cond=r0,l.conforms=i0,l.constant=Js,l.countBy=$d,l.create=Xg,l.curry=Nu,l.curryRight=Su,l.debounce=bu,l.defaults=Zg,l.defaultsDeep=em,l.defer=cg,l.delay=lg,l.difference=Rh,l.differenceBy=Dh,l.differenceWith=Fh,l.drop=kh,l.dropRight=Uh,l.dropRightWhile=Ph,l.dropWhile=Mh,l.fill=$h,l.filter=Gd,l.flatMap=jd,l.flatMapDeep=qd,l.flatMapDepth=Jd,l.flatten=mu,l.flattenDeep=Bh,l.flattenDepth=Gh,l.flip=fg,l.flow=o0,l.flowRight=a0,l.fromPairs=Wh,l.functions=am,l.functionsIn=um,l.groupBy=Qd,l.initial=jh,l.intersection=qh,l.intersectionBy=Jh,l.intersectionWith=Qh,l.invert=lm,l.invertBy=fm,l.invokeMap=Yd,l.iteratee=Qs,l.keyBy=Hd,l.keys=Ae,l.keysIn=$e,l.map=ai,l.mapKeys=hm,l.mapValues=dm,l.matches=u0,l.matchesProperty=c0,l.memoize=ci,l.merge=gm,l.mergeWith=Mu,l.method=l0,l.methodOf=f0,l.mixin=zs,l.negate=li,l.nthArg=h0,l.omit=mm,l.omitBy=ym,l.once=pg,l.orderBy=Kd,l.over=d0,l.overArgs=hg,l.overEvery=g0,l.overSome=m0,l.partial=Bs,l.partialRight=Ou,l.partition=Xd,l.pick=vm,l.pickBy=$u,l.property=Ju,l.propertyOf=y0,l.pull=Kh,l.pullAll=vu,l.pullAllBy=Xh,l.pullAllWith=Zh,l.pullAt=ed,l.range=v0,l.rangeRight=_0,l.rearg=dg,l.reject=tg,l.remove=td,l.rest=gg,l.reverse=Ps,l.sampleSize=rg,l.set=Tm,l.setWith=wm,l.shuffle=ig,l.slice=nd,l.sortBy=ag,l.sortedUniq=cd,l.sortedUniqBy=ld,l.split=jm,l.spread=mg,l.tail=fd,l.take=pd,l.takeRight=hd,l.takeRightWhile=dd,l.takeWhile=gd,l.tap=Ld,l.throttle=yg,l.thru=oi,l.toArray=Fu,l.toPairs=Bu,l.toPairsIn=Gu,l.toPath=A0,l.toPlainObject=Uu,l.transform=Em,l.unary=vg,l.union=md,l.unionBy=yd,l.unionWith=vd,l.uniq=_d,l.uniqBy=Td,l.uniqWith=wd,l.unset=xm,l.unzip=Ms,l.unzipWith=_u,l.update=Am,l.updateWith=Im,l.values=Fn,l.valuesIn=Nm,l.without=Ed,l.words=ju,l.wrap=_g,l.xor=xd,l.xorBy=Ad,l.xorWith=Id,l.zip=Nd,l.zipObject=Sd,l.zipObjectDeep=bd,l.zipWith=Od,l.entries=Bu,l.entriesIn=Gu,l.extend=Pu,l.extendWith=hi,zs(l,l),l.add=N0,l.attempt=qu,l.camelCase=Lm,l.capitalize=Wu,l.ceil=S0,l.clamp=Sm,l.clone=wg,l.cloneDeep=xg,l.cloneDeepWith=Ag,l.cloneWith=Eg,l.conformsTo=Ig,l.deburr=Vu,l.defaultTo=s0,l.divide=b0,l.endsWith=Cm,l.eq=dt,l.escape=Rm,l.escapeRegExp=Dm,l.every=Bd,l.find=Wd,l.findIndex=du,l.findKey=tm,l.findLast=Vd,l.findLastIndex=gu,l.findLastKey=nm,l.floor=O0,l.forEach=wu,l.forEachRight=Eu,l.forIn=rm,l.forInRight=im,l.forOwn=sm,l.forOwnRight=om,l.get=Vs,l.gt=Ng,l.gte=Sg,l.has=cm,l.hasIn=js,l.head=yu,l.identity=Be,l.includes=zd,l.indexOf=Vh,l.inRange=bm,l.invoke=pm,l.isArguments=pn,l.isArray=W,l.isArrayBuffer=bg,l.isArrayLike=Me,l.isArrayLikeObject=ge,l.isBoolean=Og,l.isBuffer=zt,l.isDate=Lg,l.isElement=Cg,l.isEmpty=Rg,l.isEqual=Dg,l.isEqualWith=Fg,l.isError=Gs,l.isFinite=kg,l.isFunction=Dt,l.isInteger=Lu,l.isLength=fi,l.isMap=Cu,l.isMatch=Ug,l.isMatchWith=Pg,l.isNaN=Mg,l.isNative=$g,l.isNil=Gg,l.isNull=Bg,l.isNumber=Ru,l.isObject=he,l.isObjectLike=de,l.isPlainObject=lr,l.isRegExp=Ws,l.isSafeInteger=Wg,l.isSet=Du,l.isString=pi,l.isSymbol=qe,l.isTypedArray=Dn,l.isUndefined=Vg,l.isWeakMap=jg,l.isWeakSet=qg,l.join=zh,l.kebabCase=Fm,l.last=nt,l.lastIndexOf=Yh,l.lowerCase=km,l.lowerFirst=Um,l.lt=Jg,l.lte=Qg,l.max=L0,l.maxBy=C0,l.mean=R0,l.meanBy=D0,l.min=F0,l.minBy=k0,l.stubArray=Hs,l.stubFalse=Ks,l.stubObject=T0,l.stubString=w0,l.stubTrue=E0,l.multiply=U0,l.nth=Hh,l.noConflict=p0,l.noop=Ys,l.now=ui,l.pad=Pm,l.padEnd=Mm,l.padStart=$m,l.parseInt=Bm,l.random=Om,l.reduce=Zd,l.reduceRight=eg,l.repeat=Gm,l.replace=Wm,l.result=_m,l.round=P0,l.runInContext=g,l.sample=ng,l.size=sg,l.snakeCase=Vm,l.some=og,l.sortedIndex=rd,l.sortedIndexBy=id,l.sortedIndexOf=sd,l.sortedLastIndex=od,l.sortedLastIndexBy=ad,l.sortedLastIndexOf=ud,l.startCase=qm,l.startsWith=Jm,l.subtract=M0,l.sum=$0,l.sumBy=B0,l.template=Qm,l.times=x0,l.toFinite=Ft,l.toInteger=j,l.toLength=ku,l.toLower=zm,l.toNumber=rt,l.toSafeInteger=zg,l.toString=re,l.toUpper=Ym,l.trim=Hm,l.trimEnd=Km,l.trimStart=Xm,l.truncate=Zm,l.unescape=e0,l.uniqueId=I0,l.upperCase=t0,l.upperFirst=qs,l.each=wu,l.eachRight=Eu,l.first=yu,zs(l,function(){var e={};return Tt(l,function(t,s){se.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=a,Ke(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),Ke(["drop","take"],function(e,t){H.prototype[e]=function(s){s=s===r?1:xe(j(s),0);var o=this.__filtered__&&!t?new H(this):this.clone();return o.__filtered__?o.__takeCount__=Le(s,o.__takeCount__):o.__views__.push({size:Le(s,_t),type:e+(o.__dir__<0?"Right":"")}),o},H.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),Ke(["filter","map","takeWhile"],function(e,t){var s=t+1,o=s==mo||s==Hc;H.prototype[e]=function(c){var f=this.clone();return f.__iteratees__.push({iteratee:k(c,3),type:s}),f.__filtered__=f.__filtered__||o,f}}),Ke(["head","last"],function(e,t){var s="take"+(t?"Right":"");H.prototype[e]=function(){return this[s](1).value()[0]}}),Ke(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");H.prototype[e]=function(){return this.__filtered__?new H(this):this[s](1)}}),H.prototype.compact=function(){return this.filter(Be)},H.prototype.find=function(e){return this.filter(e).head()},H.prototype.findLast=function(e){return this.reverse().find(e)},H.prototype.invokeMap=Q(function(e,t){return typeof e=="function"?new H(this):this.map(function(s){return ir(s,e,t)})}),H.prototype.reject=function(e){return this.filter(li(k(e)))},H.prototype.slice=function(e,t){e=j(e);var s=this;return s.__filtered__&&(e>0||t<0)?new H(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=j(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},H.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},H.prototype.toArray=function(){return this.take(_t)},Tt(H.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),c=l[o?"take"+(t=="last"?"Right":""):t],f=o||/^find/.test(t);c&&(l.prototype[t]=function(){var h=this.__wrapped__,d=o?[1]:arguments,m=h instanceof H,w=d[0],E=m||W(h),I=function(z){var X=c.apply(l,Gt([z],d));return o&&b?X[0]:X};E&&s&&typeof w=="function"&&w.length!=1&&(m=E=!1);var b=this.__chain__,F=!!this.__actions__.length,U=f&&!b,q=m&&!F;if(!f&&E){h=q?h:new H(this);var P=e.apply(h,d);return P.__actions__.push({func:oi,args:[I],thisArg:r}),new Ze(P,b)}return U&&q?e.apply(this,d):(P=this.thru(I),U?o?P.value()[0]:P.value():P)})}),Ke(["pop","push","shift","sort","splice","unshift"],function(e){var t=Rr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(o&&!this.__chain__){var f=this.value();return t.apply(W(f)?f:[],c)}return this[s](function(h){return t.apply(W(h)?h:[],c)})}}),Tt(H.prototype,function(e,t){var s=l[t];if(s){var o=s.name+"";se.call(bn,o)||(bn[o]=[]),bn[o].push({name:t,func:s})}}),bn[Zr(r,ve).name]=[{name:"wrapper",func:r}],H.prototype.clone=ep,H.prototype.reverse=tp,H.prototype.value=np,l.prototype.at=Cd,l.prototype.chain=Rd,l.prototype.commit=Dd,l.prototype.next=Fd,l.prototype.plant=Ud,l.prototype.reverse=Pd,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Md,l.prototype.first=l.prototype.head,Kn&&(l.prototype[Kn]=kd),l},In=Df();rn?((rn.exports=In)._=In,Qi._=In):Se._=In}).call(iy)}(pr,pr.exports)),pr.exports}var oy=sy();const Yu=n=>{const i=oy.startCase(n).toLowerCase();return i.charAt(0).toUpperCase()+i.slice(1)};var wi=(n=>(n.AGENT="agent",n.OBJECT="object",n.FUNCTION="function",n))(wi||{});const ay=n=>Object.values(wi).includes(n);class uy{async execute(i,r){try{const a=Oe.join(mn,r??"");await Ge.ensureDir(a);const u=i??await this.getEntity();if(u==="object"){const p=await this.getObjectData(),y=p.nameSingular,_=`${no.default(y)}.ts`,N=ny({data:p,name:y});await Ge.writeFile(Oe.join(a,_),N);return}if(u==="function"){const p=await this.getEntityName(u),y=`${no.default(p)}.ts`,_=ry({name:p});await Ge.writeFile(Oe.join(a,y),_);return}}catch(a){console.error($.default.red("Add new entity failed:"),a instanceof Error?a.message:a),process.exit(1)}}async getEntity(){const{entity:i}=await Pn.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:["function","object"]}]);return i}async getEntityName(i){const{name:r}=await Pn.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${i}:`,default:"",validate:a=>a.length===0?`${i} name is required`:/^[a-z0-9-]+$/.test(a)?!0:"Name must contain only lowercase letters, numbers, and hyphens"}]);return r}async getObjectData(){return Pn.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(i,r)=>i.trim()===r?.nameSingular.trim()?"Name plural must be different from name singular":!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:i=>Yu(i.nameSingular),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:i=>Yu(i.namePlural),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0}])}}function ne(n,i){if(!!!n)throw new Error(i)}function Mt(n){return typeof n=="object"&&n!==null}function vr(n,i){if(!!!n)throw new Error(i??"Unexpected invariant triggered.")}const cy=/\r\n|[\n\r]/g;function ro(n,i){let r=0,a=1;for(const u of n.body.matchAll(cy)){if(typeof u.index=="number"||vr(!1),u.index>=i)break;r=u.index+u[0].length,a+=1}return{line:a,column:i+1-r}}function ly(n){return uc(n.source,ro(n.source,n.start))}function uc(n,i){const r=n.locationOffset.column-1,a="".padStart(r)+n.body,u=i.line-1,p=n.locationOffset.line-1,y=i.line+p,_=i.line===1?r:0,N=i.column+_,D=`${n.name}:${y}:${N}
|
|
58
|
-
`,
|
|
59
|
-
`)}function
|
|
105
|
+
`)+A+`return __p
|
|
106
|
+
}`;var q=Qu(function(){return ee(f,D+"return "+A).apply(r,h)});if(q.source=A,Gs(q))throw q;return q}function Zm(e){return ne(e).toLowerCase()}function e0(e){return ne(e).toUpperCase()}function t0(e,t,s){if(e=ne(e),e&&(s||t===r))return na(e);if(!e||!(t=We(t)))return e;var o=ft(e),c=ft(t),f=ra(o,c),h=ia(o,c)+1;return zt(o,f,h).join("")}function n0(e,t,s){if(e=ne(e),e&&(s||t===r))return e.slice(0,oa(e)+1);if(!e||!(t=We(t)))return e;var o=ft(e),c=ia(o,ft(t))+1;return zt(o,0,c).join("")}function r0(e,t,s){if(e=ne(e),e&&(s||t===r))return e.replace(Gi,"");if(!e||!(t=We(t)))return e;var o=ft(e),c=ra(o,ft(t));return zt(o,c).join("")}function i0(e,t){var s=G,o=ze;if(pe(t)){var c="separator"in t?t.separator:c;s="length"in t?j(t.length):s,o="omission"in t?We(t.omission):o}e=ne(e);var f=e.length;if(En(e)){var h=ft(e);f=h.length}if(s>=f)return e;var d=s-In(o);if(d<1)return o;var m=h?zt(h,0,d).join(""):e.slice(0,d);if(c===r)return m+o;if(h&&(d+=m.length-d),Vs(c)){if(e.slice(d).search(c)){var T,w=m;for(c.global||(c=is(c.source,ne(xo.exec(c))+"g")),c.lastIndex=0;T=c.exec(w);)var A=T.index;m=m.slice(0,A===r?d:A)}}else if(e.indexOf(We(c),d)!=d){var S=m.lastIndexOf(c);S>-1&&(m=m.slice(0,S))}return m+o}function s0(e){return e=ne(e),e&&gl.test(e)?e.replace(wo,Ff):e}var o0=Ln(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),qs=za("toUpperCase");function Ju(e,t,s){return e=ne(e),t=s?r:t,t===r?Of(e)?$f(e):Tf(e):e.match(t)||[]}var Qu=J(function(e,t){try{return Ge(e,r,t)}catch(s){return Gs(s)?s:new B(s)}}),a0=Ct(function(e,t){return He(t,function(s){s=It(s),Lt(e,s,Ms(e[s],e))}),e});function u0(e){var t=e==null?0:e.length,s=k();return e=t?le(e,function(o){if(typeof o[1]!="function")throw new Ke(v);return[s(o[0]),o[1]]}):[],J(function(o){for(var c=-1;++c<t;){var f=e[c];if(Ge(f[0],this,o))return Ge(f[1],this,o)}})}function c0(e){return Fp(Ze(e,M))}function Js(e){return function(){return e}}function l0(e,t){return e==null||e!==e?t:e}var f0=Ha(),p0=Ha(!0);function Be(e){return e}function Qs(e){return Na(typeof e=="function"?e:Ze(e,M))}function h0(e){return Sa(Ze(e,M))}function d0(e,t){return Oa(e,Ze(t,M))}var g0=J(function(e,t){return function(s){return ir(s,e,t)}}),m0=J(function(e,t){return function(s){return ir(e,s,t)}});function zs(e,t,s){var o=xe(t),c=Yr(t,o);s==null&&!(pe(t)&&(c.length||!o.length))&&(s=t,t=e,e=this,c=Yr(t,xe(t)));var f=!(pe(s)&&"chain"in s)||!!s.chain,h=Ft(e);return He(c,function(d){var m=t[d];e[d]=m,h&&(e.prototype[d]=function(){var T=this.__chain__;if(f||T){var w=e(this.__wrapped__),A=w.__actions__=$e(this.__actions__);return A.push({func:m,args:arguments,thisArg:e}),w.__chain__=T,w}return m.apply(e,Vt([this.value()],arguments))})}),e}function v0(){return be._===this&&(be._=Wf),this}function Ys(){}function y0(e){return e=j(e),J(function(t){return La(t,e)})}var _0=Ns(le),T0=Ns(Ko),w0=Ns(Ki);function zu(e){return Ds(e)?Xi(It(e)):Kp(e)}function E0(e){return function(t){return e==null?r:ln(e,t)}}var I0=Xa(),x0=Xa(!0);function Hs(){return[]}function Ks(){return!1}function A0(){return{}}function N0(){return""}function b0(){return!0}function S0(e,t){if(e=j(e),e<1||e>Bt)return[];var s=Tt,o=Oe(e,Tt);t=k(t),e-=Tt;for(var c=ts(o,t);++s<e;)t(s);return c}function O0(e){return V(e)?le(e,It):je(e)?[e]:$e(du(ne(e)))}function L0(e){var t=++Gf;return ne(e)+t}var R0=ti(function(e,t){return e+t},0),C0=bs("ceil"),D0=ti(function(e,t){return e/t},1),F0=bs("floor");function k0(e){return e&&e.length?zr(e,Be,ps):r}function U0(e,t){return e&&e.length?zr(e,k(t,2),ps):r}function $0(e){return ea(e,Be)}function P0(e,t){return ea(e,k(t,2))}function M0(e){return e&&e.length?zr(e,Be,ms):r}function B0(e,t){return e&&e.length?zr(e,k(t,2),ms):r}var G0=ti(function(e,t){return e*t},1),V0=bs("round"),W0=ti(function(e,t){return e-t},0);function j0(e){return e&&e.length?es(e,Be):0}function q0(e,t){return e&&e.length?es(e,k(t,2)):0}return l.after=hg,l.ary=Au,l.assign=em,l.assignIn=Mu,l.assignInWith=di,l.assignWith=tm,l.at=nm,l.before=Nu,l.bind=Ms,l.bindAll=a0,l.bindKey=bu,l.castArray=Ag,l.chain=Eu,l.chunk=Fh,l.compact=kh,l.concat=Uh,l.cond=u0,l.conforms=c0,l.constant=Js,l.countBy=jd,l.create=rm,l.curry=Su,l.curryRight=Ou,l.debounce=Lu,l.defaults=im,l.defaultsDeep=sm,l.defer=dg,l.delay=gg,l.difference=$h,l.differenceBy=Ph,l.differenceWith=Mh,l.drop=Bh,l.dropRight=Gh,l.dropRightWhile=Vh,l.dropWhile=Wh,l.fill=jh,l.filter=Jd,l.flatMap=Yd,l.flatMapDeep=Hd,l.flatMapDepth=Kd,l.flatten=yu,l.flattenDeep=qh,l.flattenDepth=Jh,l.flip=mg,l.flow=f0,l.flowRight=p0,l.fromPairs=Qh,l.functions=pm,l.functionsIn=hm,l.groupBy=Xd,l.initial=Yh,l.intersection=Hh,l.intersectionBy=Kh,l.intersectionWith=Xh,l.invert=gm,l.invertBy=mm,l.invokeMap=eg,l.iteratee=Qs,l.keyBy=tg,l.keys=xe,l.keysIn=Me,l.map=ui,l.mapKeys=ym,l.mapValues=_m,l.matches=h0,l.matchesProperty=d0,l.memoize=li,l.merge=Tm,l.mergeWith=Bu,l.method=g0,l.methodOf=m0,l.mixin=zs,l.negate=fi,l.nthArg=y0,l.omit=wm,l.omitBy=Em,l.once=vg,l.orderBy=ng,l.over=_0,l.overArgs=yg,l.overEvery=T0,l.overSome=w0,l.partial=Bs,l.partialRight=Ru,l.partition=rg,l.pick=Im,l.pickBy=Gu,l.property=zu,l.propertyOf=E0,l.pull=nd,l.pullAll=Tu,l.pullAllBy=rd,l.pullAllWith=id,l.pullAt=sd,l.range=I0,l.rangeRight=x0,l.rearg=_g,l.reject=og,l.remove=od,l.rest=Tg,l.reverse=$s,l.sampleSize=ug,l.set=Am,l.setWith=Nm,l.shuffle=cg,l.slice=ad,l.sortBy=pg,l.sortedUniq=dd,l.sortedUniqBy=gd,l.split=Ym,l.spread=wg,l.tail=md,l.take=vd,l.takeRight=yd,l.takeRightWhile=_d,l.takeWhile=Td,l.tap=kd,l.throttle=Eg,l.thru=ai,l.toArray=Uu,l.toPairs=Vu,l.toPairsIn=Wu,l.toPath=O0,l.toPlainObject=Pu,l.transform=bm,l.unary=Ig,l.union=wd,l.unionBy=Ed,l.unionWith=Id,l.uniq=xd,l.uniqBy=Ad,l.uniqWith=Nd,l.unset=Sm,l.unzip=Ps,l.unzipWith=wu,l.update=Om,l.updateWith=Lm,l.values=Dn,l.valuesIn=Rm,l.without=bd,l.words=Ju,l.wrap=xg,l.xor=Sd,l.xorBy=Od,l.xorWith=Ld,l.zip=Rd,l.zipObject=Cd,l.zipObjectDeep=Dd,l.zipWith=Fd,l.entries=Vu,l.entriesIn=Wu,l.extend=Mu,l.extendWith=di,zs(l,l),l.add=R0,l.attempt=Qu,l.camelCase=km,l.capitalize=ju,l.ceil=C0,l.clamp=Cm,l.clone=Ng,l.cloneDeep=Sg,l.cloneDeepWith=Og,l.cloneWith=bg,l.conformsTo=Lg,l.deburr=qu,l.defaultTo=l0,l.divide=D0,l.endsWith=Um,l.eq=ht,l.escape=$m,l.escapeRegExp=Pm,l.every=qd,l.find=Qd,l.findIndex=mu,l.findKey=om,l.findLast=zd,l.findLastIndex=vu,l.findLastKey=am,l.floor=F0,l.forEach=Iu,l.forEachRight=xu,l.forIn=um,l.forInRight=cm,l.forOwn=lm,l.forOwnRight=fm,l.get=Ws,l.gt=Rg,l.gte=Cg,l.has=dm,l.hasIn=js,l.head=_u,l.identity=Be,l.includes=Zd,l.indexOf=zh,l.inRange=Dm,l.invoke=vm,l.isArguments=hn,l.isArray=V,l.isArrayBuffer=Dg,l.isArrayLike=Pe,l.isArrayLikeObject=de,l.isBoolean=Fg,l.isBuffer=Yt,l.isDate=kg,l.isElement=Ug,l.isEmpty=$g,l.isEqual=Pg,l.isEqualWith=Mg,l.isError=Gs,l.isFinite=Bg,l.isFunction=Ft,l.isInteger=Cu,l.isLength=pi,l.isMap=Du,l.isMatch=Gg,l.isMatchWith=Vg,l.isNaN=Wg,l.isNative=jg,l.isNil=Jg,l.isNull=qg,l.isNumber=Fu,l.isObject=pe,l.isObjectLike=he,l.isPlainObject=lr,l.isRegExp=Vs,l.isSafeInteger=Qg,l.isSet=ku,l.isString=hi,l.isSymbol=je,l.isTypedArray=Cn,l.isUndefined=zg,l.isWeakMap=Yg,l.isWeakSet=Hg,l.join=Zh,l.kebabCase=Mm,l.last=tt,l.lastIndexOf=ed,l.lowerCase=Bm,l.lowerFirst=Gm,l.lt=Kg,l.lte=Xg,l.max=k0,l.maxBy=U0,l.mean=$0,l.meanBy=P0,l.min=M0,l.minBy=B0,l.stubArray=Hs,l.stubFalse=Ks,l.stubObject=A0,l.stubString=N0,l.stubTrue=b0,l.multiply=G0,l.nth=td,l.noConflict=v0,l.noop=Ys,l.now=ci,l.pad=Vm,l.padEnd=Wm,l.padStart=jm,l.parseInt=qm,l.random=Fm,l.reduce=ig,l.reduceRight=sg,l.repeat=Jm,l.replace=Qm,l.result=xm,l.round=V0,l.runInContext=g,l.sample=ag,l.size=lg,l.snakeCase=zm,l.some=fg,l.sortedIndex=ud,l.sortedIndexBy=cd,l.sortedIndexOf=ld,l.sortedLastIndex=fd,l.sortedLastIndexBy=pd,l.sortedLastIndexOf=hd,l.startCase=Hm,l.startsWith=Km,l.subtract=W0,l.sum=j0,l.sumBy=q0,l.template=Xm,l.times=S0,l.toFinite=kt,l.toInteger=j,l.toLength=$u,l.toLower=Zm,l.toNumber=nt,l.toSafeInteger=Zg,l.toString=ne,l.toUpper=e0,l.trim=t0,l.trimEnd=n0,l.trimStart=r0,l.truncate=i0,l.unescape=s0,l.uniqueId=L0,l.upperCase=o0,l.upperFirst=qs,l.each=Iu,l.eachRight=xu,l.first=_u,zs(l,function(){var e={};return wt(l,function(t,s){ie.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=a,He(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),He(["drop","take"],function(e,t){z.prototype[e]=function(s){s=s===r?1:Ee(j(s),0);var o=this.__filtered__&&!t?new z(this):this.clone();return o.__filtered__?o.__takeCount__=Oe(s,o.__takeCount__):o.__views__.push({size:Oe(s,Tt),type:e+(o.__dir__<0?"Right":"")}),o},z.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),He(["filter","map","takeWhile"],function(e,t){var s=t+1,o=s==yo||s==tl;z.prototype[e]=function(c){var f=this.clone();return f.__iteratees__.push({iteratee:k(c,3),type:s}),f.__filtered__=f.__filtered__||o,f}}),He(["head","last"],function(e,t){var s="take"+(t?"Right":"");z.prototype[e]=function(){return this[s](1).value()[0]}}),He(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");z.prototype[e]=function(){return this.__filtered__?new z(this):this[s](1)}}),z.prototype.compact=function(){return this.filter(Be)},z.prototype.find=function(e){return this.filter(e).head()},z.prototype.findLast=function(e){return this.reverse().find(e)},z.prototype.invokeMap=J(function(e,t){return typeof e=="function"?new z(this):this.map(function(s){return ir(s,e,t)})}),z.prototype.reject=function(e){return this.filter(fi(k(e)))},z.prototype.slice=function(e,t){e=j(e);var s=this;return s.__filtered__&&(e>0||t<0)?new z(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=j(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},z.prototype.toArray=function(){return this.take(Tt)},wt(z.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),c=l[o?"take"+(t=="last"?"Right":""):t],f=o||/^find/.test(t);c&&(l.prototype[t]=function(){var h=this.__wrapped__,d=o?[1]:arguments,m=h instanceof z,T=d[0],w=m||V(h),A=function(Q){var H=c.apply(l,Vt([Q],d));return o&&S?H[0]:H};w&&s&&typeof T=="function"&&T.length!=1&&(m=w=!1);var S=this.__chain__,D=!!this.__actions__.length,U=f&&!S,q=m&&!D;if(!f&&w){h=q?h:new z(this);var $=e.apply(h,d);return $.__actions__.push({func:ai,args:[A],thisArg:r}),new Xe($,S)}return U&&q?e.apply(this,d):($=this.thru(A),U?o?$.value()[0]:$.value():$)})}),He(["pop","push","shift","sort","splice","unshift"],function(e){var t=Dr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(o&&!this.__chain__){var f=this.value();return t.apply(V(f)?f:[],c)}return this[s](function(h){return t.apply(V(h)?h:[],c)})}}),wt(z.prototype,function(e,t){var s=l[t];if(s){var o=s.name+"";ie.call(bn,o)||(bn[o]=[]),bn[o].push({name:t,func:s})}}),bn[ei(r,ve).name]=[{name:"wrapper",func:r}],z.prototype.clone=sp,z.prototype.reverse=op,z.prototype.value=ap,l.prototype.at=Ud,l.prototype.chain=$d,l.prototype.commit=Pd,l.prototype.next=Md,l.prototype.plant=Gd,l.prototype.reverse=Vd,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Wd,l.prototype.first=l.prototype.head,Kn&&(l.prototype[Kn]=Bd),l},xn=Pf();sn?((sn.exports=xn)._=xn,Qi._=xn):be._=xn}).call(pv)}(pr,pr.exports)),pr.exports}var dv=hv();const Ku=n=>{const i=dv.startCase(n).toLowerCase();return i.charAt(0).toUpperCase()+i.slice(1)},gv="src/app";var wi=(n=>(n.AGENT="agent",n.OBJECT="object",n.FUNCTION="function",n.ROLE="role",n))(wi||{});const mv=n=>Object.values(wi).includes(n);class vv{async execute(i,r){try{const a=r?ke.join(vt,r):ke.join(vt,gv);await Ie.ensureDir(a);const u=i??await this.getEntity();if(u==="object"){const p=await this.getObjectData(),v=p.nameSingular,I=`${ov.default(v)}.object.ts`,N=cv({data:p,name:v}),R=ke.join(a,I);await Ie.writeFile(R,N),console.log(F.default.green("✓ Created object:"),F.default.cyan(R.replace(vt+"/","")));return}if(u==="function"){const p=await this.getEntityName(u),v=`${Ti.default(p)}.function.ts`,I=lv({name:p}),N=ke.join(a,v);await Ie.writeFile(N,I),console.log(F.default.green("✓ Created function:"),F.default.cyan(N.replace(vt+"/","")));return}if(u==="role"){const p=await this.getEntityName(u),v=`${Ti.default(p)}.role.ts`,I=fv({name:p}),N=ke.join(a,v);await Ie.writeFile(N,I),console.log(F.default.green("✓ Created role:"),F.default.cyan(N.replace(vt+"/","")));return}}catch(a){console.error(F.default.red("Add new entity failed:"),a instanceof Error?a.message:a),process.exit(1)}}async getEntity(){const{entity:i}=await $n.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:["function","object","role"]}]);return i}async getEntityName(i){const{name:r}=await $n.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${i}:`,default:"",validate:a=>a.length===0?`${i} name is required`:/^[a-z0-9-]+$/.test(a)?!0:"Name must contain only lowercase letters, numbers, and hyphens"}]);return r}async getObjectData(){return $n.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(i,r)=>i.trim()===r?.nameSingular.trim()?"Name plural must be different from name singular":!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:i=>Ku(i.nameSingular),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:i=>Ku(i.namePlural),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0}])}}function te(n,i){if(!!!n)throw new Error(i)}function Mt(n){return typeof n=="object"&&n!==null}function yr(n,i){if(!!!n)throw new Error(i??"Unexpected invariant triggered.")}const yv=/\r\n|[\n\r]/g;function ro(n,i){let r=0,a=1;for(const u of n.body.matchAll(yv)){if(typeof u.index=="number"||yr(!1),u.index>=i)break;r=u.index+u[0].length,a+=1}return{line:a,column:i+1-r}}function _v(n){return uc(n.source,ro(n.source,n.start))}function uc(n,i){const r=n.locationOffset.column-1,a="".padStart(r)+n.body,u=i.line-1,p=n.locationOffset.line-1,v=i.line+p,I=i.line===1?r:0,N=i.column+I,R=`${n.name}:${v}:${N}
|
|
107
|
+
`,O=a.split(/\r\n|[\n\r]/g),M=O[u];if(M.length>120){const Z=Math.floor(N/80),ce=N%80,W=[];for(let Te=0;Te<M.length;Te+=80)W.push(M.slice(Te,Te+80));return R+Xu([[`${v} |`,W[0]],...W.slice(1,Z+1).map(Te=>["|",Te]),["|","^".padStart(ce)],["|",W[Z+1]]])}return R+Xu([[`${v-1} |`,O[u-1]],[`${v} |`,M],["|","^".padStart(N)],[`${v+1} |`,O[u+1]]])}function Xu(n){const i=n.filter(([a,u])=>u!==void 0),r=Math.max(...i.map(([a])=>a.length));return i.map(([a,u])=>a.padStart(r)+(u?" "+u:"")).join(`
|
|
108
|
+
`)}function Tv(n){const i=n[0];return i==null||"kind"in i||"length"in i?{nodes:i,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:i}class re extends Error{constructor(i,...r){var a,u,p;const{nodes:v,source:I,positions:N,path:R,originalError:O,extensions:M}=Tv(r);super(i),this.name="GraphQLError",this.path=R??void 0,this.originalError=O??void 0,this.nodes=Zu(Array.isArray(v)?v:v?[v]:void 0);const Z=Zu((a=this.nodes)===null||a===void 0?void 0:a.map(W=>W.loc).filter(W=>W!=null));this.source=I??(Z==null||(u=Z[0])===null||u===void 0?void 0:u.source),this.positions=N??Z?.map(W=>W.start),this.locations=N&&I?N.map(W=>ro(I,W)):Z?.map(W=>ro(W.source,W.start));const ce=Mt(O?.extensions)?O?.extensions:void 0;this.extensions=(p=M??ce)!==null&&p!==void 0?p:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),O!=null&&O.stack?Object.defineProperty(this,"stack",{value:O.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,re):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let i=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(i+=`
|
|
60
109
|
|
|
61
|
-
`+
|
|
110
|
+
`+_v(r.loc));else if(this.source&&this.locations)for(const r of this.locations)i+=`
|
|
62
111
|
|
|
63
|
-
`+uc(this.source,r);return i}toJSON(){const i={message:this.message};return this.locations!=null&&(i.locations=this.locations),this.path!=null&&(i.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(i.extensions=this.extensions),i}}function
|
|
64
|
-
`),
|
|
65
|
-
`),'"""'+
|
|
66
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw
|
|
67
|
-
`));return n.line+=N.length-1,n.lineStart=u,
|
|
112
|
+
`+uc(this.source,r);return i}toJSON(){const i={message:this.message};return this.locations!=null&&(i.locations=this.locations),this.path!=null&&(i.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(i.extensions=this.extensions),i}}function Zu(n){return n===void 0||n.length===0?void 0:n}function Ae(n,i,r){return new re(`Syntax Error: ${r}`,{source:n,positions:[i]})}class wv{constructor(i,r,a){this.start=i.start,this.end=r.end,this.startToken=i,this.endToken=r,this.source=a}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class cc{constructor(i,r,a,u,p,v){this.kind=i,this.start=r,this.end=a,this.line=u,this.column=p,this.value=v,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const lc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ev=new Set(Object.keys(lc));function ec(n){const i=n?.kind;return typeof i=="string"&&Ev.has(i)}var $t;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})($t||($t={}));var X;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(X||(X={}));var b;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(b||(b={}));function io(n){return n===9||n===32}function gr(n){return n>=48&&n<=57}function fc(n){return n>=97&&n<=122||n>=65&&n<=90}function co(n){return fc(n)||n===95}function pc(n){return fc(n)||gr(n)||n===95}function Iv(n){var i;let r=Number.MAX_SAFE_INTEGER,a=null,u=-1;for(let v=0;v<n.length;++v){var p;const I=n[v],N=xv(I);N!==I.length&&(a=(p=a)!==null&&p!==void 0?p:v,u=v,v!==0&&N<r&&(r=N))}return n.map((v,I)=>I===0?v:v.slice(r)).slice((i=a)!==null&&i!==void 0?i:0,u+1)}function xv(n){let i=0;for(;i<n.length&&io(n.charCodeAt(i));)++i;return i}function Av(n){if(n==="")return!0;let i=!0,r=!1,a=!0,u=!1;for(let p=0;p<n.length;++p)switch(n.codePointAt(p)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(i&&!u)return!1;u=!0,i=!0,r=!1;break;case 9:case 32:r||(r=i);break;default:a&&(a=r),i=!1}return!(i||a&&u)}function Nv(n,i){const r=n.replace(/"""/g,'\\"""'),a=r.split(/\r\n|[\n\r]/g),u=a.length===1,p=a.length>1&&a.slice(1).every(ce=>ce.length===0||io(ce.charCodeAt(0))),v=r.endsWith('\\"""'),I=n.endsWith('"')&&!v,N=n.endsWith("\\"),R=I||N,O=!u||n.length>70||R||p||v;let M="";const Z=u&&io(n.charCodeAt(0));return(O&&!Z||p)&&(M+=`
|
|
113
|
+
`),M+=r,(O||R)&&(M+=`
|
|
114
|
+
`),'"""'+M+'"""'}var E;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(E||(E={}));class bv{constructor(i){const r=new cc(E.SOF,0,0,0,0);this.source=i,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let i=this.token;if(i.kind!==E.EOF)do if(i.next)i=i.next;else{const r=Ov(this,i.end);i.next=r,r.prev=i,i=r}while(i.kind===E.COMMENT);return i}}function Sv(n){return n===E.BANG||n===E.DOLLAR||n===E.AMP||n===E.PAREN_L||n===E.PAREN_R||n===E.SPREAD||n===E.COLON||n===E.EQUALS||n===E.AT||n===E.BRACKET_L||n===E.BRACKET_R||n===E.BRACE_L||n===E.PIPE||n===E.BRACE_R}function Mn(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function Ai(n,i){return hc(n.charCodeAt(i))&&dc(n.charCodeAt(i+1))}function hc(n){return n>=55296&&n<=56319}function dc(n){return n>=56320&&n<=57343}function gn(n,i){const r=n.source.body.codePointAt(i);if(r===void 0)return E.EOF;if(r>=32&&r<=126){const a=String.fromCodePoint(r);return a==='"'?`'"'`:`"${a}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function _e(n,i,r,a,u){const p=n.line,v=1+r-n.lineStart;return new cc(i,r,a,p,v,u)}function Ov(n,i){const r=n.source.body,a=r.length;let u=i;for(;u<a;){const p=r.charCodeAt(u);switch(p){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:r.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return Lv(n,u);case 33:return _e(n,E.BANG,u,u+1);case 36:return _e(n,E.DOLLAR,u,u+1);case 38:return _e(n,E.AMP,u,u+1);case 40:return _e(n,E.PAREN_L,u,u+1);case 41:return _e(n,E.PAREN_R,u,u+1);case 46:if(r.charCodeAt(u+1)===46&&r.charCodeAt(u+2)===46)return _e(n,E.SPREAD,u,u+3);break;case 58:return _e(n,E.COLON,u,u+1);case 61:return _e(n,E.EQUALS,u,u+1);case 64:return _e(n,E.AT,u,u+1);case 91:return _e(n,E.BRACKET_L,u,u+1);case 93:return _e(n,E.BRACKET_R,u,u+1);case 123:return _e(n,E.BRACE_L,u,u+1);case 124:return _e(n,E.PIPE,u,u+1);case 125:return _e(n,E.BRACE_R,u,u+1);case 34:return r.charCodeAt(u+1)===34&&r.charCodeAt(u+2)===34?Uv(n,u):Cv(n,u)}if(gr(p)||p===45)return Rv(n,u,p);if(co(p))return $v(n,u);throw Ae(n.source,u,p===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Mn(p)||Ai(r,u)?`Unexpected character: ${gn(n,u)}.`:`Invalid character: ${gn(n,u)}.`)}return _e(n,E.EOF,a,a)}function Lv(n,i){const r=n.source.body,a=r.length;let u=i+1;for(;u<a;){const p=r.charCodeAt(u);if(p===10||p===13)break;if(Mn(p))++u;else if(Ai(r,u))u+=2;else break}return _e(n,E.COMMENT,i,u,r.slice(i+1,u))}function Rv(n,i,r){const a=n.source.body;let u=i,p=r,v=!1;if(p===45&&(p=a.charCodeAt(++u)),p===48){if(p=a.charCodeAt(++u),gr(p))throw Ae(n.source,u,`Invalid number, unexpected digit after 0: ${gn(n,u)}.`)}else u=eo(n,u,p),p=a.charCodeAt(u);if(p===46&&(v=!0,p=a.charCodeAt(++u),u=eo(n,u,p),p=a.charCodeAt(u)),(p===69||p===101)&&(v=!0,p=a.charCodeAt(++u),(p===43||p===45)&&(p=a.charCodeAt(++u)),u=eo(n,u,p),p=a.charCodeAt(u)),p===46||co(p))throw Ae(n.source,u,`Invalid number, expected digit but got: ${gn(n,u)}.`);return _e(n,v?E.FLOAT:E.INT,i,u,a.slice(i,u))}function eo(n,i,r){if(!gr(r))throw Ae(n.source,i,`Invalid number, expected digit but got: ${gn(n,i)}.`);const a=n.source.body;let u=i+1;for(;gr(a.charCodeAt(u));)++u;return u}function Cv(n,i){const r=n.source.body,a=r.length;let u=i+1,p=u,v="";for(;u<a;){const I=r.charCodeAt(u);if(I===34)return v+=r.slice(p,u),_e(n,E.STRING,i,u+1,v);if(I===92){v+=r.slice(p,u);const N=r.charCodeAt(u+1)===117?r.charCodeAt(u+2)===123?Dv(n,u):Fv(n,u):kv(n,u);v+=N.value,u+=N.size,p=u;continue}if(I===10||I===13)break;if(Mn(I))++u;else if(Ai(r,u))u+=2;else throw Ae(n.source,u,`Invalid character within String: ${gn(n,u)}.`)}throw Ae(n.source,u,"Unterminated string.")}function Dv(n,i){const r=n.source.body;let a=0,u=3;for(;u<12;){const p=r.charCodeAt(i+u++);if(p===125){if(u<5||!Mn(a))break;return{value:String.fromCodePoint(a),size:u}}if(a=a<<4|hr(p),a<0)break}throw Ae(n.source,i,`Invalid Unicode escape sequence: "${r.slice(i,i+u)}".`)}function Fv(n,i){const r=n.source.body,a=tc(r,i+2);if(Mn(a))return{value:String.fromCodePoint(a),size:6};if(hc(a)&&r.charCodeAt(i+6)===92&&r.charCodeAt(i+7)===117){const u=tc(r,i+8);if(dc(u))return{value:String.fromCodePoint(a,u),size:12}}throw Ae(n.source,i,`Invalid Unicode escape sequence: "${r.slice(i,i+6)}".`)}function tc(n,i){return hr(n.charCodeAt(i))<<12|hr(n.charCodeAt(i+1))<<8|hr(n.charCodeAt(i+2))<<4|hr(n.charCodeAt(i+3))}function hr(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function kv(n,i){const r=n.source.body;switch(r.charCodeAt(i+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
115
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ae(n.source,i,`Invalid character escape sequence: "${r.slice(i,i+2)}".`)}function Uv(n,i){const r=n.source.body,a=r.length;let u=n.lineStart,p=i+3,v=p,I="";const N=[];for(;p<a;){const R=r.charCodeAt(p);if(R===34&&r.charCodeAt(p+1)===34&&r.charCodeAt(p+2)===34){I+=r.slice(v,p),N.push(I);const O=_e(n,E.BLOCK_STRING,i,p+3,Iv(N).join(`
|
|
116
|
+
`));return n.line+=N.length-1,n.lineStart=u,O}if(R===92&&r.charCodeAt(p+1)===34&&r.charCodeAt(p+2)===34&&r.charCodeAt(p+3)===34){I+=r.slice(v,p),v=p+1,p+=4;continue}if(R===10||R===13){I+=r.slice(v,p),N.push(I),R===13&&r.charCodeAt(p+1)===10?p+=2:++p,I="",v=p,u=p;continue}if(Mn(R))++p;else if(Ai(r,p))p+=2;else throw Ae(n.source,p,`Invalid character within String: ${gn(n,p)}.`)}throw Ae(n.source,p,"Unterminated string.")}function $v(n,i){const r=n.source.body,a=r.length;let u=i+1;for(;u<a;){const p=r.charCodeAt(u);if(pc(p))++u;else break}return _e(n,E.NAME,i,u,r.slice(i,u))}const Pv=10,gc=2;function P(n){return Ni(n,[])}function Ni(n,i){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Mv(n,i);default:return String(n)}}function Mv(n,i){if(n===null)return"null";if(i.includes(n))return"[Circular]";const r=[...i,n];if(Bv(n)){const a=n.toJSON();if(a!==n)return typeof a=="string"?a:Ni(a,r)}else if(Array.isArray(n))return Vv(n,r);return Gv(n,r)}function Bv(n){return typeof n.toJSON=="function"}function Gv(n,i){const r=Object.entries(n);return r.length===0?"{}":i.length>gc?"["+Wv(n)+"]":"{ "+r.map(([u,p])=>u+": "+Ni(p,i)).join(", ")+" }"}function Vv(n,i){if(n.length===0)return"[]";if(i.length>gc)return"[Array]";const r=Math.min(Pv,n.length),a=n.length-r,u=[];for(let p=0;p<r;++p)u.push(Ni(n[p],i));return a===1?u.push("... 1 more item"):a>1&&u.push(`... ${a} more items`),"["+u.join(", ")+"]"}function Wv(n){const i=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(i==="Object"&&typeof n.constructor=="function"){const r=n.constructor.name;if(typeof r=="string"&&r!=="")return r}return i}const Nt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(i,r){return i instanceof r}:function(i,r){if(i instanceof r)return!0;if(typeof i=="object"&&i!==null){var a;const u=r.prototype[Symbol.toStringTag],p=Symbol.toStringTag in i?i[Symbol.toStringTag]:(a=i.constructor)===null||a===void 0?void 0:a.name;if(u===p){const v=P(i);throw new Error(`Cannot use ${u} "${v}" from another module or realm.
|
|
68
117
|
|
|
69
118
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
70
119
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -75,36 +124,36 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
75
124
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
76
125
|
versions may have different capabilities and behavior. The data from one
|
|
77
126
|
version used in the function from another could produce confusing and
|
|
78
|
-
spurious results.`)}}return!1};class mc{constructor(i,r="GraphQL request",a={line:1,column:1}){typeof i=="string"||ne(!1,`Body must be a string. Received: ${M(i)}.`),this.body=i,this.name=r,this.locationOffset=a,this.locationOffset.line>0||ne(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ne(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ky(n){return It(n,mc)}function Uy(n,i){const r=new Py(n,i);r.expectToken(x.SOF);const a=r.parseValueLiteral(!1);return r.expectToken(x.EOF),a}class Py{constructor(i,r={}){const a=ky(i)?i:new mc(i);this._lexer=new vy(a),this._options=r,this._tokenCounter=0}parseName(){const i=this.expectToken(x.NAME);return this.node(i,{kind:S.NAME,value:i.value})}parseDocument(){return this.node(this._lexer.token,{kind:S.DOCUMENT,definitions:this.many(x.SOF,this.parseDefinition,x.EOF)})}parseDefinition(){if(this.peek(x.BRACE_L))return this.parseOperationDefinition();const i=this.peekDescription(),r=i?this._lexer.lookahead():this._lexer.token;if(r.kind===x.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(i)throw Ie(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const i=this._lexer.token;if(this.peek(x.BRACE_L))return this.node(i,{kind:S.OPERATION_DEFINITION,operation:Ut.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let a;return this.peek(x.NAME)&&(a=this.parseName()),this.node(i,{kind:S.OPERATION_DEFINITION,operation:r,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const i=this.expectToken(x.NAME);switch(i.value){case"query":return Ut.QUERY;case"mutation":return Ut.MUTATION;case"subscription":return Ut.SUBSCRIPTION}throw this.unexpected(i)}parseVariableDefinitions(){return this.optionalMany(x.PAREN_L,this.parseVariableDefinition,x.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:S.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(x.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(x.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const i=this._lexer.token;return this.expectToken(x.DOLLAR),this.node(i,{kind:S.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:S.SELECTION_SET,selections:this.many(x.BRACE_L,this.parseSelection,x.BRACE_R)})}parseSelection(){return this.peek(x.SPREAD)?this.parseFragment():this.parseField()}parseField(){const i=this._lexer.token,r=this.parseName();let a,u;return this.expectOptionalToken(x.COLON)?(a=r,u=this.parseName()):u=r,this.node(i,{kind:S.FIELD,alias:a,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(x.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(i){const r=i?this.parseConstArgument:this.parseArgument;return this.optionalMany(x.PAREN_L,r,x.PAREN_R)}parseArgument(i=!1){const r=this._lexer.token,a=this.parseName();return this.expectToken(x.COLON),this.node(r,{kind:S.ARGUMENT,name:a,value:this.parseValueLiteral(i)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const i=this._lexer.token;this.expectToken(x.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(x.NAME)?this.node(i,{kind:S.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(i,{kind:S.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const i=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(i,{kind:S.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(i,{kind:S.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(i){const r=this._lexer.token;switch(r.kind){case x.BRACKET_L:return this.parseList(i);case x.BRACE_L:return this.parseObject(i);case x.INT:return this.advanceLexer(),this.node(r,{kind:S.INT,value:r.value});case x.FLOAT:return this.advanceLexer(),this.node(r,{kind:S.FLOAT,value:r.value});case x.STRING:case x.BLOCK_STRING:return this.parseStringLiteral();case x.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:S.BOOLEAN,value:!0});case"false":return this.node(r,{kind:S.BOOLEAN,value:!1});case"null":return this.node(r,{kind:S.NULL});default:return this.node(r,{kind:S.ENUM,value:r.value})}case x.DOLLAR:if(i)if(this.expectToken(x.DOLLAR),this._lexer.token.kind===x.NAME){const a=this._lexer.token.value;throw Ie(this._lexer.source,r.start,`Unexpected variable "$${a}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const i=this._lexer.token;return this.advanceLexer(),this.node(i,{kind:S.STRING,value:i.value,block:i.kind===x.BLOCK_STRING})}parseList(i){const r=()=>this.parseValueLiteral(i);return this.node(this._lexer.token,{kind:S.LIST,values:this.any(x.BRACKET_L,r,x.BRACKET_R)})}parseObject(i){const r=()=>this.parseObjectField(i);return this.node(this._lexer.token,{kind:S.OBJECT,fields:this.any(x.BRACE_L,r,x.BRACE_R)})}parseObjectField(i){const r=this._lexer.token,a=this.parseName();return this.expectToken(x.COLON),this.node(r,{kind:S.OBJECT_FIELD,name:a,value:this.parseValueLiteral(i)})}parseDirectives(i){const r=[];for(;this.peek(x.AT);)r.push(this.parseDirective(i));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(i){const r=this._lexer.token;return this.expectToken(x.AT),this.node(r,{kind:S.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(i)})}parseTypeReference(){const i=this._lexer.token;let r;if(this.expectOptionalToken(x.BRACKET_L)){const a=this.parseTypeReference();this.expectToken(x.BRACKET_R),r=this.node(i,{kind:S.LIST_TYPE,type:a})}else r=this.parseNamedType();return this.expectOptionalToken(x.BANG)?this.node(i,{kind:S.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:S.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(x.STRING)||this.peek(x.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const a=this.parseConstDirectives(),u=this.many(x.BRACE_L,this.parseOperationTypeDefinition,x.BRACE_R);return this.node(i,{kind:S.SCHEMA_DEFINITION,description:r,directives:a,operationTypes:u})}parseOperationTypeDefinition(){const i=this._lexer.token,r=this.parseOperationType();this.expectToken(x.COLON);const a=this.parseNamedType();return this.node(i,{kind:S.OPERATION_TYPE_DEFINITION,operation:r,type:a})}parseScalarTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const a=this.parseName(),u=this.parseConstDirectives();return this.node(i,{kind:S.SCALAR_TYPE_DEFINITION,description:r,name:a,directives:u})}parseObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),y=this.parseFieldsDefinition();return this.node(i,{kind:S.OBJECT_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:y})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(x.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(x.BRACE_L,this.parseFieldDefinition,x.BRACE_R)}parseFieldDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName(),u=this.parseArgumentDefs();this.expectToken(x.COLON);const p=this.parseTypeReference(),y=this.parseConstDirectives();return this.node(i,{kind:S.FIELD_DEFINITION,description:r,name:a,arguments:u,type:p,directives:y})}parseArgumentDefs(){return this.optionalMany(x.PAREN_L,this.parseInputValueDef,x.PAREN_R)}parseInputValueDef(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName();this.expectToken(x.COLON);const u=this.parseTypeReference();let p;this.expectOptionalToken(x.EQUALS)&&(p=this.parseConstValueLiteral());const y=this.parseConstDirectives();return this.node(i,{kind:S.INPUT_VALUE_DEFINITION,description:r,name:a,type:u,defaultValue:p,directives:y})}parseInterfaceTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),y=this.parseFieldsDefinition();return this.node(i,{kind:S.INTERFACE_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:y})}parseUnionTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseUnionMemberTypes();return this.node(i,{kind:S.UNION_TYPE_DEFINITION,description:r,name:a,directives:u,types:p})}parseUnionMemberTypes(){return this.expectOptionalToken(x.EQUALS)?this.delimitedMany(x.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseEnumValuesDefinition();return this.node(i,{kind:S.ENUM_TYPE_DEFINITION,description:r,name:a,directives:u,values:p})}parseEnumValuesDefinition(){return this.optionalMany(x.BRACE_L,this.parseEnumValueDefinition,x.BRACE_R)}parseEnumValueDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(i,{kind:S.ENUM_VALUE_DEFINITION,description:r,name:a,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ie(this._lexer.source,this._lexer.token.start,`${gi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseInputFieldsDefinition();return this.node(i,{kind:S.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:a,directives:u,fields:p})}parseInputFieldsDefinition(){return this.optionalMany(x.BRACE_L,this.parseInputValueDef,x.BRACE_R)}parseTypeSystemExtension(){const i=this._lexer.lookahead();if(i.kind===x.NAME)switch(i.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(i)}parseSchemaExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),a=this.optionalMany(x.BRACE_L,this.parseOperationTypeDefinition,x.BRACE_R);if(r.length===0&&a.length===0)throw this.unexpected();return this.node(i,{kind:S.SCHEMA_EXTENSION,directives:r,operationTypes:a})}parseScalarTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),a=this.parseConstDirectives();if(a.length===0)throw this.unexpected();return this.node(i,{kind:S.SCALAR_TYPE_EXTENSION,name:r,directives:a})}parseObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:S.OBJECT_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseInterfaceTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:S.INTERFACE_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseUnionTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:S.UNION_TYPE_EXTENSION,name:r,directives:a,types:u})}parseEnumTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:S.ENUM_TYPE_EXTENSION,name:r,directives:a,values:u})}parseInputObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:S.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:a,fields:u})}parseDirectiveDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(x.AT);const a=this.parseName(),u=this.parseArgumentDefs(),p=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const y=this.parseDirectiveLocations();return this.node(i,{kind:S.DIRECTIVE_DEFINITION,description:r,name:a,arguments:u,repeatable:p,locations:y})}parseDirectiveLocations(){return this.delimitedMany(x.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const i=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(ee,r.value))return r;throw this.unexpected(i)}node(i,r){return this._options.noLocation!==!0&&(r.loc=new py(i,this._lexer.lastToken,this._lexer.source)),r}peek(i){return this._lexer.token.kind===i}expectToken(i){const r=this._lexer.token;if(r.kind===i)return this.advanceLexer(),r;throw Ie(this._lexer.source,r.start,`Expected ${yc(i)}, found ${gi(r)}.`)}expectOptionalToken(i){return this._lexer.token.kind===i?(this.advanceLexer(),!0):!1}expectKeyword(i){const r=this._lexer.token;if(r.kind===x.NAME&&r.value===i)this.advanceLexer();else throw Ie(this._lexer.source,r.start,`Expected "${i}", found ${gi(r)}.`)}expectOptionalKeyword(i){const r=this._lexer.token;return r.kind===x.NAME&&r.value===i?(this.advanceLexer(),!0):!1}unexpected(i){const r=i??this._lexer.token;return Ie(this._lexer.source,r.start,`Unexpected ${gi(r)}.`)}any(i,r,a){this.expectToken(i);const u=[];for(;!this.expectOptionalToken(a);)u.push(r.call(this));return u}optionalMany(i,r,a){if(this.expectOptionalToken(i)){const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}return[]}many(i,r,a){this.expectToken(i);const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}delimitedMany(i,r){this.expectOptionalToken(i);const a=[];do a.push(r.call(this));while(this.expectOptionalToken(i));return a}advanceLexer(){const{maxTokens:i}=this._options,r=this._lexer.advance();if(i!==void 0&&r.kind!==x.EOF&&(++this._tokenCounter,this._tokenCounter>i))throw Ie(this._lexer.source,r.start,`Document contains more that ${i} tokens. Parsing aborted.`)}}function gi(n){const i=n.value;return yc(n.kind)+(i!=null?` "${i}"`:"")}function yc(n){return _y(n)?`"${n}"`:n}const My=5;function $y(n,i){const[r,a]=i?[n,i]:[void 0,n];let u=" Did you mean ";r&&(u+=r+" ");const p=a.map(N=>`"${N}"`);switch(p.length){case 0:return"";case 1:return u+p[0]+"?";case 2:return u+p[0]+" or "+p[1]+"?"}const y=p.slice(0,My),_=y.pop();return u+y.join(", ")+", or "+_+"?"}function ec(n){return n}function vc(n,i){const r=Object.create(null);for(const a of n)r[i(a)]=a;return r}function hn(n,i,r){const a=Object.create(null);for(const u of n)a[i(u)]=r(u);return a}function Si(n,i){const r=Object.create(null);for(const a of Object.keys(n))r[a]=i(n[a],a);return r}function By(n,i){let r=0,a=0;for(;r<n.length&&a<i.length;){let u=n.charCodeAt(r),p=i.charCodeAt(a);if(mi(u)&&mi(p)){let y=0;do++r,y=y*10+u-so,u=n.charCodeAt(r);while(mi(u)&&y>0);let _=0;do++a,_=_*10+p-so,p=i.charCodeAt(a);while(mi(p)&&_>0);if(y<_)return-1;if(y>_)return 1}else{if(u<p)return-1;if(u>p)return 1;++r,++a}}return n.length-i.length}const so=48,Gy=57;function mi(n){return!isNaN(n)&&so<=n&&n<=Gy}function Wy(n,i){const r=Object.create(null),a=new Vy(n),u=Math.floor(n.length*.4)+1;for(const p of i){const y=a.measure(p,u);y!==void 0&&(r[p]=y)}return Object.keys(r).sort((p,y)=>{const _=r[p]-r[y];return _!==0?_:By(p,y)})}class Vy{constructor(i){this._input=i,this._inputLowerCase=i.toLowerCase(),this._inputArray=tc(this._inputLowerCase),this._rows=[new Array(i.length+1).fill(0),new Array(i.length+1).fill(0),new Array(i.length+1).fill(0)]}measure(i,r){if(this._input===i)return 0;const a=i.toLowerCase();if(this._inputLowerCase===a)return 1;let u=tc(a),p=this._inputArray;if(u.length<p.length){const C=u;u=p,p=C}const y=u.length,_=p.length;if(y-_>r)return;const N=this._rows;for(let C=0;C<=_;C++)N[0][C]=C;for(let C=1;C<=y;C++){const J=N[(C-1)%3],Y=N[C%3];let oe=Y[0]=C;for(let V=1;V<=_;V++){const we=u[C-1]===p[V-1]?0:1;let pe=Math.min(J[V]+1,Y[V-1]+1,J[V-1]+we);if(C>1&&V>1&&u[C-1]===p[V-2]&&u[C-2]===p[V-1]){const ve=N[(C-2)%3][V-2];pe=Math.min(pe,ve+1)}pe<oe&&(oe=pe),Y[V]=pe}if(oe>r)return}const D=N[y%3][_];return D<=r?D:void 0}}function tc(n){const i=n.length,r=new Array(i);for(let a=0;a<i;++a)r[a]=n.charCodeAt(a);return r}function ct(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const i=Object.create(null);for(const[r,a]of Object.entries(n))i[r]=a;return i}function jy(n){return`"${n.replace(qy,Jy)}"`}const qy=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Jy(n){return Qy[n.charCodeAt(0)]}const Qy=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],zy=Object.freeze({});function Yy(n,i,r=lc){const a=new Map;for(const ve of Object.values(S))a.set(ve,Hy(i,ve));let u,p=Array.isArray(n),y=[n],_=-1,N=[],D=n,C,J;const Y=[],oe=[];do{_++;const ve=_===y.length,en=ve&&N.length!==0;if(ve){if(C=oe.length===0?void 0:Y[Y.length-1],D=J,J=oe.pop(),en)if(p){D=D.slice();let Ne=0;for(const[Re,ze]of N){const Ue=Re-Ne;ze===null?(D.splice(Ue,1),Ne++):D[Ue]=ze}}else{D=Object.defineProperties({},Object.getOwnPropertyDescriptors(D));for(const[Ne,Re]of N)D[Ne]=Re}_=u.index,y=u.keys,N=u.edits,p=u.inArray,u=u.prev}else if(J){if(C=p?_:y[_],D=J[C],D==null)continue;Y.push(C)}let _e;if(!Array.isArray(D)){var V,we;Xu(D)||ne(!1,`Invalid AST Node: ${M(D)}.`);const Ne=ve?(V=a.get(D.kind))===null||V===void 0?void 0:V.leave:(we=a.get(D.kind))===null||we===void 0?void 0:we.enter;if(_e=Ne?.call(i,D,C,J,Y,oe),_e===zy)break;if(_e===!1){if(!ve){Y.pop();continue}}else if(_e!==void 0&&(N.push([C,_e]),!ve))if(Xu(_e))D=_e;else{Y.pop();continue}}if(_e===void 0&&en&&N.push([C,D]),ve)Y.pop();else{var pe;u={inArray:p,index:_,keys:y,edits:N,prev:u},p=Array.isArray(D),y=p?D:(pe=r[D.kind])!==null&&pe!==void 0?pe:[],_=-1,N=[],J&&oe.push(J),J=D}}while(u!==void 0);return N.length!==0?N[N.length-1][1]:n}function Hy(n,i){const r=n[i];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:n.enter,leave:n.leave}}function at(n){return Yy(n,Xy)}const Ky=80,Xy={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>R(n.definitions,`
|
|
127
|
+
spurious results.`)}}return!1};class mc{constructor(i,r="GraphQL request",a={line:1,column:1}){typeof i=="string"||te(!1,`Body must be a string. Received: ${P(i)}.`),this.body=i,this.name=r,this.locationOffset=a,this.locationOffset.line>0||te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function jv(n){return Nt(n,mc)}function qv(n,i){const r=new Jv(n,i);r.expectToken(E.SOF);const a=r.parseValueLiteral(!1);return r.expectToken(E.EOF),a}class Jv{constructor(i,r={}){const a=jv(i)?i:new mc(i);this._lexer=new bv(a),this._options=r,this._tokenCounter=0}parseName(){const i=this.expectToken(E.NAME);return this.node(i,{kind:b.NAME,value:i.value})}parseDocument(){return this.node(this._lexer.token,{kind:b.DOCUMENT,definitions:this.many(E.SOF,this.parseDefinition,E.EOF)})}parseDefinition(){if(this.peek(E.BRACE_L))return this.parseOperationDefinition();const i=this.peekDescription(),r=i?this._lexer.lookahead():this._lexer.token;if(r.kind===E.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(i)throw Ae(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const i=this._lexer.token;if(this.peek(E.BRACE_L))return this.node(i,{kind:b.OPERATION_DEFINITION,operation:$t.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let a;return this.peek(E.NAME)&&(a=this.parseName()),this.node(i,{kind:b.OPERATION_DEFINITION,operation:r,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const i=this.expectToken(E.NAME);switch(i.value){case"query":return $t.QUERY;case"mutation":return $t.MUTATION;case"subscription":return $t.SUBSCRIPTION}throw this.unexpected(i)}parseVariableDefinitions(){return this.optionalMany(E.PAREN_L,this.parseVariableDefinition,E.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:b.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(E.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(E.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const i=this._lexer.token;return this.expectToken(E.DOLLAR),this.node(i,{kind:b.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:b.SELECTION_SET,selections:this.many(E.BRACE_L,this.parseSelection,E.BRACE_R)})}parseSelection(){return this.peek(E.SPREAD)?this.parseFragment():this.parseField()}parseField(){const i=this._lexer.token,r=this.parseName();let a,u;return this.expectOptionalToken(E.COLON)?(a=r,u=this.parseName()):u=r,this.node(i,{kind:b.FIELD,alias:a,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(E.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(i){const r=i?this.parseConstArgument:this.parseArgument;return this.optionalMany(E.PAREN_L,r,E.PAREN_R)}parseArgument(i=!1){const r=this._lexer.token,a=this.parseName();return this.expectToken(E.COLON),this.node(r,{kind:b.ARGUMENT,name:a,value:this.parseValueLiteral(i)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const i=this._lexer.token;this.expectToken(E.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(E.NAME)?this.node(i,{kind:b.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(i,{kind:b.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const i=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(i,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(i,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(i){const r=this._lexer.token;switch(r.kind){case E.BRACKET_L:return this.parseList(i);case E.BRACE_L:return this.parseObject(i);case E.INT:return this.advanceLexer(),this.node(r,{kind:b.INT,value:r.value});case E.FLOAT:return this.advanceLexer(),this.node(r,{kind:b.FLOAT,value:r.value});case E.STRING:case E.BLOCK_STRING:return this.parseStringLiteral();case E.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:b.BOOLEAN,value:!0});case"false":return this.node(r,{kind:b.BOOLEAN,value:!1});case"null":return this.node(r,{kind:b.NULL});default:return this.node(r,{kind:b.ENUM,value:r.value})}case E.DOLLAR:if(i)if(this.expectToken(E.DOLLAR),this._lexer.token.kind===E.NAME){const a=this._lexer.token.value;throw Ae(this._lexer.source,r.start,`Unexpected variable "$${a}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const i=this._lexer.token;return this.advanceLexer(),this.node(i,{kind:b.STRING,value:i.value,block:i.kind===E.BLOCK_STRING})}parseList(i){const r=()=>this.parseValueLiteral(i);return this.node(this._lexer.token,{kind:b.LIST,values:this.any(E.BRACKET_L,r,E.BRACKET_R)})}parseObject(i){const r=()=>this.parseObjectField(i);return this.node(this._lexer.token,{kind:b.OBJECT,fields:this.any(E.BRACE_L,r,E.BRACE_R)})}parseObjectField(i){const r=this._lexer.token,a=this.parseName();return this.expectToken(E.COLON),this.node(r,{kind:b.OBJECT_FIELD,name:a,value:this.parseValueLiteral(i)})}parseDirectives(i){const r=[];for(;this.peek(E.AT);)r.push(this.parseDirective(i));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(i){const r=this._lexer.token;return this.expectToken(E.AT),this.node(r,{kind:b.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(i)})}parseTypeReference(){const i=this._lexer.token;let r;if(this.expectOptionalToken(E.BRACKET_L)){const a=this.parseTypeReference();this.expectToken(E.BRACKET_R),r=this.node(i,{kind:b.LIST_TYPE,type:a})}else r=this.parseNamedType();return this.expectOptionalToken(E.BANG)?this.node(i,{kind:b.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:b.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(E.STRING)||this.peek(E.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const a=this.parseConstDirectives(),u=this.many(E.BRACE_L,this.parseOperationTypeDefinition,E.BRACE_R);return this.node(i,{kind:b.SCHEMA_DEFINITION,description:r,directives:a,operationTypes:u})}parseOperationTypeDefinition(){const i=this._lexer.token,r=this.parseOperationType();this.expectToken(E.COLON);const a=this.parseNamedType();return this.node(i,{kind:b.OPERATION_TYPE_DEFINITION,operation:r,type:a})}parseScalarTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const a=this.parseName(),u=this.parseConstDirectives();return this.node(i,{kind:b.SCALAR_TYPE_DEFINITION,description:r,name:a,directives:u})}parseObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),v=this.parseFieldsDefinition();return this.node(i,{kind:b.OBJECT_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:v})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(E.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(E.BRACE_L,this.parseFieldDefinition,E.BRACE_R)}parseFieldDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName(),u=this.parseArgumentDefs();this.expectToken(E.COLON);const p=this.parseTypeReference(),v=this.parseConstDirectives();return this.node(i,{kind:b.FIELD_DEFINITION,description:r,name:a,arguments:u,type:p,directives:v})}parseArgumentDefs(){return this.optionalMany(E.PAREN_L,this.parseInputValueDef,E.PAREN_R)}parseInputValueDef(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName();this.expectToken(E.COLON);const u=this.parseTypeReference();let p;this.expectOptionalToken(E.EQUALS)&&(p=this.parseConstValueLiteral());const v=this.parseConstDirectives();return this.node(i,{kind:b.INPUT_VALUE_DEFINITION,description:r,name:a,type:u,defaultValue:p,directives:v})}parseInterfaceTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),v=this.parseFieldsDefinition();return this.node(i,{kind:b.INTERFACE_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:v})}parseUnionTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseUnionMemberTypes();return this.node(i,{kind:b.UNION_TYPE_DEFINITION,description:r,name:a,directives:u,types:p})}parseUnionMemberTypes(){return this.expectOptionalToken(E.EQUALS)?this.delimitedMany(E.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseEnumValuesDefinition();return this.node(i,{kind:b.ENUM_TYPE_DEFINITION,description:r,name:a,directives:u,values:p})}parseEnumValuesDefinition(){return this.optionalMany(E.BRACE_L,this.parseEnumValueDefinition,E.BRACE_R)}parseEnumValueDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(i,{kind:b.ENUM_VALUE_DEFINITION,description:r,name:a,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ae(this._lexer.source,this._lexer.token.start,`${gi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseInputFieldsDefinition();return this.node(i,{kind:b.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:a,directives:u,fields:p})}parseInputFieldsDefinition(){return this.optionalMany(E.BRACE_L,this.parseInputValueDef,E.BRACE_R)}parseTypeSystemExtension(){const i=this._lexer.lookahead();if(i.kind===E.NAME)switch(i.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(i)}parseSchemaExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),a=this.optionalMany(E.BRACE_L,this.parseOperationTypeDefinition,E.BRACE_R);if(r.length===0&&a.length===0)throw this.unexpected();return this.node(i,{kind:b.SCHEMA_EXTENSION,directives:r,operationTypes:a})}parseScalarTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),a=this.parseConstDirectives();if(a.length===0)throw this.unexpected();return this.node(i,{kind:b.SCALAR_TYPE_EXTENSION,name:r,directives:a})}parseObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:b.OBJECT_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseInterfaceTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:b.INTERFACE_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseUnionTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.UNION_TYPE_EXTENSION,name:r,directives:a,types:u})}parseEnumTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.ENUM_TYPE_EXTENSION,name:r,directives:a,values:u})}parseInputObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:a,fields:u})}parseDirectiveDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(E.AT);const a=this.parseName(),u=this.parseArgumentDefs(),p=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const v=this.parseDirectiveLocations();return this.node(i,{kind:b.DIRECTIVE_DEFINITION,description:r,name:a,arguments:u,repeatable:p,locations:v})}parseDirectiveLocations(){return this.delimitedMany(E.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const i=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(X,r.value))return r;throw this.unexpected(i)}node(i,r){return this._options.noLocation!==!0&&(r.loc=new wv(i,this._lexer.lastToken,this._lexer.source)),r}peek(i){return this._lexer.token.kind===i}expectToken(i){const r=this._lexer.token;if(r.kind===i)return this.advanceLexer(),r;throw Ae(this._lexer.source,r.start,`Expected ${vc(i)}, found ${gi(r)}.`)}expectOptionalToken(i){return this._lexer.token.kind===i?(this.advanceLexer(),!0):!1}expectKeyword(i){const r=this._lexer.token;if(r.kind===E.NAME&&r.value===i)this.advanceLexer();else throw Ae(this._lexer.source,r.start,`Expected "${i}", found ${gi(r)}.`)}expectOptionalKeyword(i){const r=this._lexer.token;return r.kind===E.NAME&&r.value===i?(this.advanceLexer(),!0):!1}unexpected(i){const r=i??this._lexer.token;return Ae(this._lexer.source,r.start,`Unexpected ${gi(r)}.`)}any(i,r,a){this.expectToken(i);const u=[];for(;!this.expectOptionalToken(a);)u.push(r.call(this));return u}optionalMany(i,r,a){if(this.expectOptionalToken(i)){const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}return[]}many(i,r,a){this.expectToken(i);const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}delimitedMany(i,r){this.expectOptionalToken(i);const a=[];do a.push(r.call(this));while(this.expectOptionalToken(i));return a}advanceLexer(){const{maxTokens:i}=this._options,r=this._lexer.advance();if(i!==void 0&&r.kind!==E.EOF&&(++this._tokenCounter,this._tokenCounter>i))throw Ae(this._lexer.source,r.start,`Document contains more that ${i} tokens. Parsing aborted.`)}}function gi(n){const i=n.value;return vc(n.kind)+(i!=null?` "${i}"`:"")}function vc(n){return Sv(n)?`"${n}"`:n}const Qv=5;function zv(n,i){const[r,a]=i?[n,i]:[void 0,n];let u=" Did you mean ";r&&(u+=r+" ");const p=a.map(N=>`"${N}"`);switch(p.length){case 0:return"";case 1:return u+p[0]+"?";case 2:return u+p[0]+" or "+p[1]+"?"}const v=p.slice(0,Qv),I=v.pop();return u+v.join(", ")+", or "+I+"?"}function nc(n){return n}function yc(n,i){const r=Object.create(null);for(const a of n)r[i(a)]=a;return r}function dn(n,i,r){const a=Object.create(null);for(const u of n)a[i(u)]=r(u);return a}function bi(n,i){const r=Object.create(null);for(const a of Object.keys(n))r[a]=i(n[a],a);return r}function Yv(n,i){let r=0,a=0;for(;r<n.length&&a<i.length;){let u=n.charCodeAt(r),p=i.charCodeAt(a);if(mi(u)&&mi(p)){let v=0;do++r,v=v*10+u-so,u=n.charCodeAt(r);while(mi(u)&&v>0);let I=0;do++a,I=I*10+p-so,p=i.charCodeAt(a);while(mi(p)&&I>0);if(v<I)return-1;if(v>I)return 1}else{if(u<p)return-1;if(u>p)return 1;++r,++a}}return n.length-i.length}const so=48,Hv=57;function mi(n){return!isNaN(n)&&so<=n&&n<=Hv}function Kv(n,i){const r=Object.create(null),a=new Xv(n),u=Math.floor(n.length*.4)+1;for(const p of i){const v=a.measure(p,u);v!==void 0&&(r[p]=v)}return Object.keys(r).sort((p,v)=>{const I=r[p]-r[v];return I!==0?I:Yv(p,v)})}class Xv{constructor(i){this._input=i,this._inputLowerCase=i.toLowerCase(),this._inputArray=rc(this._inputLowerCase),this._rows=[new Array(i.length+1).fill(0),new Array(i.length+1).fill(0),new Array(i.length+1).fill(0)]}measure(i,r){if(this._input===i)return 0;const a=i.toLowerCase();if(this._inputLowerCase===a)return 1;let u=rc(a),p=this._inputArray;if(u.length<p.length){const O=u;u=p,p=O}const v=u.length,I=p.length;if(v-I>r)return;const N=this._rows;for(let O=0;O<=I;O++)N[0][O]=O;for(let O=1;O<=v;O++){const M=N[(O-1)%3],Z=N[O%3];let ce=Z[0]=O;for(let W=1;W<=I;W++){const Te=u[O-1]===p[W-1]?0:1;let fe=Math.min(M[W]+1,Z[W-1]+1,M[W-1]+Te);if(O>1&&W>1&&u[O-1]===p[W-2]&&u[O-2]===p[W-1]){const ve=N[(O-2)%3][W-2];fe=Math.min(fe,ve+1)}fe<ce&&(ce=fe),Z[W]=fe}if(ce>r)return}const R=N[v%3][I];return R<=r?R:void 0}}function rc(n){const i=n.length,r=new Array(i);for(let a=0;a<i;++a)r[a]=n.charCodeAt(a);return r}function ut(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const i=Object.create(null);for(const[r,a]of Object.entries(n))i[r]=a;return i}function Zv(n){return`"${n.replace(ey,ty)}"`}const ey=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ty(n){return ny[n.charCodeAt(0)]}const ny=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],ry=Object.freeze({});function iy(n,i,r=lc){const a=new Map;for(const ve of Object.values(b))a.set(ve,sy(i,ve));let u,p=Array.isArray(n),v=[n],I=-1,N=[],R=n,O,M;const Z=[],ce=[];do{I++;const ve=I===v.length,tn=ve&&N.length!==0;if(ve){if(O=ce.length===0?void 0:Z[Z.length-1],R=M,M=ce.pop(),tn)if(p){R=R.slice();let Ne=0;for(const[Re,Qe]of N){const Ue=Re-Ne;Qe===null?(R.splice(Ue,1),Ne++):R[Ue]=Qe}}else{R=Object.defineProperties({},Object.getOwnPropertyDescriptors(R));for(const[Ne,Re]of N)R[Ne]=Re}I=u.index,v=u.keys,N=u.edits,p=u.inArray,u=u.prev}else if(M){if(O=p?I:v[I],R=M[O],R==null)continue;Z.push(O)}let ye;if(!Array.isArray(R)){var W,Te;ec(R)||te(!1,`Invalid AST Node: ${P(R)}.`);const Ne=ve?(W=a.get(R.kind))===null||W===void 0?void 0:W.leave:(Te=a.get(R.kind))===null||Te===void 0?void 0:Te.enter;if(ye=Ne?.call(i,R,O,M,Z,ce),ye===ry)break;if(ye===!1){if(!ve){Z.pop();continue}}else if(ye!==void 0&&(N.push([O,ye]),!ve))if(ec(ye))R=ye;else{Z.pop();continue}}if(ye===void 0&&tn&&N.push([O,R]),ve)Z.pop();else{var fe;u={inArray:p,index:I,keys:v,edits:N,prev:u},p=Array.isArray(R),v=p?R:(fe=r[R.kind])!==null&&fe!==void 0?fe:[],I=-1,N=[],M&&ce.push(M),M=R}}while(u!==void 0);return N.length!==0?N[N.length-1][1]:n}function sy(n,i){const r=n[i];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:n.enter,leave:n.leave}}function ot(n){return iy(n,ay)}const oy=80,ay={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>C(n.definitions,`
|
|
79
128
|
|
|
80
|
-
`)},OperationDefinition:{leave(n){const i=
|
|
81
|
-
`,
|
|
129
|
+
`)},OperationDefinition:{leave(n){const i=Y("(",C(n.variableDefinitions,", "),")"),r=C([n.operation,C([n.name,i]),C(n.directives," ")]," ");return(r==="query"?"":r+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:i,defaultValue:r,directives:a})=>n+": "+i+Y(" = ",r)+Y(" ",C(a," "))},SelectionSet:{leave:({selections:n})=>gt(n)},Field:{leave({alias:n,name:i,arguments:r,directives:a,selectionSet:u}){const p=Y("",n,": ")+i;let v=p+Y("(",C(r,", "),")");return v.length>oy&&(v=p+Y(`(
|
|
130
|
+
`,yi(C(r,`
|
|
82
131
|
`)),`
|
|
83
|
-
)`)),
|
|
84
|
-
`)+
|
|
85
|
-
`)+
|
|
86
|
-
`)+
|
|
87
|
-
`)+i+(
|
|
88
|
-
`,
|
|
132
|
+
)`)),C([v,C(a," "),u]," ")}},Argument:{leave:({name:n,value:i})=>n+": "+i},FragmentSpread:{leave:({name:n,directives:i})=>"..."+n+Y(" ",C(i," "))},InlineFragment:{leave:({typeCondition:n,directives:i,selectionSet:r})=>C(["...",Y("on ",n),C(i," "),r]," ")},FragmentDefinition:{leave:({name:n,typeCondition:i,variableDefinitions:r,directives:a,selectionSet:u})=>`fragment ${n}${Y("(",C(r,", "),")")} on ${i} ${Y("",C(a," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:i})=>i?Nv(n):Zv(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+C(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+C(n,", ")+"}"},ObjectField:{leave:({name:n,value:i})=>n+": "+i},Directive:{leave:({name:n,arguments:i})=>"@"+n+Y("(",C(i,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:i,operationTypes:r})=>Y("",n,`
|
|
133
|
+
`)+C(["schema",C(i," "),gt(r)]," ")},OperationTypeDefinition:{leave:({operation:n,type:i})=>n+": "+i},ScalarTypeDefinition:{leave:({description:n,name:i,directives:r})=>Y("",n,`
|
|
134
|
+
`)+C(["scalar",i,C(r," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:i,interfaces:r,directives:a,fields:u})=>Y("",n,`
|
|
135
|
+
`)+C(["type",i,Y("implements ",C(r," & ")),C(a," "),gt(u)]," ")},FieldDefinition:{leave:({description:n,name:i,arguments:r,type:a,directives:u})=>Y("",n,`
|
|
136
|
+
`)+i+(ic(r)?Y(`(
|
|
137
|
+
`,yi(C(r,`
|
|
89
138
|
`)),`
|
|
90
|
-
)`):
|
|
91
|
-
`)+
|
|
92
|
-
`)+
|
|
93
|
-
`)+
|
|
94
|
-
`)+
|
|
95
|
-
`)+
|
|
96
|
-
`)+
|
|
97
|
-
`)+"directive @"+i+(
|
|
98
|
-
`,
|
|
139
|
+
)`):Y("(",C(r,", "),")"))+": "+a+Y(" ",C(u," "))},InputValueDefinition:{leave:({description:n,name:i,type:r,defaultValue:a,directives:u})=>Y("",n,`
|
|
140
|
+
`)+C([i+": "+r,Y("= ",a),C(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:i,interfaces:r,directives:a,fields:u})=>Y("",n,`
|
|
141
|
+
`)+C(["interface",i,Y("implements ",C(r," & ")),C(a," "),gt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:i,directives:r,types:a})=>Y("",n,`
|
|
142
|
+
`)+C(["union",i,C(r," "),Y("= ",C(a," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:i,directives:r,values:a})=>Y("",n,`
|
|
143
|
+
`)+C(["enum",i,C(r," "),gt(a)]," ")},EnumValueDefinition:{leave:({description:n,name:i,directives:r})=>Y("",n,`
|
|
144
|
+
`)+C([i,C(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:i,directives:r,fields:a})=>Y("",n,`
|
|
145
|
+
`)+C(["input",i,C(r," "),gt(a)]," ")},DirectiveDefinition:{leave:({description:n,name:i,arguments:r,repeatable:a,locations:u})=>Y("",n,`
|
|
146
|
+
`)+"directive @"+i+(ic(r)?Y(`(
|
|
147
|
+
`,yi(C(r,`
|
|
99
148
|
`)),`
|
|
100
|
-
)`):
|
|
101
|
-
`,
|
|
149
|
+
)`):Y("(",C(r,", "),")"))+(a?" repeatable":"")+" on "+C(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:i})=>C(["extend schema",C(n," "),gt(i)]," ")},ScalarTypeExtension:{leave:({name:n,directives:i})=>C(["extend scalar",n,C(i," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:i,directives:r,fields:a})=>C(["extend type",n,Y("implements ",C(i," & ")),C(r," "),gt(a)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:i,directives:r,fields:a})=>C(["extend interface",n,Y("implements ",C(i," & ")),C(r," "),gt(a)]," ")},UnionTypeExtension:{leave:({name:n,directives:i,types:r})=>C(["extend union",n,C(i," "),Y("= ",C(r," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:i,values:r})=>C(["extend enum",n,C(i," "),gt(r)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:i,fields:r})=>C(["extend input",n,C(i," "),gt(r)]," ")}};function C(n,i=""){var r;return(r=n?.filter(a=>a).join(i))!==null&&r!==void 0?r:""}function gt(n){return Y(`{
|
|
150
|
+
`,yi(C(n,`
|
|
102
151
|
`)),`
|
|
103
|
-
}`)}function
|
|
104
|
-
`))}function
|
|
105
|
-
`)))!==null&&i!==void 0?i:!1}function oo(n,i){switch(n.kind){case S.NULL:return null;case S.INT:return parseInt(n.value,10);case S.FLOAT:return parseFloat(n.value);case S.STRING:case S.ENUM:case S.BOOLEAN:return n.value;case S.LIST:return n.values.map(r=>oo(r,i));case S.OBJECT:return hn(n.fields,r=>r.name.value,r=>oo(r.value,i));case S.VARIABLE:return i?.[n.name.value]}}function vt(n){if(n!=null||ne(!1,"Must provide name."),typeof n=="string"||ne(!1,"Expected name to be a string."),n.length===0)throw new ie("Expected name to be a non-empty string.");for(let i=1;i<n.length;++i)if(!pc(n.charCodeAt(i)))throw new ie(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!lo(n.charCodeAt(0)))throw new ie(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function Zy(n){if(n==="true"||n==="false"||n==="null")throw new ie(`Enum values cannot be named: ${n}`);return vt(n)}function _c(n){return Bn(n)||Pt(n)||st(n)||Ht(n)||Kt(n)||Xt(n)||_r(n)||Yt(n)}function Bn(n){return It(n,yn)}function Pt(n){return It(n,Zt)}function ev(n){if(!Pt(n))throw new Error(`Expected ${M(n)} to be a GraphQL Object type.`);return n}function st(n){return It(n,Cc)}function tv(n){if(!st(n))throw new Error(`Expected ${M(n)} to be a GraphQL Interface type.`);return n}function Ht(n){return It(n,Rc)}function Kt(n){return It(n,bi)}function Xt(n){return It(n,Dc)}function _r(n){return It(n,it)}function Yt(n){return It(n,Z)}function Tc(n){return Bn(n)||Kt(n)||Xt(n)||fo(n)&&Tc(n.ofType)}function wc(n){return Bn(n)||Pt(n)||st(n)||Ht(n)||Kt(n)||fo(n)&&wc(n.ofType)}function Ec(n){return Bn(n)||Kt(n)}function nv(n){return st(n)||Ht(n)}class it{constructor(i){_c(i)||ne(!1,`Expected ${M(i)} to be a GraphQL type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class Z{constructor(i){xc(i)||ne(!1,`Expected ${M(i)} to be a GraphQL nullable type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function fo(n){return _r(n)||Yt(n)}function xc(n){return _c(n)&&!Yt(n)}function rv(n){if(!xc(n))throw new Error(`Expected ${M(n)} to be a GraphQL nullable type.`);return n}function iv(n){if(n){let i=n;for(;fo(i);)i=i.ofType;return i}}function Ac(n){return typeof n=="function"?n():n}function Ic(n){return typeof n=="function"?n():n}class yn{constructor(i){var r,a,u,p;const y=(r=i.parseValue)!==null&&r!==void 0?r:ec;this.name=vt(i.name),this.description=i.description,this.specifiedByURL=i.specifiedByURL,this.serialize=(a=i.serialize)!==null&&a!==void 0?a:ec,this.parseValue=y,this.parseLiteral=(u=i.parseLiteral)!==null&&u!==void 0?u:(_,N)=>y(oo(_,N)),this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(p=i.extensionASTNodes)!==null&&p!==void 0?p:[],i.specifiedByURL==null||typeof i.specifiedByURL=="string"||ne(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${M(i.specifiedByURL)}.`),i.serialize==null||typeof i.serialize=="function"||ne(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),i.parseLiteral&&(typeof i.parseValue=="function"&&typeof i.parseLiteral=="function"||ne(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Zt{constructor(i){var r;this.name=vt(i.name),this.description=i.description,this.isTypeOf=i.isTypeOf,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>Sc(i),this._interfaces=()=>Nc(i),i.isTypeOf==null||typeof i.isTypeOf=="function"||ne(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${M(i.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Nc(n){var i;const r=Ac((i=n.interfaces)!==null&&i!==void 0?i:[]);return Array.isArray(r)||ne(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),r}function Sc(n){const i=Ic(n.fields);return Mn(i)||ne(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),Si(i,(r,a)=>{var u;Mn(r)||ne(!1,`${n.name}.${a} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||ne(!1,`${n.name}.${a} field resolver must be a function if provided, but got: ${M(r.resolve)}.`);const p=(u=r.args)!==null&&u!==void 0?u:{};return Mn(p)||ne(!1,`${n.name}.${a} args must be an object with argument names as keys.`),{name:vt(a),description:r.description,type:r.type,args:bc(p),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:ct(r.extensions),astNode:r.astNode}})}function bc(n){return Object.entries(n).map(([i,r])=>({name:vt(i),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ct(r.extensions),astNode:r.astNode}))}function Mn(n){return Mt(n)&&!Array.isArray(n)}function Oc(n){return Si(n,i=>({description:i.description,type:i.type,args:Lc(i.args),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}function Lc(n){return hn(n,i=>i.name,i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}class Cc{constructor(i){var r;this.name=vt(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=Sc.bind(void 0,i),this._interfaces=Nc.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||ne(!1,`${this.name} must provide "resolveType" as a function, but got: ${M(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Rc{constructor(i){var r;this.name=vt(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=sv.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||ne(!1,`${this.name} must provide "resolveType" as a function, but got: ${M(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function sv(n){const i=Ac(n.types);return Array.isArray(i)||ne(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),i}class bi{constructor(i){var r;this.name=vt(i.name),this.description=i.description,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=ov(this.name,i.values),this._valueLookup=new Map(this._values.map(a=>[a.value,a])),this._nameLookup=vc(this._values,a=>a.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(i){return this._nameLookup[i]}serialize(i){const r=this._valueLookup.get(i);if(r===void 0)throw new ie(`Enum "${this.name}" cannot represent value: ${M(i)}`);return r.name}parseValue(i){if(typeof i!="string"){const a=M(i);throw new ie(`Enum "${this.name}" cannot represent non-string value: ${a}.`+yi(this,a))}const r=this.getValue(i);if(r==null)throw new ie(`Value "${i}" does not exist in "${this.name}" enum.`+yi(this,i));return r.value}parseLiteral(i,r){if(i.kind!==S.ENUM){const u=at(i);throw new ie(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+yi(this,u),{nodes:i})}const a=this.getValue(i.value);if(a==null){const u=at(i);throw new ie(`Value "${u}" does not exist in "${this.name}" enum.`+yi(this,u),{nodes:i})}return a.value}toConfig(){const i=hn(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function yi(n,i){const r=n.getValues().map(u=>u.name),a=Wy(i,r);return $y("the enum value",a)}function ov(n,i){return Mn(i)||ne(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map(([r,a])=>(Mn(a)||ne(!1,`${n}.${r} must refer to an object with a "value" key representing an internal value but got: ${M(a)}.`),{name:Zy(r),description:a.description,value:a.value!==void 0?a.value:r,deprecationReason:a.deprecationReason,extensions:ct(a.extensions),astNode:a.astNode}))}class Dc{constructor(i){var r;this.name=vt(i.name),this.description=i.description,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=av.bind(void 0,i)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const i=Si(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function av(n){const i=Ic(n.fields);return Mn(i)||ne(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),Si(i,(r,a)=>(!("resolve"in r)||ne(!1,`${n.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:vt(a),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ct(r.extensions),astNode:r.astNode}))}const eo=2147483647,to=-2147483648,uv=new yn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isInteger(r))throw new ie(`Int cannot represent non-integer value: ${M(i)}`);if(r>eo||r<to)throw new ie("Int cannot represent non 32-bit signed integer value: "+M(i));return r},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new ie(`Int cannot represent non-integer value: ${M(n)}`);if(n>eo||n<to)throw new ie(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==S.INT)throw new ie(`Int cannot represent non-integer value: ${at(n)}`,{nodes:n});const i=parseInt(n.value,10);if(i>eo||i<to)throw new ie(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return i}}),cv=new yn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isFinite(r))throw new ie(`Float cannot represent non numeric value: ${M(i)}`);return r},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new ie(`Float cannot represent non numeric value: ${M(n)}`);return n},parseLiteral(n){if(n.kind!==S.FLOAT&&n.kind!==S.INT)throw new ie(`Float cannot represent non numeric value: ${at(n)}`,n);return parseFloat(n.value)}}),ye=new yn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(typeof i=="boolean")return i?"true":"false";if(typeof i=="number"&&Number.isFinite(i))return i.toString();throw new ie(`String cannot represent value: ${M(n)}`)},parseValue(n){if(typeof n!="string")throw new ie(`String cannot represent a non string value: ${M(n)}`);return n},parseLiteral(n){if(n.kind!==S.STRING)throw new ie(`String cannot represent a non string value: ${at(n)}`,{nodes:n});return n.value}}),ot=new yn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i;if(Number.isFinite(i))return i!==0;throw new ie(`Boolean cannot represent a non boolean value: ${M(i)}`)},parseValue(n){if(typeof n!="boolean")throw new ie(`Boolean cannot represent a non boolean value: ${M(n)}`);return n},parseLiteral(n){if(n.kind!==S.BOOLEAN)throw new ie(`Boolean cannot represent a non boolean value: ${at(n)}`,{nodes:n});return n.value}}),Fc=new yn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(Number.isInteger(i))return String(i);throw new ie(`ID cannot represent value: ${M(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new ie(`ID cannot represent value: ${M(n)}`)},parseLiteral(n){if(n.kind!==S.STRING&&n.kind!==S.INT)throw new ie("ID cannot represent a non-string and non-integer value: "+at(n),{nodes:n});return n.value}}),kc=Object.freeze([ye,uv,cv,ot,Fc]);function lv(n){return kc.some(({name:i})=>n.name===i)}function Tr(n){if(Mt(n)){if(typeof n.valueOf=="function"){const i=n.valueOf();if(!Mt(i))return i}if(typeof n.toJSON=="function")return n.toJSON()}return n}function fv(n){return It(n,Gn)}class Gn{constructor(i){var r,a;this.name=vt(i.name),this.description=i.description,this.locations=i.locations,this.isRepeatable=(r=i.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=ct(i.extensions),this.astNode=i.astNode,Array.isArray(i.locations)||ne(!1,`@${i.name} locations must be an Array.`);const u=(a=i.args)!==null&&a!==void 0?a:{};Mt(u)&&!Array.isArray(u)||ne(!1,`@${i.name} args must be an object with argument names as keys.`),this.args=bc(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Lc(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const pv=new Gn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[ee.FIELD,ee.FRAGMENT_SPREAD,ee.INLINE_FRAGMENT],args:{if:{type:new Z(ot),description:"Included when true."}}}),hv=new Gn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[ee.FIELD,ee.FRAGMENT_SPREAD,ee.INLINE_FRAGMENT],args:{if:{type:new Z(ot),description:"Skipped when true."}}}),Uc="No longer supported",dv=new Gn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[ee.FIELD_DEFINITION,ee.ARGUMENT_DEFINITION,ee.INPUT_FIELD_DEFINITION,ee.ENUM_VALUE],args:{reason:{type:ye,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Uc}}}),gv=new Gn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[ee.SCALAR],args:{url:{type:new Z(ye),description:"The URL that specifies the behavior of this scalar."}}}),Pc=Object.freeze([pv,hv,dv,gv]);function mv(n){return Pc.some(({name:i})=>i===n.name)}function yv(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function Un(n,i){if(Yt(i)){const r=Un(n,i.ofType);return r?.kind===S.NULL?null:r}if(n===null)return{kind:S.NULL};if(n===void 0)return null;if(_r(i)){const r=i.ofType;if(yv(n)){const a=[];for(const u of n){const p=Un(u,r);p!=null&&a.push(p)}return{kind:S.LIST,values:a}}return Un(n,r)}if(Xt(i)){if(!Mt(n))return null;const r=[];for(const a of Object.values(i.getFields())){const u=Un(n[a.name],a.type);u&&r.push({kind:S.OBJECT_FIELD,name:{kind:S.NAME,value:a.name},value:u})}return{kind:S.OBJECT,fields:r}}if(Ec(i)){const r=i.serialize(n);if(r==null)return null;if(typeof r=="boolean")return{kind:S.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){const a=String(r);return rc.test(a)?{kind:S.INT,value:a}:{kind:S.FLOAT,value:a}}if(typeof r=="string")return Kt(i)?{kind:S.ENUM,value:r}:i===Fc&&rc.test(r)?{kind:S.INT,value:r}:{kind:S.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${M(r)}.`)}vr(!1,"Unexpected input type: "+M(i))}const rc=/^-?(?:0|[1-9][0-9]*)$/,po=new Zt({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:ye,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new Z(new it(new Z(xt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Z(xt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:xt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:xt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Z(new it(new Z(Mc))),resolve:n=>n.getDirectives()}})}),Mc=new Zt({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
152
|
+
}`)}function Y(n,i,r=""){return i!=null&&i!==""?n+i+r:""}function yi(n){return Y(" ",n.replace(/\n/g,`
|
|
153
|
+
`))}function ic(n){var i;return(i=n?.some(r=>r.includes(`
|
|
154
|
+
`)))!==null&&i!==void 0?i:!1}function oo(n,i){switch(n.kind){case b.NULL:return null;case b.INT:return parseInt(n.value,10);case b.FLOAT:return parseFloat(n.value);case b.STRING:case b.ENUM:case b.BOOLEAN:return n.value;case b.LIST:return n.values.map(r=>oo(r,i));case b.OBJECT:return dn(n.fields,r=>r.name.value,r=>oo(r.value,i));case b.VARIABLE:return i?.[n.name.value]}}function _t(n){if(n!=null||te(!1,"Must provide name."),typeof n=="string"||te(!1,"Expected name to be a string."),n.length===0)throw new re("Expected name to be a non-empty string.");for(let i=1;i<n.length;++i)if(!pc(n.charCodeAt(i)))throw new re(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!co(n.charCodeAt(0)))throw new re(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function uy(n){if(n==="true"||n==="false"||n==="null")throw new re(`Enum values cannot be named: ${n}`);return _t(n)}function _c(n){return Bn(n)||Pt(n)||it(n)||Kt(n)||Xt(n)||Zt(n)||_r(n)||Ht(n)}function Bn(n){return Nt(n,mn)}function Pt(n){return Nt(n,en)}function cy(n){if(!Pt(n))throw new Error(`Expected ${P(n)} to be a GraphQL Object type.`);return n}function it(n){return Nt(n,Rc)}function ly(n){if(!it(n))throw new Error(`Expected ${P(n)} to be a GraphQL Interface type.`);return n}function Kt(n){return Nt(n,Cc)}function Xt(n){return Nt(n,Si)}function Zt(n){return Nt(n,Dc)}function _r(n){return Nt(n,rt)}function Ht(n){return Nt(n,K)}function Tc(n){return Bn(n)||Xt(n)||Zt(n)||lo(n)&&Tc(n.ofType)}function wc(n){return Bn(n)||Pt(n)||it(n)||Kt(n)||Xt(n)||lo(n)&&wc(n.ofType)}function Ec(n){return Bn(n)||Xt(n)}function fy(n){return it(n)||Kt(n)}class rt{constructor(i){_c(i)||te(!1,`Expected ${P(i)} to be a GraphQL type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class K{constructor(i){Ic(i)||te(!1,`Expected ${P(i)} to be a GraphQL nullable type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function lo(n){return _r(n)||Ht(n)}function Ic(n){return _c(n)&&!Ht(n)}function py(n){if(!Ic(n))throw new Error(`Expected ${P(n)} to be a GraphQL nullable type.`);return n}function hy(n){if(n){let i=n;for(;lo(i);)i=i.ofType;return i}}function xc(n){return typeof n=="function"?n():n}function Ac(n){return typeof n=="function"?n():n}class mn{constructor(i){var r,a,u,p;const v=(r=i.parseValue)!==null&&r!==void 0?r:nc;this.name=_t(i.name),this.description=i.description,this.specifiedByURL=i.specifiedByURL,this.serialize=(a=i.serialize)!==null&&a!==void 0?a:nc,this.parseValue=v,this.parseLiteral=(u=i.parseLiteral)!==null&&u!==void 0?u:(I,N)=>v(oo(I,N)),this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(p=i.extensionASTNodes)!==null&&p!==void 0?p:[],i.specifiedByURL==null||typeof i.specifiedByURL=="string"||te(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${P(i.specifiedByURL)}.`),i.serialize==null||typeof i.serialize=="function"||te(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),i.parseLiteral&&(typeof i.parseValue=="function"&&typeof i.parseLiteral=="function"||te(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class en{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.isTypeOf=i.isTypeOf,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>bc(i),this._interfaces=()=>Nc(i),i.isTypeOf==null||typeof i.isTypeOf=="function"||te(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${P(i.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Nc(n){var i;const r=xc((i=n.interfaces)!==null&&i!==void 0?i:[]);return Array.isArray(r)||te(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),r}function bc(n){const i=Ac(n.fields);return Pn(i)||te(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),bi(i,(r,a)=>{var u;Pn(r)||te(!1,`${n.name}.${a} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||te(!1,`${n.name}.${a} field resolver must be a function if provided, but got: ${P(r.resolve)}.`);const p=(u=r.args)!==null&&u!==void 0?u:{};return Pn(p)||te(!1,`${n.name}.${a} args must be an object with argument names as keys.`),{name:_t(a),description:r.description,type:r.type,args:Sc(p),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}})}function Sc(n){return Object.entries(n).map(([i,r])=>({name:_t(i),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}))}function Pn(n){return Mt(n)&&!Array.isArray(n)}function Oc(n){return bi(n,i=>({description:i.description,type:i.type,args:Lc(i.args),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}function Lc(n){return dn(n,i=>i.name,i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}class Rc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=bc.bind(void 0,i),this._interfaces=Nc.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||te(!1,`${this.name} must provide "resolveType" as a function, but got: ${P(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Cc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=dy.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||te(!1,`${this.name} must provide "resolveType" as a function, but got: ${P(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function dy(n){const i=xc(n.types);return Array.isArray(i)||te(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),i}class Si{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=gy(this.name,i.values),this._valueLookup=new Map(this._values.map(a=>[a.value,a])),this._nameLookup=yc(this._values,a=>a.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(i){return this._nameLookup[i]}serialize(i){const r=this._valueLookup.get(i);if(r===void 0)throw new re(`Enum "${this.name}" cannot represent value: ${P(i)}`);return r.name}parseValue(i){if(typeof i!="string"){const a=P(i);throw new re(`Enum "${this.name}" cannot represent non-string value: ${a}.`+vi(this,a))}const r=this.getValue(i);if(r==null)throw new re(`Value "${i}" does not exist in "${this.name}" enum.`+vi(this,i));return r.value}parseLiteral(i,r){if(i.kind!==b.ENUM){const u=ot(i);throw new re(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+vi(this,u),{nodes:i})}const a=this.getValue(i.value);if(a==null){const u=ot(i);throw new re(`Value "${u}" does not exist in "${this.name}" enum.`+vi(this,u),{nodes:i})}return a.value}toConfig(){const i=dn(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vi(n,i){const r=n.getValues().map(u=>u.name),a=Kv(i,r);return zv("the enum value",a)}function gy(n,i){return Pn(i)||te(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map(([r,a])=>(Pn(a)||te(!1,`${n}.${r} must refer to an object with a "value" key representing an internal value but got: ${P(a)}.`),{name:uy(r),description:a.description,value:a.value!==void 0?a.value:r,deprecationReason:a.deprecationReason,extensions:ut(a.extensions),astNode:a.astNode}))}class Dc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=my.bind(void 0,i)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const i=bi(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function my(n){const i=Ac(n.fields);return Pn(i)||te(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),bi(i,(r,a)=>(!("resolve"in r)||te(!1,`${n.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:_t(a),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}))}const to=2147483647,no=-2147483648,vy=new mn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isInteger(r))throw new re(`Int cannot represent non-integer value: ${P(i)}`);if(r>to||r<no)throw new re("Int cannot represent non 32-bit signed integer value: "+P(i));return r},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new re(`Int cannot represent non-integer value: ${P(n)}`);if(n>to||n<no)throw new re(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==b.INT)throw new re(`Int cannot represent non-integer value: ${ot(n)}`,{nodes:n});const i=parseInt(n.value,10);if(i>to||i<no)throw new re(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return i}}),yy=new mn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isFinite(r))throw new re(`Float cannot represent non numeric value: ${P(i)}`);return r},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new re(`Float cannot represent non numeric value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.FLOAT&&n.kind!==b.INT)throw new re(`Float cannot represent non numeric value: ${ot(n)}`,n);return parseFloat(n.value)}}),me=new mn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(typeof i=="boolean")return i?"true":"false";if(typeof i=="number"&&Number.isFinite(i))return i.toString();throw new re(`String cannot represent value: ${P(n)}`)},parseValue(n){if(typeof n!="string")throw new re(`String cannot represent a non string value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.STRING)throw new re(`String cannot represent a non string value: ${ot(n)}`,{nodes:n});return n.value}}),st=new mn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i;if(Number.isFinite(i))return i!==0;throw new re(`Boolean cannot represent a non boolean value: ${P(i)}`)},parseValue(n){if(typeof n!="boolean")throw new re(`Boolean cannot represent a non boolean value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.BOOLEAN)throw new re(`Boolean cannot represent a non boolean value: ${ot(n)}`,{nodes:n});return n.value}}),Fc=new mn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(Number.isInteger(i))return String(i);throw new re(`ID cannot represent value: ${P(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new re(`ID cannot represent value: ${P(n)}`)},parseLiteral(n){if(n.kind!==b.STRING&&n.kind!==b.INT)throw new re("ID cannot represent a non-string and non-integer value: "+ot(n),{nodes:n});return n.value}}),kc=Object.freeze([me,vy,yy,st,Fc]);function _y(n){return kc.some(({name:i})=>n.name===i)}function Tr(n){if(Mt(n)){if(typeof n.valueOf=="function"){const i=n.valueOf();if(!Mt(i))return i}if(typeof n.toJSON=="function")return n.toJSON()}return n}function Ty(n){return Nt(n,Gn)}class Gn{constructor(i){var r,a;this.name=_t(i.name),this.description=i.description,this.locations=i.locations,this.isRepeatable=(r=i.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=ut(i.extensions),this.astNode=i.astNode,Array.isArray(i.locations)||te(!1,`@${i.name} locations must be an Array.`);const u=(a=i.args)!==null&&a!==void 0?a:{};Mt(u)&&!Array.isArray(u)||te(!1,`@${i.name} args must be an object with argument names as keys.`),this.args=Sc(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Lc(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const wy=new Gn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[X.FIELD,X.FRAGMENT_SPREAD,X.INLINE_FRAGMENT],args:{if:{type:new K(st),description:"Included when true."}}}),Ey=new Gn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[X.FIELD,X.FRAGMENT_SPREAD,X.INLINE_FRAGMENT],args:{if:{type:new K(st),description:"Skipped when true."}}}),Uc="No longer supported",Iy=new Gn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[X.FIELD_DEFINITION,X.ARGUMENT_DEFINITION,X.INPUT_FIELD_DEFINITION,X.ENUM_VALUE],args:{reason:{type:me,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Uc}}}),xy=new Gn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[X.SCALAR],args:{url:{type:new K(me),description:"The URL that specifies the behavior of this scalar."}}}),$c=Object.freeze([wy,Ey,Iy,xy]);function Ay(n){return $c.some(({name:i})=>i===n.name)}function Ny(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function Un(n,i){if(Ht(i)){const r=Un(n,i.ofType);return r?.kind===b.NULL?null:r}if(n===null)return{kind:b.NULL};if(n===void 0)return null;if(_r(i)){const r=i.ofType;if(Ny(n)){const a=[];for(const u of n){const p=Un(u,r);p!=null&&a.push(p)}return{kind:b.LIST,values:a}}return Un(n,r)}if(Zt(i)){if(!Mt(n))return null;const r=[];for(const a of Object.values(i.getFields())){const u=Un(n[a.name],a.type);u&&r.push({kind:b.OBJECT_FIELD,name:{kind:b.NAME,value:a.name},value:u})}return{kind:b.OBJECT,fields:r}}if(Ec(i)){const r=i.serialize(n);if(r==null)return null;if(typeof r=="boolean")return{kind:b.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){const a=String(r);return sc.test(a)?{kind:b.INT,value:a}:{kind:b.FLOAT,value:a}}if(typeof r=="string")return Xt(i)?{kind:b.ENUM,value:r}:i===Fc&&sc.test(r)?{kind:b.INT,value:r}:{kind:b.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${P(r)}.`)}yr(!1,"Unexpected input type: "+P(i))}const sc=/^-?(?:0|[1-9][0-9]*)$/,fo=new en({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:me,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new K(new rt(new K(xt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new K(xt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:xt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:xt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new K(new rt(new K(Pc))),resolve:n=>n.getDirectives()}})}),Pc=new en({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
106
155
|
|
|
107
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new Z(ye),resolve:n=>n.name},description:{type:ye,resolve:n=>n.description},isRepeatable:{type:new Z(ot),resolve:n=>n.isRepeatable},locations:{type:new Z(new it(new Z($c))),resolve:n=>n.locations},args:{type:new Z(new it(new Z(Oi))),args:{includeDeprecated:{type:ot,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}}})}),$c=new bi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:ee.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:ee.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:ee.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:ee.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:ee.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:ee.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:ee.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:ee.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:ee.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:ee.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:ee.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:ee.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:ee.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:ee.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:ee.UNION,description:"Location adjacent to a union definition."},ENUM:{value:ee.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:ee.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:ee.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:ee.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),xt=new Zt({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Z(Wc),resolve(n){if(Bn(n))return ue.SCALAR;if(Pt(n))return ue.OBJECT;if(st(n))return ue.INTERFACE;if(Ht(n))return ue.UNION;if(Kt(n))return ue.ENUM;if(Xt(n))return ue.INPUT_OBJECT;if(_r(n))return ue.LIST;if(Yt(n))return ue.NON_NULL;vr(!1,`Unexpected type: "${M(n)}".`)}},name:{type:ye,resolve:n=>"name"in n?n.name:void 0},description:{type:ye,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:ye,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new it(new Z(Bc)),args:{includeDeprecated:{type:ot,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Pt(n)||st(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},interfaces:{type:new it(new Z(xt)),resolve(n){if(Pt(n)||st(n))return n.getInterfaces()}},possibleTypes:{type:new it(new Z(xt)),resolve(n,i,r,{schema:a}){if(nv(n))return a.getPossibleTypes(n)}},enumValues:{type:new it(new Z(Gc)),args:{includeDeprecated:{type:ot,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Kt(n)){const r=n.getValues();return i?r:r.filter(a=>a.deprecationReason==null)}}},inputFields:{type:new it(new Z(Oi)),args:{includeDeprecated:{type:ot,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Xt(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},ofType:{type:xt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),Bc=new Zt({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Z(ye),resolve:n=>n.name},description:{type:ye,resolve:n=>n.description},args:{type:new Z(new it(new Z(Oi))),args:{includeDeprecated:{type:ot,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}},type:{type:new Z(xt),resolve:n=>n.type},isDeprecated:{type:new Z(ot),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:ye,resolve:n=>n.deprecationReason}})}),Oi=new Zt({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Z(ye),resolve:n=>n.name},description:{type:ye,resolve:n=>n.description},type:{type:new Z(xt),resolve:n=>n.type},defaultValue:{type:ye,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:i,defaultValue:r}=n,a=Un(r,i);return a?at(a):null}},isDeprecated:{type:new Z(ot),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:ye,resolve:n=>n.deprecationReason}})}),Gc=new Zt({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Z(ye),resolve:n=>n.name},description:{type:ye,resolve:n=>n.description},isDeprecated:{type:new Z(ot),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:ye,resolve:n=>n.deprecationReason}})});var ue;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ue||(ue={}));const Wc=new bi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ue.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ue.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ue.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ue.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ue.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ue.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ue.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ue.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new Z(po);new Z(ye);new Z(ye);const Vc=Object.freeze([po,Mc,$c,xt,Bc,Oi,Gc,Wc]);function vv(n){return Vc.some(({name:i})=>n.name===i)}class _v{constructor(i){var r,a;this.__validationErrors=i.assumeValid===!0?[]:void 0,Mt(i)||ne(!1,"Must provide configuration object."),!i.types||Array.isArray(i.types)||ne(!1,`"types" must be Array if provided but got: ${M(i.types)}.`),!i.directives||Array.isArray(i.directives)||ne(!1,`"directives" must be Array if provided but got: ${M(i.directives)}.`),this.description=i.description,this.extensions=ct(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=i.query,this._mutationType=i.mutation,this._subscriptionType=i.subscription,this._directives=(a=i.directives)!==null&&a!==void 0?a:Pc;const u=new Set(i.types);if(i.types!=null)for(const p of i.types)u.delete(p),yt(p,u);this._queryType!=null&&yt(this._queryType,u),this._mutationType!=null&&yt(this._mutationType,u),this._subscriptionType!=null&&yt(this._subscriptionType,u);for(const p of this._directives)if(fv(p))for(const y of p.args)yt(y.type,u);yt(po,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const p of u){if(p==null)continue;const y=p.name;if(y||ne(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[y]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${y}".`);if(this._typeMap[y]=p,st(p)){for(const _ of p.getInterfaces())if(st(_)){let N=this._implementationsMap[_.name];N===void 0&&(N=this._implementationsMap[_.name]={objects:[],interfaces:[]}),N.interfaces.push(p)}}else if(Pt(p)){for(const _ of p.getInterfaces())if(st(_)){let N=this._implementationsMap[_.name];N===void 0&&(N=this._implementationsMap[_.name]={objects:[],interfaces:[]}),N.objects.push(p)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(i){switch(i){case Ut.QUERY:return this.getQueryType();case Ut.MUTATION:return this.getMutationType();case Ut.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(i){return this.getTypeMap()[i]}getPossibleTypes(i){return Ht(i)?i.getTypes():this.getImplementations(i).objects}getImplementations(i){const r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}}isSubType(i,r){let a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),Ht(i))for(const u of i.getTypes())a[u.name]=!0;else{const u=this.getImplementations(i);for(const p of u.objects)a[p.name]=!0;for(const p of u.interfaces)a[p.name]=!0}this._subTypeMap[i.name]=a}return a[r.name]!==void 0}getDirectives(){return this._directives}getDirective(i){return this.getDirectives().find(r=>r.name===i)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function yt(n,i){const r=iv(n);if(!i.has(r)){if(i.add(r),Ht(r))for(const a of r.getTypes())yt(a,i);else if(Pt(r)||st(r)){for(const a of r.getInterfaces())yt(a,i);for(const a of Object.values(r.getFields())){yt(a.type,i);for(const u of a.args)yt(u.type,i)}}else if(Xt(r))for(const a of Object.values(r.getFields()))yt(a.type,i)}return i}function dr(n,i,r){if(n){if(n.kind===S.VARIABLE){n.name.value;return}if(Yt(i))return n.kind===S.NULL?void 0:dr(n,i.ofType,r);if(n.kind===S.NULL)return null;if(_r(i)){const a=i.ofType;if(n.kind===S.LIST){const p=[];for(const y of n.values)if(ic(y,r)){if(Yt(a))return;p.push(null)}else{const _=dr(y,a,r);if(_===void 0)return;p.push(_)}return p}const u=dr(n,a,r);return u===void 0?void 0:[u]}if(Xt(i)){if(n.kind!==S.OBJECT)return;const a=Object.create(null),u=vc(n.fields,p=>p.name.value);for(const p of Object.values(i.getFields())){const y=u[p.name];if(!y||ic(y.value,r)){if(p.defaultValue!==void 0)a[p.name]=p.defaultValue;else if(Yt(p.type))return;continue}const _=dr(y.value,p.type,r);if(_===void 0)return;a[p.name]=_}return a}if(Ec(i)){let a;try{a=i.parseLiteral(n,r)}catch{return}return a===void 0?void 0:a}vr(!1,"Unexpected input type: "+M(i))}}function ic(n,i){return n.kind===S.VARIABLE&&i==null}function Tv(n){const i={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},r=i.descriptions?"description":"",a=i.specifiedByUrl?"specifiedByURL":"",u=i.directiveIsRepeatable?"isRepeatable":"",p=i.schemaDescription?r:"";function y(_){return i.inputValueDeprecation?_:""}return`
|
|
156
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},isRepeatable:{type:new K(st),resolve:n=>n.isRepeatable},locations:{type:new K(new rt(new K(Mc))),resolve:n=>n.locations},args:{type:new K(new rt(new K(Oi))),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}}})}),Mc=new Si({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:X.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:X.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:X.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:X.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:X.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:X.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:X.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:X.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:X.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:X.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:X.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:X.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:X.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:X.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:X.UNION,description:"Location adjacent to a union definition."},ENUM:{value:X.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:X.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:X.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:X.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),xt=new en({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new K(Vc),resolve(n){if(Bn(n))return oe.SCALAR;if(Pt(n))return oe.OBJECT;if(it(n))return oe.INTERFACE;if(Kt(n))return oe.UNION;if(Xt(n))return oe.ENUM;if(Zt(n))return oe.INPUT_OBJECT;if(_r(n))return oe.LIST;if(Ht(n))return oe.NON_NULL;yr(!1,`Unexpected type: "${P(n)}".`)}},name:{type:me,resolve:n=>"name"in n?n.name:void 0},description:{type:me,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:me,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new rt(new K(Bc)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Pt(n)||it(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},interfaces:{type:new rt(new K(xt)),resolve(n){if(Pt(n)||it(n))return n.getInterfaces()}},possibleTypes:{type:new rt(new K(xt)),resolve(n,i,r,{schema:a}){if(fy(n))return a.getPossibleTypes(n)}},enumValues:{type:new rt(new K(Gc)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Xt(n)){const r=n.getValues();return i?r:r.filter(a=>a.deprecationReason==null)}}},inputFields:{type:new rt(new K(Oi)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Zt(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},ofType:{type:xt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),Bc=new en({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},args:{type:new K(new rt(new K(Oi))),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}},type:{type:new K(xt),resolve:n=>n.type},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})}),Oi=new en({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},type:{type:new K(xt),resolve:n=>n.type},defaultValue:{type:me,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:i,defaultValue:r}=n,a=Un(r,i);return a?ot(a):null}},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})}),Gc=new en({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})});var oe;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(oe||(oe={}));const Vc=new Si({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:oe.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:oe.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:oe.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:oe.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:oe.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:oe.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:oe.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:oe.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new K(fo);new K(me);new K(me);const Wc=Object.freeze([fo,Pc,Mc,xt,Bc,Oi,Gc,Vc]);function by(n){return Wc.some(({name:i})=>n.name===i)}class Sy{constructor(i){var r,a;this.__validationErrors=i.assumeValid===!0?[]:void 0,Mt(i)||te(!1,"Must provide configuration object."),!i.types||Array.isArray(i.types)||te(!1,`"types" must be Array if provided but got: ${P(i.types)}.`),!i.directives||Array.isArray(i.directives)||te(!1,`"directives" must be Array if provided but got: ${P(i.directives)}.`),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=i.query,this._mutationType=i.mutation,this._subscriptionType=i.subscription,this._directives=(a=i.directives)!==null&&a!==void 0?a:$c;const u=new Set(i.types);if(i.types!=null)for(const p of i.types)u.delete(p),mt(p,u);this._queryType!=null&&mt(this._queryType,u),this._mutationType!=null&&mt(this._mutationType,u),this._subscriptionType!=null&&mt(this._subscriptionType,u);for(const p of this._directives)if(Ty(p))for(const v of p.args)mt(v.type,u);mt(fo,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const p of u){if(p==null)continue;const v=p.name;if(v||te(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[v]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${v}".`);if(this._typeMap[v]=p,it(p)){for(const I of p.getInterfaces())if(it(I)){let N=this._implementationsMap[I.name];N===void 0&&(N=this._implementationsMap[I.name]={objects:[],interfaces:[]}),N.interfaces.push(p)}}else if(Pt(p)){for(const I of p.getInterfaces())if(it(I)){let N=this._implementationsMap[I.name];N===void 0&&(N=this._implementationsMap[I.name]={objects:[],interfaces:[]}),N.objects.push(p)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(i){switch(i){case $t.QUERY:return this.getQueryType();case $t.MUTATION:return this.getMutationType();case $t.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(i){return this.getTypeMap()[i]}getPossibleTypes(i){return Kt(i)?i.getTypes():this.getImplementations(i).objects}getImplementations(i){const r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}}isSubType(i,r){let a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),Kt(i))for(const u of i.getTypes())a[u.name]=!0;else{const u=this.getImplementations(i);for(const p of u.objects)a[p.name]=!0;for(const p of u.interfaces)a[p.name]=!0}this._subTypeMap[i.name]=a}return a[r.name]!==void 0}getDirectives(){return this._directives}getDirective(i){return this.getDirectives().find(r=>r.name===i)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function mt(n,i){const r=hy(n);if(!i.has(r)){if(i.add(r),Kt(r))for(const a of r.getTypes())mt(a,i);else if(Pt(r)||it(r)){for(const a of r.getInterfaces())mt(a,i);for(const a of Object.values(r.getFields())){mt(a.type,i);for(const u of a.args)mt(u.type,i)}}else if(Zt(r))for(const a of Object.values(r.getFields()))mt(a.type,i)}return i}function dr(n,i,r){if(n){if(n.kind===b.VARIABLE){n.name.value;return}if(Ht(i))return n.kind===b.NULL?void 0:dr(n,i.ofType,r);if(n.kind===b.NULL)return null;if(_r(i)){const a=i.ofType;if(n.kind===b.LIST){const p=[];for(const v of n.values)if(oc(v,r)){if(Ht(a))return;p.push(null)}else{const I=dr(v,a,r);if(I===void 0)return;p.push(I)}return p}const u=dr(n,a,r);return u===void 0?void 0:[u]}if(Zt(i)){if(n.kind!==b.OBJECT)return;const a=Object.create(null),u=yc(n.fields,p=>p.name.value);for(const p of Object.values(i.getFields())){const v=u[p.name];if(!v||oc(v.value,r)){if(p.defaultValue!==void 0)a[p.name]=p.defaultValue;else if(Ht(p.type))return;continue}const I=dr(v.value,p.type,r);if(I===void 0)return;a[p.name]=I}return a}if(Ec(i)){let a;try{a=i.parseLiteral(n,r)}catch{return}return a===void 0?void 0:a}yr(!1,"Unexpected input type: "+P(i))}}function oc(n,i){return n.kind===b.VARIABLE&&i==null}function Oy(n){const i={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},r=i.descriptions?"description":"",a=i.specifiedByUrl?"specifiedByURL":"",u=i.directiveIsRepeatable?"isRepeatable":"",p=i.schemaDescription?r:"";function v(I){return i.inputValueDeprecation?I:""}return`
|
|
108
157
|
query IntrospectionQuery {
|
|
109
158
|
__schema {
|
|
110
159
|
${p}
|
|
@@ -119,7 +168,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
119
168
|
${r}
|
|
120
169
|
${u}
|
|
121
170
|
locations
|
|
122
|
-
args${
|
|
171
|
+
args${v("(includeDeprecated: true)")} {
|
|
123
172
|
...InputValue
|
|
124
173
|
}
|
|
125
174
|
}
|
|
@@ -134,7 +183,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
134
183
|
fields(includeDeprecated: true) {
|
|
135
184
|
name
|
|
136
185
|
${r}
|
|
137
|
-
args${
|
|
186
|
+
args${v("(includeDeprecated: true)")} {
|
|
138
187
|
...InputValue
|
|
139
188
|
}
|
|
140
189
|
type {
|
|
@@ -143,7 +192,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
143
192
|
isDeprecated
|
|
144
193
|
deprecationReason
|
|
145
194
|
}
|
|
146
|
-
inputFields${
|
|
195
|
+
inputFields${v("(includeDeprecated: true)")} {
|
|
147
196
|
...InputValue
|
|
148
197
|
}
|
|
149
198
|
interfaces {
|
|
@@ -165,8 +214,8 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
165
214
|
${r}
|
|
166
215
|
type { ...TypeRef }
|
|
167
216
|
defaultValue
|
|
168
|
-
${
|
|
169
|
-
${
|
|
217
|
+
${v("isDeprecated")}
|
|
218
|
+
${v("deprecationReason")}
|
|
170
219
|
}
|
|
171
220
|
|
|
172
221
|
fragment TypeRef on __Type {
|
|
@@ -209,21 +258,21 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
209
258
|
}
|
|
210
259
|
}
|
|
211
260
|
}
|
|
212
|
-
`}function
|
|
261
|
+
`}function Ly(n,i){Mt(n)&&Mt(n.__schema)||te(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${P(n)}.`);const r=n.__schema,a=dn(r.types,x=>x.name,x=>Z(x));for(const x of[...kc,...Wc])a[x.name]&&(a[x.name]=x);const u=r.queryType?O(r.queryType):null,p=r.mutationType?O(r.mutationType):null,v=r.subscriptionType?O(r.subscriptionType):null,I=r.directives?r.directives.map(nn):[];return new Sy({description:r.description,query:u,mutation:p,subscription:v,types:Object.values(a),directives:I,assumeValid:void 0});function N(x){if(x.kind===oe.LIST){const G=x.ofType;if(!G)throw new Error("Decorated type deeper than introspection query.");return new rt(N(G))}if(x.kind===oe.NON_NULL){const G=x.ofType;if(!G)throw new Error("Decorated type deeper than introspection query.");const ze=N(G);return new K(py(ze))}return R(x)}function R(x){const G=x.name;if(!G)throw new Error(`Unknown type reference: ${P(x)}.`);const ze=a[G];if(!ze)throw new Error(`Invalid or incomplete schema, unknown type: ${G}. Ensure that a full introspection query is used in order to build a client schema.`);return ze}function O(x){return cy(R(x))}function M(x){return ly(R(x))}function Z(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case oe.SCALAR:return ce(x);case oe.OBJECT:return Te(x);case oe.INTERFACE:return fe(x);case oe.UNION:return ve(x);case oe.ENUM:return tn(x);case oe.INPUT_OBJECT:return ye(x)}const G=P(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${G}.`)}function ce(x){return new mn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function W(x){if(x.interfaces===null&&x.kind===oe.INTERFACE)return[];if(!x.interfaces){const G=P(x);throw new Error(`Introspection result missing interfaces: ${G}.`)}return x.interfaces.map(M)}function Te(x){return new en({name:x.name,description:x.description,interfaces:()=>W(x),fields:()=>Ne(x)})}function fe(x){return new Rc({name:x.name,description:x.description,interfaces:()=>W(x),fields:()=>Ne(x)})}function ve(x){if(!x.possibleTypes){const G=P(x);throw new Error(`Introspection result missing possibleTypes: ${G}.`)}return new Cc({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function tn(x){if(!x.enumValues){const G=P(x);throw new Error(`Introspection result missing enumValues: ${G}.`)}return new Si({name:x.name,description:x.description,values:dn(x.enumValues,G=>G.name,G=>({description:G.description,deprecationReason:G.deprecationReason}))})}function ye(x){if(!x.inputFields){const G=P(x);throw new Error(`Introspection result missing inputFields: ${G}.`)}return new Dc({name:x.name,description:x.description,fields:()=>Qe(x.inputFields)})}function Ne(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${P(x)}.`);return dn(x.fields,G=>G.name,Re)}function Re(x){const G=N(x.type);if(!wc(G)){const ze=P(G);throw new Error(`Introspection must provide output type for fields, but received: ${ze}.`)}if(!x.args){const ze=P(x);throw new Error(`Introspection result missing field args: ${ze}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:G,args:Qe(x.args)}}function Qe(x){return dn(x,G=>G.name,Ue)}function Ue(x){const G=N(x.type);if(!Tc(G)){const Li=P(G);throw new Error(`Introspection must provide input type for arguments, but received: ${Li}.`)}const ze=x.defaultValue!=null?dr(qv(x.defaultValue),G):void 0;return{description:x.description,type:G,defaultValue:ze,deprecationReason:x.deprecationReason}}function nn(x){if(!x.args){const G=P(x);throw new Error(`Introspection result missing directive args: ${G}.`)}if(!x.locations){const G=P(x);throw new Error(`Introspection result missing directive locations: ${G}.`)}return new Gn({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:Qe(x.args)})}}function Ry(n){return Dy(n,i=>!Ay(i),Cy)}function Cy(n){return!_y(n)&&!by(n)}function Dy(n,i,r){const a=n.getDirectives().filter(i),u=Object.values(n.getTypeMap()).filter(r);return[Fy(n),...a.map(p=>Wy(p)),...u.map(p=>Uy(p))].filter(Boolean).join(`
|
|
213
262
|
|
|
214
|
-
`)}function
|
|
263
|
+
`)}function Fy(n){if(n.description==null&&ky(n))return;const i=[],r=n.getQueryType();r&&i.push(` query: ${r.name}`);const a=n.getMutationType();a&&i.push(` mutation: ${a.name}`);const u=n.getSubscriptionType();return u&&i.push(` subscription: ${u.name}`),at(n)+`schema {
|
|
215
264
|
${i.join(`
|
|
216
265
|
`)}
|
|
217
|
-
}`}function
|
|
266
|
+
}`}function ky(n){const i=n.getQueryType();if(i&&i.name!=="Query")return!1;const r=n.getMutationType();if(r&&r.name!=="Mutation")return!1;const a=n.getSubscriptionType();return!(a&&a.name!=="Subscription")}function Uy(n){if(Bn(n))return $y(n);if(Pt(n))return Py(n);if(it(n))return My(n);if(Kt(n))return By(n);if(Xt(n))return Gy(n);if(Zt(n))return Vy(n);yr(!1,"Unexpected type: "+P(n))}function $y(n){return at(n)+`scalar ${n.name}`+jy(n)}function jc(n){const i=n.getInterfaces();return i.length?" implements "+i.map(r=>r.name).join(" & "):""}function Py(n){return at(n)+`type ${n.name}`+jc(n)+qc(n)}function My(n){return at(n)+`interface ${n.name}`+jc(n)+qc(n)}function By(n){const i=n.getTypes(),r=i.length?" = "+i.join(" | "):"";return at(n)+"union "+n.name+r}function Gy(n){const i=n.getValues().map((r,a)=>at(r," ",!a)+" "+r.name+ho(r.deprecationReason));return at(n)+`enum ${n.name}`+po(i)}function Vy(n){const i=Object.values(n.getFields()).map((r,a)=>at(r," ",!a)+" "+ao(r));return at(n)+`input ${n.name}`+po(i)}function qc(n){const i=Object.values(n.getFields()).map((r,a)=>at(r," ",!a)+" "+r.name+Jc(r.args," ")+": "+String(r.type)+ho(r.deprecationReason));return po(i)}function po(n){return n.length!==0?` {
|
|
218
267
|
`+n.join(`
|
|
219
268
|
`)+`
|
|
220
269
|
}`:""}function Jc(n,i=""){return n.length===0?"":n.every(r=>!r.description)?"("+n.map(ao).join(", ")+")":`(
|
|
221
|
-
`+n.map((r,a)=>
|
|
270
|
+
`+n.map((r,a)=>at(r," "+i,!a)+" "+i+ao(r)).join(`
|
|
222
271
|
`)+`
|
|
223
|
-
`+i+")"}function ao(n){const i=Un(n.defaultValue,n.type);let r=n.name+": "+String(n.type);return i&&(r+=` = ${
|
|
272
|
+
`+i+")"}function ao(n){const i=Un(n.defaultValue,n.type);let r=n.name+": "+String(n.type);return i&&(r+=` = ${ot(i)}`),r+ho(n.deprecationReason)}function Wy(n){return at(n)+"directive @"+n.name+Jc(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function ho(n){return n==null?"":n!==Uc?` @deprecated(reason: ${ot({kind:b.STRING,value:n})})`:" @deprecated"}function jy(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${ot({kind:b.STRING,value:n.specifiedByURL})})`}function at(n,i="",r=!0){const{description:a}=n;if(a==null)return"";const u=ot({kind:b.STRING,value:a,block:Av(a)});return(i&&!r?`
|
|
224
273
|
`+i:i)+u.replace(/\n/g,`
|
|
225
274
|
`+i)+`
|
|
226
|
-
`}const fr="default",Ei=class Ei{constructor(){this.configPath=
|
|
275
|
+
`}const fr="default",Ei=class Ei{constructor(){this.configPath=yt.join(av.homedir(),".twenty","config.json")}static setActiveWorkspace(i){this.activeWorkspace=i??fr}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Ei.getActiveWorkspace()}async readRawConfig(){await Ie.ensureFile(this.configPath);const i=await Ie.readFile(this.configPath,"utf8");return JSON.parse(i||"{}")}async getConfig(){const i=this.getDefaultConfig();try{const r=await this.readRawConfig(),a=this.getActiveWorkspaceName(),u=a===fr&&!r.profiles?.[fr]?r:r.profiles?.[a],p=u?.apiUrl??i.apiUrl,v=u?.apiKey;return{apiUrl:p,apiKey:v}}catch{return i}}async setConfig(i){const r=await this.readRawConfig(),a=this.getActiveWorkspaceName();r.profiles||(r.profiles={});const u=r.profiles[a]||{apiUrl:""};r.profiles[a]={...u,...i},await Ie.ensureDir(yt.dirname(this.configPath)),await Ie.writeFile(this.configPath,JSON.stringify(r,null,2))}async clearConfig(){const i=await this.readRawConfig(),r=this.getActiveWorkspaceName();if(i.profiles||(i.profiles={}),i.profiles[r]&&delete i.profiles[r],r===fr){const a=this.getDefaultConfig();delete i.apiKey,i.apiUrl=a.apiUrl}await Ie.ensureDir(yt.dirname(this.configPath)),await Ie.writeFile(this.configPath,JSON.stringify(i,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}};Ei.activeWorkspace=fr;let At=Ei;class Vn{constructor(){this.configService=new At,this.client=Zs.default.create(),this.client.interceptors.request.use(async i=>{const r=await this.configService.getConfig();return i.baseURL=r.apiUrl,r.apiKey&&(i.headers.Authorization=`Bearer ${r.apiKey}`),i}),this.client.interceptors.response.use(i=>i,i=>{throw i.response?.status===401?console.error(F.default.red("Authentication failed. Please run `twenty auth login` first.")):i.response?.status===403?console.error(F.default.red("Access denied. Check your API key and workspace permissions.")):i.code==="ECONNREFUSED"&&console.error(F.default.red("Cannot connect to Twenty server. Is it running?")),i})}async validateAuth(){try{const r=await this.client.post("/metadata",{query:`
|
|
227
276
|
query CurrentWorkspace {
|
|
228
277
|
currentWorkspace {
|
|
229
278
|
id
|
|
@@ -233,27 +282,35 @@ ${i.join(`
|
|
|
233
282
|
mutation SyncApplication($manifest: JSON!, $packageJson: JSON!, $yarnLock: String!) {
|
|
234
283
|
syncApplication(manifest: $manifest, packageJson: $packageJson, yarnLock: $yarnLock)
|
|
235
284
|
}
|
|
236
|
-
`,p={manifest:a,yarnLock:r,packageJson:i},
|
|
285
|
+
`,p={manifest:a,yarnLock:r,packageJson:i},v=await this.client.post("/metadata",{query:u,variables:p},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return v.data.errors?{success:!1,error:v.data.errors[0]}:{success:!0,data:v.data.data.syncApplication,message:`Successfully synced application: ${i.name}`}}catch(u){return{success:!1,error:u}}}async uninstallApplication(i){try{const r=`
|
|
237
286
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
238
287
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
239
288
|
}
|
|
240
|
-
`,a={universalIdentifier:i},u=await this.client.post("/metadata",{query:r,variables:a},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(r){if(
|
|
289
|
+
`,a={universalIdentifier:i},u=await this.client.post("/metadata",{query:r,variables:a},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(r){if(Zs.default.isAxiosError(r)&&r.response)return{success:!1,error:r.response.data?.errors?.[0]?.message||r.message};throw r}}async getSchema(){try{const i=Oy(),r=await this.client.post("/graphql",{query:i},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(r.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(r.data.errors)}`};const a=Ly(r.data.data);return{success:!0,data:Ry(a),message:"Successfully load schema"}}catch(i){if(Zs.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw i}}async subscribeToLogs({applicationUniversalIdentifier:i,functionUniversalIdentifier:r,functionName:a}){const u=await this.configService.getConfig(),p=X0.createClient({url:u.apiUrl+"/graphql",headers:{Authorization:`Bearer ${u.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),v=`
|
|
241
290
|
subscription SubscribeToLogs($input: ServerlessFunctionLogsInput!) {
|
|
242
291
|
serverlessFunctionLogs(input: $input) {
|
|
243
292
|
logs
|
|
244
293
|
}
|
|
245
294
|
}
|
|
246
|
-
`,
|
|
295
|
+
`,I={input:{applicationUniversalIdentifier:i,universalIdentifier:r,name:a}};p.subscribe({query:v,variables:I},{next:({data:N})=>console.log(N?.serverlessFunctionLogs.logs),error:N=>console.error(N),complete:()=>console.log("Completed")})}}const Qc=()=>tv.createJiti(nv.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Xs&&Xs.tagName.toUpperCase()==="SCRIPT"&&Xs.src||new URL("cli.cjs",document.baseURI).href),{moduleCache:!1,fsCache:!1,interopDefault:!0}),zc=(n,i)=>{if(n.default!==void 0&&(!i||i(n.default)))return n.default;for(const[r,a]of Object.entries(n))if(r!=="default"&&a!=null&&typeof a=="object"&&!Array.isArray(a)&&(!i||i(a)))return a},go=async n=>{const i=Qc();try{const r=await i.import(n),a=zc(r);if(!a)throw new Error(`Config file ${n} must export a config object (default export or any named object export)`);return a}catch(r){throw r instanceof Error?new Error(`Failed to load config from ${n}: ${r.message}`):r}},qy=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Jy=(n,i,r,a)=>{const u=qy(i),p=[new RegExp(`import\\s*\\{[^}]*\\b${u}\\b[^}]*\\}\\s*from\\s*['"]([^'"]+)['"]`),new RegExp(`import\\s*\\{[^}]*\\w+\\s+as\\s+${u}[^}]*\\}\\s*from\\s*['"]([^'"]+)['"]`),new RegExp(`import\\s+${u}\\s+from\\s*['"]([^'"]+)['"]`)];for(const v of p){const I=n.match(v);if(I){const N=I[1],R=yt.default.dirname(r),O=yt.default.resolve(R,N),M=yt.default.relative(a,O);return(M.endsWith(".ts")?M:`${M}.ts`).replace(/\\/g,"/")}}return null},Qy=async(n,i)=>{const r=Qc();try{const a=await r.import(n),p=zc(a,O=>typeof O=="object"&&O!==null&&"handler"in O&&typeof O.handler=="function");if(!p)throw new Error(`Function file ${n} must export a config object with a "handler" property`);const v=p.handler.name;if(!v)throw new Error(`Handler function in ${n} must be a named function`);const I=await Ie.readFile(n,"utf8"),R=Jy(I,v,n,i)??yt.default.relative(i,n).replace(/\\/g,"/");return{config:p,handlerName:v,handlerPath:R}}catch(a){throw a instanceof Error?new Error(`Failed to load function module from ${n}: ${a.message}`):a}},ac=async(n,i)=>{const r=yt.default.join(n,i);if(await Ie.pathExists(r))return r;throw new Error(`${i} not found in ${n}`)};class uo extends Error{constructor(i,r,a){super(i),this.parseErrors=r,this.filePath=a,this.name="JsoncParseError"}}const zy=(n,i={})=>{const r=[],a=rv.parse(n,r,{allowTrailingComma:i.allowTrailingComma??!0,disallowComments:i.disallowComments??!1,allowEmptyContent:i.allowEmptyContent??!1});if(r.length>0){const u=r.map(p=>`Line ${p.offset}: ${p.error}`);throw new uo(`JSONC parse errors:
|
|
296
|
+
${u.join(`
|
|
297
|
+
`)}`,r)}return a},Yy=async n=>await Ie.readFile(n,"utf8"),Hy=async(n,i={})=>{try{const r=await Ie.readFile(n,"utf8");return zy(r,i)}catch(r){throw r instanceof uo?new uo(r.message,r.parseErrors,n):new Error(`Failed to read file ${n}: ${r}`)}};class mo extends Error{constructor(i){const r=i.map(a=>` • ${a.path}: ${a.message}`).join(`
|
|
298
|
+
`);super(`Manifest validation failed:
|
|
299
|
+
${r}`),this.errors=i,this.name="ManifestValidationError"}}const Ky=n=>{const i=[];if(n.application?.universalIdentifier&&i.push({id:n.application.universalIdentifier,location:"application"}),n.application?.applicationVariables)for(const[r,a]of Object.entries(n.application.applicationVariables))a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`application.variables.${r}`});for(const r of n.objects??[]){r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`objects/${r.nameSingular}`});for(const a of r.fields??[])a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`objects/${r.nameSingular}.fields.${a.label}`})}for(const r of n.serverlessFunctions??[]){r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`functions/${r.name??r.handlerName}`});for(const a of r.triggers??[])a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`functions/${r.name??r.handlerName}.triggers.${a.type}`})}for(const r of n.roles??[])r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`roles/${r.label}`});return i},Xy=n=>{const i=new Map;for(const{id:r,location:a}of n){const u=i.get(r)??[];u.push(a),i.set(r,u)}return Array.from(i.entries()).filter(([r,a])=>a.length>1).map(([r,a])=>({id:r,locations:a}))},Zy=(n,i)=>{if(!n){i.push({path:"application",message:"Application config is required"});return}n.universalIdentifier||i.push({path:"application",message:"Application must have a universalIdentifier"})},e_=(n,i)=>{for(const r of n){const a=`objects/${r.nameSingular??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Object must have a universalIdentifier"}),r.nameSingular||i.push({path:a,message:"Object must have a nameSingular"}),r.namePlural||i.push({path:a,message:"Object must have a namePlural"});for(const u of r.fields??[]){const p=`${a}.fields.${u.label??"unknown"}`;u.universalIdentifier||i.push({path:p,message:"Field must have a universalIdentifier"}),u.type||i.push({path:p,message:"Field must have a type"}),u.label||i.push({path:p,message:"Field must have a label"}),(u.type===kn.s.SELECT||u.type===kn.s.MULTI_SELECT)&&(!u.options||u.options.length===0)&&i.push({path:p,message:"SELECT/MULTI_SELECT field must have options"})}}},t_=(n,i)=>{for(const r of n){const a=`functions/${r.name??r.handlerName??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Function must have a universalIdentifier"}),(!r.triggers||r.triggers.length===0)&&i.push({path:a,message:"Function must have at least one trigger"});for(const u of r.triggers??[]){const p=`${a}.triggers.${u.type??"unknown"}`;if(u.universalIdentifier||i.push({path:p,message:"Trigger must have a universalIdentifier"}),!u.type){i.push({path:p,message:"Trigger must have a type"});continue}switch(u.type){case"route":u.path||i.push({path:p,message:"Route trigger must have a path"}),u.httpMethod||i.push({path:p,message:"Route trigger must have an httpMethod"});break;case"cron":u.pattern||i.push({path:p,message:"Cron trigger must have a pattern"});break;case"databaseEvent":u.eventName||i.push({path:p,message:"Database event trigger must have an eventName"});break}}}},n_=(n,i)=>{for(const r of n){const a=`roles/${r.label??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Role must have a universalIdentifier"}),r.label||i.push({path:a,message:"Role must have a label"})}},r_=n=>{const i=[],r=[];Zy(n.application,i),e_(n.objects??[],i),t_(n.serverlessFunctions??[],i),n_(n.roles??[],i);const a=Ky(n),u=Xy(a);for(const p of u)i.push({path:p.locations.join(", "),message:`Duplicate universalIdentifier: ${p.id}`});return(!n.objects||n.objects.length===0)&&r.push({message:"No objects defined in src/app/objects/"}),(!n.serverlessFunctions||n.serverlessFunctions.length===0)&&r.push({message:"No functions defined in src/app/functions/"}),{isValid:i.length===0,errors:i,warnings:r}},i_=async n=>{const i=yt.default.join(n,"src","app");if(!await Ie.pathExists(i))throw new Error(`Missing src/app/ folder in ${n}.
|
|
300
|
+
Create it with: mkdir -p src/app`);const r=yt.default.join(n,"src","app","application.config.ts");if(!await Ie.pathExists(r))throw new Error("Missing src/app/application.config.ts")},vo=(n,i)=>ke.relative(i,n).split(ke.sep).join(ke.posix.sep),wr=async(n,i)=>ev.glob(n,{cwd:i,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**"]}),s_=async n=>{const i=await wr(["src/app/**/*.object.ts"],n),r=[];for(const a of i)try{const u=await go(a);r.push(u)}catch(u){const p=vo(a,n);throw new Error(`Failed to load object from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},o_=async n=>{const i=await wr(["src/app/**/*.function.ts"],n),r=[];for(const a of i)try{const{config:u,handlerName:p,handlerPath:v}=await Qy(a,n),I=u,N={universalIdentifier:I.universalIdentifier,name:I.name,description:I.description,timeoutSeconds:I.timeoutSeconds,triggers:I.triggers??[],handlerPath:v,handlerName:p};r.push(N)}catch(u){const p=vo(a,n);throw new Error(`Failed to load function from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},a_=async n=>{const i=await wr(["src/app/**/*.role.ts"],n),r=[];for(const a of i)try{const u=await go(a);r.push(u)}catch(u){const p=vo(a,n);throw new Error(`Failed to load role from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},u_=async n=>{const i={},r=await wr(["src/**/*.ts"],n);for(const a of r){const p=ke.relative(n,a).split(ke.sep),v=await Ie.readFile(a,"utf8");let I=i;for(let N=0;N<p.length;N++){const R=p[N];N===p.length-1?I[R]=v:(I[R]=I[R]??{},I=I[R])}}return i},c_=async n=>{const i=await wr(["src/**/*.ts"],n),r=/from\s+['"][^'"]*\/generated(?:\/[^'"]*)?['"]|from\s+['"]generated['"]/;for(const a of i){const u=await Ie.readFile(a,"utf8");if(r.test(u))return!0}return!1},mr=async n=>{await i_(n);const i=await Hy(await ac(n,"package.json")),r=await Yy(await ac(n,"yarn.lock")),a=yt.default.join(n,"src","app","application.config.ts"),u=await go(a),[p,v,I,N,R]=await Promise.all([s_(n),o_(n),a_(n),u_(n),c_(n)]),O={application:u,objects:p,serverlessFunctions:v,roles:I,sources:N},M=r_({application:u,objects:p,serverlessFunctions:v,roles:I});if(!M.isValid)throw new mo(M.errors);return{packageJson:i,yarnLock:r,manifest:O,shouldGenerate:R,warnings:M.warnings}};class l_{constructor(){this.apiService=new Vn}async execute({appPath:i=vt,askForConfirmation:r}){try{console.log(F.default.blue("🚀 Uninstall Twenty Application")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(""),r&&!await this.confirmationPrompt()&&(console.error(F.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:a}=await mr(i),u=await this.apiService.uninstallApplication(a.application.universalIdentifier);return u.success===!1?console.error(F.default.red("❌ Uninstall failed:"),u.error):console.log(F.default.green("✅ Application uninstalled successfully")),u}catch(a){throw console.error(F.default.red("Uninstall failed:"),a instanceof Error?a.message:a),a}}async confirmationPrompt(){const{confirmation:i}=await $n.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return i}}const Yc=n=>{const i=n.application.displayName??"Application";console.log(F.default.green(` ✓ Loaded "${i}"`)),console.log(F.default.green(` ✓ Found ${n.objects.length} object(s)`)),console.log(F.default.green(` ✓ Found ${n.serverlessFunctions.length} function(s)`)),console.log(F.default.green(` ✓ Found ${n.roles?.length??"no"} role(s)`))},Hc=n=>{if(!(!n||n.length===0)){console.log("");for(const i of n){const r=i.path?`${i.path}: `:"";console.log(F.default.yellow(` ⚠ ${r}${i.message}`))}}},Kc=n=>{console.log(F.default.red(`
|
|
301
|
+
✗ Manifest validation failed:
|
|
302
|
+
`));for(const i of n.errors)console.log(F.default.red(` • ${i.path}: ${i.message}`));console.log("")};class f_{constructor(){this.apiService=new Vn}async execute(i){try{const r=i.appPath??vt,a=parseInt(i.debounce,10);this.logStartupInfo(r,a),await this.synchronize(r);const u=this.setupFileWatcher(r,a);this.setupGracefulShutdown(u)}catch(r){console.error(F.default.red("Development mode failed:"),r instanceof Error?r.message:r),process.exit(1)}}async synchronize(i){try{const{manifest:r,packageJson:a,yarnLock:u,warnings:p}=await mr(i);Yc(r),Hc(p),await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u}),console.log(F.default.green(" ✓ Synced with server"))}catch(r){throw r instanceof mo&&Kc(r),r}}logStartupInfo(i,r){console.log(F.default.blue("🚀 Starting Twenty Application Development Mode")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(F.default.gray(`⏱️ Debounce: ${r}ms`)),console.log("")}setupFileWatcher(i,r){const a=uv.watch(i,{ignored:/node_modules|\.git/,persistent:!0});let u=null;const p=()=>{u&&clearTimeout(u),u=setTimeout(async()=>{console.log(F.default.blue("🔄 Changes detected, syncing...")),await this.synchronize(i),console.log(F.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)"))},r)};return a.on("change",()=>{p()}),console.log(F.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)")),a}setupGracefulShutdown(i){process.on("SIGINT",()=>{console.log(F.default.yellow(`
|
|
303
|
+
🛑 Stopping development mode...`)),i.close(),process.exit(0)})}}const p_="TWENTY_API_KEY",h_="TWENTY_API_URL",d_="generated";class Xc{constructor(){this.configService=new At,this.apiService=new Vn}async generateClient(i){const r=ke.join(i,d_);console.log(F.default.blue("📦 Generating Twenty client...")),console.log(F.default.gray(`📁 Output Path: ${r}`)),console.log("");const a=await this.configService.getConfig(),u=a.apiUrl,p=a.apiKey;if(!u||!p){console.log(F.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(F.default.gray(`API URL: ${u}`)),console.log(F.default.gray(`Output: ${r}`));const v=await this.apiService.getSchema();if(!v.success)return;const{data:I}=v,N=ke.resolve(r);await sv.generate({schema:I,output:N,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(N),console.log(F.default.green("✓ Client generated successfully!")),console.log(F.default.gray(`Generated files at: ${r}`))}async injectTwentyClient(i){const r=`
|
|
247
304
|
|
|
248
305
|
// ----------------------------------------------------
|
|
249
306
|
// ✨ Custom Twenty client (auto-injected)
|
|
250
307
|
// ----------------------------------------------------
|
|
251
308
|
|
|
252
309
|
const defaultOptions: ClientOptions = {
|
|
253
|
-
url: \`\${process.env.${
|
|
310
|
+
url: \`\${process.env.${h_}}/graphql\`,
|
|
254
311
|
headers: {
|
|
255
312
|
'Content-Type': 'application/json',
|
|
256
|
-
Authorization: \`Bearer \${process.env.${
|
|
313
|
+
Authorization: \`Bearer \${process.env.${p_}}\`,
|
|
257
314
|
},
|
|
258
315
|
}
|
|
259
316
|
|
|
@@ -282,7 +339,4 @@ export default class Twenty {
|
|
|
282
339
|
}
|
|
283
340
|
}
|
|
284
341
|
|
|
285
|
-
`;await
|
|
286
|
-
${u.join(`
|
|
287
|
-
`)}`,r)}return a},Gv=async n=>await Ge.readFile(n,"utf8"),Wv=async(n,i={})=>{try{const r=await Ge.readFile(n,"utf8");return Bv(r,i)}catch(r){throw r instanceof co?new co(r.message,r.parseErrors,n):new Error(`Failed to read file ${n}: ${r}`)}},Vv=({diagnostics:n})=>{if(n.length>0){const i=L.formatDiagnosticsWithColorAndContext(n,{getCanonicalFileName:r=>r,getCurrentDirectory:L.sys.getCurrentDirectory,getNewLine:()=>L.sys.newLine});console.warn(i)}},vi=(n,i)=>{const r=n.expression;if(L.isCallExpression(r)){if(L.isIdentifier(r.expression))return r.expression.text===i;if(L.isPropertyAccessExpression(r.expression))return r.expression.name.text===i}return!1},dn=n=>{if(L.isStringLiteralLike(n))return n.text;if(L.isNumericLiteral(n))return Number(n.text);if(n.kind===L.SyntaxKind.TrueKeyword)return!0;if(n.kind===L.SyntaxKind.FalseKeyword)return!1;if(n.kind===L.SyntaxKind.NullKeyword)return null;if(L.isPropertyAccessExpression(n))return L.isIdentifier(n.expression)&&L.isIdentifier(n.name)?n.name.text:String(n.getText());if(L.isNoSubstitutionTemplateLiteral(n))return n.text;if(L.isTemplateExpression(n)){let i=n.head.text;for(const r of n.templateSpans){const a=dn(r.expression);i+=String(a)+r.literal.text}return i}if(L.isArrayLiteralExpression(n))return n.elements.map(i=>i.kind===L.SyntaxKind.SpreadElement?[]:dn(i));if(L.isObjectLiteralExpression(n)){const i={};for(const r of n.properties)if(L.isPropertyAssignment(r)){const a=L.isIdentifier(r.name)||L.isStringLiteralLike(r.name)?r.name.text:L.isComputedPropertyName(r.name)&&L.isStringLiteralLike(r.name.expression)?r.name.expression.text:void 0;a&&(i[a]=dn(r.initializer))}else L.isShorthandPropertyAssignment(r);return i}return L.isIdentifier(n)?n.text:String(n.getText?.()??"")},oc=n=>{if(!L.isCallExpression(n.expression))return;const[i]=n.expression.arguments;return i&&L.isObjectLiteralExpression(i)?dn(i):void 0},jv=n=>{const i=[];for(const r of n.getSourceFiles()){if(r.isDeclarationFile)continue;const a=u=>{if(L.isClassDeclaration(u)&&L.getDecorators(u)?.length){const y=L.getDecorators(u)?.find(_=>vi(_,"ObjectMetadata")||vi(_,"Object"));if(y){const _=oc(y);if(_&&typeof _=="object"&&!Array.isArray(_)){const N=[];for(const D of u.members){if(!L.isPropertyDeclaration(D))continue;const C=L.getDecorators(D)?.find(oe=>vi(oe,"FieldManifest")||vi(oe,"Field"));if(!C)continue;const J=oc(C);if(!J)continue;let Y;D.name&&L.isIdentifier(D.name)?Y=D.name.text:Y=D.name?.getText?.()??void 0,N.push({...J,...Y?{name:Y}:{}})}i.push({..._,fields:N})}}}L.forEachChild(u,a)};a(r)}return i},ac=n=>n.modifiers?.some(i=>i.kind===L.SyntaxKind.ExportKeyword)??!1,qv=n=>{const i=[];for(const _ of n.statements)if(!(!L.isVariableStatement(_)||!ac(_)))for(const N of _.declarationList.declarations){if(!L.isIdentifier(N.name))continue;const D=N.name.text,C=N.initializer??void 0;i.push({name:D,kind:"const",init:C,declNode:N})}for(const _ of n.statements)if(_.kind===L.SyntaxKind.FunctionDeclaration&&ac(_)){const N=_;N.name&&L.isIdentifier(N.name)&&i.push({name:N.name.text,kind:"function",init:void 0,declNode:N})}const r=Array.from(new Map(i.map(_=>[_.name,_])).values());if(r.length!==2)throw new Error(`Serverless file ${n.fileName} must export exactly 2 bindings (handler + config). Found: ${r.map(_=>_.name).join(", ")}`);const a=r.find(_=>_.name==="config");if(!a)throw new Error(`Serverless file ${n.fileName} must export a binding named "config".`);if(!a.init||!L.isObjectLiteralExpression(a.init))throw new Error(`"config" in ${n.fileName} must be initialized to an object literal.`);const u=a.declNode;if("type"in u&&u.type){const _=u.type.getText(n);if(!/\bFunctionConfig\b/.test(_))throw new Error(`"config" in ${n.fileName} must be typed as FunctionConfig (got: ${_}).`)}const p=dn(a.init),y=r.find(_=>_.name!=="config");if(!y)throw new Error(`Could not find the handler export in ${n.fileName}.`);if(y.kind==="const"){const _=y.init;if(!(!!_&&(L.isArrowFunction(_)||L.isFunctionExpression(_))))throw new Error(`Handler "${y.name}" in ${n.fileName} must be a function (arrow or function expression).`)}return{handlerName:y.name,configObject:p}},Jv=(n,i)=>Oe.relative(i,n).split(Oe.sep).join(Oe.posix.sep),Qv=(n,i)=>{const r=[];for(const a of n.getSourceFiles())if(!a.isDeclarationFile)try{const{handlerName:u,configObject:p}=qv(a),y=Jv(a.fileName,i);r.push({...p,handlerPath:y,handlerName:u})}catch{continue}return r},zv=(n,i,r)=>{let a=n;for(let u=0;u<i.length;u++){const p=i[u];u===i.length-1?a[p]=r:(a[p]=a[p]??{},a=a[p])}},Yv=async(n,i)=>{const r={};for(const a of n.getSourceFiles()){const u=a.fileName;if(a.isDeclarationFile||!u.startsWith(i+Oe.sep)&&u!==i||!(u.endsWith(".ts")||u.endsWith(".tsx"))||u.includes(`${Oe.sep}node_modules${Oe.sep}`))continue;const y=Oe.relative(i,u).split(Oe.sep),_=await Ge.readFile(u,"utf8");zv(r,y,_)}return r},Hv=n=>{for(const i of n.getSourceFiles()){if(i.isDeclarationFile||!i.fileName.endsWith("application.config.ts"))continue;let r;const a=u=>{if(L.isExportAssignment(u)&&L.isIdentifier(u.expression)){const p=u.expression.text;for(const y of i.statements)if(L.isVariableStatement(y))for(const _ of y.declarationList.declarations)L.isIdentifier(_.name)&&_.name.text===p&&_.initializer&&L.isObjectLiteralExpression(_.initializer)&&(r=dn(_.initializer))}r||L.forEachChild(u,a)};if(a(i),r)return r}throw new Error("Could not find default exported ApplicationConfig")},Kv=n=>{for(const i of n.getSourceFiles()){if(i.isDeclarationFile)continue;let r=!1;const a=u=>{if(!r){if(L.isImportDeclaration(u)){const p=u.moduleSpecifier;if(L.isStringLiteralLike(p)){const y=p.text;if((y===uo||y.endsWith(`/${uo}`))&&u.importClause){r=!0;return}}}L.forEachChild(u,a)}};if(a(i),r)return!0}return!1},Xv=n=>{const i=[];for(const r of n.getSourceFiles())if(!r.isDeclarationFile){for(const a of r.statements)if(!(!L.isVariableStatement(a)||!(a.modifiers?.some(p=>p.kind===L.SyntaxKind.ExportKeyword)??!1)))for(const p of a.declarationList.declarations){if(!L.isIdentifier(p.name)||!(p.type?.getText(r)??"").includes("RoleConfig"))continue;const _=p.initializer;!_||!L.isObjectLiteralExpression(_)||i.push(dn(_))}}return i},mr=async n=>{const i=await Wv(await sc(n,"package.json")),r=await Gv(await sc(n,"yarn.lock")),{diagnostics:a,program:u}=await $v({appPath:n});Vv({diagnostics:a});const[p,y,_,N,D]=[jv(u),Qv(u,n),Hv(u),Xv(u),await Yv(u,n)],C=Kv(u);return{packageJson:i,yarnLock:r,manifest:{application:_,objects:p,serverlessFunctions:y,roles:N,sources:D},shouldGenerate:C}};class Zv{constructor(){this.apiService=new Wn}async execute({appPath:i=mn,askForConfirmation:r}){try{console.log($.default.blue("🚀 Uninstall Twenty Application")),console.log($.default.gray(`📁 App Path: ${i}`)),console.log(""),r&&!await this.confirmationPrompt()&&(console.error($.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:a}=await mr(i),u=await this.apiService.uninstallApplication(a.application.universalIdentifier);return u.success===!1?console.error($.default.red("❌ Uninstall failed:"),u.error):console.log($.default.green("✅ Application uninstalled successfully")),u}catch(a){throw console.error($.default.red("Uninstall failed:"),a instanceof Error?a.message:a),a}}async confirmationPrompt(){const{confirmation:i}=await Pn.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return i}}class e_{constructor(){this.apiService=new Wn}async execute(i){try{const r=i.appPath??mn,a=parseInt(i.debounce,10);this.logStartupInfo(r,a),await this.synchronize(r);const u=this.setupFileWatcher(r,a);this.setupGracefulShutdown(u)}catch(r){console.error($.default.red("Development mode failed:"),r instanceof Error?r.message:r),process.exit(1)}}async synchronize(i){const{manifest:r,packageJson:a,yarnLock:u}=await mr(i);await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u})}logStartupInfo(i,r){console.log($.default.blue("🚀 Starting Twenty Application Development Mode")),console.log($.default.gray(`📁 App Path: ${i}`)),console.log($.default.gray(`⏱️ Debounce: ${r}ms`)),console.log("")}setupFileWatcher(i,r){const a=ty.watch(i,{ignored:/node_modules|\.git/,persistent:!0});let u=null;const p=()=>{u&&clearTimeout(u),u=setTimeout(async()=>{console.log($.default.blue("🔄 Changes detected, syncing...")),await this.synchronize(i),console.log($.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)"))},r)};return a.on("change",()=>{p()}),console.log($.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)")),a}setupGracefulShutdown(i){process.on("SIGINT",()=>{console.log($.default.yellow(`
|
|
288
|
-
🛑 Stopping development mode...`)),i.close(),process.exit(0)})}}class t_{constructor(){this.apiService=new Wn,this.generateService=new Qc}async execute(i=mn){try{return console.log($.default.blue("🚀 Syncing Twenty Application")),console.log($.default.gray(`📁 App Path: ${i}`)),console.log(""),await this.synchronize({appPath:i})}catch(r){throw console.error($.default.red("Sync failed:"),r instanceof Error?r.message:r),r}}async synchronize({appPath:i}){const{manifest:r,packageJson:a,yarnLock:u,shouldGenerate:p}=await mr(i);let y=await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u});if(p){await this.generateService.generateClient(i);const{manifest:_}=await mr(i);y=await this.apiService.syncApplication({manifest:_,packageJson:a,yarnLock:u})}return y.success===!1?console.error($.default.red("❌ Serverless functions Sync failed:"),y.error):console.log($.default.green("✅ Serverless functions synced successfully")),y}}const kn=n=>n&&!n?.startsWith("/")?Oe.join(mn,n):n;class n_{constructor(){this.generateService=new Qc}async execute(i=mn){try{await this.generateService.generateClient(i)}catch(r){throw console.error($.default.red("Generate Twenty client failed:"),r instanceof Error?r.message:r),r}}}class r_{constructor(){this.apiService=new Wn}async execute({appPath:i=mn,functionUniversalIdentifier:r,functionName:a}){try{const{manifest:u}=await mr(i);this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:r,functionName:a}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:r,functionName:a})}catch(u){console.error($.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:i,functionUniversalIdentifier:r,functionName:a}){const u=i??"Twenty Application",p=r||a?`function "${r||a}"`:"functions";console.log($.default.blue(`🚀 Watching ${u} ${p} logs:`)),console.log("")}}class i_{constructor(){this.devCommand=new e_,this.syncCommand=new t_,this.uninstallCommand=new Zv,this.addCommand=new uy,this.generateCommand=new n_,this.logsCommand=new r_}getCommand(){const i=new xi.Command("app");return i.description("Application development commands"),i.command("dev [appPath]").description("Watch and sync local application changes").option("-d, --debounce <ms>","Debounce delay in milliseconds","1000").action(async(r,a)=>{await this.devCommand.execute({...a,appPath:kn(r)})}),i.command("sync [appPath]").description("Sync application to Twenty").action(async r=>{try{(await this.syncCommand.execute(kn(r))).success||process.exit(1)}catch{process.exit(1)}}),i.command("uninstall [appPath]").description("Uninstall application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:kn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("delete [appPath]",{hidden:!0}).description("Delete application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:kn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(wi).join("|")})`).action(async(r,a)=>{r&&!ay(r)&&(console.error($.default.red(`Invalid entity type "${r}". Must be one of: ${Object.values(wi).join("|")}`)),process.exit(1)),await this.addCommand.execute(r,a?.path)}),i.command("generate [appPath]").description("Generate Twenty client").action(async r=>{await this.generateCommand.execute(kn(r))}),i.command("logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(r,a)=>{await this.logsCommand.execute({...a,appPath:kn(r)})}),i}}class s_{constructor(){this.configService=new At,this.apiService=new Wn}getCommand(){const i=new xi.Command("auth");return i.description("Authentication commands"),i.command("login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async r=>{await this.login(r)}),i.command("logout").description("Remove authentication credentials").action(async()=>{await this.logout()}),i.command("status").description("Check authentication status").action(async()=>{await this.status()}),i}async login(i){try{let{apiKey:r,apiUrl:a}=i;const u=await this.configService.getConfig();if(a||(a=(await Pn.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:_=>{try{return new URL(_),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),r||(r=(await Pn.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:_=>_.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:a,apiKey:r}),await this.apiService.validateAuth()){const y=At.getActiveWorkspace();console.log($.default.green(`✓ Successfully authenticated with Twenty (workspace: ${y})`))}else console.log($.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(r){console.error($.default.red("Login failed:"),r instanceof Error?r.message:r),process.exit(1)}}async logout(){try{await this.configService.clearConfig();const i=At.getActiveWorkspace();console.log($.default.green(`✓ Successfully logged out (workspace: ${i})`))}catch(i){console.error($.default.red("Logout failed:"),i instanceof Error?i.message:i),process.exit(1)}}async status(){try{const i=At.getActiveWorkspace(),r=await this.configService.getConfig();if(console.log($.default.blue("Authentication Status:")),console.log(`Workspace: ${i}`),console.log(`API URL: ${r.apiUrl}`),console.log(`API Key: ${r.apiKey?"***"+r.apiKey.slice(-4):"Not set"}`),r.apiKey){const a=await this.apiService.validateAuth();console.log(`Status: ${a?$.default.green("✓ Valid"):$.default.red("✗ Invalid")}`)}else console.log(`Status: ${$.default.yellow("⚠ Not authenticated")}`)}catch(i){console.error($.default.red("Status check failed:"),i instanceof Error?i.message:i),process.exit(1)}}}const o_="0.2.4",a_={version:o_},vn=new xi.Command;vn.name("twenty").description("CLI for Twenty application development").version(a_.version);vn.option("--workspace <name>","Use a specific workspace configuration","default");vn.hook("preAction",n=>{const r=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;At.setActiveWorkspace(r),console.log($.default.gray(`👩💻 Workspace - ${At.getActiveWorkspace()}`))});vn.addCommand(new s_().getCommand());vn.addCommand(new i_().getCommand());vn.exitOverride();try{vn.parse()}catch(n){n instanceof xi.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error($.default.red("Error:"),n.message),process.exit(1))}
|
|
342
|
+
`;await Ie.appendFile(ke.join(i,"index.ts"),r)}}class g_{constructor(){this.apiService=new Vn,this.generateService=new Xc}async execute(i=vt){try{return console.log(F.default.blue("🚀 Syncing Twenty Application")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(""),await this.synchronize({appPath:i})}catch(r){throw console.error(F.default.red("Sync failed:"),r instanceof Error?r.message:r),r}}async synchronize({appPath:i}){try{const{manifest:r,packageJson:a,yarnLock:u,shouldGenerate:p,warnings:v}=await mr(i);Yc(r),Hc(v);let I=await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u});if(p){await this.generateService.generateClient(i);const{manifest:N}=await mr(i);I=await this.apiService.syncApplication({manifest:N,packageJson:a,yarnLock:u})}return I.success===!1?console.error(F.default.red("❌ Serverless functions Sync failed:"),I.error):console.log(F.default.green("✅ Serverless functions synced successfully")),I}catch(r){throw r instanceof mo&&Kc(r),r}}}const Fn=n=>n&&!n?.startsWith("/")?ke.join(vt,n):n;class m_{constructor(){this.generateService=new Xc}async execute(i=vt){try{await this.generateService.generateClient(i)}catch(r){throw console.error(F.default.red("Generate Twenty client failed:"),r instanceof Error?r.message:r),r}}}class v_{constructor(){this.apiService=new Vn}async execute({appPath:i=vt,functionUniversalIdentifier:r,functionName:a}){try{const{manifest:u}=await mr(i);this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:r,functionName:a}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:r,functionName:a})}catch(u){console.error(F.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:i,functionUniversalIdentifier:r,functionName:a}){const u=i??"Twenty Application",p=r||a?`function "${r||a}"`:"functions";console.log(F.default.blue(`🚀 Watching ${u} ${p} logs:`)),console.log("")}}class y_{constructor(){this.devCommand=new f_,this.syncCommand=new g_,this.uninstallCommand=new l_,this.addCommand=new vv,this.generateCommand=new m_,this.logsCommand=new v_}getCommand(){const i=new Ii.Command("app");return i.description("Application development commands"),i.command("dev [appPath]").description("Watch and sync local application changes").option("-d, --debounce <ms>","Debounce delay in milliseconds","1000").action(async(r,a)=>{await this.devCommand.execute({...a,appPath:Fn(r)})}),i.command("sync [appPath]").description("Sync application to Twenty").action(async r=>{try{(await this.syncCommand.execute(Fn(r))).success||process.exit(1)}catch{process.exit(1)}}),i.command("uninstall [appPath]").description("Uninstall application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:Fn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("delete [appPath]",{hidden:!0}).description("Delete application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:Fn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(wi).join("|")})`).action(async(r,a)=>{r&&!mv(r)&&(console.error(F.default.red(`Invalid entity type "${r}". Must be one of: ${Object.values(wi).join("|")}`)),process.exit(1)),await this.addCommand.execute(r,a?.path)}),i.command("generate [appPath]").description("Generate Twenty client").action(async r=>{await this.generateCommand.execute(Fn(r))}),i.command("logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(r,a)=>{await this.logsCommand.execute({...a,appPath:Fn(r)})}),i}}class __{constructor(){this.configService=new At,this.apiService=new Vn}getCommand(){const i=new Ii.Command("auth");return i.description("Authentication commands"),i.command("login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async r=>{await this.login(r)}),i.command("logout").description("Remove authentication credentials").action(async()=>{await this.logout()}),i.command("status").description("Check authentication status").action(async()=>{await this.status()}),i}async login(i){try{let{apiKey:r,apiUrl:a}=i;const u=await this.configService.getConfig();if(a||(a=(await $n.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:I=>{try{return new URL(I),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),r||(r=(await $n.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:I=>I.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:a,apiKey:r}),await this.apiService.validateAuth()){const v=At.getActiveWorkspace();console.log(F.default.green(`✓ Successfully authenticated with Twenty (workspace: ${v})`))}else console.log(F.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(r){console.error(F.default.red("Login failed:"),r instanceof Error?r.message:r),process.exit(1)}}async logout(){try{await this.configService.clearConfig();const i=At.getActiveWorkspace();console.log(F.default.green(`✓ Successfully logged out (workspace: ${i})`))}catch(i){console.error(F.default.red("Logout failed:"),i instanceof Error?i.message:i),process.exit(1)}}async status(){try{const i=At.getActiveWorkspace(),r=await this.configService.getConfig();if(console.log(F.default.blue("Authentication Status:")),console.log(`Workspace: ${i}`),console.log(`API URL: ${r.apiUrl}`),console.log(`API Key: ${r.apiKey?"***"+r.apiKey.slice(-4):"Not set"}`),r.apiKey){const a=await this.apiService.validateAuth();console.log(`Status: ${a?F.default.green("✓ Valid"):F.default.red("✗ Invalid")}`)}else console.log(`Status: ${F.default.yellow("⚠ Not authenticated")}`)}catch(i){console.error(F.default.red("Status check failed:"),i instanceof Error?i.message:i),process.exit(1)}}}const T_="0.3.0-alpha",w_={version:T_},vn=new Ii.Command;vn.name("twenty").description("CLI for Twenty application development").version(w_.version);vn.option("--workspace <name>","Use a specific workspace configuration","default");vn.hook("preAction",n=>{const r=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;At.setActiveWorkspace(r),console.log(F.default.gray(`👩💻 Workspace - ${At.getActiveWorkspace()}`))});vn.addCommand(new __().getCommand());vn.addCommand(new y_().getCommand());vn.exitOverride();try{vn.parse()}catch(n){n instanceof Ii.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(F.default.red("Error:"),n.message),process.exit(1))}
|