likec4 1.59.3 → 1.59.4
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/__app__/src/chunks/AIChat.mjs +108 -108
- package/__app__/src/chunks/LikeC4Styles.mjs +752 -604
- package/__app__/src/chunks/ProjectsOverview.mjs +72 -72
- package/__app__/src/chunks/es.mjs +1 -1
- package/__app__/src/chunks/hooks.mjs +94 -91
- package/__app__/src/chunks/libs/@floating-ui.mjs +3 -3
- package/__app__/src/chunks/libs/@mantine.mjs +1609 -892
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +2 -2
- package/__app__/src/chunks/libs/@tanstack.mjs +4 -10
- package/__app__/src/chunks/libs/@xyflow/react.mjs +4 -4
- package/__app__/src/chunks/libs/d3.mjs +4 -9
- package/__app__/src/chunks/libs/fast-equals.mjs +61 -49
- package/__app__/src/chunks/libs/framer.mjs +6 -6
- package/__app__/src/chunks/styled-system.mjs +2578 -124
- package/__app__/src/main.mjs +21537 -20155
- package/__app__/src/style.css +1 -1
- package/config/schema.json +14 -0
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +99 -105
- package/dist/chunks/filenames.mjs +6 -6
- package/dist/chunks/index.d.mts +7 -1
- package/dist/chunks/index2.d.mts +38 -21
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/types.d.mts +108 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
- package/dist/chunks/libs/langium.d.mts +1777 -16
- package/dist/chunks/libs/langium.mjs +4 -4
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +2 -2
- package/dist/chunks/libs/picomatch.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +1717 -17
- package/dist/chunks/node.mjs +58 -59
- package/dist/chunks/vite-plugin.mjs +15 -12
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +104 -88
- package/dist/index.d.mts +3 -3
- package/dist/model/index.d.mts +4 -4
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/internal/index.d.mts +15 -15
- package/dist/vite-plugin/internal/index.mjs +72 -27
- package/package.json +28 -28
- package/react/index.d.mts +22720 -1460
- package/react/index.mjs +30391 -25072
- package/vite-plugin-modules.d.ts +4 -2
|
@@ -10,9 +10,9 @@ These values will be used if such property is not defined`}),L=t.strictObject({c
|
|
|
10
10
|
These values will be used if such property is not defined`}),relationship:I.optional().meta({description:`Override default values for relationship style properties
|
|
11
11
|
These values will be used if such property is not defined`})}).meta({id:`DefaultStyleValues`}),R=t.union([t.string().min(1,`Custom CSS file path cannot be empty`),t.array(t.string().min(1,`Custom CSS file path cannot be empty`))]).meta({id:`CustomStylesheets`}),z=t.strictObject({theme:P.optional().meta({description:`Project theme customization`}),defaults:L.optional().meta({description:`Override default values for style properties
|
|
12
12
|
These values will be used if such property is not defined`}),customCss:R.optional().meta({description:`Custom CSS (or list of CSS files) to be included in the generated diagrams`})}).transform(({theme:e,defaults:t,customCss:n})=>l({defaults:normalizeDefaults(t),customCss:normalizeStylesheets(n),theme:e}));function normalizeDefaults(e){if(!e)return;let{relationship:t,group:n,...r}=e;return l({...r,relationship:t&&l(t),group:n&&l(n)})}function normalizeStylesheets(e){if(!e)return;let t=(Array.isArray(e)?e:[e]).filter(Boolean);if(t.length!==0)return{paths:t,content:``}}const B=[`png`,`jpg`,`dot`,`d2`,`mmd`,`puml`,`drawio`],V=t.strictObject({outDir:t.string().default(`.likec4`).meta({description:[`Path to the directory where manual layouts will be stored,`,`relative to the folder containing the project config. `,``,`Defaults to '.likec4'.`].join(`
|
|
13
|
-
`)})}).meta({id:`ManualLayoutsConfig`,description:`Configuration for manual layouts`}),H=t.enum(B),U=t.strictObject({exportFormats:t.array(H).refine(e=>new Set(e).size===e.length,{message:`Export formats cannot contain duplicates`}).default([...B]).meta({description:[`Webapp export formats enabled in the generated application.`,`Omit to enable all export formats. Use an empty array to disable webapp exports.`].join(`
|
|
14
|
-
`)})}).meta({id:`WebappConfig`,description:`Configuration for the generated web application`}),
|
|
15
|
-
`)}),implicitViews:t.boolean().optional().meta({description:`Auto-generate scoped views for elements without explicit views. Defaults to false.`}),landingPage:
|
|
16
|
-
`+t.prettifyError(e.error));r=e.data}let i=
|
|
17
|
-
`+t.prettifyError(i.error));let a=i.data;r!==null&&(a={...a,landingPage:r});let o=e.generators;if(typeof o==`object`&&o&&!Array.isArray(o)){let e=
|
|
18
|
-
`+t.prettifyError(e.error));return{...a,generators:e.data}}return a}function parseProjectConfigJSON(t){return validateProjectConfig(e.parse(t.trim()||`{}`))}const
|
|
13
|
+
`)})}).meta({id:`ManualLayoutsConfig`,description:`Configuration for manual layouts`}),H=t.enum(B),U=t.enum([`global`,`view`]),W=t.strictObject({defaultScope:U.default(`view`)}),G=t.strictObject({exportFormats:t.array(H).refine(e=>new Set(e).size===e.length,{message:`Export formats cannot contain duplicates`}).default([...B]).meta({description:[`Webapp export formats enabled in the generated application.`,`Omit to enable all export formats. Use an empty array to disable webapp exports.`].join(`
|
|
14
|
+
`)}),relationshipsBrowser:W.optional()}).meta({id:`WebappConfig`,description:`Configuration for the generated web application`}),K=t.union([t.strictObject({redirect:t.literal(!0)}),t.strictObject({include:t.array(t.string().nonempty().refine(e=>e!==`#`,{message:`selector cannot be "#"`})).nonempty(`include list cannot be empty`)}),t.strictObject({exclude:t.array(t.string().nonempty().refine(e=>e!==`#`,{message:`selector cannot be "#"`})).nonempty(`exclude list cannot be empty`)})]).meta({id:`LandingPageConfig`,description:`Configure the landing page. Use redirect to go to the index view, or include/exclude to filter the view grid.`}),q=t.object({name:t.string().nonempty(`Project name cannot be empty`).refine(e=>e!=="default",{abort:!0,error:`Project name cannot be "default"`}).refine(e=>!e.includes(`.`)&&!e.includes(`@`)&&!e.includes(`#`),{abort:!0,error:`Project name cannot contain ".", "@" or "#", try to use A-z, 0-9, _ and -`}).meta({description:`Project name, must be unique in the workspace`}),extends:t.union([t.string().min(1,`Extend path cannot be empty`),t.array(t.string().min(1,`Extend path cannot be empty`)).min(1,`Extend list cannot be empty`)]).optional().meta({description:`Extend styles from other config files`}),title:t.string().nonempty(`Project title cannot be empty if specified`).optional().meta({description:`A human readable title for the project`}),contactPerson:t.string().nonempty(`Contact person cannot be empty if specified`).optional().meta({description:`A person who has been involved in creating or maintaining this project`}),metadata:t.record(t.string(),t.any()).optional().meta({description:`Arbitrary metadata as key-value pairs for custom project information`}),styles:z.optional().meta({description:`Project styles customization`}),imageAliases:m.optional(),include:g.optional(),exclude:t.array(t.string()).optional().meta({description:`List of file patterns to exclude from the project, default is ["**/node_modules/**"]`}),manualLayouts:V.optional(),inferTechnologyFromIcon:t.boolean().optional().meta({description:[`Automatically derive element technology from icon name when technology is not set explicitly.`,`Applies to aws:, azure:, gcp:, and tech: icons. Bootstrap icons are excluded.`,`Defaults to true.`].join(`
|
|
15
|
+
`)}),implicitViews:t.boolean().optional().meta({description:`Auto-generate scoped views for elements without explicit views. Defaults to false.`}),landingPage:K.optional(),webapp:G.optional()}).meta({id:`LikeC4ProjectConfig`,description:`LikeC4 Project Configuration`}),J=t.instanceof(Function),Y=t.record(t.string(),J),X=q.extend({generators:Y.optional()});function validateProjectConfig(e){let n=e.landingPage,r=null;if(n!=null){let e=K.safeParse(n);if(!e.success)throw Error(`Config validation failed:
|
|
16
|
+
`+t.prettifyError(e.error));r=e.data}let i=q.safeParse(e);if(!i.success)throw Error(`Config validation failed:
|
|
17
|
+
`+t.prettifyError(i.error));let a=i.data;r!==null&&(a={...a,landingPage:r});let o=e.generators;if(typeof o==`object`&&o&&!Array.isArray(o)){let e=Y.safeParse(o);if(!e.success)throw Error(`Config validation failed (generators):
|
|
18
|
+
`+t.prettifyError(e.error));return{...a,generators:e.data}}return a}function parseProjectConfigJSON(t){return validateProjectConfig(e.parse(t.trim()||`{}`))}const Z={parse:parseProjectConfigJSON,validate:validateProjectConfig,normalizeInclude:e=>{let t=g.safeParse(e);return t.success?t.data:{paths:[],maxDepth:3,fileThreshold:30}}};function trimTrailingSlashes(e){let t=e.length;for(;t>0&&(e[t-1]===`/`||e[t-1]===`\\`);)t--;return e.slice(0,t)}function splitPath(e){return e.split(`/`).flatMap(e=>e.split(`\\`))}function basename(e){let t=trimTrailingSlashes(e),n=splitPath(t);return n[n.length-1]||t}const Q=[`.likec4rc`,`.likec4.config.json`,`likec4.config.json`],$=[`likec4.config.js`,`likec4.config.cjs`,`likec4.config.mjs`,`likec4.config.ts`,`likec4.config.cts`,`likec4.config.mts`];[...Q,...$];function isLikeC4JsonConfig(e){return Q.includes(basename(e))}function isLikeC4NonJsonConfig(e){return $.includes(basename(e))}function isLikeC4Config(e){return isLikeC4JsonConfig(e)||isLikeC4NonJsonConfig(e)}export{Z as a,validateProjectConfig as c,z as d,A as f,Y as i,B as l,isLikeC4JsonConfig as n,X as o,isLikeC4NonJsonConfig as r,q as s,isLikeC4Config as t,P as u};
|
package/dist/chunks/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __name } from "./rolldown-runtime.mjs";
|
|
2
|
-
import { _ as
|
|
2
|
+
import { S as $strip, _ as ZodUnion, a as ZodCustom, b as $partial, c as ZodInt, d as ZodObject, f as ZodOptional, g as ZodTransform, h as ZodString, i as ZodBoolean, l as ZodLiteral, m as ZodRecord, n as ZodAny, o as ZodDefault, p as ZodPipe, r as ZodArray, s as ZodEnum, t as external_d_exports, u as ZodNumber, v as input, x as $strict, y as output } from "./libs/zod.mjs";
|
|
3
3
|
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
4
4
|
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
5
5
|
//#region ../config/dist/chunks/index.d.mts
|
|
@@ -161,6 +161,12 @@ declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
|
161
161
|
puml: "puml";
|
|
162
162
|
drawio: "drawio";
|
|
163
163
|
}>>>;
|
|
164
|
+
relationshipsBrowser: ZodOptional<ZodObject<{
|
|
165
|
+
defaultScope: ZodDefault<ZodEnum<{
|
|
166
|
+
global: "global";
|
|
167
|
+
view: "view";
|
|
168
|
+
}>>;
|
|
169
|
+
}, $strict>>;
|
|
164
170
|
}, $strict>>;
|
|
165
171
|
}, $strip>;
|
|
166
172
|
type LikeC4ProjectJsonConfig = input<typeof LikeC4ProjectJsonConfigSchema>;
|
package/dist/chunks/index2.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __name } from "./rolldown-runtime.mjs";
|
|
2
2
|
import { a as LikeC4ProjectConfig, i as IncludeConfig, o as LikeC4ProjectConfigInput } from "./index.mjs";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as cancellation_d_exports, A as DiagnosticInfo, B as DefaultNameProvider, C as CodeLensParams, D as RequestType, E as NotificationType, F as DefaultScopeProvider, G as AstNodeDescription, H as AsyncDisposable, I as Scope, J as ReferenceInfo, K as CstNode, L as JSDocDocumentationProvider, M as DefaultValueConverter, N as ValueType, O as DefaultDocumentValidator, P as MaybePromise, Q as PrecomputedScopes, R as DefaultIndexManager, S as CodeActionParams, T as DocumentSymbolParams, U as Disposable$1, V as WorkspaceCache, W as AstNode, X as LangiumDocument, Y as DefaultLangiumDocuments, Z as LangiumDocumentFactory, _ as CodeLensProvider, _t as TextEdit, a as LangiumServices, at as CodeLens, b as DefaultWorkspaceManager, bt as ast_d_exports, c as AbstractSemanticTokenProvider, ct as Diagnostic, d as AbstractFormatter, dt as DocumentSymbol, et as CancellationToken$1, f as FormattingRegion, ft as FormattingOptions, g as DefaultDocumentHighlightProvider, gt as SymbolKind, h as DocumentLinkProvider, ht as Range, i as NextFeature, it as CodeAction, j as DefaultScopeComputation, k as ValidationOptions, l as SemanticTokenAcceptor, lt as DocumentHighlight, m as NodeKindProvider, mt as Location, n as CompletionContext, nt as FileSystemNode, o as LangiumSharedServices, ot as Command, p as DocumentSymbolProvider, pt as Hover, q as Reference, r as DefaultCompletionProvider, rt as FileSystemProvider, s as DefaultWorkspaceSymbolProvider, st as CompletionItemKind, t as CompletionAcceptor, tt as Stream, u as AstNodeHoverProvider, ut as DocumentLink, v as CodeActionProvider, vt as WorkspaceFolder, w as DocumentLinkParams, x as BuildOptions, xt as URI, y as index_d_exports, yt as Keyword, z as ReferenceDescription } from "./libs/langium.mjs";
|
|
4
4
|
import { t as $keywords } from "./libs/@ts-graphviz/common.mjs";
|
|
5
5
|
import "./libs/unstorage.mjs";
|
|
6
6
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
@@ -12,7 +12,7 @@ import { DefaultWeakMap, MultiMap } from "@likec4/core/utils";
|
|
|
12
12
|
import { ElementModel, LikeC4Model } from "@likec4/core/model";
|
|
13
13
|
import { AdhocViewPredicate, ComputedProjectsView, LayoutedProjectsView } from "@likec4/core/compute-view";
|
|
14
14
|
import { ConditionalPick, MergeExclusive, Simplify, Tagged, ValueOf, Writable } from "type-fest";
|
|
15
|
-
//#region ../../node_modules/.pnpm/@logtape+logtape@2.
|
|
15
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.3.4/node_modules/@logtape/logtape/dist/level.d.ts
|
|
16
16
|
//#region src/level.d.ts
|
|
17
17
|
declare const logLevels: readonly ["trace", "debug", "info", "warning", "error", "fatal"];
|
|
18
18
|
/**
|
|
@@ -20,7 +20,7 @@ declare const logLevels: readonly ["trace", "debug", "info", "warning", "error",
|
|
|
20
20
|
*/
|
|
21
21
|
type LogLevel = typeof logLevels[number];
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region ../../node_modules/.pnpm/@logtape+logtape@2.
|
|
23
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.3.4/node_modules/@logtape/logtape/dist/record.d.ts
|
|
24
24
|
//#region src/record.d.ts
|
|
25
25
|
/**
|
|
26
26
|
* A log record.
|
|
@@ -65,7 +65,7 @@ interface LogRecord {
|
|
|
65
65
|
readonly properties: Record<string, unknown>;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region ../../node_modules/.pnpm/@logtape+logtape@2.
|
|
68
|
+
//#region ../../node_modules/.pnpm/@logtape+logtape@2.3.4/node_modules/@logtape/logtape/dist/logger.d.ts
|
|
69
69
|
/**
|
|
70
70
|
* A logger interface. It provides methods to log messages at different
|
|
71
71
|
* severity levels.
|
|
@@ -1569,8 +1569,6 @@ declare abstract class ADisposable implements Disposable$1 {
|
|
|
1569
1569
|
dispose(): void;
|
|
1570
1570
|
protected throwIfDisposed(): void;
|
|
1571
1571
|
}
|
|
1572
|
-
//#endregion
|
|
1573
|
-
//#region src/generated/ast.d.ts
|
|
1574
1572
|
type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty | RelationProperty | RelationshipStyleProperty | StringProperty | StyleProperty | ViewProperty;
|
|
1575
1573
|
declare const AnyProperty = "AnyProperty";
|
|
1576
1574
|
type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
@@ -1790,6 +1788,7 @@ interface DeploymentRelation extends AstNode {
|
|
|
1790
1788
|
body?: DeploymentRelationBody;
|
|
1791
1789
|
description?: string;
|
|
1792
1790
|
dotKind?: RelationKindDotRef;
|
|
1791
|
+
isBidirectional: boolean;
|
|
1793
1792
|
kind?: Reference<RelationshipKind>;
|
|
1794
1793
|
source?: FqnRef$2;
|
|
1795
1794
|
tags?: Tags;
|
|
@@ -3519,6 +3518,10 @@ declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
|
|
|
3519
3518
|
workspace(): WorkspaceFolder | null;
|
|
3520
3519
|
rebuildAll(cancelToken?: CancellationToken$1): Promise<void>;
|
|
3521
3520
|
get workspaceUri(): URI;
|
|
3521
|
+
/**
|
|
3522
|
+
* Returns relative path from workspace to the given URI
|
|
3523
|
+
*/
|
|
3524
|
+
relativePath(uri: URI): string;
|
|
3522
3525
|
get workspaceURL(): URL;
|
|
3523
3526
|
/**
|
|
3524
3527
|
* Force clean all caches
|
|
@@ -3670,7 +3673,7 @@ declare class MergedSpecification {
|
|
|
3670
3673
|
/**
|
|
3671
3674
|
* Converts a parsed deployment relation into a C4 deployment relation.
|
|
3672
3675
|
*/
|
|
3673
|
-
toDeploymentRelation: ({ astPath: _astPath, source, target, kind, links, id, tags, ...model }: ParsedAstDeploymentRelation) => c4.DeploymentRelationship | null;
|
|
3676
|
+
toDeploymentRelation: ({ astPath: _astPath, source, target, kind, links, id, tags, isBidirectional, ...model }: ParsedAstDeploymentRelation) => c4.DeploymentRelationship | null;
|
|
3674
3677
|
}
|
|
3675
3678
|
//#endregion
|
|
3676
3679
|
//#region src/model/last-seen-artifacts.d.ts
|
|
@@ -4640,6 +4643,23 @@ declare class LikeC4ModelChanges {
|
|
|
4640
4643
|
}
|
|
4641
4644
|
//#endregion
|
|
4642
4645
|
//#region src/LikeC4LanguageServices.d.ts
|
|
4646
|
+
interface LikeC4ProjectData {
|
|
4647
|
+
readonly id: ProjectId$1;
|
|
4648
|
+
/**
|
|
4649
|
+
* Absolute path to project folder
|
|
4650
|
+
*/
|
|
4651
|
+
readonly folder: URI;
|
|
4652
|
+
/**
|
|
4653
|
+
* Relative path from workspace to project folder
|
|
4654
|
+
*/
|
|
4655
|
+
readonly path: string;
|
|
4656
|
+
/**
|
|
4657
|
+
* Project title
|
|
4658
|
+
*/
|
|
4659
|
+
readonly title: string;
|
|
4660
|
+
readonly documents: ReadonlyArray<URI>;
|
|
4661
|
+
readonly config: Readonly<LikeC4ProjectConfig>;
|
|
4662
|
+
}
|
|
4643
4663
|
interface LikeC4LanguageServices {
|
|
4644
4664
|
readonly views: LikeC4Views;
|
|
4645
4665
|
readonly builder: LikeC4ModelBuilder;
|
|
@@ -4650,23 +4670,20 @@ interface LikeC4LanguageServices {
|
|
|
4650
4670
|
/**
|
|
4651
4671
|
* Returns all projects with relevant documents
|
|
4652
4672
|
*/
|
|
4653
|
-
projects(): NonEmptyArray$1<
|
|
4654
|
-
id: ProjectId$1;
|
|
4655
|
-
folder: URI;
|
|
4656
|
-
title: string;
|
|
4657
|
-
documents: ReadonlyArray<URI>;
|
|
4658
|
-
config: Readonly<LikeC4ProjectConfig>;
|
|
4659
|
-
}>;
|
|
4673
|
+
projects(): NonEmptyArray$1<LikeC4ProjectData>;
|
|
4660
4674
|
/**
|
|
4661
4675
|
* Returns project by ID, returns default project if no ID is specified
|
|
4662
4676
|
*/
|
|
4663
|
-
project(projectId?: ProjectId$1):
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4677
|
+
project(projectId?: ProjectId$1): LikeC4ProjectData;
|
|
4678
|
+
/**
|
|
4679
|
+
* Computes and layouts projects overview - a special diagram
|
|
4680
|
+
* that shows all projects and their relationships
|
|
4681
|
+
}>
|
|
4682
|
+
|
|
4683
|
+
/**
|
|
4684
|
+
* Returns project by ID, returns default project if no ID is specified
|
|
4685
|
+
*/
|
|
4686
|
+
project(projectId?: ProjectId$1): LikeC4ProjectData;
|
|
4670
4687
|
/**
|
|
4671
4688
|
* Computes and layouts projects overview - a special diagram
|
|
4672
4689
|
* that shows all projects and their relationships
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../rolldown-runtime.mjs";var e=typeof global==`object`&&global&&global.Object===Object&&global,t=typeof self==`object`&&self&&self.Object===Object&&self,n=e||t||Function(`return this`)(),r=n.Symbol,i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;function getRawTag(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch{}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}var c=Object.prototype.toString;function objectToString(e){return c.call(e)}var l=`[object Null]`,u=`[object Undefined]`,d=r?r.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?u:l:d&&d in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return typeof e==`object`&&!!e}var f=`[object Symbol]`;function isSymbol(e){return typeof e==`symbol`||isObjectLike(e)&&baseGetTag(e)==f}function arrayMap(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p=Array.isArray,m=1/0,h=r?r.prototype:void 0,g=h?h.toString:void 0;function baseToString(e){if(typeof e==`string`)return e;if(p(e))return arrayMap(e,baseToString)+``;if(isSymbol(e))return g?g.call(e):``;var t=e+``;return t==`0`&&1/e==-m?`-0`:t}var _=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}var v=/^\s+/;function baseTrim(e){return e&&e.slice(0,trimmedEndIndex(e)+1).replace(v,``)}function isObject(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var y=NaN,ee=/^[-+]0x[0-9a-f]+$/i,te=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,re=parseInt;function toNumber(e){if(typeof e==`number`)return e;if(isSymbol(e))return y;if(isObject(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=isObject(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=baseTrim(e);var n=te.test(e);return n||ne.test(e)?re(e.slice(2),n?2:8):ee.test(e)?y:+e}var b=1/0,ie=17976931348623157e292;function toFinite(e){return e?(e=toNumber(e),e===b||e===-b?(e<0?-1:1)*ie:e===e?e:0):e===0?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function identity(e){return e}var ae=`[object AsyncFunction]`,oe=`[object Function]`,se=`[object GeneratorFunction]`,ce=`[object Proxy]`;function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==oe||t==se||t==ae||t==ce}var x=n[`__core-js_shared__`],le=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function isMasked(e){return!!le&&le in e}var ue=Function.prototype.toString;function toSource(e){if(e!=null){try{return ue.call(e)}catch{}try{return e+``}catch{}}return``}var de=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,pe=Function.prototype,me=Object.prototype,he=pe.toString,ge=me.hasOwnProperty,_e=RegExp(`^`+he.call(ge).replace(de,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function baseIsNative(e){return!isObject(e)||isMasked(e)?!1:(isFunction(e)?_e:fe).test(toSource(e))}function getValue(e,t){return e?.[t]}function getNative(e,t){var n=getValue(e,t);return baseIsNative(n)?n:void 0}var S=getNative(n,`WeakMap`);function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ve=800,ye=16,be=Date.now;function shortOut(e){var t=0,n=0;return function(){var r=be(),i=ye-(r-n);if(n=r,i>0){if(++t>=ve)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var C=function(){try{var e=getNative(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),xe=shortOut(C?function(e,t){return C(e,`toString`,{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity);function arrayEach(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function baseFindIndex(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function baseIsNaN(e){return e!==e}function strictIndexOf(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function baseIndexOf(e,t,n){return t===t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}var Se=9007199254740991,Ce=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var n=typeof e;return t??=Se,!!t&&(n==`number`||n!=`symbol`&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,n){t==`__proto__`&&C?C(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function eq(e,t){return e===t||e!==e&&t!==t}var we=Object.prototype.hasOwnProperty;function assignValue(e,t,n){var r=e[t];(!(we.call(e,t)&&eq(r,n))||n===void 0&&!(t in e))&&baseAssignValue(e,t,n)}function copyObject(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?baseAssignValue(n,s,c):assignValue(n,s,c)}return n}var w=Math.max;function overRest(e,t,n){return t=w(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=w(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),apply(e,this,s)}}function baseRest(e,t){return xe(overRest(e,t,identity),e+``)}var Te=9007199254740991;function isLength(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Te}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isIterateeCall(e,t,n){if(!isObject(n))return!1;var r=typeof t;return(r==`number`?isArrayLike(n)&&isIndex(t,n.length):r==`string`&&t in n)?eq(n[t],e):!1}function createAssigner(e){return baseRest(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&isIterateeCall(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Ee=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ee)}function baseTimes(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var De=`[object Arguments]`;function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==De}var T=Object.prototype,Oe=T.hasOwnProperty,ke=T.propertyIsEnumerable,E=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&Oe.call(e,`callee`)&&!ke.call(e,`callee`)};function stubFalse(){return!1}var D=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ae=D&&typeof module==`object`&&module&&!module.nodeType&&module,je=Ae&&Ae.exports===D?n.Buffer:void 0,O=(je?je.isBuffer:void 0)||stubFalse,Me=`[object Arguments]`,Ne=`[object Array]`,Pe=`[object Boolean]`,Fe=`[object Date]`,Ie=`[object Error]`,Le=`[object Function]`,Re=`[object Map]`,ze=`[object Number]`,Be=`[object Object]`,Ve=`[object RegExp]`,He=`[object Set]`,Ue=`[object String]`,We=`[object WeakMap]`,Ge=`[object ArrayBuffer]`,Ke=`[object DataView]`,qe=`[object Float32Array]`,Je=`[object Float64Array]`,Ye=`[object Int8Array]`,Xe=`[object Int16Array]`,Ze=`[object Int32Array]`,Qe=`[object Uint8Array]`,$e=`[object Uint8ClampedArray]`,et=`[object Uint16Array]`,tt=`[object Uint32Array]`,k={};k[qe]=k[Je]=k[Ye]=k[Xe]=k[Ze]=k[Qe]=k[$e]=k[et]=k[tt]=!0,k[Me]=k[Ne]=k[Ge]=k[Pe]=k[Ke]=k[Fe]=k[Ie]=k[Le]=k[Re]=k[ze]=k[Be]=k[Ve]=k[He]=k[Ue]=k[We]=!1;function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!k[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}var A=typeof exports==`object`&&exports&&!exports.nodeType&&exports,j=A&&typeof module==`object`&&module&&!module.nodeType&&module,M=j&&j.exports===A&&e.process,N=function(){try{return j&&j.require&&j.require(`util`).types||M&&M.binding&&M.binding(`util`)}catch{}}(),P=N&&N.isTypedArray,F=P?baseUnary(P):baseIsTypedArray,nt=Object.prototype.hasOwnProperty;function arrayLikeKeys(e,t){var n=p(e),r=!n&&E(e),i=!n&&!r&&O(e),a=!n&&!r&&!i&&F(e),o=n||r||i||a,s=o?baseTimes(e.length,String):[],c=s.length;for(var l in e)(t||nt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||isIndex(l,c)))&&s.push(l);return s}function overArg(e,t){return function(n){return e(t(n))}}var rt=overArg(Object.keys,Object),it=Object.prototype.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return rt(e);var t=[];for(var n in Object(e))it.call(e,n)&&n!=`constructor`&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var at=Object.prototype.hasOwnProperty,I=createAssigner(function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var n in t)at.call(t,n)&&assignValue(e,n,t[n])});function nativeKeysIn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),n=[];for(var r in e)r==`constructor`&&(t||!ot.call(e,r))||n.push(r);return n}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/;function isKey(e,t){if(p(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||isSymbol(e)?!0:ct.test(e)||!st.test(e)||t!=null&&e in Object(t)}var L=getNative(Object,`create`);function hashClear(){this.__data__=L?L(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var lt=`__lodash_hash_undefined__`,ut=Object.prototype.hasOwnProperty;function hashGet(e){var t=this.__data__;if(L){var n=t[e];return n===lt?void 0:n}return ut.call(t,e)?t[e]:void 0}var dt=Object.prototype.hasOwnProperty;function hashHas(e){var t=this.__data__;return L?t[e]!==void 0:dt.call(t,e)}var ft=`__lodash_hash_undefined__`;function hashSet(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=L&&t===void 0?ft:t,this}function Hash(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var n=e.length;n--;)if(eq(e[n][0],t))return n;return-1}var pt=Array.prototype.splice;function listCacheDelete(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?!1:(n==t.length-1?t.pop():pt.call(t,n,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?void 0:t[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ListCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var R=getNative(n,`Map`);function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(R||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function getMapData(e,t){var n=e.__data__;return isKeyable(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=+!!t,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var n=getMapData(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function MapCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var mt=`Expected a function`;function memoize(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mt);var memoized=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=memoized.cache;if(i.has(r))return i.get(r);var a=e.apply(this,n);return memoized.cache=i.set(r,a)||i,a};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var ht=500;function memoizeCapped(e){var t=memoize(e,function(e){return n.size===ht&&n.clear(),e}),n=t.cache;return t}var gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_t=/\\(\\)?/g,vt=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(gt,function(e,n,r,i){t.push(r?i.replace(_t,`$1`):n||e)}),t});function toString(e){return e==null?``:baseToString(e)}function castPath(e,t){return p(e)?e:isKey(e,t)?[e]:vt(toString(e))}var yt=1/0;function toKey(e){if(typeof e==`string`||isSymbol(e))return e;var t=e+``;return t==`0`&&1/e==-yt?`-0`:t}function baseGet(e,t){t=castPath(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[toKey(t[n++])];return n&&n==r?e:void 0}function get(e,t,n){var r=e==null?void 0:baseGet(e,t);return r===void 0?n:r}function arrayPush(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bt=overArg(Object.getPrototypeOf,Object);function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var xt=200;function stackSet(e,t){var n=this.__data__;if(n instanceof ListCache){var r=n.__data__;if(!R||r.length<xt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache(r)}return n.set(e,t),this.size=n.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;function arrayFilter(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function stubArray(){return[]}var St=Object.prototype.propertyIsEnumerable,Ct=Object.getOwnPropertySymbols,z=Ct?function(e){return e==null?[]:(e=Object(e),arrayFilter(Ct(e),function(t){return St.call(e,t)}))}:stubArray,B=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)arrayPush(t,z(e)),e=bt(e);return t}:stubArray;function baseGetAllKeys(e,t,n){var r=t(e);return p(e)?r:arrayPush(r,n(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,z)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,B)}var V=getNative(n,`DataView`),H=getNative(n,`Promise`),U=getNative(n,`Set`),W=`[object Map]`,wt=`[object Object]`,G=`[object Promise]`,K=`[object Set]`,q=`[object WeakMap]`,J=`[object DataView]`,Tt=toSource(V),Et=toSource(R),Dt=toSource(H),Ot=toSource(U),kt=toSource(S),getTag=baseGetTag;(V&&getTag(new V(new ArrayBuffer(1)))!=J||R&&getTag(new R)!=W||H&&getTag(H.resolve())!=G||U&&getTag(new U)!=K||S&&getTag(new S)!=q)&&(getTag=function(e){var t=baseGetTag(e),n=t==wt?e.constructor:void 0,r=n?toSource(n):``;if(r)switch(r){case Tt:return J;case Et:return W;case Dt:return G;case Ot:return K;case kt:return q}return t});var Y=getTag,X=n.Uint8Array,At=`__lodash_hash_undefined__`;function setCacheAdd(e){return this.__data__.set(e,At),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}var jt=1,Mt=2;function equalArrays(e,t,n,r,i,a){var o=n&jt,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Mt?new SetCache:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!arraySome(t,function(e,t){if(!cacheHas(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function mapToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function setToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=1,Pt=2,Ft=`[object Boolean]`,It=`[object Date]`,Lt=`[object Error]`,Rt=`[object Map]`,zt=`[object Number]`,Bt=`[object RegExp]`,Vt=`[object Set]`,Ht=`[object String]`,Ut=`[object Symbol]`,Wt=`[object ArrayBuffer]`,Gt=`[object DataView]`,Kt=r?r.prototype:void 0,Z=Kt?Kt.valueOf:void 0;function equalByTag(e,t,n,r,i,a,o){switch(n){case Gt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wt:return!(e.byteLength!=t.byteLength||!a(new X(e),new X(t)));case Ft:case It:case zt:return eq(+e,+t);case Lt:return e.name==t.name&&e.message==t.message;case Bt:case Ht:return e==t+``;case Rt:var s=mapToArray;case Vt:var c=r&Nt;if(s||=setToArray,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Pt,o.set(e,t);var u=equalArrays(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ut:if(Z)return Z.call(e)==Z.call(t)}return!1}var qt=1,Jt=Object.prototype.hasOwnProperty;function equalObjects(e,t,n,r,i,a){var o=n&qt,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Jt.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Yt=1,Xt=`[object Arguments]`,Zt=`[object Array]`,Q=`[object Object]`,Qt=Object.prototype.hasOwnProperty;function baseIsEqualDeep(e,t,n,r,i,a){var o=p(e),s=p(t),c=o?Zt:Y(e),l=s?Zt:Y(t);c=c==Xt?Q:c,l=l==Xt?Q:l;var u=c==Q,d=l==Q,f=c==l;if(f&&O(e)){if(!O(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Stack,o||F(e)?equalArrays(e,t,n,r,i,a):equalByTag(e,t,c,n,r,i,a);if(!(n&Yt)){var m=u&&Qt.call(e,`__wrapped__`),h=d&&Qt.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new Stack,i(g,_,n,r,a)}}return f?(a||=new Stack,equalObjects(e,t,n,r,i,a)):!1}function baseIsEqual(e,t,n,r,i){return e===t?!0:e==null||t==null||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,n,r,baseIsEqual,i)}var $t=1,en=2;function baseIsMatch(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Stack;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?baseIsEqual(u,l,$t|en,r,d):f))return!1}}return!0}function isStrictComparable(e){return e===e&&!isObject(e)}function getMatchData(e){for(var t=keys(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,isStrictComparable(i)]}return t}function matchesStrictComparable(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function baseMatches(e){var t=getMatchData(e);return t.length==1&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(n){return n===e||baseIsMatch(n,e,t)}}function baseHasIn(e,t){return e!=null&&t in Object(e)}function hasPath(e,t,n){t=castPath(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=toKey(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&isLength(i)&&isIndex(o,i)&&(p(e)||E(e)))}function hasIn(e,t){return e!=null&&hasPath(e,t,baseHasIn)}var tn=1,nn=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(n){var r=get(n,e);return r===void 0&&r===t?hasIn(n,e):baseIsEqual(t,r,tn|nn)}}function baseProperty(e){return function(t){return t?.[e]}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return typeof e==`function`?e:e==null?identity:typeof e==`object`?p(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function createBaseFor(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var rn=createBaseFor();function baseForOwn(e,t){return e&&rn(e,t,keys)}function createBaseEach(e,t){return function(n,r){if(n==null)return n;if(!isArrayLike(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $=createBaseEach(baseForOwn);function castFunction(e){return typeof e==`function`?e:identity}function forEach(e,t){return(p(e)?arrayEach:$)(e,castFunction(t))}function arrayEvery(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function baseEvery(e,t){var n=!0;return $(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function every(e,t,n){var r=p(e)?arrayEvery:baseEvery;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function baseMap(e,t){var n=-1,r=isArrayLike(e)?Array(e.length):[];return $(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function map(e,t){return(p(e)?arrayMap:baseMap)(e,baseIteratee(t,3))}var an=`[object String]`;function isString(e){return typeof e==`string`||!p(e)&&isObjectLike(e)&&baseGetTag(e)==an}function baseValues(e,t){return arrayMap(t,function(t){return e[t]})}function values(e){return e==null?[]:baseValues(e,keys(e))}var on=Math.max;function includes(e,t,n,r){e=isArrayLike(e)?e:values(e),n=n&&!r?toInteger(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),isString(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&baseIndexOf(e,t,n)>-1}var sn=`[object RegExp]`;function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==sn}var cn=N&&N.isRegExp,ln=cn?baseUnary(cn):baseIsRegExp;function baseSet(e,t,n,r){if(!isObject(e))return e;t=castPath(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=toKey(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=isObject(u)?u:isIndex(t[i+1])?[]:{})}assignValue(s,c,l),s=s[c]}return e}function basePickBy(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=baseGet(e,o);n(s,o)&&baseSet(a,castPath(o,e),s)}return a}function pickBy(e,t){if(e==null)return{};var n=arrayMap(getAllKeysIn(e),function(e){return[e]});return t=baseIteratee(t),basePickBy(e,n,function(e,n){return t(e,n[0])})}function baseSome(e,t){var n;return $(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function some(e,t,n){var r=p(e)?arraySome:baseSome;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function tokenLabel(e){return hasTokenLabel(e)?e.LABEL:e.name}function hasTokenLabel(e){return isString(e.LABEL)&&e.LABEL!==``}var AbstractProduction=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),forEach(this.definition,t=>{t.accept(e)})}},NonTerminal=class extends AbstractProduction{constructor(e){super([]),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},Rule=class extends AbstractProduction{constructor(e){super(e.definition),this.orgText=``,I(this,pickBy(e,e=>e!==void 0))}},Alternative=class extends AbstractProduction{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,I(this,pickBy(e,e=>e!==void 0))}},Option=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatory=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatoryWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Repetition=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Alternation=class extends AbstractProduction{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,I(this,pickBy(e,e=>e!==void 0))}},Terminal=class{constructor(e){this.idx=1,I(this,pickBy(e,e=>e!==void 0))}accept(e){e.visit(this)}};function serializeGrammar(e){return map(e,serializeProduction)}function serializeProduction(e){function convertDefinition(e){return map(e,serializeProduction)}if(e instanceof NonTerminal){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return isString(e.label)&&(t.label=e.label),t}if(e instanceof Alternative)return{type:`Alternative`,definition:convertDefinition(e.definition)};if(e instanceof Option)return{type:`Option`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof RepetitionMandatory)return{type:`RepetitionMandatory`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof RepetitionMandatoryWithSeparator)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};if(e instanceof RepetitionWithSeparator)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};if(e instanceof Repetition)return{type:`Repetition`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof Alternation)return{type:`Alternation`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof Terminal){let t={type:`Terminal`,name:e.terminalType.name,label:tokenLabel(e.terminalType),idx:e.idx};isString(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ln(n)?n.source:n),t}if(e instanceof Rule)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:convertDefinition(e.definition)};throw Error(`non exhaustive match`)}var GAstVisitor=class{visit(e){let t=e;switch(t.constructor){case NonTerminal:return this.visitNonTerminal(t);case Alternative:return this.visitAlternative(t);case Option:return this.visitOption(t);case RepetitionMandatory:return this.visitRepetitionMandatory(t);case RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Repetition:return this.visitRepetition(t);case Alternation:return this.visitAlternation(t);case Terminal:return this.visitTerminal(t);case Rule:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function isSequenceProd(e){return e instanceof Alternative||e instanceof Option||e instanceof Repetition||e instanceof RepetitionMandatory||e instanceof RepetitionMandatoryWithSeparator||e instanceof RepetitionWithSeparator||e instanceof Terminal||e instanceof Rule}function isOptionalProd(e,t=[]){return e instanceof Option||e instanceof Repetition||e instanceof RepetitionWithSeparator?!0:e instanceof Alternation?some(e.definition,e=>isOptionalProd(e,t)):e instanceof NonTerminal&&includes(t,e)?!1:e instanceof AbstractProduction&&(e instanceof NonTerminal&&t.push(e),every(e.definition,e=>isOptionalProd(e,t)))}function isBranchingProd(e){return e instanceof Alternation}function getProductionDslName(e){if(e instanceof NonTerminal)return`SUBRULE`;if(e instanceof Option)return`OPTION`;if(e instanceof Alternation)return`OR`;if(e instanceof RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof Repetition)return`MANY`;if(e instanceof Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}export{isIterateeCall as $,cacheHas as A,Stack as B,map as C,baseIteratee as D,$ as E,getAllKeysIn as F,keys as G,arrayPush as H,getAllKeys as I,N as J,baseKeys as K,B as L,X as M,Y as N,hasPath as O,U as P,isPrototype as Q,z as R,isString as S,forEach as T,keysIn as U,bt as V,I as W,O as X,baseUnary as Y,E as Z,some as _,n as _t,GAstVisitor as a,baseAssignValue as at,includes as b,NonTerminal as c,arrayEach as ct,RepetitionMandatory as d,toInteger as dt,isArrayLike as et,RepetitionMandatoryWithSeparator as f,isObject as ft,serializeGrammar as g,r as gt,Terminal as h,isObjectLike as ht,isSequenceProd as i,eq as it,SetCache as j,setToArray as k,Option as l,isFunction as lt,Rule as m,arrayMap as mt,isBranchingProd as n,copyObject as nt,Alternation as o,baseIndexOf as ot,RepetitionWithSeparator as p,p as pt,F as q,isOptionalProd as r,assignValue as rt,Alternative as s,baseFindIndex as st,getProductionDslName as t,baseRest as tt,Repetition as u,identity as ut,pickBy as v,every as w,values as x,ln as y,arrayFilter as z};
|
|
1
|
+
import"../../rolldown-runtime.mjs";var e=typeof global==`object`&&global&&global.Object===Object&&global,t=typeof self==`object`&&self&&self.Object===Object&&self,n=e||t||Function(`return this`)(),r=n.Symbol,i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;function getRawTag(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch{}var i=o.call(e);return r&&(t?e[s]=n:delete e[s]),i}var c=Object.prototype.toString;function objectToString(e){return c.call(e)}var l=`[object Null]`,u=`[object Undefined]`,d=r?r.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?u:l:d&&d in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return typeof e==`object`&&!!e}var f=`[object Symbol]`;function isSymbol(e){return typeof e==`symbol`||isObjectLike(e)&&baseGetTag(e)==f}function arrayMap(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p=Array.isArray,m=1/0,h=r?r.prototype:void 0,g=h?h.toString:void 0;function baseToString(e){if(typeof e==`string`)return e;if(p(e))return arrayMap(e,baseToString)+``;if(isSymbol(e))return g?g.call(e):``;var t=e+``;return t==`0`&&1/e==-m?`-0`:t}var _=/\s/;function trimmedEndIndex(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}var v=/^\s+/;function baseTrim(e){return e&&e.slice(0,trimmedEndIndex(e)+1).replace(v,``)}function isObject(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var y=NaN,ee=/^[-+]0x[0-9a-f]+$/i,te=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,re=parseInt;function toNumber(e){if(typeof e==`number`)return e;if(isSymbol(e))return y;if(isObject(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=isObject(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=baseTrim(e);var n=te.test(e);return n||ne.test(e)?re(e.slice(2),n?2:8):ee.test(e)?y:+e}var b=1/0,ie=17976931348623157e292;function toFinite(e){return e?(e=toNumber(e),e===b||e===-b?(e<0?-1:1)*ie:e===e?e:0):e===0?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function identity(e){return e}var ae=`[object AsyncFunction]`,oe=`[object Function]`,se=`[object GeneratorFunction]`,ce=`[object Proxy]`;function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==oe||t==se||t==ae||t==ce}var x=n[`__core-js_shared__`],le=function(){var e=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function isMasked(e){return!!le&&le in e}var ue=Function.prototype.toString;function toSource(e){if(e!=null){try{return ue.call(e)}catch{}try{return e+``}catch{}}return``}var de=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,pe=Function.prototype,me=Object.prototype,he=pe.toString,ge=me.hasOwnProperty,_e=RegExp(`^`+he.call(ge).replace(de,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function baseIsNative(e){return!isObject(e)||isMasked(e)?!1:(isFunction(e)?_e:fe).test(toSource(e))}function getValue(e,t){return e?.[t]}function getNative(e,t){var n=getValue(e,t);return baseIsNative(n)?n:void 0}var S=getNative(n,`WeakMap`);function apply(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ve=800,ye=16,be=Date.now;function shortOut(e){var t=0,n=0;return function(){var r=be(),i=ye-(r-n);if(n=r,i>0){if(++t>=ve)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var C=function(){try{var e=getNative(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),xe=shortOut(C?function(e,t){return C(e,`toString`,{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity);function arrayEach(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function baseFindIndex(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function baseIsNaN(e){return e!==e}function strictIndexOf(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function baseIndexOf(e,t,n){return t===t?strictIndexOf(e,t,n):baseFindIndex(e,baseIsNaN,n)}var Se=9007199254740991,Ce=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var n=typeof e;return t??=Se,!!t&&(n==`number`||n!=`symbol`&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,n){t==`__proto__`&&C?C(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function eq(e,t){return e===t||e!==e&&t!==t}var we=Object.prototype.hasOwnProperty;function assignValue(e,t,n){var r=e[t];(!(we.call(e,t)&&eq(r,n))||n===void 0&&!(t in e))&&baseAssignValue(e,t,n)}function copyObject(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?baseAssignValue(n,s,c):assignValue(n,s,c)}return n}var w=Math.max;function overRest(e,t,n){return t=w(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=w(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),apply(e,this,s)}}function baseRest(e,t){return xe(overRest(e,t,identity),e+``)}var Te=9007199254740991;function isLength(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Te}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isIterateeCall(e,t,n){if(!isObject(n))return!1;var r=typeof t;return(r==`number`?isArrayLike(n)&&isIndex(t,n.length):r==`string`&&t in n)?eq(n[t],e):!1}function createAssigner(e){return baseRest(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&isIterateeCall(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Ee=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ee)}function baseTimes(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var De=`[object Arguments]`;function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==De}var T=Object.prototype,Oe=T.hasOwnProperty,ke=T.propertyIsEnumerable,E=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&Oe.call(e,`callee`)&&!ke.call(e,`callee`)};function stubFalse(){return!1}var D=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Ae=D&&typeof module==`object`&&module&&!module.nodeType&&module,je=Ae&&Ae.exports===D?n.Buffer:void 0,O=(je?je.isBuffer:void 0)||stubFalse,Me=`[object Arguments]`,Ne=`[object Array]`,Pe=`[object Boolean]`,Fe=`[object Date]`,Ie=`[object Error]`,Le=`[object Function]`,Re=`[object Map]`,ze=`[object Number]`,Be=`[object Object]`,Ve=`[object RegExp]`,He=`[object Set]`,Ue=`[object String]`,We=`[object WeakMap]`,Ge=`[object ArrayBuffer]`,Ke=`[object DataView]`,qe=`[object Float32Array]`,Je=`[object Float64Array]`,Ye=`[object Int8Array]`,Xe=`[object Int16Array]`,Ze=`[object Int32Array]`,Qe=`[object Uint8Array]`,$e=`[object Uint8ClampedArray]`,et=`[object Uint16Array]`,tt=`[object Uint32Array]`,k={};k[qe]=k[Je]=k[Ye]=k[Xe]=k[Ze]=k[Qe]=k[$e]=k[et]=k[tt]=!0,k[Me]=k[Ne]=k[Ge]=k[Pe]=k[Ke]=k[Fe]=k[Ie]=k[Le]=k[Re]=k[ze]=k[Be]=k[Ve]=k[He]=k[Ue]=k[We]=!1;function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!k[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}var A=typeof exports==`object`&&exports&&!exports.nodeType&&exports,j=A&&typeof module==`object`&&module&&!module.nodeType&&module,M=j&&j.exports===A&&e.process,N=function(){try{return j&&j.require&&j.require(`util`).types||M&&M.binding&&M.binding(`util`)}catch{}}(),P=N&&N.isTypedArray,F=P?baseUnary(P):baseIsTypedArray,nt=Object.prototype.hasOwnProperty;function arrayLikeKeys(e,t){var n=p(e),r=!n&&E(e),i=!n&&!r&&O(e),a=!n&&!r&&!i&&F(e),o=n||r||i||a,s=o?baseTimes(e.length,String):[],c=s.length;for(var l in e)(t||nt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||isIndex(l,c)))&&s.push(l);return s}function overArg(e,t){return function(n){return e(t(n))}}var rt=overArg(Object.keys,Object),it=Object.prototype.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return rt(e);var t=[];for(var n in Object(e))it.call(e,n)&&n!=`constructor`&&t.push(n);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var at=Object.prototype.hasOwnProperty,I=createAssigner(function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var n in t)at.call(t,n)&&assignValue(e,n,t[n])});function nativeKeysIn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),n=[];for(var r in e)(r!=`constructor`||!t&&ot.call(e,r))&&n.push(r);return n}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ct=/^\w*$/;function isKey(e,t){if(p(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||isSymbol(e)?!0:ct.test(e)||!st.test(e)||t!=null&&e in Object(t)}var L=getNative(Object,`create`);function hashClear(){this.__data__=L?L(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var lt=`__lodash_hash_undefined__`,ut=Object.prototype.hasOwnProperty;function hashGet(e){var t=this.__data__;if(L){var n=t[e];return n===lt?void 0:n}return ut.call(t,e)?t[e]:void 0}var dt=Object.prototype.hasOwnProperty;function hashHas(e){var t=this.__data__;return L?t[e]!==void 0:dt.call(t,e)}var ft=`__lodash_hash_undefined__`;function hashSet(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=L&&t===void 0?ft:t,this}function Hash(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var n=e.length;n--;)if(eq(e[n][0],t))return n;return-1}var pt=Array.prototype.splice;function listCacheDelete(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?!1:(n==t.length-1?t.pop():pt.call(t,n,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,n=assocIndexOf(t,e);return n<0?void 0:t[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ListCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var R=getNative(n,`Map`);function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(R||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function getMapData(e,t){var n=e.__data__;return isKeyable(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=+!!t,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var n=getMapData(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function MapCache(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var mt=`Expected a function`;function memoize(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(mt);var memoized=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=memoized.cache;if(i.has(r))return i.get(r);var a=e.apply(this,n);return memoized.cache=i.set(r,a)||i,a};return memoized.cache=new(memoize.Cache||MapCache),memoized}memoize.Cache=MapCache;var ht=500;function memoizeCapped(e){var t=memoize(e,function(e){return n.size===ht&&n.clear(),e}),n=t.cache;return t}var gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_t=/\\(\\)?/g,vt=memoizeCapped(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(gt,function(e,n,r,i){t.push(r?i.replace(_t,`$1`):n||e)}),t});function toString(e){return e==null?``:baseToString(e)}function castPath(e,t){return p(e)?e:isKey(e,t)?[e]:vt(toString(e))}var yt=1/0;function toKey(e){if(typeof e==`string`||isSymbol(e))return e;var t=e+``;return t==`0`&&1/e==-yt?`-0`:t}function baseGet(e,t){t=castPath(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[toKey(t[n++])];return n&&n==r?e:void 0}function get(e,t,n){var r=e==null?void 0:baseGet(e,t);return r===void 0?n:r}function arrayPush(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var bt=overArg(Object.getPrototypeOf,Object);function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var xt=200;function stackSet(e,t){var n=this.__data__;if(n instanceof ListCache){var r=n.__data__;if(!R||r.length<xt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new MapCache(r)}return n.set(e,t),this.size=n.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;function arrayFilter(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function stubArray(){return[]}var St=Object.prototype.propertyIsEnumerable,Ct=Object.getOwnPropertySymbols,z=Ct?function(e){return e==null?[]:(e=Object(e),arrayFilter(Ct(e),function(t){return St.call(e,t)}))}:stubArray,B=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)arrayPush(t,z(e)),e=bt(e);return t}:stubArray;function baseGetAllKeys(e,t,n){var r=t(e);return p(e)?r:arrayPush(r,n(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,z)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,B)}var V=getNative(n,`DataView`),H=getNative(n,`Promise`),U=getNative(n,`Set`),W=`[object Map]`,wt=`[object Object]`,G=`[object Promise]`,K=`[object Set]`,q=`[object WeakMap]`,J=`[object DataView]`,Tt=toSource(V),Et=toSource(R),Dt=toSource(H),Ot=toSource(U),kt=toSource(S),getTag=baseGetTag;(V&&getTag(new V(new ArrayBuffer(1)))!=J||R&&getTag(new R)!=W||H&&getTag(H.resolve())!=G||U&&getTag(new U)!=K||S&&getTag(new S)!=q)&&(getTag=function(e){var t=baseGetTag(e),n=t==wt?e.constructor:void 0,r=n?toSource(n):``;if(r)switch(r){case Tt:return J;case Et:return W;case Dt:return G;case Ot:return K;case kt:return q}return t});var Y=getTag,X=n.Uint8Array,At=`__lodash_hash_undefined__`;function setCacheAdd(e){return this.__data__.set(e,At),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new MapCache;++t<n;)this.add(e[t])}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arraySome(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cacheHas(e,t){return e.has(t)}var jt=1,Mt=2;function equalArrays(e,t,n,r,i,a){var o=n&jt,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Mt?new SetCache:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!arraySome(t,function(e,t){if(!cacheHas(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function mapToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function setToArray(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=1,Pt=2,Ft=`[object Boolean]`,It=`[object Date]`,Lt=`[object Error]`,Rt=`[object Map]`,zt=`[object Number]`,Bt=`[object RegExp]`,Vt=`[object Set]`,Ht=`[object String]`,Ut=`[object Symbol]`,Wt=`[object ArrayBuffer]`,Gt=`[object DataView]`,Kt=r?r.prototype:void 0,Z=Kt?Kt.valueOf:void 0;function equalByTag(e,t,n,r,i,a,o){switch(n){case Gt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wt:return!(e.byteLength!=t.byteLength||!a(new X(e),new X(t)));case Ft:case It:case zt:return eq(+e,+t);case Lt:return e.name==t.name&&e.message==t.message;case Bt:case Ht:return e==t+``;case Rt:var s=mapToArray;case Vt:var c=r&Nt;if(s||=setToArray,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Pt,o.set(e,t);var u=equalArrays(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ut:if(Z)return Z.call(e)==Z.call(t)}return!1}var qt=1,Jt=Object.prototype.hasOwnProperty;function equalObjects(e,t,n,r,i,a){var o=n&qt,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Jt.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Yt=1,Xt=`[object Arguments]`,Zt=`[object Array]`,Q=`[object Object]`,Qt=Object.prototype.hasOwnProperty;function baseIsEqualDeep(e,t,n,r,i,a){var o=p(e),s=p(t),c=o?Zt:Y(e),l=s?Zt:Y(t);c=c==Xt?Q:c,l=l==Xt?Q:l;var u=c==Q,d=l==Q,f=c==l;if(f&&O(e)){if(!O(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Stack,o||F(e)?equalArrays(e,t,n,r,i,a):equalByTag(e,t,c,n,r,i,a);if(!(n&Yt)){var m=u&&Qt.call(e,`__wrapped__`),h=d&&Qt.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new Stack,i(g,_,n,r,a)}}return f?(a||=new Stack,equalObjects(e,t,n,r,i,a)):!1}function baseIsEqual(e,t,n,r,i){return e===t?!0:e==null||t==null||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,n,r,baseIsEqual,i)}var $t=1,en=2;function baseIsMatch(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Stack;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?baseIsEqual(u,l,$t|en,r,d):f))return!1}}return!0}function isStrictComparable(e){return e===e&&!isObject(e)}function getMatchData(e){for(var t=keys(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,isStrictComparable(i)]}return t}function matchesStrictComparable(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function baseMatches(e){var t=getMatchData(e);return t.length==1&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(n){return n===e||baseIsMatch(n,e,t)}}function baseHasIn(e,t){return e!=null&&t in Object(e)}function hasPath(e,t,n){t=castPath(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=toKey(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&isLength(i)&&isIndex(o,i)&&(p(e)||E(e)))}function hasIn(e,t){return e!=null&&hasPath(e,t,baseHasIn)}var tn=1,nn=2;function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(n){var r=get(n,e);return r===void 0&&r===t?hasIn(n,e):baseIsEqual(t,r,tn|nn)}}function baseProperty(e){return function(t){return t?.[e]}}function basePropertyDeep(e){return function(t){return baseGet(t,e)}}function property(e){return isKey(e)?baseProperty(toKey(e)):basePropertyDeep(e)}function baseIteratee(e){return typeof e==`function`?e:e==null?identity:typeof e==`object`?p(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function createBaseFor(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var rn=createBaseFor();function baseForOwn(e,t){return e&&rn(e,t,keys)}function createBaseEach(e,t){return function(n,r){if(n==null)return n;if(!isArrayLike(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var $=createBaseEach(baseForOwn);function castFunction(e){return typeof e==`function`?e:identity}function forEach(e,t){return(p(e)?arrayEach:$)(e,castFunction(t))}function arrayEvery(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function baseEvery(e,t){var n=!0;return $(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function every(e,t,n){var r=p(e)?arrayEvery:baseEvery;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function baseMap(e,t){var n=-1,r=isArrayLike(e)?Array(e.length):[];return $(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function map(e,t){return(p(e)?arrayMap:baseMap)(e,baseIteratee(t,3))}var an=`[object String]`;function isString(e){return typeof e==`string`||!p(e)&&isObjectLike(e)&&baseGetTag(e)==an}function baseValues(e,t){return arrayMap(t,function(t){return e[t]})}function values(e){return e==null?[]:baseValues(e,keys(e))}var on=Math.max;function includes(e,t,n,r){e=isArrayLike(e)?e:values(e),n=n&&!r?toInteger(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),isString(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&baseIndexOf(e,t,n)>-1}var sn=`[object RegExp]`;function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==sn}var cn=N&&N.isRegExp,ln=cn?baseUnary(cn):baseIsRegExp;function baseSet(e,t,n,r){if(!isObject(e))return e;t=castPath(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=toKey(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=isObject(u)?u:isIndex(t[i+1])?[]:{})}assignValue(s,c,l),s=s[c]}return e}function basePickBy(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=baseGet(e,o);n(s,o)&&baseSet(a,castPath(o,e),s)}return a}function pickBy(e,t){if(e==null)return{};var n=arrayMap(getAllKeysIn(e),function(e){return[e]});return t=baseIteratee(t),basePickBy(e,n,function(e,n){return t(e,n[0])})}function baseSome(e,t){var n;return $(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function some(e,t,n){var r=p(e)?arraySome:baseSome;return n&&isIterateeCall(e,t,n)&&(t=void 0),r(e,baseIteratee(t,3))}function tokenLabel(e){return hasTokenLabel(e)?e.LABEL:e.name}function hasTokenLabel(e){return isString(e.LABEL)&&e.LABEL!==``}var AbstractProduction=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),forEach(this.definition,t=>{t.accept(e)})}},NonTerminal=class extends AbstractProduction{constructor(e){super([]),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},Rule=class extends AbstractProduction{constructor(e){super(e.definition),this.orgText=``,I(this,pickBy(e,e=>e!==void 0))}},Alternative=class extends AbstractProduction{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,I(this,pickBy(e,e=>e!==void 0))}},Option=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatory=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionMandatoryWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Repetition=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},RepetitionWithSeparator=class extends AbstractProduction{constructor(e){super(e.definition),this.idx=1,I(this,pickBy(e,e=>e!==void 0))}},Alternation=class extends AbstractProduction{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,I(this,pickBy(e,e=>e!==void 0))}},Terminal=class{constructor(e){this.idx=1,I(this,pickBy(e,e=>e!==void 0))}accept(e){e.visit(this)}};function serializeGrammar(e){return map(e,serializeProduction)}function serializeProduction(e){function convertDefinition(e){return map(e,serializeProduction)}if(e instanceof NonTerminal){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return isString(e.label)&&(t.label=e.label),t}if(e instanceof Alternative)return{type:`Alternative`,definition:convertDefinition(e.definition)};if(e instanceof Option)return{type:`Option`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof RepetitionMandatory)return{type:`RepetitionMandatory`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof RepetitionMandatoryWithSeparator)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};if(e instanceof RepetitionWithSeparator)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:serializeProduction(new Terminal({terminalType:e.separator})),definition:convertDefinition(e.definition)};if(e instanceof Repetition)return{type:`Repetition`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof Alternation)return{type:`Alternation`,idx:e.idx,definition:convertDefinition(e.definition)};if(e instanceof Terminal){let t={type:`Terminal`,name:e.terminalType.name,label:tokenLabel(e.terminalType),idx:e.idx};isString(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=ln(n)?n.source:n),t}if(e instanceof Rule)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:convertDefinition(e.definition)};throw Error(`non exhaustive match`)}var GAstVisitor=class{visit(e){let t=e;switch(t.constructor){case NonTerminal:return this.visitNonTerminal(t);case Alternative:return this.visitAlternative(t);case Option:return this.visitOption(t);case RepetitionMandatory:return this.visitRepetitionMandatory(t);case RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Repetition:return this.visitRepetition(t);case Alternation:return this.visitAlternation(t);case Terminal:return this.visitTerminal(t);case Rule:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function isSequenceProd(e){return e instanceof Alternative||e instanceof Option||e instanceof Repetition||e instanceof RepetitionMandatory||e instanceof RepetitionMandatoryWithSeparator||e instanceof RepetitionWithSeparator||e instanceof Terminal||e instanceof Rule}function isOptionalProd(e,t=[]){return e instanceof Option||e instanceof Repetition||e instanceof RepetitionWithSeparator?!0:e instanceof Alternation?some(e.definition,e=>isOptionalProd(e,t)):e instanceof NonTerminal&&includes(t,e)?!1:e instanceof AbstractProduction&&(e instanceof NonTerminal&&t.push(e),every(e.definition,e=>isOptionalProd(e,t)))}function isBranchingProd(e){return e instanceof Alternation}function getProductionDslName(e){if(e instanceof NonTerminal)return`SUBRULE`;if(e instanceof Option)return`OPTION`;if(e instanceof Alternation)return`OR`;if(e instanceof RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof Repetition)return`MANY`;if(e instanceof Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}export{isIterateeCall as $,cacheHas as A,Stack as B,map as C,baseIteratee as D,$ as E,getAllKeysIn as F,keys as G,arrayPush as H,getAllKeys as I,N as J,baseKeys as K,B as L,X as M,Y as N,hasPath as O,U as P,isPrototype as Q,z as R,isString as S,forEach as T,keysIn as U,bt as V,I as W,O as X,baseUnary as Y,E as Z,some as _,n as _t,GAstVisitor as a,baseAssignValue as at,includes as b,NonTerminal as c,arrayEach as ct,RepetitionMandatory as d,toInteger as dt,isArrayLike as et,RepetitionMandatoryWithSeparator as f,isObject as ft,serializeGrammar as g,r as gt,Terminal as h,isObjectLike as ht,isSequenceProd as i,eq as it,SetCache as j,setToArray as k,Option as l,isFunction as lt,Rule as m,arrayMap as mt,isBranchingProd as n,copyObject as nt,Alternation as o,baseIndexOf as ot,RepetitionWithSeparator as p,p as pt,F as q,isOptionalProd as r,assignValue as rt,Alternative as s,baseFindIndex as st,getProductionDslName as t,baseRest as tt,Repetition as u,identity as ut,pickBy as v,every as w,values as x,ln as y,arrayFilter as z};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { i as __name } from "../../rolldown-runtime.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@chevrotain+types@11.0.3/node_modules/@chevrotain/types/api.d.ts
|
|
3
|
+
type TokenPattern = RegExp | string | CustomPatternMatcherFunc | ICustomPattern;
|
|
4
|
+
/**
|
|
5
|
+
* API #1 [Custom Token Patterns](http://chevrotain.io/docs/guide/custom_token_patterns.html).
|
|
6
|
+
*/
|
|
7
|
+
declare type CustomPatternMatcherFunc = (
|
|
8
|
+
/**
|
|
9
|
+
* The full input string.
|
|
10
|
+
*/
|
|
11
|
+
text: string,
|
|
12
|
+
/**
|
|
13
|
+
* The offset at which to attempt a match
|
|
14
|
+
*/
|
|
15
|
+
offset: number,
|
|
16
|
+
/**
|
|
17
|
+
* Previously scanned Tokens
|
|
18
|
+
*/
|
|
19
|
+
tokens: IToken[],
|
|
20
|
+
/**
|
|
21
|
+
* Token Groups
|
|
22
|
+
*/
|
|
23
|
+
groups: {
|
|
24
|
+
[groupName: string]: IToken[];
|
|
25
|
+
}) => CustomPatternMatcherReturn | RegExpExecArray | null; // RegExpExecArray included for legacy reasons
|
|
26
|
+
type CustomPatternMatcherReturn = [string] & {
|
|
27
|
+
payload?: any;
|
|
28
|
+
};
|
|
29
|
+
interface TokenType {
|
|
30
|
+
name: string;
|
|
31
|
+
GROUP?: string;
|
|
32
|
+
PATTERN?: TokenPattern;
|
|
33
|
+
LABEL?: string;
|
|
34
|
+
LONGER_ALT?: TokenType | TokenType[];
|
|
35
|
+
POP_MODE?: boolean;
|
|
36
|
+
PUSH_MODE?: string;
|
|
37
|
+
LINE_BREAKS?: boolean;
|
|
38
|
+
CATEGORIES?: TokenType[];
|
|
39
|
+
tokenTypeIdx?: number;
|
|
40
|
+
categoryMatches?: number[];
|
|
41
|
+
categoryMatchesMap?: {
|
|
42
|
+
[tokType: number]: boolean;
|
|
43
|
+
};
|
|
44
|
+
isParent?: boolean;
|
|
45
|
+
START_CHARS_HINT?: (string | number)[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* API #2 for [Custom Token Patterns](http://chevrotain.io/docs/guide/custom_token_patterns.html).
|
|
49
|
+
*/
|
|
50
|
+
interface ICustomPattern {
|
|
51
|
+
exec: CustomPatternMatcherFunc;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Things to note:
|
|
55
|
+
* - The offset range is inclusive to exclusive.
|
|
56
|
+
*
|
|
57
|
+
* - A lineTerminator as the last character does not effect the Token's line numbering.
|
|
58
|
+
* In other words a new line only starts **after** a line terminator.
|
|
59
|
+
*
|
|
60
|
+
* - A Token's image is it's **literal** text.
|
|
61
|
+
* e.g unicode escaping is untouched.
|
|
62
|
+
*/
|
|
63
|
+
interface IToken {
|
|
64
|
+
/** The textual representation of the Token as it appeared in the text. */
|
|
65
|
+
image: string;
|
|
66
|
+
/** Offset of the first character of the Token. 0-indexed. */
|
|
67
|
+
startOffset: number;
|
|
68
|
+
/** Line of the first character of the Token. 1-indexed. */
|
|
69
|
+
startLine?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Column of the first character of the Token. 1-indexed.
|
|
72
|
+
*
|
|
73
|
+
* For token foo in the following line, startColumn will be 3 and endColumn will be 5.
|
|
74
|
+
* ```
|
|
75
|
+
* a foo
|
|
76
|
+
* 123456
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
startColumn?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Offset of the last character of the Token. 0-indexed.
|
|
82
|
+
* Note that this points at the last character, not the end of the token, so the original image would be
|
|
83
|
+
* `input.substring(token.startOffset, token.endOffset + 1)`.
|
|
84
|
+
*/
|
|
85
|
+
endOffset?: number;
|
|
86
|
+
/** Line of the last character of the Token. 1-indexed. Will be the same as startLine for single-line tokens.*/
|
|
87
|
+
endLine?: number;
|
|
88
|
+
/** Column of the last character of the Token. 1-indexed. See also startColumn. */
|
|
89
|
+
endColumn?: number;
|
|
90
|
+
/** this marks if a Token does not really exist and has been inserted "artificially" during parsing in rule error recovery. */
|
|
91
|
+
isInsertedInRecovery?: boolean;
|
|
92
|
+
/** An number index representing the type of the Token use <getTokenConstructor> to get the Token Type from a token "instance" */
|
|
93
|
+
tokenTypeIdx: number;
|
|
94
|
+
/**
|
|
95
|
+
* The actual Token Type of this Token "instance"
|
|
96
|
+
* This is the same Object returned by the "createToken" API.
|
|
97
|
+
* This property is very useful for debugging the Lexing and Parsing phases.
|
|
98
|
+
*/
|
|
99
|
+
tokenType: TokenType;
|
|
100
|
+
/**
|
|
101
|
+
* Custom Payload value, this is an optional feature of Custom Token Patterns
|
|
102
|
+
* For additional details see the docs:
|
|
103
|
+
* https://chevrotain.io/docs/guide/custom_token_patterns.html#custom-payloads
|
|
104
|
+
*/
|
|
105
|
+
payload?: any;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { IToken as t };
|