likec4 1.56.0 → 1.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/__app__/chunks/AIChat2.mjs +2 -0
  2. package/__app__/chunks/DiagramActorProvider.mjs +4 -4
  3. package/__app__/chunks/EmbedPage.mjs +1 -0
  4. package/__app__/chunks/ExportPage.mjs +2 -0
  5. package/__app__/chunks/LikeC4Diagram.mjs +5 -5
  6. package/__app__/chunks/LikeC4Styles.mjs +11 -11
  7. package/__app__/chunks/Markdown.mjs +1 -0
  8. package/__app__/chunks/NavigationPanel.mjs +1 -1
  9. package/__app__/chunks/ViewReact.mjs +1 -1
  10. package/__app__/chunks/adhoc-editor.mjs +1 -1
  11. package/__app__/chunks/aichat.mjs +1 -0
  12. package/__app__/chunks/box.mjs +1 -0
  13. package/__app__/chunks/create-style-context.mjs +1 -0
  14. package/__app__/chunks/css.mjs +1 -0
  15. package/__app__/chunks/factory.mjs +1 -0
  16. package/__app__/chunks/hooks.mjs +1 -1
  17. package/__app__/chunks/hstack.mjs +1 -0
  18. package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -1
  19. package/__app__/chunks/libs/@floating-ui/core.mjs +1 -1
  20. package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -1
  21. package/__app__/chunks/libs/@floating-ui/react.mjs +1 -1
  22. package/__app__/chunks/libs/@mantine/core.mjs +24 -24
  23. package/__app__/chunks/libs/@mantine/hooks.mjs +1 -1
  24. package/__app__/chunks/libs/@nanostores/react.mjs +1 -1
  25. package/__app__/chunks/libs/@react-hookz/web.mjs +1 -1
  26. package/__app__/chunks/libs/@tabler/icons-react.mjs +347 -4
  27. package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
  28. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
  29. package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
  30. package/__app__/chunks/libs/@tanstack/ai.mjs +2 -0
  31. package/__app__/chunks/libs/@tanstack/history.mjs +1 -1
  32. package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -3
  33. package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -1
  34. package/__app__/chunks/libs/@xstate/react.mjs +1 -1
  35. package/__app__/chunks/libs/@xstate/store.mjs +1 -1
  36. package/__app__/chunks/libs/@xyflow/react.mjs +3 -3
  37. package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -1
  38. package/__app__/chunks/libs/@zag-js/collection.mjs +1 -1
  39. package/__app__/chunks/libs/@zag-js/core.mjs +1 -1
  40. package/__app__/chunks/libs/@zag-js/react.mjs +1 -1
  41. package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -1
  42. package/__app__/chunks/libs/bezier-js.mjs +1 -1
  43. package/__app__/chunks/libs/copy-anything.mjs +1 -0
  44. package/__app__/chunks/libs/d3-path.mjs +1 -1
  45. package/__app__/chunks/libs/d3-shape.mjs +1 -1
  46. package/__app__/chunks/libs/fast-equals.mjs +1 -1
  47. package/__app__/chunks/libs/framer-motion.mjs +3 -3
  48. package/__app__/chunks/libs/html-to-image.mjs +2 -2
  49. package/__app__/chunks/libs/motion-dom.mjs +1 -1
  50. package/__app__/chunks/libs/nanostores.mjs +1 -1
  51. package/__app__/chunks/libs/react-error-boundary.mjs +1 -1
  52. package/__app__/chunks/libs/react-resizable-panels.mjs +1 -1
  53. package/__app__/chunks/libs/remeda.mjs +1 -1
  54. package/__app__/chunks/libs/superjson.mjs +1 -0
  55. package/__app__/chunks/libs/zod.mjs +39 -14
  56. package/__app__/chunks/rolldown-runtime.mjs +1 -1
  57. package/__app__/chunks/styles.css.mjs +1 -1
  58. package/__app__/chunks/txt.mjs +1 -0
  59. package/__app__/chunks/useLikeC4Project.mjs +1 -1
  60. package/__app__/codegen/webcomponent.mjs +221 -69
  61. package/__app__/src/aichat/index.mjs +1 -0
  62. package/__app__/src/main.mjs +45 -1
  63. package/__app__/src/pages/AdHocViewEditor.mjs +1 -1
  64. package/__app__/src/pages/EmbedPage.mjs +1 -1
  65. package/__app__/src/pages/ExportPage.mjs +1 -1
  66. package/__app__/src/pages/ProjectsOverview.mjs +1 -1
  67. package/__app__/src/pages/ViewAsD2.mjs +1 -1
  68. package/__app__/src/pages/ViewAsDot.mjs +1 -1
  69. package/__app__/src/pages/ViewAsMmd.mjs +1 -1
  70. package/__app__/src/pages/ViewAsPuml.mjs +1 -1
  71. package/__app__/src/pages/ViewEditor.mjs +1 -1
  72. package/__app__/src/style.css +1 -1
  73. package/config/schema.json +14 -41
  74. package/dist/chunks/enableServer.mjs +1 -0
  75. package/dist/chunks/index2.d.mts +569 -377
  76. package/dist/chunks/libs/@hono/mcp.mjs +33 -8
  77. package/dist/chunks/libs/@hono/node-server.mjs +1 -1
  78. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +7 -7
  79. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  80. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  81. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  82. package/dist/chunks/libs/ajv.mjs +1 -1
  83. package/dist/chunks/libs/ansi-styles.mjs +1 -1
  84. package/dist/chunks/libs/boxen.mjs +2 -2
  85. package/dist/chunks/libs/chevrotain.mjs +2 -2
  86. package/dist/chunks/libs/conf.mjs +1 -1
  87. package/dist/chunks/libs/langium.d.mts +5 -5
  88. package/dist/chunks/libs/langium.mjs +10 -10
  89. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  90. package/dist/chunks/libs/pako.mjs +3 -1
  91. package/dist/chunks/libs/remeda.mjs +1 -1
  92. package/dist/chunks/libs/ts-graphviz.mjs +1 -4
  93. package/dist/chunks/libs/unctx.mjs +1 -0
  94. package/dist/chunks/libs/vscode-languageserver.mjs +1 -1
  95. package/dist/chunks/libs/zod.d.mts +60 -25
  96. package/dist/chunks/node.mjs +62 -45
  97. package/dist/chunks/plugin.mjs +234 -41
  98. package/dist/chunks/sequence-view.mjs +1 -1
  99. package/dist/cli/index.mjs +142 -139
  100. package/dist/index.d.mts +1 -130
  101. package/dist/model/index.d.mts +1 -1
  102. package/dist/vite-plugin/index.d.mts +53 -2
  103. package/dist/vite-plugin/internal/index.d.mts +331 -3
  104. package/dist/vite-plugin/internal/index.mjs +1 -1
  105. package/package.json +65 -51
  106. package/react/index.d.mts +82 -50
  107. package/react/index.mjs +34017 -32421
  108. package/vite-plugin-modules.d.ts +4 -0
  109. package/__app__/chunks/ColorSchemeToggle.mjs +0 -1
  110. package/__app__/chunks/Fallback.mjs +0 -1
  111. package/__app__/chunks/Header.mjs +0 -13
  112. package/__app__/chunks/IconRenderer.mjs +0 -1
  113. package/__app__/chunks/LikeC4ModelContext.mjs +0 -1
  114. package/__app__/chunks/LikeC4ModelContext2.mjs +0 -1
  115. package/__app__/chunks/StaticLikeC4Diagram.mjs +0 -1
  116. package/__app__/chunks/__root.mjs +0 -1
  117. package/__app__/chunks/libs/motion.mjs +0 -1
  118. package/__app__/chunks/libs/xstate.mjs +0 -1
  119. package/__app__/chunks/safeCtx.mjs +0 -1
  120. package/__app__/chunks/searchParams.mjs +0 -1
  121. package/__app__/chunks/single-index.mjs +0 -1
  122. package/__app__/chunks/styled-system.mjs +0 -1
  123. package/__app__/chunks/useUpdateEffect.mjs +0 -1
  124. package/__app__/src/routeTree.gen.mjs +0 -1
  125. package/__app__/src/routes/__root.mjs +0 -1
  126. package/__app__/src/routes/_single/adhoc.mjs +0 -1
  127. package/__app__/src/routes/_single/embed._viewId.mjs +0 -1
  128. package/__app__/src/routes/_single/export._viewId.mjs +0 -1
  129. package/__app__/src/routes/_single/route.mjs +0 -1
  130. package/__app__/src/routes/_single/single-index.mjs +0 -1
  131. package/__app__/src/routes/_single/view._viewId.d2.mjs +0 -1
  132. package/__app__/src/routes/_single/view._viewId.dot.mjs +0 -1
  133. package/__app__/src/routes/_single/view._viewId.index.mjs +0 -1
  134. package/__app__/src/routes/_single/view._viewId.mjs +0 -1
  135. package/__app__/src/routes/_single/view._viewId.mmd.mjs +0 -1
  136. package/__app__/src/routes/_single/view._viewId.puml.mjs +0 -1
  137. package/__app__/src/routes/_single/webcomponent._.mjs +0 -33
  138. package/__app__/src/routes/index.mjs +0 -1
  139. package/__app__/src/routes/project._projectId/-components.mjs +0 -1
  140. package/__app__/src/routes/project._projectId/adhoc.mjs +0 -1
  141. package/__app__/src/routes/project._projectId/embed._viewId.mjs +0 -1
  142. package/__app__/src/routes/project._projectId/export._viewId.mjs +0 -1
  143. package/__app__/src/routes/project._projectId/index.mjs +0 -1
  144. package/__app__/src/routes/project._projectId/route.mjs +0 -1
  145. package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +0 -1
  146. package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +0 -1
  147. package/__app__/src/routes/project._projectId/view._viewId.index.mjs +0 -1
  148. package/__app__/src/routes/project._projectId/view._viewId.mjs +0 -1
  149. package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +0 -1
  150. package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +0 -1
  151. package/__app__/src/routes/projects.mjs +0 -1
  152. package/dist/chunks/libs/ts-graphviz.d.mts +0 -12
  153. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.d.mts +0 -269
  154. package/dist/vite-plugin/internal/chunks/libs/nanostores.d.mts +0 -59
@@ -0,0 +1,3 @@
1
+ import"../../rolldown-runtime.mjs";function isForwardRefNode(e){return typeof e==`object`&&!!e&&typeof e.id==`string`}function isNodeModel(e){return typeof e==`object`&&!!e&&e.$$type===`Node`&&typeof e.id==`string`}function isNodeRef(e){return isNodeModel(e)||isForwardRefNode(e)}function isNodeRefLike(e){return typeof e==`string`||isNodeRef(e)}function isNodeRefGroupLike(e){return Array.isArray(e)&&e.every(isNodeRefLike)}function isCompass(e){return[`n`,`ne`,`e`,`se`,`s`,`sw`,`w`,`nw`,`c`].includes(e)}function toNodeRef(e){if(isNodeRef(e))return e;let[t,n,r]=e.split(`:`);return isCompass(r)?{id:t,port:n,compass:r}:{id:t,port:n}}function toNodeRefGroup(e){if(e.length<1)throw Error(`EdgeTargets must have at least 1 elements.`);if(!e.every(e=>isNodeRefLike(e)))throw Error(`The element of Edge target is missing or not satisfied as Edge target.`);return e.map(e=>toNodeRef(e))}const e=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function createModelsContext(t){return Object.assign(Object.seal(Object.assign({},e)),t)}var ASTNodeCountExceededError=class extends Error{constructor(e,t){super(`AST node count (${e}) exceeds maximum allowed (${t}). Consider increasing 'maxASTNodes' option or simplifying the input.`),this.nodeCount=e,this.maxNodes=t,this.name=`ASTNodeCountExceededError`}},Builder=class{constructor(e){this.options=e,this.maxNodes=e?.maxASTNodes??1e5}nodeCount=0;maxNodes;getLocation(){return this.options?.locationFunction?.()??null}createElement(e,t,n=[]){if(this.nodeCount++,this.maxNodes>0&&this.nodeCount>this.maxNodes)throw new ASTNodeCountExceededError(this.nodeCount,this.maxNodes);return{location:this.getLocation(),...t,type:e,children:n}}resetNodeCount(){this.nodeCount=0}};function createElementFactory(e){let t=new Builder(e);return t.createElement.bind(t)}createElementFactory();const t={match(e){return e.type===`AttributeList`},*print(e,t){t.children.length===0?yield`${t.kind.toLocaleLowerCase()} [];`:(yield`${t.kind.toLocaleLowerCase()} [`,yield*e.printChildren(t.children),yield`];`)}},n={match(e){return e.type===`Attribute`},*print(e,t){yield*e.print(t.key),yield` = `,yield*e.print(t.value),yield`;`}};function escapeComment(e,t){let n=e.replace(/\0/g,``);return t===`Block`&&(n=n.replace(/\*\//g,`*​/`)),n}const r=/\r?\n/,i={Block:` * `,Macro:`# `,Slash:`// `},a={match(e){return e.type===`Comment`},*print(e,t){let n=i[t.kind];t.kind===`Block`&&(yield*[`/**`,e.EOL]);let a=escapeComment(t.value,t.kind).split(r),o=a.length;for(let t=0;t<o;t++)yield n,yield a[t],t<o-1&&(yield e.EOL);t.kind===`Block`&&(yield*[e.EOL,` */`])}},o={match(e){return e.type===`Dot`},*print(e,t){yield*e.join(t.children,e.EOL)}},s={match(e){return e.type===`Edge`},*print(e,t){yield*e.join(t.targets,e.directed?` -> `:` -- `),t.children.length===0?yield`;`:(yield` [`,yield*e.printChildren(t.children),yield`];`)}},c={match(e){return e.type===`Graph`},*print(e,t){e.directed=t.directed,t.strict&&(yield`strict `),yield t.directed?`digraph `:`graph `,t.id&&(yield*e.print(t.id),yield` `),yield`{`,t.children.length>=1&&(yield*e.printChildren(t.children)),yield`}`}},escape=e=>e.replace(/\0/g,``).replace(/(?<!\\)"|[\r\n]/g,escapeReplacer),l={"\r":String.raw`\r`,"\n":String.raw`\n`,'"':String.raw`\"`};function escapeReplacer(e){return l[e]}const u=[t,n,a,o,s,c,{match(e){return e.type===`Literal`},*print(e,t){switch(t.quoted){case`html`:yield`<`,yield t.value,yield`>`;return;case!0:yield`"`,yield escape(t.value),yield`"`;return;default:yield t.value;return}}},{match(e){return e.type===`Node`},*print(e,t){yield*e.print(t.id),t.children.length>=1&&(yield` [`,yield*e.printChildren(t.children),yield`]`),yield`;`}},{match(e){return e.type===`NodeRefGroup`},*print(e,t){yield`{`,yield*e.join(t.children,` `),yield`}`}},{match(e){return e.type===`NodeRef`},*print(e,t){yield*e.print(t.id),t.port&&(yield`:`,yield*e.print(t.port)),t.compass&&(yield`:`,yield*e.print(t.compass))}},{match(e){return e.type===`Subgraph`},*print(e,t){yield`subgraph`,t.id&&(yield` `,yield*e.print(t.id)),yield` {`,t.children.length>=1&&(yield*e.printChildren(t.children)),yield`}`}}];var Printer=class{constructor(e={}){this.options=e}#e=[...u];print(e){return Array.from(this.toChunks(e)).join(``)}toChunks(e){let t=[...this.#e],{indentSize:n=2,indentStyle:r=`space`,endOfLine:i=`lf`}=this.options,a=i===`crlf`?`\r
2
+ `:`
3
+ `,o=r===`space`?` `.repeat(n):` `,s={directed:!0,EOL:a,*printChildren(e){yield*indent(function*(){yield a,yield*s.join(e,a)}),yield a},*print(e){for(let n of t)if(n.match(e)){yield*n.print(this,e);return}throw Error(`No matching plugin found for AST node: ${JSON.stringify(e)}`)},*join(e,t){let n=e.length;for(let r=0;r<n;r++)yield*s.print(e[r]),r<n-1&&(yield t)}};return{[Symbol.iterator]:function*(){yield*s.print(e)}};function*indent(e){for(let t of e())yield t,t===a&&(yield o)}}};function stringify(e,t){let n=new Printer(t).print(e);if(!n)throw Error();return n}function convertAttribute(e,t,n){if(typeof n==`string`){let r=n.trim();return/^<.+>$/ms.test(r)?e(`Attribute`,{key:e(`Literal`,{value:t,quoted:!1},[]),value:e(`Literal`,{value:r.slice(1,-1),quoted:`html`},[])},[]):e(`Attribute`,{key:e(`Literal`,{value:t,quoted:!1},[]),value:e(`Literal`,{value:n,quoted:!0},[])},[])}return e(`Attribute`,{key:e(`Literal`,{value:t,quoted:!1},[]),value:e(`Literal`,{value:String(n),quoted:!1},[])},[])}function convertComment(e,t,n){return e(`Comment`,{kind:n,value:t},[])}function convertClusterChildren(e,t){let{createElement:n}=e;return Array.from((function*(){for(let[e,r]of t.values)yield convertAttribute(n,e,r);for(let r of Object.values(t.attributes))r.size>0&&(r.comment&&(yield convertComment(n,r.comment,e.commentKind)),yield e.convert(r));for(let r of t.nodes)r.comment&&(yield convertComment(n,r.comment,e.commentKind)),yield e.convert(r);for(let r of t.subgraphs)r.comment&&(yield convertComment(n,r.comment,e.commentKind)),yield e.convert(r);for(let r of t.edges)r.comment&&(yield convertComment(n,r.comment,e.commentKind)),yield e.convert(r)})())}const d=[{match(e){return e.$$type===`AttributeList`},convert(e,t){let{createElement:n}=e;return n(`AttributeList`,{kind:t.$$kind},t.values.map(([e,t])=>convertAttribute(n,e,t)))}},{match(e){return e.$$type===`Edge`},convert(e,t){let{createElement:n}=e;return n(`Edge`,{targets:t.targets.map(e=>isNodeModel(e)?n(`NodeRef`,{id:n(`Literal`,{value:e.id,quoted:!0},[])},[]):isForwardRefNode(e)?n(`NodeRef`,{id:n(`Literal`,{value:e.id,quoted:!0},[]),port:e.port?n(`Literal`,{value:e.port,quoted:!0},[]):void 0,compass:e.compass?n(`Literal`,{value:e.compass,quoted:!0},[]):void 0},[]):n(`NodeRefGroup`,{},e.map(e=>isNodeModel(e)?n(`NodeRef`,{id:n(`Literal`,{value:e.id,quoted:!0},[])},[]):n(`NodeRef`,{id:n(`Literal`,{value:e.id,quoted:!0},[]),port:e.port?n(`Literal`,{value:e.port,quoted:!0},[]):void 0,compass:e.compass?n(`Literal`,{value:e.compass,quoted:!0},[]):void 0},[]))))},[...t.attributes.comment?[convertComment(n,t.attributes.comment,e.commentKind)]:[],...t.attributes.values.map(([e,t])=>convertAttribute(n,e,t))])}},{match(e){return e.$$type===`Node`},convert(e,t){let{createElement:n}=e;return n(`Node`,{id:n(`Literal`,{value:t.id,quoted:!0},[])},[...t.attributes.comment?[convertComment(n,t.attributes.comment,e.commentKind)]:[],...t.attributes.values.map(([e,t])=>convertAttribute(n,e,t))])}},{match(e){return e.$$type===`Graph`},convert(e,t){let{createElement:n}=e;return n(`Dot`,{},[...t.comment?[convertComment(n,t.comment,e.commentKind)]:[],n(`Graph`,{directed:t.directed,strict:t.strict,id:t.id?n(`Literal`,{value:t.id,quoted:!0},[]):void 0},convertClusterChildren(e,t))])}},{match(e){return e.$$type===`Subgraph`},convert(e,t){let{createElement:n}=e;return n(`Subgraph`,{id:t.id?n(`Literal`,{value:t.id,quoted:!0},[]):void 0},convertClusterChildren(e,t))}}];var FromModelConverter=class{constructor(e={}){this.options=e}#e=[...d];convert(e){let t=[...this.#e],{commentKind:n=`Slash`,maxASTNodes:r}=this.options,i={commentKind:n,createElement:createElementFactory({maxASTNodes:r}),convert(e){for(let n of t)if(n.match(e))return n.convert(i,e);throw Error()}};return i.convert(e)}};function fromModel(e,t){return new FromModelConverter(t).convert(e)}export{isNodeRefGroupLike as a,toNodeRefGroup as c,createModelsContext as i,stringify as n,isNodeRefLike as o,e as r,toNodeRef as s,fromModel as t};
@@ -0,0 +1,9 @@
1
+ import { i as __name } from "../../rolldown-runtime.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/@ts-graphviz+common@3.0.5/node_modules/@ts-graphviz/common/lib/common.d.ts
4
+ /**
5
+ * @hidden
6
+ */
7
+ declare type $keywords<T extends string> = { [key in T]: key };
8
+ //#endregion
9
+ export { $keywords as t };
@@ -0,0 +1 @@
1
+ import"../../rolldown-runtime.mjs";import{a as e,c as t,i as n,o as r,r as i,s as a}from"./ast.mjs";var DotObject=class{},AttributesBase=class extends DotObject{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,t){t!=null&&this.#e.set(e,t)}delete(e){this.#e.delete(e)}apply(e){let t=Array.isArray(e)?e:Object.entries(e);for(let[e,n]of t)this.set(e,n)}clear(){this.#e.clear()}},AttributeList=class extends AttributesBase{constructor(e,t){super(t),this.$$kind=e}get $$type(){return`AttributeList`}comment},AttributesGroup=class extends AttributesBase{comment},GraphBase=class extends AttributesBase{#e=i;id;comment;attributes=Object.freeze({graph:new AttributeList(`Graph`),edge:new AttributeList(`Edge`),node:new AttributeList(`Node`)});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=n(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){let t=new this.#e.Subgraph(...e);return t.with(this.#e),this.addSubgraph(t),t}removeNode(e){this.#t.nodes.delete(typeof e==`string`?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,t){let n=new this.#e.Node(e,t);return this.addNode(n),n}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(t=>t.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(n,r){let i=n.map(n=>e(n)?t(n):a(n)),o=new this.#e.Edge(i,r);return this.addEdge(o),o}subgraph(...e){let t=e.find(e=>typeof e==`string`),n=e.find(e=>typeof e==`object`&&!!e),r=e.find(e=>typeof e==`function`),i=t?this.getSubgraph(t)??this.createSubgraph(t):this.createSubgraph();return n!==void 0&&i.apply(n),r!==void 0&&r(i),i}node(e,...t){if(typeof e==`string`){let n=e,r=t.find(e=>typeof e==`object`&&!!e),i=t.find(e=>typeof e==`function`),a=this.getNode(n)??this.createNode(n);return r!==void 0&&a.attributes.apply(r),i!==void 0&&i(a),a}typeof e==`object`&&e&&this.attributes.node.apply(e)}edge(e,...t){if(Array.isArray(e)){let n=e,r=t.find(e=>typeof e==`object`),i=t.find(e=>typeof e==`function`),a=this.createEdge(n,r);return i!==void 0&&i(a),a}typeof e==`object`&&e&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}},RootGraph=class extends GraphBase{get $$type(){return`Graph`}id;strict;constructor(...e){super(),this.id=e.find(e=>typeof e==`string`),this.strict=e.find(e=>typeof e==`boolean`)??!1;let t=e.find(e=>typeof e==`object`&&!!e);t!==void 0&&this.apply(t)}},Digraph=class extends RootGraph{get directed(){return!0}},Edge=class extends DotObject{constructor(e,t){if(super(),this.targets=e,e.length<2&&(r(e[0])&&r(e[1]))===!1)throw Error(`The element of Edge target is missing or not satisfied as Edge target.`);this.attributes=new AttributesGroup(t)}get $$type(){return`Edge`}comment;attributes},Graph=class extends RootGraph{get directed(){return!1}},Node=class extends DotObject{constructor(e,t){super(),this.id=e,this.attributes=new AttributesGroup(t)}get $$type(){return`Node`}comment;attributes;port(e){return typeof e==`string`?{id:this.id,port:e}:{id:this.id,...e}}},Subgraph=class extends GraphBase{get $$type(){return`Subgraph`}id;constructor(...e){super(),this.id=e.find(e=>typeof e==`string`);let t=e.find(e=>typeof e==`object`&&!!e);t!==void 0&&this.apply(t)}isSubgraphCluster(){return typeof this.id==`string`?this.id.startsWith(`cluster`):!1}};function registerDefault(){Object.assign(i,{Graph,Digraph,Subgraph,Node,Edge})}export{registerDefault as t};
@@ -1 +1 @@
1
- import{t as e}from"../rolldown-runtime.mjs";import{A as t,C as n,D as r,E as i,O as a,S as o,T as s,_ as c,b as l,g as u,h as d,k as f,v as p,w as m,x as h,y as g}from"./@modelcontextprotocol/sdk.mjs";var _=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicAnchor=void 0;let n=t(),r=a(),i=m(),s=o(),c={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>dynamicAnchor(e,e.schema)};function dynamicAnchor(e,t){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[t]=!0;let o=(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(t)}`,s=a.errSchemaPath===`#`?a.validateName:_getValidate(e);i.if((0,n._)`!${o}`,()=>i.assign(o,s))}e.dynamicAnchor=dynamicAnchor;function _getValidate(e){let{schemaEnv:t,schema:n,self:r}=e.it,{root:a,baseId:o,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new i.SchemaEnv({schema:n,schemaId:u,root:a,baseId:o,localRefs:c,meta:l});return i.compileSchema.call(r,d),(0,s.getValidate)(e,d)}e.default=c})),v=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dynamicRef=void 0;let n=t(),r=a(),i=o(),s={keyword:`$dynamicRef`,schemaType:`string`,code:e=>dynamicRef(e,e.schema)};function dynamicRef(e,t){let{gen:a,keyword:o,it:s}=e;if(t[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=t.slice(1);if(s.allErrors)_dynamicRef();else{let t=a.let(`valid`,!1);_dynamicRef(t),e.ok(t)}function _dynamicRef(e){if(s.schemaEnv.root.dynamicAnchors[c]){let t=a.let(`_v`,(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(c)}`);a.if(t,_callRef(t,e),_callRef(s.validateName,e))}else _callRef(s.validateName,e)()}function _callRef(t,n){return n?()=>a.block(()=>{(0,i.callRef)(e,t),a.let(n,!0)}):()=>(0,i.callRef)(e,t)}}e.dynamicRef=dynamicRef,e.default=s})),y=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_(),n=f();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),b=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=v();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),x=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_(),n=v(),r=y(),i=b();e.default=[t.default,n.default,r.default,i.default]})),S=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=g();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),C=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=g();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),w=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=f();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),T=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(),n=C(),r=w();e.default=[t.default,n.default,r.default]})),E=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=t(),r=f(),i=a();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,n._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:t,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof n.Name?t.if((0,n._)`${u} !== true`,()=>t.forIn(`key`,o,e=>t.if(unevaluatedDynamic(u,e),()=>unevaluatedPropCode(e)))):u!==!0&&t.forIn(`key`,o,e=>u===void 0?unevaluatedPropCode(e):t.if(unevaluatedStatic(u,e),()=>unevaluatedPropCode(e))),c.props=!0,e.ok((0,n._)`${s} === ${i.default.errors}`);function unevaluatedPropCode(i){if(a===!1){e.setParams({unevaluatedProperty:i}),e.error(),l||t.break();return}if(!(0,r.alwaysValidSchema)(c,a)){let a=t.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:i,dataPropType:r.Type.Str},a),l||t.if((0,n.not)(a),()=>t.break())}}function unevaluatedDynamic(e,t){return(0,n._)`!${e} || !${e}[${t}]`}function unevaluatedStatic(e,t){let r=[];for(let i in e)e[i]===!0&&r.push((0,n._)`${t} !== ${i}`);return(0,n.and)(...r)}}}})),D=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let n=t(),r=f();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{gen:t,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=t.const(`len`,(0,n._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,n._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,r.alwaysValidSchema)(o,i)){let r=t.var(`valid`,(0,n._)`${c} <= ${s}`);t.if((0,n.not)(r),()=>validateItems(r,s)),e.ok(r)}o.items=!0;function validateItems(i,a){t.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:r.Type.Num},i),o.allErrors||t.if((0,n.not)(i),()=>t.break())})}}}})),O=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(),n=D();e.default=[t.default,n.default]})),k=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(),n=l(),r=p(),i=x(),a=T(),o=O(),s=c(),d=u();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,d.metadataVocabulary,d.contentVocabulary,a.default,o.default]})),A=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),j=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),M=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),N=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),P=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),F=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),I=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),L=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),R=e((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=A(),n=j(),r=M(),i=N(),a=P(),o=F(),s=I(),c=L(),l=[`/properties`];function addMetaSchema2020(e){return[t,n,r,i,a,with$data(this,o),s,with$data(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function with$data(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=addMetaSchema2020})),z=e(((e,a)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let o=n(),c=k(),l=d(),u=R(),f=`https://json-schema.org/draft/2020-12/schema`;var Ajv2020=class extends o.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),c.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(u.default.call(this,e),this.refs[`http://json-schema.org/schema`]=f)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(f)?f:void 0)}};e.Ajv2020=Ajv2020,a.exports=e=Ajv2020,a.exports.Ajv2020=Ajv2020,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=Ajv2020;var p=r();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return p.KeywordCxt}});var m=t();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return m.CodeGen}});var h=i();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return h.default}});var g=s();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return g.default}})}));export{z as t};
1
+ import{t as e}from"../rolldown-runtime.mjs";import{A as t,C as n,D as r,E as i,M as a,O as o,S as s,T as c,_ as l,b as u,j as d,k as f,v as p,w as m,x as h,y as g}from"./@modelcontextprotocol/sdk.mjs";var _=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let n=a(),r=t(),o=i(),s=m(),c={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>dynamicAnchor(e,e.schema)};function dynamicAnchor(e,t){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[t]=!0;let o=(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(t)}`,s=a.errSchemaPath===`#`?a.validateName:_getValidate(e);i.if((0,n._)`!${o}`,()=>i.assign(o,s))}e.dynamicAnchor=dynamicAnchor;function _getValidate(e){let{schemaEnv:t,schema:n,self:r}=e.it,{root:i,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new o.SchemaEnv({schema:n,schemaId:u,root:i,baseId:a,localRefs:c,meta:l});return o.compileSchema.call(r,d),(0,s.getValidate)(e,d)}e.default=c})),v=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let n=a(),r=t(),i=m(),o={keyword:`$dynamicRef`,schemaType:`string`,code:e=>dynamicRef(e,e.schema)};function dynamicRef(e,t){let{gen:a,keyword:o,it:s}=e;if(t[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=t.slice(1);if(s.allErrors)_dynamicRef();else{let t=a.let(`valid`,!1);_dynamicRef(t),e.ok(t)}function _dynamicRef(e){if(s.schemaEnv.root.dynamicAnchors[c]){let t=a.let(`_v`,(0,n._)`${r.default.dynamicAnchors}${(0,n.getProperty)(c)}`);a.if(t,_callRef(t,e),_callRef(s.validateName,e))}else _callRef(s.validateName,e)()}function _callRef(t,n){return n?()=>a.block(()=>{(0,i.callRef)(e,t),a.let(n,!0)}):()=>(0,i.callRef)(e,t)}}e.dynamicRef=dynamicRef,e.default=o})),y=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_(),n=d();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),b=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=v();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),x=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_(),n=v(),r=y(),i=b();e.default=[t.default,n.default,r.default,i.default]})),S=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=h();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),C=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=h();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),w=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),T=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=S(),n=C(),r=w();e.default=[t.default,n.default,r.default]})),E=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let n=a(),r=d(),i=t();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,n._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:t,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof n.Name?t.if((0,n._)`${u} !== true`,()=>t.forIn(`key`,o,e=>t.if(unevaluatedDynamic(u,e),()=>unevaluatedPropCode(e)))):u!==!0&&t.forIn(`key`,o,e=>u===void 0?unevaluatedPropCode(e):t.if(unevaluatedStatic(u,e),()=>unevaluatedPropCode(e))),c.props=!0,e.ok((0,n._)`${s} === ${i.default.errors}`);function unevaluatedPropCode(i){if(a===!1){e.setParams({unevaluatedProperty:i}),e.error(),l||t.break();return}if(!(0,r.alwaysValidSchema)(c,a)){let a=t.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:i,dataPropType:r.Type.Str},a),l||t.if((0,n.not)(a),()=>t.break())}}function unevaluatedDynamic(e,t){return(0,n._)`!${e} || !${e}[${t}]`}function unevaluatedStatic(e,t){let r=[];for(let i in e)e[i]===!0&&r.push((0,n._)`${t} !== ${i}`);return(0,n.and)(...r)}}}})),D=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=a(),n=d();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>validateItems(n,s)),e.ok(n)}o.items=!0;function validateItems(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),O=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=E(),n=D();e.default=[t.default,n.default]})),k=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n(),r=s(),i=u(),a=x(),o=T(),c=O(),l=g(),d=p();e.default=[a.default,t.default,r.default,(0,i.default)(!0),l.default,d.metadataVocabulary,d.contentVocabulary,o.default,c.default]})),A=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),j=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),M=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),N=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),P=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),F=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),I=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),L=e(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),R=e((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=A(),n=j(),r=M(),i=N(),a=P(),o=F(),s=I(),c=L(),l=[`/properties`];function addMetaSchema2020(e){return[t,n,r,i,a,with$data(this,o),s,with$data(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function with$data(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=addMetaSchema2020})),z=e(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=c(),i=k(),s=l(),u=R(),d=`https://json-schema.org/draft/2020-12/schema`;var Ajv2020=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(u.default.call(this,e),this.refs[`http://json-schema.org/schema`]=d)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d)?d:void 0)}};e.Ajv2020=Ajv2020,t.exports=e=Ajv2020,t.exports.Ajv2020=Ajv2020,Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ajv2020;var p=f();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var m=a();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var h=o();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var g=r();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})}));export{z as t};
@@ -1 +1 @@
1
- import"../rolldown-runtime.mjs";const wrapAnsi16=(e=0)=>t=>`\u001B[${t+e}m`,wrapAnsi256=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(e.modifier);const t=Object.keys(e.color),n=Object.keys(e.bgColor);[...t,...n];function assembleStyles(){let t=new Map;for(let[n,r]of Object.entries(e)){for(let[n,i]of Object.entries(r))e[n]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},r[n]=e[n],t.set(i[0],i[1]);Object.defineProperty(e,n,{value:r,enumerable:!1})}return Object.defineProperty(e,`codes`,{value:t,enumerable:!1}),e.color.close=`\x1B[39m`,e.bgColor.close=`\x1B[49m`,e.color.ansi=wrapAnsi16(),e.color.ansi256=wrapAnsi256(),e.color.ansi16m=wrapAnsi16m(),e.bgColor.ansi=wrapAnsi16(10),e.bgColor.ansi256=wrapAnsi256(10),e.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(e,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),enumerable:!1}}),e}const r=assembleStyles();export{r as t};
1
+ import"../rolldown-runtime.mjs";const wrapAnsi16=(e=0)=>t=>`\u001B[${t+e}m`,wrapAnsi256=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(e.modifier);const t=Object.keys(e.color),n=Object.keys(e.bgColor);[...t,...n];function assembleStyles(){let t=new Map;for(let[n,r]of Object.entries(e)){for(let[n,i]of Object.entries(r))e[n]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},r[n]=e[n],t.set(i[0],i[1]);Object.defineProperty(e,n,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close=`\x1B[39m`,e.bgColor.close=`\x1B[49m`,e.color.ansi=wrapAnsi16(),e.color.ansi256=wrapAnsi256(),e.color.ansi16m=wrapAnsi16m(),e.bgColor.ansi=wrapAnsi16(10),e.bgColor.ansi256=wrapAnsi256(10),e.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(e,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),enumerable:!1}}),e}const r=assembleStyles();export{r as t};
@@ -1,7 +1,7 @@
1
- import{c as e,i as t,t as n}from"../rolldown-runtime.mjs";import{t as r}from"./ansi-regex.mjs";import{t as i}from"./ansi-align.mjs";import{t as a}from"./ansi-styles.mjs";import o from"node:os";import s from"node:process";import c from"node:tty";const l=r();function stripAnsi(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(l,``)}function isAmbiguous(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function isFullWidth(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function isWide(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function validate(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function eastAsianWidth(e,{ambiguousAsWide:t=!1}={}){return validate(e),isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)?2:1}var u=t(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,`default`);const d=new Intl.Segmenter,f=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=stripAnsi(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of d.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!f.test(t)){if(u().test(t)){i+=2;continue}i+=eastAsianWidth(e,a)}}return i}const wrapAnsi16=(e=0)=>t=>`\u001B[${t+e}m`,wrapAnsi256=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,p={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(p.modifier);const m=Object.keys(p.color),h=Object.keys(p.bgColor);[...m,...h];function assembleStyles(){let e=new Map;for(let[t,n]of Object.entries(p)){for(let[t,r]of Object.entries(n))p[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=p[t],e.set(r[0],r[1]);Object.defineProperty(p,t,{value:n,enumerable:!1})}return Object.defineProperty(p,`codes`,{value:e,enumerable:!1}),p.color.close=`\x1B[39m`,p.bgColor.close=`\x1B[49m`,p.color.ansi=wrapAnsi16(),p.color.ansi256=wrapAnsi256(),p.color.ansi16m=wrapAnsi16m(),p.bgColor.ansi=wrapAnsi16(10),p.bgColor.ansi256=wrapAnsi256(10),p.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(p,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>p.rgbToAnsi256(...p.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>p.ansi256ToAnsi(p.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>p.ansi256ToAnsi(p.hexToAnsi256(e)),enumerable:!1}}),p}const g=assembleStyles();function hasFlag(e,t=globalThis.Deno?globalThis.Deno.args:s.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:_}=s;let v;hasFlag(`no-color`)||hasFlag(`no-colors`)||hasFlag(`color=false`)||hasFlag(`color=never`)?v=0:(hasFlag(`color`)||hasFlag(`colors`)||hasFlag(`color=true`)||hasFlag(`color=always`))&&(v=1);function envForceColor(){if(`FORCE_COLOR`in _)return _.FORCE_COLOR===`true`?1:_.FORCE_COLOR===`false`?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function translateLevel(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function _supportsColor(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=envForceColor();r!==void 0&&(v=r);let i=n?v:r;if(i===0)return 0;if(n){if(hasFlag(`color=16m`)||hasFlag(`color=full`)||hasFlag(`color=truecolor`))return 3;if(hasFlag(`color=256`))return 2}if(`TF_BUILD`in _&&`AGENT_NAME`in _)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(_.TERM===`dumb`)return a;if(s.platform===`win32`){let e=o.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in _)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in _)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in _)||_.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in _)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION);if(_.COLORTERM===`truecolor`||_.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in _){let e=Number.parseInt((_.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(_.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||`COLORTERM`in _?1:a}function createSupportsColor(e,t={}){return translateLevel(_supportsColor(e,{streamIsTTY:e&&e.isTTY,...t}))}const y={stdout:createSupportsColor({isTTY:c.isatty(1)}),stderr:createSupportsColor({isTTY:c.isatty(2)})};function stringReplaceAll(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function stringEncaseCRLFWithFirstIndex(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
1
+ import{c as e,i as t,t as n}from"../rolldown-runtime.mjs";import{t as r}from"./ansi-regex.mjs";import{t as i}from"./ansi-align.mjs";import{t as a}from"./ansi-styles.mjs";import o from"node:os";import s from"node:process";import c from"node:tty";const l=r();function stripAnsi(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(l,``)}function isAmbiguous(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function isFullWidth(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function isWide(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function validate(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function eastAsianWidth(e,{ambiguousAsWide:t=!1}={}){return validate(e),isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)?2:1}var u=t(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,`default`);const d=new Intl.Segmenter,f=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=stripAnsi(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of d.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!f.test(t)){if(u().test(t)){i+=2;continue}i+=eastAsianWidth(e,a)}}return i}const wrapAnsi16=(e=0)=>t=>`\u001B[${t+e}m`,wrapAnsi256=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,wrapAnsi16m=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,p={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(p.modifier);const m=Object.keys(p.color),h=Object.keys(p.bgColor);[...m,...h];function assembleStyles(){let e=new Map;for(let[t,n]of Object.entries(p)){for(let[t,r]of Object.entries(n))p[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=p[t],e.set(r[0],r[1]);Object.defineProperty(p,t,{value:n,enumerable:!1})}return Object.defineProperty(p,"codes",{value:e,enumerable:!1}),p.color.close=`\x1B[39m`,p.bgColor.close=`\x1B[49m`,p.color.ansi=wrapAnsi16(),p.color.ansi256=wrapAnsi256(),p.color.ansi16m=wrapAnsi16m(),p.bgColor.ansi=wrapAnsi16(10),p.bgColor.ansi256=wrapAnsi256(10),p.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(p,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>p.rgbToAnsi256(...p.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>p.ansi256ToAnsi(p.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>p.ansi256ToAnsi(p.hexToAnsi256(e)),enumerable:!1}}),p}const g=assembleStyles();function hasFlag(e,t=globalThis.Deno?globalThis.Deno.args:s.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:_}=s;let v;hasFlag(`no-color`)||hasFlag(`no-colors`)||hasFlag(`color=false`)||hasFlag(`color=never`)?v=0:(hasFlag(`color`)||hasFlag(`colors`)||hasFlag(`color=true`)||hasFlag(`color=always`))&&(v=1);function envForceColor(){if(`FORCE_COLOR`in _)return _.FORCE_COLOR===`true`?1:_.FORCE_COLOR===`false`?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function translateLevel(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function _supportsColor(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=envForceColor();r!==void 0&&(v=r);let i=n?v:r;if(i===0)return 0;if(n){if(hasFlag(`color=16m`)||hasFlag(`color=full`)||hasFlag(`color=truecolor`))return 3;if(hasFlag(`color=256`))return 2}if(`TF_BUILD`in _&&`AGENT_NAME`in _)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(_.TERM===`dumb`)return a;if(s.platform===`win32`){let e=o.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in _)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in _)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in _)||_.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in _)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION);if(_.COLORTERM===`truecolor`||_.TERM===`xterm-kitty`)return 3;if(`TERM_PROGRAM`in _){let e=Number.parseInt((_.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(_.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||`COLORTERM`in _?1:a}function createSupportsColor(e,t={}){return translateLevel(_supportsColor(e,{streamIsTTY:e&&e.isTTY,...t}))}const y={stdout:createSupportsColor({isTTY:c.isatty(1)}),stderr:createSupportsColor({isTTY:c.isatty(2)})};function stringReplaceAll(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function stringEncaseCRLFWithFirstIndex(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
2
2
  `:`
3
3
  `)+n,i=r+1,r=e.indexOf(`
4
- `,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:b,stderr:x}=y,S=Symbol(`GENERATOR`),C=Symbol(`STYLER`),w=Symbol(`IS_EMPTY`),T=[`ansi`,`ansi`,`ansi256`,`ansi16m`],E=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=b?b.level:0;e.level=t.level===void 0?n:t.level},chalkFactory=e=>{let chalk=(...e)=>e.join(` `);return applyOptions(chalk,e),Object.setPrototypeOf(chalk,createChalk.prototype),chalk};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[e,t]of Object.entries(g))E[e]={get(){let n=createBuilder(this,createStyler(t.open,t.close,this[C]),this[w]);return Object.defineProperty(this,e,{value:n}),n}};E.visible={get(){let e=createBuilder(this,this[C],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const getModelAnsi=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?g[n].ansi16m(...r):t===`ansi256`?g[n].ansi256(g.rgbToAnsi256(...r)):g[n].ansi(g.rgbToAnsi(...r)):e===`hex`?getModelAnsi(`rgb`,t,n,...g.hexToRgb(...r)):g[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){E[e]={get(){let{level:t}=this;return function(...n){let r=createStyler(getModelAnsi(e,T[t],`color`,...n),g.color.close,this[C]);return createBuilder(this,r,this[w])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);E[t]={get(){let{level:t}=this;return function(...n){let r=createStyler(getModelAnsi(e,T[t],`bgColor`,...n),g.bgColor.close,this[C]);return createBuilder(this,r,this[w])}}}}const D=Object.defineProperties(()=>{},{...E,level:{enumerable:!0,get(){return this[S].level},set(e){this[S].level=e}}}),createStyler=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},createBuilder=(e,t,n)=>{let builder=(...e)=>applyStyle(builder,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(builder,D),builder[S]=e,builder[C]=t,builder[w]=n,builder},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[w]?``:t;let n=e[C];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=stringReplaceAll(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
4
+ `,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:b,stderr:x}=y,S=Symbol(`GENERATOR`),C=Symbol(`STYLER`),w=Symbol(`IS_EMPTY`),T=[`ansi`,`ansi`,`ansi256`,`ansi16m`],E=Object.create(null),applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=b?b.level:0;e.level=t.level===void 0?n:t.level},chalkFactory=e=>{let chalk=(...e)=>e.join(` `);return applyOptions(chalk,e),Object.setPrototypeOf(chalk,createChalk.prototype),chalk};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(let[e,t]of Object.entries(g))E[e]={get(){let n=createBuilder(this,createStyler(t.open,t.close,this[C]),this[w]);return Object.defineProperty(this,e,{value:n}),n}};E.visible={get(){let e=createBuilder(this,this[C],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const getModelAnsi=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?g[n].ansi16m(...r):t===`ansi256`?g[n].ansi256(g.rgbToAnsi256(...r)):g[n].ansi(g.rgbToAnsi(...r)):e===`hex`?getModelAnsi(`rgb`,t,n,...g.hexToRgb(...r)):g[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){E[e]={get(){let{level:t}=this;return function(...n){let r=createStyler(getModelAnsi(e,T[t],`color`,...n),g.color.close,this[C]);return createBuilder(this,r,this[w])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);E[t]={get(){let{level:t}=this;return function(...n){let r=createStyler(getModelAnsi(e,T[t],`bgColor`,...n),g.bgColor.close,this[C]);return createBuilder(this,r,this[w])}}}}const D=Object.defineProperties(()=>{},{...E,level:{enumerable:!0,get(){return this[S].level},set(e){this[S].level=e}}}),createStyler=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},createBuilder=(e,t,n)=>{let builder=(...e)=>applyStyle(builder,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(builder,D),builder[S]=e,builder[C]=t,builder[w]=n,builder},applyStyle=(e,t)=>{if(e.level<=0||!t)return e[w]?``:t;let n=e[C];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=stringReplaceAll(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
5
5
  `);return a!==-1&&(t=stringEncaseCRLFWithFirstIndex(t,i,r,a)),r+t+i};Object.defineProperties(createChalk.prototype,E);const O=createChalk();createChalk({level:x?x.level:0});function widestLine(e){let t=0;for(let n of e.split(`
6
6
  `))t=Math.max(t,stringWidth(n));return t}var k=n(((e,t)=>{t.exports={single:{topLeft:`┌`,top:`─`,topRight:`┐`,right:`│`,bottomRight:`┘`,bottom:`─`,bottomLeft:`└`,left:`│`},double:{topLeft:`╔`,top:`═`,topRight:`╗`,right:`║`,bottomRight:`╝`,bottom:`═`,bottomLeft:`╚`,left:`║`},round:{topLeft:`╭`,top:`─`,topRight:`╮`,right:`│`,bottomRight:`╯`,bottom:`─`,bottomLeft:`╰`,left:`│`},bold:{topLeft:`┏`,top:`━`,topRight:`┓`,right:`┃`,bottomRight:`┛`,bottom:`━`,bottomLeft:`┗`,left:`┃`},singleDouble:{topLeft:`╓`,top:`─`,topRight:`╖`,right:`║`,bottomRight:`╜`,bottom:`─`,bottomLeft:`╙`,left:`║`},doubleSingle:{topLeft:`╒`,top:`═`,topRight:`╕`,right:`│`,bottomRight:`╛`,bottom:`═`,bottomLeft:`╘`,left:`│`},classic:{topLeft:`+`,top:`-`,topRight:`+`,right:`|`,bottomRight:`+`,bottom:`-`,bottomLeft:`+`,left:`|`},arrow:{topLeft:`↘`,top:`↓`,topRight:`↙`,right:`←`,bottomRight:`↖`,bottom:`↑`,bottomLeft:`↗`,left:`→`}}})),A=e(n(((e,t)=>{let n=k();t.exports=n,t.exports.default=n}))(),1);const j=/[\p{Lu}]/u,M=/[\p{Ll}]/u,N=/^[\p{Lu}](?![\p{Lu}])/gu,P=/([\p{Alpha}\p{N}_]|$)/u,F=/[_.\- ]+/,I=RegExp(`^`+F.source),L=new RegExp(F.source+P.source,`gu`),R=RegExp(`\\d+`+P.source,`gu`),preserveCamelCase=(e,t,n,r)=>{let i=!1,a=!1,o=!1,s=!1;for(let c=0;c<e.length;c++){let l=e[c];s=c>2?e[c-3]===`-`:!0,i&&j.test(l)?(e=e.slice(0,c)+`-`+e.slice(c),i=!1,o=a,a=!0,c++):a&&o&&M.test(l)&&(!s||r)?(e=e.slice(0,c-1)+`-`+e.slice(c-1),o=a,a=!1,i=!0):(i=t(l)===l&&n(l)!==l,o=a,a=n(l)===l&&t(l)!==l)}return e},preserveConsecutiveUppercase=(e,t)=>(N.lastIndex=0,e.replaceAll(N,e=>t(e))),postProcess=(e,t)=>(L.lastIndex=0,R.lastIndex=0,e.replaceAll(R,(n,r,i)=>[`_`,`-`].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(L,(e,n)=>t(n)));function camelCase(e,t){if(!(typeof e==`string`||Array.isArray(e)))throw TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join(`-`):e.trim(),e.length===0)return``;let n=t.locale===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t.locale),r=t.locale===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(t.locale);return e.length===1?F.test(e)?``:t.pascalCase?r(e):n(e):(e!==n(e)&&(e=preserveCamelCase(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(I,``),e=t.preserveConsecutiveUppercase?preserveConsecutiveUppercase(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),postProcess(e,r))}var z=e(i(),1);const B=new Set([`\x1B`,`›`]),V=`]8;;`,wrapAnsiCode=e=>`${B.values().next().value}[${e}m`,wrapAnsiHyperlink=e=>`${B.values().next().value}${V}${e}`,wordLengths=e=>e.split(` `).map(e=>stringWidth(e)),wrapWord=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=stringWidth(stripAnsi(e.at(-1)));for(let[t,s]of r.entries()){let c=stringWidth(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),B.has(s)&&(i=!0,a=r.slice(t+1,t+1+4).join(``)===V),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},stringVisibleTrimSpacesRight=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(stringWidth(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},exec=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,o,s=wordLengths(e),c=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(c[c.length-1]=c.at(-1).trimStart());let e=stringWidth(c.at(-1));if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(c.push(``),e=0),(e>0||n.trim===!1)&&(c[c.length-1]+=` `,e++)),n.hard&&s[r]>t){let n=t-e,a=1+Math.floor((s[r]-n-1)/t);Math.floor((s[r]-1)/t)<a&&c.push(``),wrapWord(c,i,t);continue}if(e+s[r]>t&&e>0&&s[r]>0){if(n.wordWrap===!1&&e<t){wrapWord(c,i,t);continue}c.push(``)}if(e+s[r]>t&&n.wordWrap===!1){wrapWord(c,i,t);continue}c[c.length-1]+=i}n.trim!==!1&&(c=c.map(e=>stringVisibleTrimSpacesRight(e)));let l=c.join(`
7
7
  `),u=[...l],d=0;for(let[e,t]of u.entries()){if(r+=t,B.has(t)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${V}(?<uri>.*))`).exec(l.slice(d))||{groups:{}};if(e.code!==void 0){let t=Number.parseFloat(e.code);i=t===39?void 0:t}else e.uri!==void 0&&(o=e.uri.length===0?void 0:e.uri)}let n=a.codes.get(Number(i));u[e+1]===`
@@ -11,7 +11,7 @@ import{i as e}from"../rolldown-runtime.mjs";import{n as t,t as n}from"./@chevrot
11
11
  Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
12
12
  See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:J.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}function findEmptyMatchRegExps(e){return o(filter(e,e=>e.PATTERN.test(``)),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:J.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}const gn=/[^\\[][\^]|^\^/;function findStartOfInputAnchor(e){class StartAnchorFinder extends n{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return o(filter(e,e=>{let t=e.PATTERN;try{let e=getRegExpAst(t),n=new StartAnchorFinder;return n.visit(e),n.found}catch{return gn.test(t.source)}}),e=>({message:`Unexpected RegExp Anchor Error:
13
13
  Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
14
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:J.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function findUnsupportedFlags(e){return o(filter(e,e=>{let t=e[q];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:J.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function findDuplicatePatterns(e){let t=[],n=o(e,n=>reduce(e,(e,r)=>n.PATTERN.source===r.PATTERN.source&&!A(t,r)&&r.PATTERN!==Lexer.NA?(t.push(r),e.push(r),e):e,[]));return n=compact(n),o(filter(n,e=>e.length>1),e=>{let t=o(e,e=>e.name);return{message:`The same RegExp pattern ->${head(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:J.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function findInvalidGroupType(e){return o(filter(e,e=>{if(!has(e,`GROUP`))return!1;let t=e.GROUP;return t!==Lexer.SKIPPED&&t!==Lexer.NA&&!b(t)}),e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:J.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function findModesThatDoNotExist(e,t){return o(filter(e,e=>e.PUSH_MODE!==void 0&&!A(t,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:J.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function findUnreachablePatterns(e){let t=[],n=reduce(e,(e,t,n)=>{let r=t.PATTERN;return r===Lexer.NA||(b(r)?e.push({str:r,idx:n,tokenType:t}):W(r)&&noMetaChar(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return x(e,(e,r)=>{x(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&testTokenType(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:J.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function testTokenType(e,t){if(W(t)){let n=t.exec(e);return n!==null&&n.index===0}else if(I(t))return t(e,0,[],{});else if(has(t,`exec`))return t.exec(e,0,[],{});else if(typeof t==`string`)return t===e;else throw Error(`non exhaustive match`)}function noMetaChar(e){return K([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}function addStartOfInput(e){let t=e.ignoreCase?`i`:``;return RegExp(`^(?:${e.source})`,t)}function addStickyFlag(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function performRuntimeChecks(e,t,n){let r=[];return has(e,`defaultMode`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+pn+`> property in its definition
14
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:J.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function findUnsupportedFlags(e){return o(filter(e,e=>{let t=e[q];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:J.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function findDuplicatePatterns(e){let t=[],n=o(e,n=>reduce(e,(e,r)=>n.PATTERN.source===r.PATTERN.source&&!A(t,r)&&r.PATTERN!==Lexer.NA?(t.push(r),e.push(r),e):e,[]));return n=compact(n),o(filter(n,e=>e.length>1),e=>{let t=o(e,e=>e.name);return{message:`The same RegExp pattern ->${head(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:J.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function findInvalidGroupType(e){return o(filter(e,e=>{if(!has(e,`GROUP`))return!1;let t=e.GROUP;return t!==Lexer.SKIPPED&&t!==Lexer.NA&&!b(t)}),e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:J.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function findModesThatDoNotExist(e,t){return o(filter(e,e=>e.PUSH_MODE!==void 0&&!A(t,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:J.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function findUnreachablePatterns(e){let t=[],n=reduce(e,(e,t,n)=>{let r=t.PATTERN;return r===Lexer.NA||(b(r)?e.push({str:r,idx:n,tokenType:t}):W(r)&&noMetaChar(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return x(e,(e,r)=>{x(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&testTokenType(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:J.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function testTokenType(e,t){if(W(t)){let n=t.exec(e);return n!==null&&n.index===0}else if(I(t))return t(e,0,[],{});else if(has(t,`exec`))return t.exec(e,0,[],{});else if(typeof t==`string`)return t===e;else throw Error(`non exhaustive match`)}function noMetaChar(e){return K([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}function addStartOfInput(e){let t=e.ignoreCase?`i`:``;return RegExp(`^(?:${e.source})`,t)}function addStickyFlag(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function performRuntimeChecks(e,t,n){let r=[];return has(e,`defaultMode`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
15
15
  `,type:J.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),has(e,`modes`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <modes> property in its definition
16
16
  `,type:J.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),has(e,`modes`)&&has(e,`defaultMode`)&&!has(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${pn}: <${e.defaultMode}>which does not exist\n`,type:J.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),has(e,`modes`)&&x(e.modes,(e,t)=>{x(e,(n,i)=>{isUndefined(n)?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:J.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):has(n,`LONGER_ALT`)&&x(R(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],i=>{!isUndefined(i)&&!A(e,i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>\n`,type:J.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function performWarningRuntimeChecks(e,t,n){let r=[],i=!1,a=reject(compact(flatten(U(e.modes))),e=>e[q]===Lexer.NA),o=getCharCodes(n);return t&&x(a,e=>{let t=checkLineBreaksIssues(e,o);if(t!==!1){let n={message:buildLineBreakIssueMessage(e,t),type:t.issue,tokenType:e};r.push(n)}else has(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):canMatchCharCode(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
17
17
  This Lexer has been defined to track line and column information,
@@ -37,7 +37,7 @@ inside top level rule: ->`+e.name+`<-`}},X={buildDuplicateFoundError(e,t){functi
37
37
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
38
38
  `;return s=s.replace(/[ \t]+/g,` `),s=s.replace(/\s\s+/g,`
39
39
  `),s},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=o(e.prefixPath,e=>tokenLabel(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){let t=o(e.prefixPath,e=>tokenLabel(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\n`;return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
40
- For Further details.`,r},buildEmptyRepetitionError(e){let t=B(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${o(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof me?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function resolveGrammar$1(e,t){let n=new GastRefResolverVisitor(e,t);return n.resolveRefs(),n.errors}e(resolveGrammar$1,`resolveGrammar`);var GastRefResolverVisitor=class extends k{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){x(U(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:$.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},AbstractNextPossibleTokensWalker=class extends RestWalker{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=clone(this.path.ruleStack).reverse(),this.occurrenceStack=clone(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){isEmpty(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},NextAfterTokenWalker=class extends AbstractNextPossibleTokensWalker{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new z({definition:t.concat(n)});this.possibleTokTypes=first(e),this.found=!0}}},AbstractNextTerminalAfterProductionWalker=class extends RestWalker{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},NextTerminalAfterManyWalker=class extends AbstractNextTerminalAfterProductionWalker{walkMany(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},NextTerminalAfterManySepWalker=class extends AbstractNextTerminalAfterProductionWalker{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},NextTerminalAfterAtLeastOneWalker=class extends AbstractNextTerminalAfterProductionWalker{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},NextTerminalAfterAtLeastOneSepWalker=class extends AbstractNextTerminalAfterProductionWalker{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function possiblePathsFrom(e,t,n=[]){n=clone(n);let r=[],i=0;function remainingPathWith(t){return t.concat(drop(e,i+1))}function getAlternativesForProd(e){let i=possiblePathsFrom(remainingPathWith(e),t,n);return r.concat(i)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof z||t instanceof j)return getAlternativesForProd(t.definition);if(t instanceof F)r=getAlternativesForProd(t.definition);else if(t instanceof M)return getAlternativesForProd(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof N)return getAlternativesForProd([new z({definition:t.definition}),new V({definition:[new P({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof ye)r=getAlternativesForProd(t.definition.concat([new V({definition:[new P({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof V)r=getAlternativesForProd(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof L)return x(t.definition,e=>{isEmpty(e.definition)===!1&&(r=getAlternativesForProd(e.definition))}),r;else if(t instanceof P)n.push(t.terminalType);else throw Error(`non exhaustive match`);i++}return r.push({partialPath:n,suffixDef:drop(e,i)}),r}function nextPossibleTokensAfter(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!isEmpty(d);){let e=d.pop();if(e===o){s&&last(d).idx<=l&&d.pop();continue}let r=e.def,f=e.idx,p=e.ruleStack,m=e.occurrenceStack;if(isEmpty(r))continue;let h=r[0];if(h===i){let e={idx:f,def:drop(r),ruleStack:dropRight(p),occurrenceStack:dropRight(m)};d.push(e)}else if(h instanceof P)if(f<c-1){let e=f+1,i=t[e];if(n(i,h.terminalType)){let t={idx:e,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(t)}}else if(f===c-1)u.push({nextTokenType:h.terminalType,nextTokenOccurrence:h.idx,ruleStack:p,occurrenceStack:m}),s=!0;else throw Error(`non exhaustive match`);else if(h instanceof j){let e=clone(p);e.push(h.nonTerminalName);let t=clone(m);t.push(h.idx);let n={idx:f,def:h.definition.concat(a,drop(r)),ruleStack:e,occurrenceStack:t};d.push(n)}else if(h instanceof F){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t={idx:f,def:h.definition.concat(drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof M){let e=new V({definition:h.definition,idx:h.idx}),t={idx:f,def:h.definition.concat([e],drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof N){let e=new V({definition:[new P({terminalType:h.separator})].concat(h.definition),idx:h.idx}),t={idx:f,def:h.definition.concat([e],drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof ye){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new V({definition:[new P({terminalType:h.separator})].concat(h.definition),idx:h.idx}),n={idx:f,def:h.definition.concat([t],drop(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof V){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new V({definition:h.definition,idx:h.idx}),n={idx:f,def:h.definition.concat([t],drop(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof L)for(let e=h.definition.length-1;e>=0;e--){let t={idx:f,def:h.definition[e].definition.concat(drop(r)),ruleStack:p,occurrenceStack:m};d.push(t),d.push(o)}else if(h instanceof z)d.push({idx:f,def:h.definition.concat(drop(r)),ruleStack:p,occurrenceStack:m});else if(h instanceof me)d.push(expandTopLevelRule(h,f,p,m));else throw Error(`non exhaustive match`)}return u}function expandTopLevelRule(e,t,n,r){let i=clone(n);i.push(e.name);let a=clone(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var Z;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(Z||={});function getProdType(e){if(e instanceof F||e===`Option`)return Z.OPTION;if(e instanceof V||e===`Repetition`)return Z.REPETITION;if(e instanceof M||e===`RepetitionMandatory`)return Z.REPETITION_MANDATORY;if(e instanceof N||e===`RepetitionMandatoryWithSeparator`)return Z.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ye||e===`RepetitionWithSeparator`)return Z.REPETITION_WITH_SEPARATOR;if(e instanceof L||e===`Alternation`)return Z.ALTERNATION;throw Error(`non exhaustive match`)}function getLookaheadPaths(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=getProdType(r);return a===Z.ALTERNATION?getLookaheadPathsForOr(t,n,i):getLookaheadPathsForOptionalProd(t,n,a,i)}function buildLookaheadFuncForOr(e,t,n,r,i,a){let o=getLookaheadPathsForOr(e,t,n);return a(o,r,areTokenCategoriesNotUsed(o)?tokenStructuredMatcherNoCategories:tokenStructuredMatcher,i)}function buildLookaheadFuncForOptionalProd(e,t,n,r,i,a){let o=getLookaheadPathsForOptionalProd(e,t,i,n),s=areTokenCategoriesNotUsed(o)?tokenStructuredMatcherNoCategories:tokenStructuredMatcher;return a(o[0],s,r)}function buildAlternativesLookAheadFunc(e,t,n,r){let i=e.length,a=H(e,e=>H(e,e=>e.length===1));if(t)return function(t){let r=o(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(!(o!==void 0&&o.call(this)===!1))nextPath:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue nextPath;return t}}};if(a&&!r){let t=reduce(o(e,e=>flatten(e)),(e,t,n)=>(x(t,t=>{has(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),x(t.categoryMatches,t=>{has(e,t)||(e[t]=n)})}),e),{});return function(){return t[this.LA(1).tokenTypeIdx]}}else return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;nextPath:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue nextPath;return t}}}}function buildSingleAlternativeLookaheadFunction(e,t,n){let r=H(e,e=>e.length===1),i=e.length;if(r&&!n){let t=flatten(e);if(t.length===1&&isEmpty(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=reduce(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,x(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}else return function(){nextPath:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue nextPath;return!0}return!1}}var RestDefinitionFinderWalker=class extends RestWalker{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1}walkOption(e,t,n){this.checkIsTarget(e,Z.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Z.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},InsideDefinitionFinderVisitor=class extends k{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Z.OPTION)}visitRepetition(e){this.checkIsTarget(e,Z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Z.ALTERNATION)}};function initializeArrayOfArrays(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function pathToHashKeys(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function isUniquePrefixHash(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}function lookAheadSequenceFromAlternatives(e,t){let n=o(e,e=>possiblePathsFrom([e],1)),r=initializeArrayOfArrays(n.length),i=o(n,e=>{let t={};return x(e,e=>{x(pathToHashKeys(e.partialPath),e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=initializeArrayOfArrays(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let c=s[n].partialPath,l=s[n].suffixDef,u=pathToHashKeys(c);if(isUniquePrefixHash(i,u,o)||isEmpty(l)||c.length===t){let e=r[o];if(containsPath(e,c)===!1){e.push(c);for(let e=0;e<u.length;e++){let t=u[e];i[o][t]=!0}}}else{let t=possiblePathsFrom(l,e+1,c);a[o]=a[o].concat(t),x(t,e=>{x(pathToHashKeys(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}function getLookaheadPathsForOr(e,t,n,r){let i=new InsideDefinitionFinderVisitor(e,Z.ALTERNATION,r);return t.accept(i),lookAheadSequenceFromAlternatives(i.result,n)}function getLookaheadPathsForOptionalProd(e,t,n,r){let i=new InsideDefinitionFinderVisitor(e,n);t.accept(i);let a=i.result,o=new RestDefinitionFinderWalker(t,e,n).startWalking();return lookAheadSequenceFromAlternatives([new z({definition:a}),new z({definition:o})],r)}function containsPath(e,t){compareOtherPath:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(!(n===i||i.categoryMatchesMap[n.tokenTypeIdx]!==void 0))continue compareOtherPath}return!0}}return!1}function isStrictPrefixOfPath(e,t){return e.length<t.length&&H(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}function areTokenCategoriesNotUsed(e){return H(e,e=>H(e,e=>H(e,e=>isEmpty(e.categoryMatches))))}function validateLookahead(e){return o(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:$.CUSTOM_LOOKAHEAD_VALIDATION},e))}function validateGrammar$1(e,t,n,r){let i=flatMap(e,e=>validateDuplicateProductions(e,n)),a=checkTerminalAndNoneTerminalsNameSpace(e,t,n),o=flatMap(e,e=>validateTooManyAlts(e,n)),s=flatMap(e,t=>validateRuleDoesNotAlreadyExist(t,e,r,n));return i.concat(a,o,s)}e(validateGrammar$1,`validateGrammar`);function validateDuplicateProductions(e,t){let n=new OccurrenceValidationCollector;e.accept(n);let r=n.allProductions;return o(U(Ee(Qt(r,identifyProductionForDuplicates),e=>e.length>1)),n=>{let r=head(n),i=t.buildDuplicateFoundError(e,n),a=B(r),o={message:i,type:$.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=getExtraProductionArgument(r);return s&&(o.parameter=s),o})}function identifyProductionForDuplicates(e){return`${B(e)}_#_${e.idx}_#_${getExtraProductionArgument(e)}`}function getExtraProductionArgument(e){return e instanceof P?e.terminalType.name:e instanceof j?e.nonTerminalName:``}var OccurrenceValidationCollector=class extends k{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function validateRuleDoesNotAlreadyExist(e,t,n,r){let i=[];if(reduce(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:$.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function validateRuleIsOverridden(e,t,n){let r=[],i;return A(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:$.INVALID_RULE_OVERRIDE,ruleName:e})),r}function validateNoLeftRecursion(e,t,n,r=[]){let i=[],a=getFirstNoneTerminal(t.definition);if(isEmpty(a))return[];{let t=e.name;A(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:$.LEFT_RECURSION,ruleName:t});let o=flatMap(Yt(a,r.concat([e])),t=>{let i=clone(r);return i.push(t),validateNoLeftRecursion(e,t,n,i)});return i.concat(o)}}function getFirstNoneTerminal(e){let t=[];if(isEmpty(e))return t;let n=head(e);if(n instanceof j)t.push(n.referencedRule);else if(n instanceof z||n instanceof F||n instanceof M||n instanceof N||n instanceof ye||n instanceof V)t=t.concat(getFirstNoneTerminal(n.definition));else if(n instanceof L)t=flatten(o(n.definition,e=>getFirstNoneTerminal(e.definition)));else if(!(n instanceof P))throw Error(`non exhaustive match`);let r=xe(n),i=e.length>1;if(r&&i){let n=drop(e);return t.concat(getFirstNoneTerminal(n))}else return t}var OrCollector=class extends k{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function validateEmptyOrAlternative(e,t){let n=new OrCollector;e.accept(n);let r=n.alternations;return flatMap(r,n=>flatMap(dropRight(n.definition),(r,i)=>isEmpty(nextPossibleTokensAfter([r],[],tokenStructuredMatcher,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:$.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}function validateAmbiguousAlternationAlternatives(e,t,n){let r=new OrCollector;e.accept(r);let i=r.alternations;return i=reject(i,e=>e.ignoreAmbiguities===!0),flatMap(i,r=>{let i=r.idx,a=getLookaheadPathsForOr(i,e,r.maxLookahead||t,r),o=checkAlternativesAmbiguities(a,r,e,n),s=checkPrefixAlternativesAmbiguities(a,r,e,n);return o.concat(s)})}var RepetitionCollector=class extends k{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function validateTooManyAlts(e,t){let n=new OrCollector;e.accept(n);let r=n.alternations;return flatMap(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:$.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}function validateSomeNonEmptyLookaheadPath(e,t,n){let r=[];return x(e,e=>{let i=new RepetitionCollector;e.accept(i);let a=i.allProductions;x(a,i=>{let a=getProdType(i),o=i.maxLookahead||t,s=i.idx,c=getLookaheadPathsForOptionalProd(s,e,a,o)[0];if(isEmpty(flatten(c))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:$.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}function checkAlternativesAmbiguities(e,t,n,r){let i=[];return o(reduce(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||x(r,r=>{let o=[a];x(e,(e,n)=>{a!==n&&containsPath(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!containsPath(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),e=>{let i=o(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}function checkPrefixAlternativesAmbiguities(e,t,n,r){let i=reduce(e,(e,t,n)=>{let r=o(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return compact(flatMap(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,s=e.path;return o(filter(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&isStrictPrefixOfPath(e.path,s)),e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}function checkTerminalAndNoneTerminalsNameSpace(e,t,n){let r=[],i=o(t,e=>e.name);return x(e,e=>{let t=e.name;if(A(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:$.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}function resolveGrammar(e){let t=qt(e,{errMsgProvider:Mn}),n={};return x(e.rules,e=>{n[e.name]=e}),resolveGrammar$1(n,t.errMsgProvider)}function validateGrammar(e){return e=qt(e,{errMsgProvider:X}),validateGrammar$1(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}const Nn=`MismatchedTokenException`,Pn=`NoViableAltException`,Fn=`EarlyExitException`,In=`NotAllInputParsedException`,Ln=[Nn,Pn,Fn,In];Object.freeze(Ln);function isRecognitionException(e){return A(Ln,e.name)}var RecognitionException=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},MismatchedTokenException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Nn}},NoViableAltException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Pn}},NotAllInputParsedException=class extends RecognitionException{constructor(e,t){super(e,t),this.name=In}},EarlyExitException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Fn}};const Rn={};var InRuleRecoveryException=class extends Error{constructor(e){super(e),this.name=`InRuleRecoveryException`}},Recoverable=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=has(e,`recoveryEnabled`)?e.recoveryEnabled:Q.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=attemptInRepetitionRecovery)}getTokenToInsert(e){let t=createTokenInstance(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,c=this.LA(1),l=this.LA(1),generateErrorMessage=()=>{let e=this.LA(0),t=new MismatchedTokenException(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),c,this.LA(0));t.resyncedTokens=dropRight(o),this.SAVE_ERROR(t)};for(;!s;)if(this.tokenMatcher(l,r)){generateErrorMessage();return}else if(n.call(this)){generateErrorMessage(),e.apply(this,t);return}else this.tokenMatcher(l,i)?s=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new InRuleRecoveryException(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||isEmpty(t))return!1;let n=this.LA(1);return K(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return A(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=K(e,e=>tokenMatcher(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Rn;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return o(e,(n,r)=>r===0?Rn:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return flatten(o(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===Rn)return[Y];let t=e.ruleName+e.idxInCallingRule+cn+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Y)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return dropRight(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:clone(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return o(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function attemptInRepetitionRecovery(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),c=this.firstAfterRepMap[s];if(c===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];c=new a(t,i).startWalking(),this.firstAfterRepMap[s]=c}let l=c.token,u=c.occurrence,d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=Y,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}const zn=1024,Bn=1280,Vn=1536;function getKeyForAutomaticLookahead(e,t,n){return n|t|e}var LLkLookaheadStrategy=class{constructor(e){this.maxLookahead=e?.maxLookahead??Q.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(isEmpty(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return flatMap(e,e=>validateNoLeftRecursion(e,e,X))}validateEmptyOrAlternatives(e){return flatMap(e,e=>validateEmptyOrAlternative(e,X))}validateAmbiguousAlternationAlternatives(e,t){return flatMap(e,e=>validateAmbiguousAlternationAlternatives(e,t,X))}validateSomeNonEmptyLookaheadPath(e,t){return validateSomeNonEmptyLookaheadPath(e,t,X)}buildLookaheadForAlternation(e){return buildLookaheadFuncForOr(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,buildAlternativesLookAheadFunc)}buildLookaheadForOptional(e){return buildLookaheadFuncForOptionalProd(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,getProdType(e.prodType),buildSingleAlternativeLookaheadFunction)}},LooksAhead=class{initLooksAhead(e){this.dynamicTokensEnabled=has(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:Q.dynamicTokensEnabled,this.maxLookahead=has(e,`maxLookahead`)?e.maxLookahead:Q.maxLookahead,this.lookaheadStrategy=has(e,`lookaheadStrategy`)?e.lookaheadStrategy:new LLkLookaheadStrategy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){x(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=collectMethods(e);x(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${B(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),x(n,t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,B(t))}),x(r,t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,B(t))}),x(i,t=>{this.computeLookaheadFunc(e,t.idx,zn,`RepetitionMandatory`,t.maxLookahead,B(t))}),x(a,t=>{this.computeLookaheadFunc(e,t.idx,Vn,`RepetitionMandatoryWithSeparator`,t.maxLookahead,B(t))}),x(o,t=>{this.computeLookaheadFunc(e,t.idx,Bn,`RepetitionWithSeparator`,t.maxLookahead,B(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return getKeyForAutomaticLookahead(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},DslMethodsCollectorVisitor=class extends k{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};const Hn=new DslMethodsCollectorVisitor;function collectMethods(e){Hn.reset(),e.accept(Hn);let t=Hn.dslMethods;return Hn.reset(),t}function setNodeLocationOnlyOffset(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function setNodeLocationFull(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function addTerminalToCst(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function addNoneTerminalToCst(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}function defineNameProp(e,t){Object.defineProperty(e,`name`,{enumerable:!1,configurable:!0,writable:!1,value:t})}function defaultVisit(e,t){let n=u(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function createBaseSemanticVisitorConstructor(e,t){let derivedConstructor=function(){};return defineNameProp(derivedConstructor,e+`BaseSemantics`),derivedConstructor.prototype={visit:function(e,t){if(R(e)&&(e=e[0]),!isUndefined(e))return this[e.name](e.children,t)},validateVisitor:function(){let e=validateVisitor(this,t);if(!isEmpty(e)){let t=o(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join(`
40
+ For Further details.`,r},buildEmptyRepetitionError(e){let t=B(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${o(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof me?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function resolveGrammar$1(e,t){let n=new GastRefResolverVisitor(e,t);return n.resolveRefs(),n.errors}e(resolveGrammar$1,`resolveGrammar`);var GastRefResolverVisitor=class extends k{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){x(U(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:$.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},AbstractNextPossibleTokensWalker=class extends RestWalker{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=clone(this.path.ruleStack).reverse(),this.occurrenceStack=clone(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){isEmpty(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},NextAfterTokenWalker=class extends AbstractNextPossibleTokensWalker{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new z({definition:t.concat(n)});this.possibleTokTypes=first(e),this.found=!0}}},AbstractNextTerminalAfterProductionWalker=class extends RestWalker{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},NextTerminalAfterManyWalker=class extends AbstractNextTerminalAfterProductionWalker{walkMany(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},NextTerminalAfterManySepWalker=class extends AbstractNextTerminalAfterProductionWalker{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},NextTerminalAfterAtLeastOneWalker=class extends AbstractNextTerminalAfterProductionWalker{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},NextTerminalAfterAtLeastOneSepWalker=class extends AbstractNextTerminalAfterProductionWalker{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=head(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof P&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function possiblePathsFrom(e,t,n=[]){n=clone(n);let r=[],i=0;function remainingPathWith(t){return t.concat(drop(e,i+1))}function getAlternativesForProd(e){let i=possiblePathsFrom(remainingPathWith(e),t,n);return r.concat(i)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof z||t instanceof j)return getAlternativesForProd(t.definition);if(t instanceof F)r=getAlternativesForProd(t.definition);else if(t instanceof M)return getAlternativesForProd(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof N)return getAlternativesForProd([new z({definition:t.definition}),new V({definition:[new P({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof ye)r=getAlternativesForProd(t.definition.concat([new V({definition:[new P({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof V)r=getAlternativesForProd(t.definition.concat([new V({definition:t.definition})]));else if(t instanceof L)return x(t.definition,e=>{isEmpty(e.definition)===!1&&(r=getAlternativesForProd(e.definition))}),r;else if(t instanceof P)n.push(t.terminalType);else throw Error(`non exhaustive match`);i++}return r.push({partialPath:n,suffixDef:drop(e,i)}),r}function nextPossibleTokensAfter(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!isEmpty(d);){let e=d.pop();if(e===o){s&&last(d).idx<=l&&d.pop();continue}let r=e.def,f=e.idx,p=e.ruleStack,m=e.occurrenceStack;if(isEmpty(r))continue;let h=r[0];if(h===i){let e={idx:f,def:drop(r),ruleStack:dropRight(p),occurrenceStack:dropRight(m)};d.push(e)}else if(h instanceof P)if(f<c-1){let e=f+1,i=t[e];if(n(i,h.terminalType)){let t={idx:e,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(t)}}else if(f===c-1)u.push({nextTokenType:h.terminalType,nextTokenOccurrence:h.idx,ruleStack:p,occurrenceStack:m}),s=!0;else throw Error(`non exhaustive match`);else if(h instanceof j){let e=clone(p);e.push(h.nonTerminalName);let t=clone(m);t.push(h.idx);let n={idx:f,def:h.definition.concat(a,drop(r)),ruleStack:e,occurrenceStack:t};d.push(n)}else if(h instanceof F){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t={idx:f,def:h.definition.concat(drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof M){let e=new V({definition:h.definition,idx:h.idx}),t={idx:f,def:h.definition.concat([e],drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof N){let e=new V({definition:[new P({terminalType:h.separator})].concat(h.definition),idx:h.idx}),t={idx:f,def:h.definition.concat([e],drop(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof ye){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new V({definition:[new P({terminalType:h.separator})].concat(h.definition),idx:h.idx}),n={idx:f,def:h.definition.concat([t],drop(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof V){let e={idx:f,def:drop(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new V({definition:h.definition,idx:h.idx}),n={idx:f,def:h.definition.concat([t],drop(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof L)for(let e=h.definition.length-1;e>=0;e--){let t={idx:f,def:h.definition[e].definition.concat(drop(r)),ruleStack:p,occurrenceStack:m};d.push(t),d.push(o)}else if(h instanceof z)d.push({idx:f,def:h.definition.concat(drop(r)),ruleStack:p,occurrenceStack:m});else if(h instanceof me)d.push(expandTopLevelRule(h,f,p,m));else throw Error(`non exhaustive match`)}return u}function expandTopLevelRule(e,t,n,r){let i=clone(n);i.push(e.name);let a=clone(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var Z;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(Z||={});function getProdType(e){if(e instanceof F||e===`Option`)return Z.OPTION;if(e instanceof V||e===`Repetition`)return Z.REPETITION;if(e instanceof M||e===`RepetitionMandatory`)return Z.REPETITION_MANDATORY;if(e instanceof N||e===`RepetitionMandatoryWithSeparator`)return Z.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ye||e===`RepetitionWithSeparator`)return Z.REPETITION_WITH_SEPARATOR;if(e instanceof L||e===`Alternation`)return Z.ALTERNATION;throw Error(`non exhaustive match`)}function getLookaheadPaths(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=getProdType(r);return a===Z.ALTERNATION?getLookaheadPathsForOr(t,n,i):getLookaheadPathsForOptionalProd(t,n,a,i)}function buildLookaheadFuncForOr(e,t,n,r,i,a){let o=getLookaheadPathsForOr(e,t,n);return a(o,r,areTokenCategoriesNotUsed(o)?tokenStructuredMatcherNoCategories:tokenStructuredMatcher,i)}function buildLookaheadFuncForOptionalProd(e,t,n,r,i,a){let o=getLookaheadPathsForOptionalProd(e,t,i,n),s=areTokenCategoriesNotUsed(o)?tokenStructuredMatcherNoCategories:tokenStructuredMatcher;return a(o[0],s,r)}function buildAlternativesLookAheadFunc(e,t,n,r){let i=e.length,a=H(e,e=>H(e,e=>e.length===1));if(t)return function(t){let r=o(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(!(o!==void 0&&o.call(this)===!1))nextPath:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue nextPath;return t}}};if(a&&!r){let t=reduce(o(e,e=>flatten(e)),(e,t,n)=>(x(t,t=>{has(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),x(t.categoryMatches,t=>{has(e,t)||(e[t]=n)})}),e),{});return function(){return t[this.LA(1).tokenTypeIdx]}}else return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;nextPath:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue nextPath;return t}}}}function buildSingleAlternativeLookaheadFunction(e,t,n){let r=H(e,e=>e.length===1),i=e.length;if(r&&!n){let t=flatten(e);if(t.length===1&&isEmpty(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}else{let e=reduce(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,x(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){return e[this.LA(1).tokenTypeIdx]===!0}}}else return function(){nextPath:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue nextPath;return!0}return!1}}var RestDefinitionFinderWalker=class extends RestWalker{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1}walkOption(e,t,n){this.checkIsTarget(e,Z.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Z.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},InsideDefinitionFinderVisitor=class extends k{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Z.OPTION)}visitRepetition(e){this.checkIsTarget(e,Z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Z.ALTERNATION)}};function initializeArrayOfArrays(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function pathToHashKeys(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function isUniquePrefixHash(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}function lookAheadSequenceFromAlternatives(e,t){let n=o(e,e=>possiblePathsFrom([e],1)),r=initializeArrayOfArrays(n.length),i=o(n,e=>{let t={};return x(e,e=>{x(pathToHashKeys(e.partialPath),e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=initializeArrayOfArrays(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let c=s[n].partialPath,l=s[n].suffixDef,u=pathToHashKeys(c);if(isUniquePrefixHash(i,u,o)||isEmpty(l)||c.length===t){let e=r[o];if(containsPath(e,c)===!1){e.push(c);for(let e=0;e<u.length;e++){let t=u[e];i[o][t]=!0}}}else{let t=possiblePathsFrom(l,e+1,c);a[o]=a[o].concat(t),x(t,e=>{x(pathToHashKeys(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}function getLookaheadPathsForOr(e,t,n,r){let i=new InsideDefinitionFinderVisitor(e,Z.ALTERNATION,r);return t.accept(i),lookAheadSequenceFromAlternatives(i.result,n)}function getLookaheadPathsForOptionalProd(e,t,n,r){let i=new InsideDefinitionFinderVisitor(e,n);t.accept(i);let a=i.result,o=new RestDefinitionFinderWalker(t,e,n).startWalking();return lookAheadSequenceFromAlternatives([new z({definition:a}),new z({definition:o})],r)}function containsPath(e,t){compareOtherPath:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(!(n===i||i.categoryMatchesMap[n.tokenTypeIdx]!==void 0))continue compareOtherPath}return!0}}return!1}function isStrictPrefixOfPath(e,t){return e.length<t.length&&H(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}function areTokenCategoriesNotUsed(e){return H(e,e=>H(e,e=>H(e,e=>isEmpty(e.categoryMatches))))}function validateLookahead(e){return o(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:$.CUSTOM_LOOKAHEAD_VALIDATION},e))}function validateGrammar$1(e,t,n,r){let i=flatMap(e,e=>validateDuplicateProductions(e,n)),a=checkTerminalAndNoneTerminalsNameSpace(e,t,n),o=flatMap(e,e=>validateTooManyAlts(e,n)),s=flatMap(e,t=>validateRuleDoesNotAlreadyExist(t,e,r,n));return i.concat(a,o,s)}e(validateGrammar$1,`validateGrammar`);function validateDuplicateProductions(e,t){let n=new OccurrenceValidationCollector;e.accept(n);let r=n.allProductions;return o(U(Ee(Qt(r,identifyProductionForDuplicates),e=>e.length>1)),n=>{let r=head(n),i=t.buildDuplicateFoundError(e,n),a=B(r),o={message:i,type:$.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=getExtraProductionArgument(r);return s&&(o.parameter=s),o})}function identifyProductionForDuplicates(e){return`${B(e)}_#_${e.idx}_#_${getExtraProductionArgument(e)}`}function getExtraProductionArgument(e){return e instanceof P?e.terminalType.name:e instanceof j?e.nonTerminalName:``}var OccurrenceValidationCollector=class extends k{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function validateRuleDoesNotAlreadyExist(e,t,n,r){let i=[];if(reduce(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:$.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function validateRuleIsOverridden(e,t,n){let r=[],i;return A(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:$.INVALID_RULE_OVERRIDE,ruleName:e})),r}function validateNoLeftRecursion(e,t,n,r=[]){let i=[],a=getFirstNoneTerminal(t.definition);if(isEmpty(a))return[];{let t=e.name;A(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:$.LEFT_RECURSION,ruleName:t});let o=flatMap(Yt(a,r.concat([e])),t=>{let i=clone(r);return i.push(t),validateNoLeftRecursion(e,t,n,i)});return i.concat(o)}}function getFirstNoneTerminal(e){let t=[];if(isEmpty(e))return t;let n=head(e);if(n instanceof j)t.push(n.referencedRule);else if(n instanceof z||n instanceof F||n instanceof M||n instanceof N||n instanceof ye||n instanceof V)t=t.concat(getFirstNoneTerminal(n.definition));else if(n instanceof L)t=flatten(o(n.definition,e=>getFirstNoneTerminal(e.definition)));else if(!(n instanceof P))throw Error(`non exhaustive match`);let r=xe(n),i=e.length>1;if(r&&i){let n=drop(e);return t.concat(getFirstNoneTerminal(n))}else return t}var OrCollector=class extends k{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function validateEmptyOrAlternative(e,t){let n=new OrCollector;e.accept(n);let r=n.alternations;return flatMap(r,n=>flatMap(dropRight(n.definition),(r,i)=>isEmpty(nextPossibleTokensAfter([r],[],tokenStructuredMatcher,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:$.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}function validateAmbiguousAlternationAlternatives(e,t,n){let r=new OrCollector;e.accept(r);let i=r.alternations;return i=reject(i,e=>e.ignoreAmbiguities===!0),flatMap(i,r=>{let i=r.idx,a=getLookaheadPathsForOr(i,e,r.maxLookahead||t,r),o=checkAlternativesAmbiguities(a,r,e,n),s=checkPrefixAlternativesAmbiguities(a,r,e,n);return o.concat(s)})}var RepetitionCollector=class extends k{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function validateTooManyAlts(e,t){let n=new OrCollector;e.accept(n);let r=n.alternations;return flatMap(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:$.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}function validateSomeNonEmptyLookaheadPath(e,t,n){let r=[];return x(e,e=>{let i=new RepetitionCollector;e.accept(i);let a=i.allProductions;x(a,i=>{let a=getProdType(i),o=i.maxLookahead||t,s=i.idx,c=getLookaheadPathsForOptionalProd(s,e,a,o)[0];if(isEmpty(flatten(c))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:$.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}function checkAlternativesAmbiguities(e,t,n,r){let i=[];return o(reduce(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||x(r,r=>{let o=[a];x(e,(e,n)=>{a!==n&&containsPath(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!containsPath(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),e=>{let i=o(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}function checkPrefixAlternativesAmbiguities(e,t,n,r){let i=reduce(e,(e,t,n)=>{let r=o(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return compact(flatMap(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,s=e.path;return o(filter(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&isStrictPrefixOfPath(e.path,s)),e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:$.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}function checkTerminalAndNoneTerminalsNameSpace(e,t,n){let r=[],i=o(t,e=>e.name);return x(e,e=>{let t=e.name;if(A(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:$.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}function resolveGrammar(e){let t=qt(e,{errMsgProvider:Mn}),n={};return x(e.rules,e=>{n[e.name]=e}),resolveGrammar$1(n,t.errMsgProvider)}function validateGrammar(e){return e=qt(e,{errMsgProvider:X}),validateGrammar$1(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}const Nn=`MismatchedTokenException`,Pn=`NoViableAltException`,Fn=`EarlyExitException`,In=`NotAllInputParsedException`,Ln=[Nn,Pn,Fn,In];Object.freeze(Ln);function isRecognitionException(e){return A(Ln,e.name)}var RecognitionException=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},MismatchedTokenException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Nn}},NoViableAltException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Pn}},NotAllInputParsedException=class extends RecognitionException{constructor(e,t){super(e,t),this.name=In}},EarlyExitException=class extends RecognitionException{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Fn}};const Rn={};var InRuleRecoveryException=class extends Error{constructor(e){super(e),this.name=`InRuleRecoveryException`}},Recoverable=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=has(e,`recoveryEnabled`)?e.recoveryEnabled:Q.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=attemptInRepetitionRecovery)}getTokenToInsert(e){let t=createTokenInstance(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,c=this.LA(1),l=this.LA(1),generateErrorMessage=()=>{let e=this.LA(0),t=new MismatchedTokenException(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),c,this.LA(0));t.resyncedTokens=dropRight(o),this.SAVE_ERROR(t)};for(;!s;)if(this.tokenMatcher(l,r)){generateErrorMessage();return}else if(n.call(this)){generateErrorMessage(),e.apply(this,t);return}else this.tokenMatcher(l,i)?s=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new InRuleRecoveryException(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||isEmpty(t))return!1;let n=this.LA(1);return K(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return A(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=K(e,e=>tokenMatcher(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Rn;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return o(e,(n,r)=>r===0?Rn:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return flatten(o(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===Rn)return[Y];let t=e.ruleName+e.idxInCallingRule+cn+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Y)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return dropRight(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:clone(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return o(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function attemptInRepetitionRecovery(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),c=this.firstAfterRepMap[s];if(c===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];c=new a(t,i).startWalking(),this.firstAfterRepMap[s]=c}let l=c.token,u=c.occurrence,d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=Y,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}const zn=1024,Bn=1280,Vn=1536;function getKeyForAutomaticLookahead(e,t,n){return n|t|e}var LLkLookaheadStrategy=class{constructor(e){this.maxLookahead=e?.maxLookahead??Q.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(isEmpty(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return flatMap(e,e=>validateNoLeftRecursion(e,e,X))}validateEmptyOrAlternatives(e){return flatMap(e,e=>validateEmptyOrAlternative(e,X))}validateAmbiguousAlternationAlternatives(e,t){return flatMap(e,e=>validateAmbiguousAlternationAlternatives(e,t,X))}validateSomeNonEmptyLookaheadPath(e,t){return validateSomeNonEmptyLookaheadPath(e,t,X)}buildLookaheadForAlternation(e){return buildLookaheadFuncForOr(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,buildAlternativesLookAheadFunc)}buildLookaheadForOptional(e){return buildLookaheadFuncForOptionalProd(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,getProdType(e.prodType),buildSingleAlternativeLookaheadFunction)}},LooksAhead=class{initLooksAhead(e){this.dynamicTokensEnabled=has(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:Q.dynamicTokensEnabled,this.maxLookahead=has(e,`maxLookahead`)?e.maxLookahead:Q.maxLookahead,this.lookaheadStrategy=has(e,`lookaheadStrategy`)?e.lookaheadStrategy:new LLkLookaheadStrategy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){x(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=collectMethods(e);x(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${B(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),x(n,t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,B(t))}),x(r,t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,B(t))}),x(i,t=>{this.computeLookaheadFunc(e,t.idx,zn,`RepetitionMandatory`,t.maxLookahead,B(t))}),x(a,t=>{this.computeLookaheadFunc(e,t.idx,Vn,`RepetitionMandatoryWithSeparator`,t.maxLookahead,B(t))}),x(o,t=>{this.computeLookaheadFunc(e,t.idx,Bn,`RepetitionWithSeparator`,t.maxLookahead,B(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return getKeyForAutomaticLookahead(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},DslMethodsCollectorVisitor=class extends k{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};const Hn=new DslMethodsCollectorVisitor;function collectMethods(e){Hn.reset(),e.accept(Hn);let t=Hn.dslMethods;return Hn.reset(),t}function setNodeLocationOnlyOffset(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function setNodeLocationFull(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function addTerminalToCst(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function addNoneTerminalToCst(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}function defineNameProp(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function defaultVisit(e,t){let n=u(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function createBaseSemanticVisitorConstructor(e,t){let derivedConstructor=function(){};return defineNameProp(derivedConstructor,e+`BaseSemantics`),derivedConstructor.prototype={visit:function(e,t){if(R(e)&&(e=e[0]),!isUndefined(e))return this[e.name](e.children,t)},validateVisitor:function(){let e=validateVisitor(this,t);if(!isEmpty(e)){let t=o(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join(`
41
41
 
42
42
  `).replace(/\n/g,`
43
43
  `)}`)}}},derivedConstructor.prototype.constructor=derivedConstructor,derivedConstructor._RULE_NAMES=t,derivedConstructor}function createBaseVisitorConstructorWithDefaults(e,t,n){let derivedConstructor=function(){};defineNameProp(derivedConstructor,e+`BaseSemanticsWithDefaults`);let r=Object.create(n.prototype);return x(t,e=>{r[e]=defaultVisit}),derivedConstructor.prototype=r,derivedConstructor.prototype.constructor=derivedConstructor,derivedConstructor}var Un;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(Un||={});function validateVisitor(e,t){return validateMissingCstMethods(e,t)}function validateMissingCstMethods(e,t){return compact(o(filter(t,t=>I(e[t])===!1),t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:Un.MISSING_METHOD,methodName:t})))}var TreeBuilder=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=has(e,`nodeLocationTracking`)?e.nodeLocationTracking:Q.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=noop,this.cstFinallyStateUpdate=noop,this.cstPostTerminal=noop,this.cstPostNonTerminal=noop,this.cstPostRule=noop;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=setNodeLocationFull,this.setNodeLocationFromNode=setNodeLocationFull,this.cstPostRule=noop,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=noop,this.setNodeLocationFromNode=noop,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=setNodeLocationOnlyOffset,this.setNodeLocationFromNode=setNodeLocationOnlyOffset,this.cstPostRule=noop,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=noop,this.setNodeLocationFromNode=noop,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=noop,this.setNodeLocationFromNode=noop,this.cstPostRule=noop,this.setInitialNodeLocation=noop;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];addTerminalToCst(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];addNoneTerminalToCst(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(isUndefined(this.baseCstVisitorConstructor)){let e=createBaseSemanticVisitorConstructor(this.className,u(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(isUndefined(this.baseCstVisitorWithDefaultsConstructor)){let e=createBaseVisitorConstructorWithDefaults(this.className,u(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},LexerAdapter=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Jn}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Jn:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},RecognizerApi=class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Yn){if(A(this.definedRulesNames,e)){let t={message:X.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:$.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Yn){let r=validateRuleIsOverridden(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(isRecognitionException(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return ce(U(this.gastProductionsCache))}},RecognizerEngine=class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=tokenStructuredMatcherNoCategories,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},has(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.