);
diff --git a/src/components/MDX/InlineToc.tsx b/src/components/MDX/InlineToc.tsx
new file mode 100644
index 00000000000..03eb17feced
--- /dev/null
+++ b/src/components/MDX/InlineToc.tsx
@@ -0,0 +1,79 @@
+'use client';
+
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import {useContext, useMemo} from 'react';
+import type {ContextType, HTMLAttributes} from 'react';
+import Link from './Link';
+import {TocContext} from './TocContext';
+
+type NestedTocRoot = {
+ children: NestedTocNode[];
+ item: null;
+};
+
+type NestedTocNode = {
+ children: NestedTocNode[];
+ item: ContextType[number];
+};
+
+function UL(props: HTMLAttributes) {
+ return
diff --git a/src/components/MDX/Sandpack/Preview.tsx b/src/components/MDX/Sandpack/Preview.tsx
index ead9341b6e3..8f3e1dbab0a 100644
--- a/src/components/MDX/Sandpack/Preview.tsx
+++ b/src/components/MDX/Sandpack/Preview.tsx
@@ -9,7 +9,6 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-// eslint-disable-next-line react-compiler/react-compiler
/* eslint-disable react-hooks/exhaustive-deps */
import {useRef, useState, useEffect, useMemo, useId} from 'react';
import {useSandpack, SandpackStack} from '@codesandbox/sandpack-react/unstyled';
diff --git a/src/components/MDX/Sandpack/SandpackRSCRoot.tsx b/src/components/MDX/Sandpack/SandpackRSCRoot.tsx
index 1c9bd058245..03ebeb5487e 100644
--- a/src/components/MDX/Sandpack/SandpackRSCRoot.tsx
+++ b/src/components/MDX/Sandpack/SandpackRSCRoot.tsx
@@ -1,3 +1,5 @@
+'use client';
+
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -9,18 +11,18 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-import {Children} from 'react';
import * as React from 'react';
import {SandpackProvider} from '@codesandbox/sandpack-react/unstyled';
import {SandpackLogLevel} from '@codesandbox/sandpack-client';
import {CustomPreset} from './CustomPreset';
-import {createFileMap} from './createFileMap';
+import type {SandpackSnippetFile} from './createFileMap';
import {CustomTheme} from './Themes';
import {templateRSC} from './templateRSC';
import {RscFileBridge} from './sandpack-rsc/RscFileBridge';
type SandpackProps = {
- children: React.ReactNode;
+ files: Record;
+ providedFiles: string[];
autorun?: boolean;
};
@@ -75,9 +77,7 @@ ul {
`.trim();
function SandpackRSCRoot(props: SandpackProps) {
- const {children, autorun = true} = props;
- const codeSnippets = Children.toArray(children) as React.ReactElement[];
- const files = createFileMap(codeSnippets);
+ const {files, providedFiles, autorun = true} = props;
if ('/index.html' in files) {
throw new Error(
@@ -86,15 +86,18 @@ function SandpackRSCRoot(props: SandpackProps) {
);
}
- files['/src/styles.css'] = {
- code: [sandboxStyle, files['/src/styles.css']?.code ?? ''].join('\n\n'),
- hidden: !files['/src/styles.css']?.visible,
+ const sandpackFiles = {
+ ...files,
+ '/src/styles.css': {
+ code: [sandboxStyle, files['/src/styles.css']?.code ?? ''].join('\n\n'),
+ hidden: !files['/src/styles.css']?.visible,
+ },
};
return (
diff --git a/src/components/MDX/Sandpack/SandpackRoot.tsx b/src/components/MDX/Sandpack/SandpackRoot.tsx
index 48d8daee50e..af34285499b 100644
--- a/src/components/MDX/Sandpack/SandpackRoot.tsx
+++ b/src/components/MDX/Sandpack/SandpackRoot.tsx
@@ -1,3 +1,5 @@
+'use client';
+
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -9,17 +11,17 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-import {Children} from 'react';
import * as React from 'react';
import {SandpackProvider} from '@codesandbox/sandpack-react/unstyled';
import {SandpackLogLevel} from '@codesandbox/sandpack-client';
import {CustomPreset} from './CustomPreset';
-import {createFileMap} from './createFileMap';
+import type {SandpackSnippetFile} from './createFileMap';
import {CustomTheme} from './Themes';
import {template} from './template';
type SandpackProps = {
- children: React.ReactNode;
+ files: Record;
+ providedFiles: string[];
autorun?: boolean;
};
@@ -74,9 +76,7 @@ ul {
`.trim();
function SandpackRoot(props: SandpackProps) {
- let {children, autorun = true} = props;
- const codeSnippets = Children.toArray(children) as React.ReactElement[];
- const files = createFileMap(codeSnippets);
+ const {files, providedFiles, autorun = true} = props;
if ('/index.html' in files) {
throw new Error(
@@ -85,15 +85,18 @@ function SandpackRoot(props: SandpackProps) {
);
}
- files['/src/styles.css'] = {
- code: [sandboxStyle, files['/src/styles.css']?.code ?? ''].join('\n\n'),
- hidden: !files['/src/styles.css']?.visible,
+ const sandpackFiles = {
+ ...files,
+ '/src/styles.css': {
+ code: [sandboxStyle, files['/src/styles.css']?.code ?? ''].join('\n\n'),
+ hidden: !files['/src/styles.css']?.visible,
+ },
};
return (
-
+
);
diff --git a/src/components/MDX/Sandpack/Themes.tsx b/src/components/MDX/Sandpack/Themes.tsx
index 8aa34dc954b..92adc05cc1c 100644
--- a/src/components/MDX/Sandpack/Themes.tsx
+++ b/src/components/MDX/Sandpack/Themes.tsx
@@ -9,7 +9,7 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-import tailwindConfig from '../../../../tailwind.config';
+import {sandpackThemeFonts} from './generatedTheme';
export const CustomTheme = {
colors: {
@@ -38,13 +38,9 @@ export const CustomTheme = {
string: 'inherit',
},
font: {
- body: tailwindConfig.theme.extend.fontFamily.text
- .join(', ')
- .replace(/"/gm, ''),
- mono: tailwindConfig.theme.extend.fontFamily.mono
- .join(', ')
- .replace(/"/gm, ''),
- size: tailwindConfig.theme.extend.fontSize.code,
+ body: sandpackThemeFonts.body,
+ mono: sandpackThemeFonts.mono,
+ size: sandpackThemeFonts.size,
lineHeight: '24px',
},
};
diff --git a/src/components/MDX/Sandpack/createFileMap.ts b/src/components/MDX/Sandpack/createFileMap.ts
index 049face93e6..0aa06242f91 100644
--- a/src/components/MDX/Sandpack/createFileMap.ts
+++ b/src/components/MDX/Sandpack/createFileMap.ts
@@ -10,12 +10,23 @@
*/
import type {SandpackFile} from '@codesandbox/sandpack-react/unstyled';
-import type {PropsWithChildren, ReactElement, HTMLAttributes} from 'react';
+import {Children, isValidElement} from 'react';
+import type {
+ PropsWithChildren,
+ ReactElement,
+ HTMLAttributes,
+ ReactNode,
+} from 'react';
+import {getMDXName} from '../getMDXName';
export const AppJSPath = `/src/App.js`;
export const StylesCSSPath = `/src/styles.css`;
export const SUPPORTED_FILES = [AppJSPath, StylesCSSPath];
+export type SandpackSnippetFile = SandpackFile & {
+ visible?: boolean;
+};
+
/**
* Tokenize meta attributes while ignoring brace-wrapped metadata (e.g. {expectedErrors: …}).
*/
@@ -76,25 +87,105 @@ function splitMeta(meta: string): string[] {
return tokens;
}
+function collectCodeSnippets(children: ReactNode): ReactElement[] {
+ const codeSnippets: ReactElement[] = [];
+
+ Children.forEach(children, (child) => {
+ if (!isValidElement(child)) {
+ return;
+ }
+
+ if (getMDXName(child) === 'pre') {
+ codeSnippets.push(child);
+ return;
+ }
+
+ const props = child.props as {children?: ReactNode} | null;
+ if (props?.children != null) {
+ codeSnippets.push(...collectCodeSnippets(props.children));
+ }
+ });
+
+ return codeSnippets;
+}
+
+type CodeElementProps = HTMLAttributes & {
+ meta?: string;
+ children?: ReactNode;
+};
+
+function findCodeElement(
+ children: ReactNode
+): ReactElement | null {
+ let codeElement: ReactElement | null = null;
+
+ Children.forEach(children, (child) => {
+ if (codeElement || !isValidElement(child)) {
+ return;
+ }
+
+ const props = child.props as CodeElementProps | null;
+ if (
+ getMDXName(child) === 'code' ||
+ typeof props?.meta === 'string' ||
+ (typeof props?.className === 'string' &&
+ props.className.startsWith('language-'))
+ ) {
+ codeElement = child as ReactElement;
+ return;
+ }
+
+ if (props?.children != null) {
+ codeElement = findCodeElement(props.children);
+ }
+ });
+
+ return codeElement;
+}
+
+function getTextContent(node: ReactNode): string {
+ let text = '';
+
+ Children.forEach(node, (child) => {
+ if (typeof child === 'string' || typeof child === 'number') {
+ text += child;
+ return;
+ }
+
+ if (!isValidElement(child)) {
+ return;
+ }
+
+ const props = child.props as {children?: ReactNode} | null;
+ text += getTextContent(props?.children ?? null);
+ });
+
+ return text;
+}
+
export const createFileMap = (codeSnippets: any) => {
- return codeSnippets.reduce(
- (result: Record, codeSnippet: React.ReactElement) => {
- if (
- (codeSnippet.type as any).mdxName !== 'pre' &&
- codeSnippet.type !== 'pre'
- ) {
- return result;
+ return collectCodeSnippets(codeSnippets).reduce(
+ (
+ result: Record,
+ codeSnippet: React.ReactElement
+ ) => {
+ const codeElement = findCodeElement(
+ (
+ codeSnippet.props as PropsWithChildren<{
+ children?: ReactNode;
+ }>
+ ).children
+ );
+
+ if (!codeElement) {
+ throw new Error('Code block is missing a code element.');
}
- const {props} = (
- codeSnippet.props as PropsWithChildren<{
- children: ReactElement<
- HTMLAttributes & {meta?: string}
- >;
- }>
- ).children;
+
+ const props = codeElement.props;
let filePath; // path in the folder structure
let fileHidden = false; // if the file is available as a tab
let fileActive = false; // if the file tab is shown by default
+ let fileVisible = false; // if the file tab should be forced visible
if (props.meta) {
const tokens = splitMeta(props.meta);
@@ -110,6 +201,9 @@ export const createFileMap = (codeSnippets: any) => {
if (tokens.includes('active')) {
fileActive = true;
}
+ if (tokens.includes('visible')) {
+ fileVisible = true;
+ }
} else {
if (props.className === 'language-js') {
filePath = AppJSPath;
@@ -140,9 +234,10 @@ export const createFileMap = (codeSnippets: any) => {
);
}
result[filePath] = {
- code: (props.children || '') as string,
+ code: getTextContent(props.children ?? null),
hidden: fileHidden,
active: fileActive,
+ visible: fileVisible,
};
return result;
diff --git a/src/components/MDX/Sandpack/generatedHooksLint.ts b/src/components/MDX/Sandpack/generatedHooksLint.ts
new file mode 100644
index 00000000000..d1dcd8943a3
--- /dev/null
+++ b/src/components/MDX/Sandpack/generatedHooksLint.ts
@@ -0,0 +1,66836 @@
+/* eslint-disable */
+// @ts-nocheck
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// This file is generated by scripts/buildSandpackHooksLint.mjs.
+
+var Ny = ((e) =>
+ typeof require < 'u'
+ ? require
+ : typeof Proxy < 'u'
+ ? new Proxy(e, {get: (t, n) => (typeof require < 'u' ? require : t)[n]})
+ : e)(function (e) {
+ if (typeof require < 'u') return require.apply(this, arguments);
+ throw Error('Dynamic require of "' + e + '" is not supported');
+});
+var xe = (e, t) => () => (t || e((t = {exports: {}}).exports, t), t.exports);
+var Jh = xe((q5, Vh) => {
+ var Mc = new Proxy(
+ function () {
+ return Mc;
+ },
+ {
+ get(e, t) {
+ if (t === Symbol.toPrimitive) return () => '';
+ if (t === 'toString') return () => '';
+ if (t === 'valueOf') return () => '';
+ if (t !== 'then') return Mc;
+ },
+ apply() {
+ return Mc;
+ },
+ construct() {
+ return Mc;
+ },
+ }
+ );
+ Vh.exports = Mc;
+});
+var Wh = xe((K5, Hh) => {
+ var Nc = new Proxy(
+ function () {
+ return Nc;
+ },
+ {
+ get(e, t) {
+ if (t === Symbol.toPrimitive) return () => '';
+ if (t === 'toString') return () => '';
+ if (t === 'valueOf') return () => '';
+ if (t !== 'then') return Nc;
+ },
+ apply() {
+ return Nc;
+ },
+ construct() {
+ return Nc;
+ },
+ }
+ );
+ Hh.exports = Nc;
+});
+var wa = xe((hn) => {
+ 'use strict';
+ Object.defineProperty(hn, '__esModule', {value: !0});
+ hn.globalConfig =
+ hn.$ZodEncodeError =
+ hn.$ZodAsyncError =
+ hn.$brand =
+ hn.NEVER =
+ void 0;
+ hn.$constructor = Tx;
+ hn.config = Ex;
+ hn.NEVER = Object.freeze({status: 'aborted'});
+ function Tx(e, t, n) {
+ function i(s, l) {
+ if (
+ (s._zod ||
+ Object.defineProperty(s, '_zod', {
+ value: {def: l, constr: o, traits: new Set()},
+ enumerable: !1,
+ }),
+ s._zod.traits.has(e))
+ )
+ return;
+ s._zod.traits.add(e), t(s, l);
+ let d = o.prototype,
+ u = Object.keys(d);
+ for (let p = 0; p < u.length; p++) {
+ let y = u[p];
+ y in s || (s[y] = d[y].bind(s));
+ }
+ }
+ let r = n?.Parent ?? Object;
+ class a extends r {}
+ Object.defineProperty(a, 'name', {value: e});
+ function o(s) {
+ var l;
+ let d = n?.Parent ? new a() : this;
+ i(d, s), (l = d._zod).deferred ?? (l.deferred = []);
+ for (let u of d._zod.deferred) u();
+ return d;
+ }
+ return (
+ Object.defineProperty(o, 'init', {value: i}),
+ Object.defineProperty(o, Symbol.hasInstance, {
+ value: (s) =>
+ n?.Parent && s instanceof n.Parent ? !0 : s?._zod?.traits?.has(e),
+ }),
+ Object.defineProperty(o, 'name', {value: e}),
+ o
+ );
+ }
+ hn.$brand = Symbol('zod_brand');
+ var Ry = class extends Error {
+ constructor() {
+ super(
+ 'Encountered Promise during synchronous parse. Use .parseAsync() instead.'
+ );
+ }
+ };
+ hn.$ZodAsyncError = Ry;
+ var Ly = class extends Error {
+ constructor(t) {
+ super(`Encountered unidirectional transform during encode: ${t}`),
+ (this.name = 'ZodEncodeError');
+ }
+ };
+ hn.$ZodEncodeError = Ly;
+ hn.globalConfig = {};
+ function Ex(e) {
+ return e && Object.assign(hn.globalConfig, e), hn.globalConfig;
+ }
+});
+var ot = xe((Ue) => {
+ 'use strict';
+ Object.defineProperty(Ue, '__esModule', {value: !0});
+ Ue.Class =
+ Ue.BIGINT_FORMAT_RANGES =
+ Ue.NUMBER_FORMAT_RANGES =
+ Ue.primitiveTypes =
+ Ue.propertyKeyTypes =
+ Ue.getParsedType =
+ Ue.allowsEval =
+ Ue.captureStackTrace =
+ void 0;
+ Ue.assertEqual = Ix;
+ Ue.assertNotEqual = Px;
+ Ue.assertIs = xx;
+ Ue.assertNever = wx;
+ Ue.assert = Ox;
+ Ue.getEnumValues = $x;
+ Ue.joinValues = jx;
+ Ue.jsonStringifyReplacer = Cx;
+ Ue.cached = Xh;
+ Ue.nullish = Dx;
+ Ue.cleanRegex = Ax;
+ Ue.floatSafeRemainder = Mx;
+ Ue.defineLazy = Nx;
+ Ue.objectClone = Rx;
+ Ue.assignProp = Ki;
+ Ue.mergeDefs = Ii;
+ Ue.cloneDef = Lx;
+ Ue.getElementAtPath = Fx;
+ Ue.promiseAllObject = zx;
+ Ue.randomString = Bx;
+ Ue.esc = Ux;
+ Ue.slugify = Zx;
+ Ue.isObject = Fy;
+ Ue.isPlainObject = Xu;
+ Ue.shallowClone = qx;
+ Ue.numKeys = Kx;
+ Ue.escapeRegex = Jx;
+ Ue.clone = Vi;
+ Ue.normalizeParams = Hx;
+ Ue.createTransparentProxy = Wx;
+ Ue.stringifyPrimitive = Yh;
+ Ue.optionalKeys = Gx;
+ Ue.pick = Xx;
+ Ue.omit = Yx;
+ Ue.extend = Qx;
+ Ue.safeExtend = ew;
+ Ue.merge = tw;
+ Ue.partial = nw;
+ Ue.required = rw;
+ Ue.aborted = iw;
+ Ue.prefixIssues = aw;
+ Ue.unwrapMessage = Rc;
+ Ue.finalizeIssue = ow;
+ Ue.getSizableOrigin = sw;
+ Ue.getLengthableOrigin = lw;
+ Ue.parsedType = cw;
+ Ue.issue = uw;
+ Ue.cleanEnum = dw;
+ Ue.base64ToUint8Array = Qh;
+ Ue.uint8ArrayToBase64 = eb;
+ Ue.base64urlToUint8Array = fw;
+ Ue.uint8ArrayToBase64url = pw;
+ Ue.hexToUint8Array = mw;
+ Ue.uint8ArrayToHex = yw;
+ function Ix(e) {
+ return e;
+ }
+ function Px(e) {
+ return e;
+ }
+ function xx(e) {}
+ function wx(e) {
+ throw new Error('Unexpected value in exhaustive check');
+ }
+ function Ox(e) {}
+ function $x(e) {
+ let t = Object.values(e).filter((i) => typeof i == 'number');
+ return Object.entries(e)
+ .filter(([i, r]) => t.indexOf(+i) === -1)
+ .map(([i, r]) => r);
+ }
+ function jx(e, t = '|') {
+ return e.map((n) => Yh(n)).join(t);
+ }
+ function Cx(e, t) {
+ return typeof t == 'bigint' ? t.toString() : t;
+ }
+ function Xh(e) {
+ return {
+ get value() {
+ {
+ let n = e();
+ return Object.defineProperty(this, 'value', {value: n}), n;
+ }
+ throw new Error('cached value already set');
+ },
+ };
+ }
+ function Dx(e) {
+ return e == null;
+ }
+ function Ax(e) {
+ let t = e.startsWith('^') ? 1 : 0,
+ n = e.endsWith('$') ? e.length - 1 : e.length;
+ return e.slice(t, n);
+ }
+ function Mx(e, t) {
+ let n = (e.toString().split('.')[1] || '').length,
+ i = t.toString(),
+ r = (i.split('.')[1] || '').length;
+ if (r === 0 && /\d?e-\d?/.test(i)) {
+ let l = i.match(/\d?e-(\d?)/);
+ l?.[1] && (r = Number.parseInt(l[1]));
+ }
+ let a = n > r ? n : r,
+ o = Number.parseInt(e.toFixed(a).replace('.', '')),
+ s = Number.parseInt(t.toFixed(a).replace('.', ''));
+ return (o % s) / 10 ** a;
+ }
+ var Gh = Symbol('evaluating');
+ function Nx(e, t, n) {
+ let i;
+ Object.defineProperty(e, t, {
+ get() {
+ if (i !== Gh) return i === void 0 && ((i = Gh), (i = n())), i;
+ },
+ set(r) {
+ Object.defineProperty(e, t, {value: r});
+ },
+ configurable: !0,
+ });
+ }
+ function Rx(e) {
+ return Object.create(
+ Object.getPrototypeOf(e),
+ Object.getOwnPropertyDescriptors(e)
+ );
+ }
+ function Ki(e, t, n) {
+ Object.defineProperty(e, t, {
+ value: n,
+ writable: !0,
+ enumerable: !0,
+ configurable: !0,
+ });
+ }
+ function Ii(...e) {
+ let t = {};
+ for (let n of e) {
+ let i = Object.getOwnPropertyDescriptors(n);
+ Object.assign(t, i);
+ }
+ return Object.defineProperties({}, t);
+ }
+ function Lx(e) {
+ return Ii(e._zod.def);
+ }
+ function Fx(e, t) {
+ return t ? t.reduce((n, i) => n?.[i], e) : e;
+ }
+ function zx(e) {
+ let t = Object.keys(e),
+ n = t.map((i) => e[i]);
+ return Promise.all(n).then((i) => {
+ let r = {};
+ for (let a = 0; a < t.length; a++) r[t[a]] = i[a];
+ return r;
+ });
+ }
+ function Bx(e = 10) {
+ let t = 'abcdefghijklmnopqrstuvwxyz',
+ n = '';
+ for (let i = 0; i < e; i++) n += t[Math.floor(Math.random() * t.length)];
+ return n;
+ }
+ function Ux(e) {
+ return JSON.stringify(e);
+ }
+ function Zx(e) {
+ return e
+ .toLowerCase()
+ .trim()
+ .replace(/[^\w\s-]/g, '')
+ .replace(/[\s_-]+/g, '-')
+ .replace(/^-+|-+$/g, '');
+ }
+ Ue.captureStackTrace =
+ 'captureStackTrace' in Error ? Error.captureStackTrace : (...e) => {};
+ function Fy(e) {
+ return typeof e == 'object' && e !== null && !Array.isArray(e);
+ }
+ Ue.allowsEval = Xh(() => {
+ if (typeof navigator < 'u' && navigator?.userAgent?.includes('Cloudflare'))
+ return !1;
+ try {
+ let e = Function;
+ return new e(''), !0;
+ } catch {
+ return !1;
+ }
+ });
+ function Xu(e) {
+ if (Fy(e) === !1) return !1;
+ let t = e.constructor;
+ if (t === void 0 || typeof t != 'function') return !0;
+ let n = t.prototype;
+ return !(
+ Fy(n) === !1 ||
+ Object.prototype.hasOwnProperty.call(n, 'isPrototypeOf') === !1
+ );
+ }
+ function qx(e) {
+ return Xu(e) ? {...e} : Array.isArray(e) ? [...e] : e;
+ }
+ function Kx(e) {
+ let t = 0;
+ for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t++;
+ return t;
+ }
+ var Vx = (e) => {
+ let t = typeof e;
+ switch (t) {
+ case 'undefined':
+ return 'undefined';
+ case 'string':
+ return 'string';
+ case 'number':
+ return Number.isNaN(e) ? 'nan' : 'number';
+ case 'boolean':
+ return 'boolean';
+ case 'function':
+ return 'function';
+ case 'bigint':
+ return 'bigint';
+ case 'symbol':
+ return 'symbol';
+ case 'object':
+ return Array.isArray(e)
+ ? 'array'
+ : e === null
+ ? 'null'
+ : e.then &&
+ typeof e.then == 'function' &&
+ e.catch &&
+ typeof e.catch == 'function'
+ ? 'promise'
+ : typeof Map < 'u' && e instanceof Map
+ ? 'map'
+ : typeof Set < 'u' && e instanceof Set
+ ? 'set'
+ : typeof Date < 'u' && e instanceof Date
+ ? 'date'
+ : typeof File < 'u' && e instanceof File
+ ? 'file'
+ : 'object';
+ default:
+ throw new Error(`Unknown data type: ${t}`);
+ }
+ };
+ Ue.getParsedType = Vx;
+ Ue.propertyKeyTypes = new Set(['string', 'number', 'symbol']);
+ Ue.primitiveTypes = new Set([
+ 'string',
+ 'number',
+ 'bigint',
+ 'boolean',
+ 'symbol',
+ 'undefined',
+ ]);
+ function Jx(e) {
+ return e.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ function Vi(e, t, n) {
+ let i = new e._zod.constr(t ?? e._zod.def);
+ return (!t || n?.parent) && (i._zod.parent = e), i;
+ }
+ function Hx(e) {
+ let t = e;
+ if (!t) return {};
+ if (typeof t == 'string') return {error: () => t};
+ if (t?.message !== void 0) {
+ if (t?.error !== void 0)
+ throw new Error('Cannot specify both `message` and `error` params');
+ t.error = t.message;
+ }
+ return (
+ delete t.message,
+ typeof t.error == 'string' ? {...t, error: () => t.error} : t
+ );
+ }
+ function Wx(e) {
+ let t;
+ return new Proxy(
+ {},
+ {
+ get(n, i, r) {
+ return t ?? (t = e()), Reflect.get(t, i, r);
+ },
+ set(n, i, r, a) {
+ return t ?? (t = e()), Reflect.set(t, i, r, a);
+ },
+ has(n, i) {
+ return t ?? (t = e()), Reflect.has(t, i);
+ },
+ deleteProperty(n, i) {
+ return t ?? (t = e()), Reflect.deleteProperty(t, i);
+ },
+ ownKeys(n) {
+ return t ?? (t = e()), Reflect.ownKeys(t);
+ },
+ getOwnPropertyDescriptor(n, i) {
+ return t ?? (t = e()), Reflect.getOwnPropertyDescriptor(t, i);
+ },
+ defineProperty(n, i, r) {
+ return t ?? (t = e()), Reflect.defineProperty(t, i, r);
+ },
+ }
+ );
+ }
+ function Yh(e) {
+ return typeof e == 'bigint'
+ ? e.toString() + 'n'
+ : typeof e == 'string'
+ ? `"${e}"`
+ : `${e}`;
+ }
+ function Gx(e) {
+ return Object.keys(e).filter(
+ (t) => e[t]._zod.optin === 'optional' && e[t]._zod.optout === 'optional'
+ );
+ }
+ Ue.NUMBER_FORMAT_RANGES = {
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
+ int32: [-2147483648, 2147483647],
+ uint32: [0, 4294967295],
+ float32: [-34028234663852886e22, 34028234663852886e22],
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
+ };
+ Ue.BIGINT_FORMAT_RANGES = {
+ int64: [BigInt('-9223372036854775808'), BigInt('9223372036854775807')],
+ uint64: [BigInt(0), BigInt('18446744073709551615')],
+ };
+ function Xx(e, t) {
+ let n = e._zod.def,
+ i = n.checks;
+ if (i && i.length > 0)
+ throw new Error(
+ '.pick() cannot be used on object schemas containing refinements'
+ );
+ let a = Ii(e._zod.def, {
+ get shape() {
+ let o = {};
+ for (let s in t) {
+ if (!(s in n.shape)) throw new Error(`Unrecognized key: "${s}"`);
+ t[s] && (o[s] = n.shape[s]);
+ }
+ return Ki(this, 'shape', o), o;
+ },
+ checks: [],
+ });
+ return Vi(e, a);
+ }
+ function Yx(e, t) {
+ let n = e._zod.def,
+ i = n.checks;
+ if (i && i.length > 0)
+ throw new Error(
+ '.omit() cannot be used on object schemas containing refinements'
+ );
+ let a = Ii(e._zod.def, {
+ get shape() {
+ let o = {...e._zod.def.shape};
+ for (let s in t) {
+ if (!(s in n.shape)) throw new Error(`Unrecognized key: "${s}"`);
+ t[s] && delete o[s];
+ }
+ return Ki(this, 'shape', o), o;
+ },
+ checks: [],
+ });
+ return Vi(e, a);
+ }
+ function Qx(e, t) {
+ if (!Xu(t))
+ throw new Error('Invalid input to extend: expected a plain object');
+ let n = e._zod.def.checks;
+ if (n && n.length > 0) {
+ let a = e._zod.def.shape;
+ for (let o in t)
+ if (Object.getOwnPropertyDescriptor(a, o) !== void 0)
+ throw new Error(
+ 'Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.'
+ );
+ }
+ let r = Ii(e._zod.def, {
+ get shape() {
+ let a = {...e._zod.def.shape, ...t};
+ return Ki(this, 'shape', a), a;
+ },
+ });
+ return Vi(e, r);
+ }
+ function ew(e, t) {
+ if (!Xu(t))
+ throw new Error('Invalid input to safeExtend: expected a plain object');
+ let n = Ii(e._zod.def, {
+ get shape() {
+ let i = {...e._zod.def.shape, ...t};
+ return Ki(this, 'shape', i), i;
+ },
+ });
+ return Vi(e, n);
+ }
+ function tw(e, t) {
+ let n = Ii(e._zod.def, {
+ get shape() {
+ let i = {...e._zod.def.shape, ...t._zod.def.shape};
+ return Ki(this, 'shape', i), i;
+ },
+ get catchall() {
+ return t._zod.def.catchall;
+ },
+ checks: [],
+ });
+ return Vi(e, n);
+ }
+ function nw(e, t, n) {
+ let r = t._zod.def.checks;
+ if (r && r.length > 0)
+ throw new Error(
+ '.partial() cannot be used on object schemas containing refinements'
+ );
+ let o = Ii(t._zod.def, {
+ get shape() {
+ let s = t._zod.def.shape,
+ l = {...s};
+ if (n)
+ for (let d in n) {
+ if (!(d in s)) throw new Error(`Unrecognized key: "${d}"`);
+ n[d] &&
+ (l[d] = e ? new e({type: 'optional', innerType: s[d]}) : s[d]);
+ }
+ else
+ for (let d in s)
+ l[d] = e ? new e({type: 'optional', innerType: s[d]}) : s[d];
+ return Ki(this, 'shape', l), l;
+ },
+ checks: [],
+ });
+ return Vi(t, o);
+ }
+ function rw(e, t, n) {
+ let i = Ii(t._zod.def, {
+ get shape() {
+ let r = t._zod.def.shape,
+ a = {...r};
+ if (n)
+ for (let o in n) {
+ if (!(o in a)) throw new Error(`Unrecognized key: "${o}"`);
+ n[o] && (a[o] = new e({type: 'nonoptional', innerType: r[o]}));
+ }
+ else
+ for (let o in r) a[o] = new e({type: 'nonoptional', innerType: r[o]});
+ return Ki(this, 'shape', a), a;
+ },
+ });
+ return Vi(t, i);
+ }
+ function iw(e, t = 0) {
+ if (e.aborted === !0) return !0;
+ for (let n = t; n < e.issues.length; n++)
+ if (e.issues[n]?.continue !== !0) return !0;
+ return !1;
+ }
+ function aw(e, t) {
+ return t.map((n) => {
+ var i;
+ return (i = n).path ?? (i.path = []), n.path.unshift(e), n;
+ });
+ }
+ function Rc(e) {
+ return typeof e == 'string' ? e : e?.message;
+ }
+ function ow(e, t, n) {
+ let i = {...e, path: e.path ?? []};
+ if (!e.message) {
+ let r =
+ Rc(e.inst?._zod.def?.error?.(e)) ??
+ Rc(t?.error?.(e)) ??
+ Rc(n.customError?.(e)) ??
+ Rc(n.localeError?.(e)) ??
+ 'Invalid input';
+ i.message = r;
+ }
+ return (
+ delete i.inst, delete i.continue, t?.reportInput || delete i.input, i
+ );
+ }
+ function sw(e) {
+ return e instanceof Set
+ ? 'set'
+ : e instanceof Map
+ ? 'map'
+ : e instanceof File
+ ? 'file'
+ : 'unknown';
+ }
+ function lw(e) {
+ return Array.isArray(e)
+ ? 'array'
+ : typeof e == 'string'
+ ? 'string'
+ : 'unknown';
+ }
+ function cw(e) {
+ let t = typeof e;
+ switch (t) {
+ case 'number':
+ return Number.isNaN(e) ? 'nan' : 'number';
+ case 'object': {
+ if (e === null) return 'null';
+ if (Array.isArray(e)) return 'array';
+ let n = e;
+ if (
+ n &&
+ Object.getPrototypeOf(n) !== Object.prototype &&
+ 'constructor' in n &&
+ n.constructor
+ )
+ return n.constructor.name;
+ }
+ }
+ return t;
+ }
+ function uw(...e) {
+ let [t, n, i] = e;
+ return typeof t == 'string'
+ ? {message: t, code: 'custom', input: n, inst: i}
+ : {...t};
+ }
+ function dw(e) {
+ return Object.entries(e)
+ .filter(([t, n]) => Number.isNaN(Number.parseInt(t, 10)))
+ .map((t) => t[1]);
+ }
+ function Qh(e) {
+ let t = atob(e),
+ n = new Uint8Array(t.length);
+ for (let i = 0; i < t.length; i++) n[i] = t.charCodeAt(i);
+ return n;
+ }
+ function eb(e) {
+ let t = '';
+ for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
+ return btoa(t);
+ }
+ function fw(e) {
+ let t = e.replace(/-/g, '+').replace(/_/g, '/'),
+ n = '='.repeat((4 - (t.length % 4)) % 4);
+ return Qh(t + n);
+ }
+ function pw(e) {
+ return eb(e).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
+ }
+ function mw(e) {
+ let t = e.replace(/^0x/, '');
+ if (t.length % 2 !== 0) throw new Error('Invalid hex string length');
+ let n = new Uint8Array(t.length / 2);
+ for (let i = 0; i < t.length; i += 2)
+ n[i / 2] = Number.parseInt(t.slice(i, i + 2), 16);
+ return n;
+ }
+ function yw(e) {
+ return Array.from(e)
+ .map((t) => t.toString(16).padStart(2, '0'))
+ .join('');
+ }
+ var zy = class {
+ constructor(...t) {}
+ };
+ Ue.Class = zy;
+});
+var By = xe((yn) => {
+ 'use strict';
+ var gw =
+ (yn && yn.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ vw =
+ (yn && yn.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ hw =
+ (yn && yn.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ gw(t, e, n);
+ return vw(t, e), t;
+ };
+ Object.defineProperty(yn, '__esModule', {value: !0});
+ yn.$ZodRealError = yn.$ZodError = void 0;
+ yn.flattenError = kw;
+ yn.formatError = Sw;
+ yn.treeifyError = _w;
+ yn.toDotPath = rb;
+ yn.prettifyError = Tw;
+ var tb = wa(),
+ bw = hw(ot()),
+ nb = (e, t) => {
+ (e.name = '$ZodError'),
+ Object.defineProperty(e, '_zod', {value: e._zod, enumerable: !1}),
+ Object.defineProperty(e, 'issues', {value: t, enumerable: !1}),
+ (e.message = JSON.stringify(t, bw.jsonStringifyReplacer, 2)),
+ Object.defineProperty(e, 'toString', {
+ value: () => e.message,
+ enumerable: !1,
+ });
+ };
+ yn.$ZodError = (0, tb.$constructor)('$ZodError', nb);
+ yn.$ZodRealError = (0, tb.$constructor)('$ZodError', nb, {Parent: Error});
+ function kw(e, t = (n) => n.message) {
+ let n = {},
+ i = [];
+ for (let r of e.issues)
+ r.path.length > 0
+ ? ((n[r.path[0]] = n[r.path[0]] || []), n[r.path[0]].push(t(r)))
+ : i.push(t(r));
+ return {formErrors: i, fieldErrors: n};
+ }
+ function Sw(e, t = (n) => n.message) {
+ let n = {_errors: []},
+ i = (r) => {
+ for (let a of r.issues)
+ if (a.code === 'invalid_union' && a.errors.length)
+ a.errors.map((o) => i({issues: o}));
+ else if (a.code === 'invalid_key') i({issues: a.issues});
+ else if (a.code === 'invalid_element') i({issues: a.issues});
+ else if (a.path.length === 0) n._errors.push(t(a));
+ else {
+ let o = n,
+ s = 0;
+ for (; s < a.path.length; ) {
+ let l = a.path[s];
+ s === a.path.length - 1
+ ? ((o[l] = o[l] || {_errors: []}), o[l]._errors.push(t(a)))
+ : (o[l] = o[l] || {_errors: []}),
+ (o = o[l]),
+ s++;
+ }
+ }
+ };
+ return i(e), n;
+ }
+ function _w(e, t = (n) => n.message) {
+ let n = {errors: []},
+ i = (r, a = []) => {
+ var o, s;
+ for (let l of r.issues)
+ if (l.code === 'invalid_union' && l.errors.length)
+ l.errors.map((d) => i({issues: d}, l.path));
+ else if (l.code === 'invalid_key') i({issues: l.issues}, l.path);
+ else if (l.code === 'invalid_element') i({issues: l.issues}, l.path);
+ else {
+ let d = [...a, ...l.path];
+ if (d.length === 0) {
+ n.errors.push(t(l));
+ continue;
+ }
+ let u = n,
+ p = 0;
+ for (; p < d.length; ) {
+ let y = d[p],
+ m = p === d.length - 1;
+ typeof y == 'string'
+ ? (u.properties ?? (u.properties = {}),
+ (o = u.properties)[y] ?? (o[y] = {errors: []}),
+ (u = u.properties[y]))
+ : (u.items ?? (u.items = []),
+ (s = u.items)[y] ?? (s[y] = {errors: []}),
+ (u = u.items[y])),
+ m && u.errors.push(t(l)),
+ p++;
+ }
+ }
+ };
+ return i(e), n;
+ }
+ function rb(e) {
+ let t = [],
+ n = e.map((i) => (typeof i == 'object' ? i.key : i));
+ for (let i of n)
+ typeof i == 'number'
+ ? t.push(`[${i}]`)
+ : typeof i == 'symbol'
+ ? t.push(`[${JSON.stringify(String(i))}]`)
+ : /[^\w$]/.test(i)
+ ? t.push(`[${JSON.stringify(i)}]`)
+ : (t.length && t.push('.'), t.push(i));
+ return t.join('');
+ }
+ function Tw(e) {
+ let t = [],
+ n = [...e.issues].sort(
+ (i, r) => (i.path ?? []).length - (r.path ?? []).length
+ );
+ for (let i of n)
+ t.push(`\u2716 ${i.message}`),
+ i.path?.length && t.push(` \u2192 at ${rb(i.path)}`);
+ return t.join(`
+`);
+ }
+});
+var Zy = xe((Re) => {
+ 'use strict';
+ var Ew =
+ (Re && Re.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Iw =
+ (Re && Re.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Uy =
+ (Re && Re.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Ew(t, e, n);
+ return Iw(t, e), t;
+ };
+ Object.defineProperty(Re, '__esModule', {value: !0});
+ Re.safeDecodeAsync =
+ Re._safeDecodeAsync =
+ Re.safeEncodeAsync =
+ Re._safeEncodeAsync =
+ Re.safeDecode =
+ Re._safeDecode =
+ Re.safeEncode =
+ Re._safeEncode =
+ Re.decodeAsync =
+ Re._decodeAsync =
+ Re.encodeAsync =
+ Re._encodeAsync =
+ Re.decode =
+ Re._decode =
+ Re.encode =
+ Re._encode =
+ Re.safeParseAsync =
+ Re._safeParseAsync =
+ Re.safeParse =
+ Re._safeParse =
+ Re.parseAsync =
+ Re._parseAsync =
+ Re.parse =
+ Re._parse =
+ void 0;
+ var Oa = Uy(wa()),
+ Un = Uy(By()),
+ $a = Uy(ot()),
+ Pw = (e) => (t, n, i, r) => {
+ let a = i ? Object.assign(i, {async: !1}) : {async: !1},
+ o = t._zod.run({value: n, issues: []}, a);
+ if (o instanceof Promise) throw new Oa.$ZodAsyncError();
+ if (o.issues.length) {
+ let s = new (r?.Err ?? e)(
+ o.issues.map((l) => $a.finalizeIssue(l, a, Oa.config()))
+ );
+ throw ($a.captureStackTrace(s, r?.callee), s);
+ }
+ return o.value;
+ };
+ Re._parse = Pw;
+ Re.parse = (0, Re._parse)(Un.$ZodRealError);
+ var xw = (e) => async (t, n, i, r) => {
+ let a = i ? Object.assign(i, {async: !0}) : {async: !0},
+ o = t._zod.run({value: n, issues: []}, a);
+ if ((o instanceof Promise && (o = await o), o.issues.length)) {
+ let s = new (r?.Err ?? e)(
+ o.issues.map((l) => $a.finalizeIssue(l, a, Oa.config()))
+ );
+ throw ($a.captureStackTrace(s, r?.callee), s);
+ }
+ return o.value;
+ };
+ Re._parseAsync = xw;
+ Re.parseAsync = (0, Re._parseAsync)(Un.$ZodRealError);
+ var ww = (e) => (t, n, i) => {
+ let r = i ? {...i, async: !1} : {async: !1},
+ a = t._zod.run({value: n, issues: []}, r);
+ if (a instanceof Promise) throw new Oa.$ZodAsyncError();
+ return a.issues.length
+ ? {
+ success: !1,
+ error: new (e ?? Un.$ZodError)(
+ a.issues.map((o) => $a.finalizeIssue(o, r, Oa.config()))
+ ),
+ }
+ : {success: !0, data: a.value};
+ };
+ Re._safeParse = ww;
+ Re.safeParse = (0, Re._safeParse)(Un.$ZodRealError);
+ var Ow = (e) => async (t, n, i) => {
+ let r = i ? Object.assign(i, {async: !0}) : {async: !0},
+ a = t._zod.run({value: n, issues: []}, r);
+ return (
+ a instanceof Promise && (a = await a),
+ a.issues.length
+ ? {
+ success: !1,
+ error: new e(
+ a.issues.map((o) => $a.finalizeIssue(o, r, Oa.config()))
+ ),
+ }
+ : {success: !0, data: a.value}
+ );
+ };
+ Re._safeParseAsync = Ow;
+ Re.safeParseAsync = (0, Re._safeParseAsync)(Un.$ZodRealError);
+ var $w = (e) => (t, n, i) => {
+ let r = i
+ ? Object.assign(i, {direction: 'backward'})
+ : {direction: 'backward'};
+ return (0, Re._parse)(e)(t, n, r);
+ };
+ Re._encode = $w;
+ Re.encode = (0, Re._encode)(Un.$ZodRealError);
+ var jw = (e) => (t, n, i) => (0, Re._parse)(e)(t, n, i);
+ Re._decode = jw;
+ Re.decode = (0, Re._decode)(Un.$ZodRealError);
+ var Cw = (e) => async (t, n, i) => {
+ let r = i
+ ? Object.assign(i, {direction: 'backward'})
+ : {direction: 'backward'};
+ return (0, Re._parseAsync)(e)(t, n, r);
+ };
+ Re._encodeAsync = Cw;
+ Re.encodeAsync = (0, Re._encodeAsync)(Un.$ZodRealError);
+ var Dw = (e) => async (t, n, i) => (0, Re._parseAsync)(e)(t, n, i);
+ Re._decodeAsync = Dw;
+ Re.decodeAsync = (0, Re._decodeAsync)(Un.$ZodRealError);
+ var Aw = (e) => (t, n, i) => {
+ let r = i
+ ? Object.assign(i, {direction: 'backward'})
+ : {direction: 'backward'};
+ return (0, Re._safeParse)(e)(t, n, r);
+ };
+ Re._safeEncode = Aw;
+ Re.safeEncode = (0, Re._safeEncode)(Un.$ZodRealError);
+ var Mw = (e) => (t, n, i) => (0, Re._safeParse)(e)(t, n, i);
+ Re._safeDecode = Mw;
+ Re.safeDecode = (0, Re._safeDecode)(Un.$ZodRealError);
+ var Nw = (e) => async (t, n, i) => {
+ let r = i
+ ? Object.assign(i, {direction: 'backward'})
+ : {direction: 'backward'};
+ return (0, Re._safeParseAsync)(e)(t, n, r);
+ };
+ Re._safeEncodeAsync = Nw;
+ Re.safeEncodeAsync = (0, Re._safeEncodeAsync)(Un.$ZodRealError);
+ var Rw = (e) => async (t, n, i) => (0, Re._safeParseAsync)(e)(t, n, i);
+ Re._safeDecodeAsync = Rw;
+ Re.safeDecodeAsync = (0, Re._safeDecodeAsync)(Un.$ZodRealError);
+});
+var Yu = xe((re) => {
+ 'use strict';
+ var Lw =
+ (re && re.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Fw =
+ (re && re.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ zw =
+ (re && re.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Lw(t, e, n);
+ return Fw(t, e), t;
+ };
+ Object.defineProperty(re, '__esModule', {value: !0});
+ re.sha384_hex =
+ re.sha256_base64url =
+ re.sha256_base64 =
+ re.sha256_hex =
+ re.sha1_base64url =
+ re.sha1_base64 =
+ re.sha1_hex =
+ re.md5_base64url =
+ re.md5_base64 =
+ re.md5_hex =
+ re.hex =
+ re.uppercase =
+ re.lowercase =
+ re.undefined =
+ re.null =
+ re.boolean =
+ re.number =
+ re.integer =
+ re.bigint =
+ re.string =
+ re.date =
+ re.e164 =
+ re.domain =
+ re.hostname =
+ re.base64url =
+ re.base64 =
+ re.cidrv6 =
+ re.cidrv4 =
+ re.mac =
+ re.ipv6 =
+ re.ipv4 =
+ re.browserEmail =
+ re.idnEmail =
+ re.unicodeEmail =
+ re.rfc5322Email =
+ re.html5Email =
+ re.email =
+ re.uuid7 =
+ re.uuid6 =
+ re.uuid4 =
+ re.uuid =
+ re.guid =
+ re.extendedDuration =
+ re.duration =
+ re.nanoid =
+ re.ksuid =
+ re.xid =
+ re.ulid =
+ re.cuid2 =
+ re.cuid =
+ void 0;
+ re.sha512_base64url =
+ re.sha512_base64 =
+ re.sha512_hex =
+ re.sha384_base64url =
+ re.sha384_base64 =
+ void 0;
+ re.emoji = qw;
+ re.time = Vw;
+ re.datetime = Jw;
+ var Bw = zw(ot());
+ re.cuid = /^[cC][^\s-]{8,}$/;
+ re.cuid2 = /^[0-9a-z]+$/;
+ re.ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
+ re.xid = /^[0-9a-vA-V]{20}$/;
+ re.ksuid = /^[A-Za-z0-9]{27}$/;
+ re.nanoid = /^[a-zA-Z0-9_-]{21}$/;
+ re.duration =
+ /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
+ re.extendedDuration =
+ /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
+ re.guid =
+ /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
+ var Uw = (e) =>
+ e
+ ? new RegExp(
+ `^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`
+ )
+ : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
+ re.uuid = Uw;
+ re.uuid4 = (0, re.uuid)(4);
+ re.uuid6 = (0, re.uuid)(6);
+ re.uuid7 = (0, re.uuid)(7);
+ re.email =
+ /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
+ re.html5Email =
+ /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
+ re.rfc5322Email =
+ /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+ re.unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
+ re.idnEmail = re.unicodeEmail;
+ re.browserEmail =
+ /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
+ var Zw = '^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$';
+ function qw() {
+ return new RegExp(Zw, 'u');
+ }
+ re.ipv4 =
+ /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
+ re.ipv6 =
+ /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
+ var Kw = (e) => {
+ let t = Bw.escapeRegex(e ?? ':');
+ return new RegExp(
+ `^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`
+ );
+ };
+ re.mac = Kw;
+ re.cidrv4 =
+ /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
+ re.cidrv6 =
+ /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
+ re.base64 =
+ /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
+ re.base64url = /^[A-Za-z0-9_-]*$/;
+ re.hostname =
+ /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
+ re.domain =
+ /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
+ re.e164 = /^\+[1-9]\d{6,14}$/;
+ var ib =
+ '(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))';
+ re.date = new RegExp(`^${ib}$`);
+ function ab(e) {
+ let t = '(?:[01]\\d|2[0-3]):[0-5]\\d';
+ return typeof e.precision == 'number'
+ ? e.precision === -1
+ ? `${t}`
+ : e.precision === 0
+ ? `${t}:[0-5]\\d`
+ : `${t}:[0-5]\\d\\.\\d{${e.precision}}`
+ : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
+ }
+ function Vw(e) {
+ return new RegExp(`^${ab(e)}$`);
+ }
+ function Jw(e) {
+ let t = ab({precision: e.precision}),
+ n = ['Z'];
+ e.local && n.push(''),
+ e.offset && n.push('([+-](?:[01]\\d|2[0-3]):[0-5]\\d)');
+ let i = `${t}(?:${n.join('|')})`;
+ return new RegExp(`^${ib}T(?:${i})$`);
+ }
+ var Hw = (e) => {
+ let t = e
+ ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ''}}`
+ : '[\\s\\S]*';
+ return new RegExp(`^${t}$`);
+ };
+ re.string = Hw;
+ re.bigint = /^-?\d+n?$/;
+ re.integer = /^-?\d+$/;
+ re.number = /^-?\d+(?:\.\d+)?$/;
+ re.boolean = /^(?:true|false)$/i;
+ var Ww = /^null$/i;
+ re.null = Ww;
+ var Gw = /^undefined$/i;
+ re.undefined = Gw;
+ re.lowercase = /^[^A-Z]*$/;
+ re.uppercase = /^[^a-z]*$/;
+ re.hex = /^[0-9a-fA-F]*$/;
+ function Lc(e, t) {
+ return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`);
+ }
+ function Fc(e) {
+ return new RegExp(`^[A-Za-z0-9_-]{${e}}$`);
+ }
+ re.md5_hex = /^[0-9a-fA-F]{32}$/;
+ re.md5_base64 = Lc(22, '==');
+ re.md5_base64url = Fc(22);
+ re.sha1_hex = /^[0-9a-fA-F]{40}$/;
+ re.sha1_base64 = Lc(27, '=');
+ re.sha1_base64url = Fc(27);
+ re.sha256_hex = /^[0-9a-fA-F]{64}$/;
+ re.sha256_base64 = Lc(43, '=');
+ re.sha256_base64url = Fc(43);
+ re.sha384_hex = /^[0-9a-fA-F]{96}$/;
+ re.sha384_base64 = Lc(64, '');
+ re.sha384_base64url = Fc(64);
+ re.sha512_hex = /^[0-9a-fA-F]{128}$/;
+ re.sha512_base64 = Lc(86, '==');
+ re.sha512_base64url = Fc(86);
+});
+var Qu = xe((Be) => {
+ 'use strict';
+ var Xw =
+ (Be && Be.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Yw =
+ (Be && Be.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ qy =
+ (Be && Be.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Xw(t, e, n);
+ return Yw(t, e), t;
+ };
+ Object.defineProperty(Be, '__esModule', {value: !0});
+ Be.$ZodCheckOverwrite =
+ Be.$ZodCheckMimeType =
+ Be.$ZodCheckProperty =
+ Be.$ZodCheckEndsWith =
+ Be.$ZodCheckStartsWith =
+ Be.$ZodCheckIncludes =
+ Be.$ZodCheckUpperCase =
+ Be.$ZodCheckLowerCase =
+ Be.$ZodCheckRegex =
+ Be.$ZodCheckStringFormat =
+ Be.$ZodCheckLengthEquals =
+ Be.$ZodCheckMinLength =
+ Be.$ZodCheckMaxLength =
+ Be.$ZodCheckSizeEquals =
+ Be.$ZodCheckMinSize =
+ Be.$ZodCheckMaxSize =
+ Be.$ZodCheckBigIntFormat =
+ Be.$ZodCheckNumberFormat =
+ Be.$ZodCheckMultipleOf =
+ Be.$ZodCheckGreaterThan =
+ Be.$ZodCheckLessThan =
+ Be.$ZodCheck =
+ void 0;
+ var tn = qy(wa()),
+ Ky = qy(Yu()),
+ dn = qy(ot());
+ Be.$ZodCheck = tn.$constructor('$ZodCheck', (e, t) => {
+ var n;
+ e._zod ?? (e._zod = {}),
+ (e._zod.def = t),
+ (n = e._zod).onattach ?? (n.onattach = []);
+ });
+ var sb = {number: 'number', bigint: 'bigint', object: 'date'};
+ Be.$ZodCheckLessThan = tn.$constructor('$ZodCheckLessThan', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = sb[typeof t.value];
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag,
+ a =
+ (t.inclusive ? r.maximum : r.exclusiveMaximum) ??
+ Number.POSITIVE_INFINITY;
+ t.value < a &&
+ (t.inclusive ? (r.maximum = t.value) : (r.exclusiveMaximum = t.value));
+ }),
+ (e._zod.check = (i) => {
+ (t.inclusive ? i.value <= t.value : i.value < t.value) ||
+ i.issues.push({
+ origin: n,
+ code: 'too_big',
+ maximum: typeof t.value == 'object' ? t.value.getTime() : t.value,
+ input: i.value,
+ inclusive: t.inclusive,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckGreaterThan = tn.$constructor('$ZodCheckGreaterThan', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = sb[typeof t.value];
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag,
+ a =
+ (t.inclusive ? r.minimum : r.exclusiveMinimum) ??
+ Number.NEGATIVE_INFINITY;
+ t.value > a &&
+ (t.inclusive ? (r.minimum = t.value) : (r.exclusiveMinimum = t.value));
+ }),
+ (e._zod.check = (i) => {
+ (t.inclusive ? i.value >= t.value : i.value > t.value) ||
+ i.issues.push({
+ origin: n,
+ code: 'too_small',
+ minimum: typeof t.value == 'object' ? t.value.getTime() : t.value,
+ input: i.value,
+ inclusive: t.inclusive,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckMultipleOf = tn.$constructor('$ZodCheckMultipleOf', (e, t) => {
+ Be.$ZodCheck.init(e, t),
+ e._zod.onattach.push((n) => {
+ var i;
+ (i = n._zod.bag).multipleOf ?? (i.multipleOf = t.value);
+ }),
+ (e._zod.check = (n) => {
+ if (typeof n.value != typeof t.value)
+ throw new Error('Cannot mix number and bigint in multiple_of check.');
+ (typeof n.value == 'bigint'
+ ? n.value % t.value === BigInt(0)
+ : dn.floatSafeRemainder(n.value, t.value) === 0) ||
+ n.issues.push({
+ origin: typeof n.value,
+ code: 'not_multiple_of',
+ divisor: t.value,
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckNumberFormat = tn.$constructor(
+ '$ZodCheckNumberFormat',
+ (e, t) => {
+ Be.$ZodCheck.init(e, t), (t.format = t.format || 'float64');
+ let n = t.format?.includes('int'),
+ i = n ? 'int' : 'number',
+ [r, a] = dn.NUMBER_FORMAT_RANGES[t.format];
+ e._zod.onattach.push((o) => {
+ let s = o._zod.bag;
+ (s.format = t.format),
+ (s.minimum = r),
+ (s.maximum = a),
+ n && (s.pattern = Ky.integer);
+ }),
+ (e._zod.check = (o) => {
+ let s = o.value;
+ if (n) {
+ if (!Number.isInteger(s)) {
+ o.issues.push({
+ expected: i,
+ format: t.format,
+ code: 'invalid_type',
+ continue: !1,
+ input: s,
+ inst: e,
+ });
+ return;
+ }
+ if (!Number.isSafeInteger(s)) {
+ s > 0
+ ? o.issues.push({
+ input: s,
+ code: 'too_big',
+ maximum: Number.MAX_SAFE_INTEGER,
+ note: 'Integers must be within the safe integer range.',
+ inst: e,
+ origin: i,
+ inclusive: !0,
+ continue: !t.abort,
+ })
+ : o.issues.push({
+ input: s,
+ code: 'too_small',
+ minimum: Number.MIN_SAFE_INTEGER,
+ note: 'Integers must be within the safe integer range.',
+ inst: e,
+ origin: i,
+ inclusive: !0,
+ continue: !t.abort,
+ });
+ return;
+ }
+ }
+ s < r &&
+ o.issues.push({
+ origin: 'number',
+ input: s,
+ code: 'too_small',
+ minimum: r,
+ inclusive: !0,
+ inst: e,
+ continue: !t.abort,
+ }),
+ s > a &&
+ o.issues.push({
+ origin: 'number',
+ input: s,
+ code: 'too_big',
+ maximum: a,
+ inclusive: !0,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ }
+ );
+ Be.$ZodCheckBigIntFormat = tn.$constructor(
+ '$ZodCheckBigIntFormat',
+ (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let [n, i] = dn.BIGINT_FORMAT_RANGES[t.format];
+ e._zod.onattach.push((r) => {
+ let a = r._zod.bag;
+ (a.format = t.format), (a.minimum = n), (a.maximum = i);
+ }),
+ (e._zod.check = (r) => {
+ let a = r.value;
+ a < n &&
+ r.issues.push({
+ origin: 'bigint',
+ input: a,
+ code: 'too_small',
+ minimum: n,
+ inclusive: !0,
+ inst: e,
+ continue: !t.abort,
+ }),
+ a > i &&
+ r.issues.push({
+ origin: 'bigint',
+ input: a,
+ code: 'too_big',
+ maximum: i,
+ inclusive: !0,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ }
+ );
+ Be.$ZodCheckMaxSize = tn.$constructor('$ZodCheckMaxSize', (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.size !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
+ t.maximum < r && (i._zod.bag.maximum = t.maximum);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value;
+ r.size <= t.maximum ||
+ i.issues.push({
+ origin: dn.getSizableOrigin(r),
+ code: 'too_big',
+ maximum: t.maximum,
+ inclusive: !0,
+ input: r,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckMinSize = tn.$constructor('$ZodCheckMinSize', (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.size !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
+ t.minimum > r && (i._zod.bag.minimum = t.minimum);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value;
+ r.size >= t.minimum ||
+ i.issues.push({
+ origin: dn.getSizableOrigin(r),
+ code: 'too_small',
+ minimum: t.minimum,
+ inclusive: !0,
+ input: r,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckSizeEquals = tn.$constructor('$ZodCheckSizeEquals', (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.size !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag;
+ (r.minimum = t.size), (r.maximum = t.size), (r.size = t.size);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value,
+ a = r.size;
+ if (a === t.size) return;
+ let o = a > t.size;
+ i.issues.push({
+ origin: dn.getSizableOrigin(r),
+ ...(o
+ ? {code: 'too_big', maximum: t.size}
+ : {code: 'too_small', minimum: t.size}),
+ inclusive: !0,
+ exact: !0,
+ input: i.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckMaxLength = tn.$constructor('$ZodCheckMaxLength', (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.length !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
+ t.maximum < r && (i._zod.bag.maximum = t.maximum);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value;
+ if (r.length <= t.maximum) return;
+ let o = dn.getLengthableOrigin(r);
+ i.issues.push({
+ origin: o,
+ code: 'too_big',
+ maximum: t.maximum,
+ inclusive: !0,
+ input: r,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckMinLength = tn.$constructor('$ZodCheckMinLength', (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.length !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
+ t.minimum > r && (i._zod.bag.minimum = t.minimum);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value;
+ if (r.length >= t.minimum) return;
+ let o = dn.getLengthableOrigin(r);
+ i.issues.push({
+ origin: o,
+ code: 'too_small',
+ minimum: t.minimum,
+ inclusive: !0,
+ input: r,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckLengthEquals = tn.$constructor(
+ '$ZodCheckLengthEquals',
+ (e, t) => {
+ var n;
+ Be.$ZodCheck.init(e, t),
+ (n = e._zod.def).when ??
+ (n.when = (i) => {
+ let r = i.value;
+ return !dn.nullish(r) && r.length !== void 0;
+ }),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag;
+ (r.minimum = t.length), (r.maximum = t.length), (r.length = t.length);
+ }),
+ (e._zod.check = (i) => {
+ let r = i.value,
+ a = r.length;
+ if (a === t.length) return;
+ let o = dn.getLengthableOrigin(r),
+ s = a > t.length;
+ i.issues.push({
+ origin: o,
+ ...(s
+ ? {code: 'too_big', maximum: t.length}
+ : {code: 'too_small', minimum: t.length}),
+ inclusive: !0,
+ exact: !0,
+ input: i.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ }
+ );
+ Be.$ZodCheckStringFormat = tn.$constructor(
+ '$ZodCheckStringFormat',
+ (e, t) => {
+ var n, i;
+ Be.$ZodCheck.init(e, t),
+ e._zod.onattach.push((r) => {
+ let a = r._zod.bag;
+ (a.format = t.format),
+ t.pattern &&
+ (a.patterns ?? (a.patterns = new Set()),
+ a.patterns.add(t.pattern));
+ }),
+ t.pattern
+ ? (n = e._zod).check ??
+ (n.check = (r) => {
+ (t.pattern.lastIndex = 0),
+ !t.pattern.test(r.value) &&
+ r.issues.push({
+ origin: 'string',
+ code: 'invalid_format',
+ format: t.format,
+ input: r.value,
+ ...(t.pattern ? {pattern: t.pattern.toString()} : {}),
+ inst: e,
+ continue: !t.abort,
+ });
+ })
+ : (i = e._zod).check ?? (i.check = () => {});
+ }
+ );
+ Be.$ZodCheckRegex = tn.$constructor('$ZodCheckRegex', (e, t) => {
+ Be.$ZodCheckStringFormat.init(e, t),
+ (e._zod.check = (n) => {
+ (t.pattern.lastIndex = 0),
+ !t.pattern.test(n.value) &&
+ n.issues.push({
+ origin: 'string',
+ code: 'invalid_format',
+ format: 'regex',
+ input: n.value,
+ pattern: t.pattern.toString(),
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckLowerCase = tn.$constructor('$ZodCheckLowerCase', (e, t) => {
+ t.pattern ?? (t.pattern = Ky.lowercase),
+ Be.$ZodCheckStringFormat.init(e, t);
+ });
+ Be.$ZodCheckUpperCase = tn.$constructor('$ZodCheckUpperCase', (e, t) => {
+ t.pattern ?? (t.pattern = Ky.uppercase),
+ Be.$ZodCheckStringFormat.init(e, t);
+ });
+ Be.$ZodCheckIncludes = tn.$constructor('$ZodCheckIncludes', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = dn.escapeRegex(t.includes),
+ i = new RegExp(
+ typeof t.position == 'number' ? `^.{${t.position}}${n}` : n
+ );
+ (t.pattern = i),
+ e._zod.onattach.push((r) => {
+ let a = r._zod.bag;
+ a.patterns ?? (a.patterns = new Set()), a.patterns.add(i);
+ }),
+ (e._zod.check = (r) => {
+ r.value.includes(t.includes, t.position) ||
+ r.issues.push({
+ origin: 'string',
+ code: 'invalid_format',
+ format: 'includes',
+ includes: t.includes,
+ input: r.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckStartsWith = tn.$constructor('$ZodCheckStartsWith', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = new RegExp(`^${dn.escapeRegex(t.prefix)}.*`);
+ t.pattern ?? (t.pattern = n),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag;
+ r.patterns ?? (r.patterns = new Set()), r.patterns.add(n);
+ }),
+ (e._zod.check = (i) => {
+ i.value.startsWith(t.prefix) ||
+ i.issues.push({
+ origin: 'string',
+ code: 'invalid_format',
+ format: 'starts_with',
+ prefix: t.prefix,
+ input: i.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckEndsWith = tn.$constructor('$ZodCheckEndsWith', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = new RegExp(`.*${dn.escapeRegex(t.suffix)}$`);
+ t.pattern ?? (t.pattern = n),
+ e._zod.onattach.push((i) => {
+ let r = i._zod.bag;
+ r.patterns ?? (r.patterns = new Set()), r.patterns.add(n);
+ }),
+ (e._zod.check = (i) => {
+ i.value.endsWith(t.suffix) ||
+ i.issues.push({
+ origin: 'string',
+ code: 'invalid_format',
+ format: 'ends_with',
+ suffix: t.suffix,
+ input: i.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ function ob(e, t, n) {
+ e.issues.length && t.issues.push(...dn.prefixIssues(n, e.issues));
+ }
+ Be.$ZodCheckProperty = tn.$constructor('$ZodCheckProperty', (e, t) => {
+ Be.$ZodCheck.init(e, t),
+ (e._zod.check = (n) => {
+ let i = t.schema._zod.run({value: n.value[t.property], issues: []}, {});
+ if (i instanceof Promise) return i.then((r) => ob(r, n, t.property));
+ ob(i, n, t.property);
+ });
+ });
+ Be.$ZodCheckMimeType = tn.$constructor('$ZodCheckMimeType', (e, t) => {
+ Be.$ZodCheck.init(e, t);
+ let n = new Set(t.mime);
+ e._zod.onattach.push((i) => {
+ i._zod.bag.mime = t.mime;
+ }),
+ (e._zod.check = (i) => {
+ n.has(i.value.type) ||
+ i.issues.push({
+ code: 'invalid_value',
+ values: t.mime,
+ input: i.value.type,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Be.$ZodCheckOverwrite = tn.$constructor('$ZodCheckOverwrite', (e, t) => {
+ Be.$ZodCheck.init(e, t),
+ (e._zod.check = (n) => {
+ n.value = t.tx(n.value);
+ });
+ });
+});
+var Jy = xe((ed) => {
+ 'use strict';
+ Object.defineProperty(ed, '__esModule', {value: !0});
+ ed.Doc = void 0;
+ var Vy = class {
+ constructor(t = []) {
+ (this.content = []), (this.indent = 0), this && (this.args = t);
+ }
+ indented(t) {
+ (this.indent += 1), t(this), (this.indent -= 1);
+ }
+ write(t) {
+ if (typeof t == 'function') {
+ t(this, {execution: 'sync'}), t(this, {execution: 'async'});
+ return;
+ }
+ let i = t
+ .split(
+ `
+`
+ )
+ .filter((o) => o),
+ r = Math.min(...i.map((o) => o.length - o.trimStart().length)),
+ a = i
+ .map((o) => o.slice(r))
+ .map((o) => ' '.repeat(this.indent * 2) + o);
+ for (let o of a) this.content.push(o);
+ }
+ compile() {
+ let t = Function,
+ n = this?.args,
+ r = [...(this?.content ?? ['']).map((a) => ` ${a}`)];
+ return new t(
+ ...n,
+ r.join(`
+`)
+ );
+ }
+ };
+ ed.Doc = Vy;
+});
+var Hy = xe((td) => {
+ 'use strict';
+ Object.defineProperty(td, '__esModule', {value: !0});
+ td.version = void 0;
+ td.version = {major: 4, minor: 3, patch: 6};
+});
+var Xy = xe((Z) => {
+ 'use strict';
+ var Qw =
+ (Z && Z.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ eO =
+ (Z && Z.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ sd =
+ (Z && Z.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Qw(t, e, n);
+ return eO(t, e), t;
+ };
+ Object.defineProperty(Z, '__esModule', {value: !0});
+ Z.$ZodTuple =
+ Z.$ZodIntersection =
+ Z.$ZodDiscriminatedUnion =
+ Z.$ZodXor =
+ Z.$ZodUnion =
+ Z.$ZodObjectJIT =
+ Z.$ZodObject =
+ Z.$ZodArray =
+ Z.$ZodDate =
+ Z.$ZodVoid =
+ Z.$ZodNever =
+ Z.$ZodUnknown =
+ Z.$ZodAny =
+ Z.$ZodNull =
+ Z.$ZodUndefined =
+ Z.$ZodSymbol =
+ Z.$ZodBigIntFormat =
+ Z.$ZodBigInt =
+ Z.$ZodBoolean =
+ Z.$ZodNumberFormat =
+ Z.$ZodNumber =
+ Z.$ZodCustomStringFormat =
+ Z.$ZodJWT =
+ Z.$ZodE164 =
+ Z.$ZodBase64URL =
+ Z.$ZodBase64 =
+ Z.$ZodCIDRv6 =
+ Z.$ZodCIDRv4 =
+ Z.$ZodMAC =
+ Z.$ZodIPv6 =
+ Z.$ZodIPv4 =
+ Z.$ZodISODuration =
+ Z.$ZodISOTime =
+ Z.$ZodISODate =
+ Z.$ZodISODateTime =
+ Z.$ZodKSUID =
+ Z.$ZodXID =
+ Z.$ZodULID =
+ Z.$ZodCUID2 =
+ Z.$ZodCUID =
+ Z.$ZodNanoID =
+ Z.$ZodEmoji =
+ Z.$ZodURL =
+ Z.$ZodEmail =
+ Z.$ZodUUID =
+ Z.$ZodGUID =
+ Z.$ZodStringFormat =
+ Z.$ZodString =
+ Z.clone =
+ Z.$ZodType =
+ void 0;
+ Z.$ZodCustom =
+ Z.$ZodLazy =
+ Z.$ZodPromise =
+ Z.$ZodFunction =
+ Z.$ZodTemplateLiteral =
+ Z.$ZodReadonly =
+ Z.$ZodCodec =
+ Z.$ZodPipe =
+ Z.$ZodNaN =
+ Z.$ZodCatch =
+ Z.$ZodSuccess =
+ Z.$ZodNonOptional =
+ Z.$ZodPrefault =
+ Z.$ZodDefault =
+ Z.$ZodNullable =
+ Z.$ZodExactOptional =
+ Z.$ZodOptional =
+ Z.$ZodTransform =
+ Z.$ZodFile =
+ Z.$ZodLiteral =
+ Z.$ZodEnum =
+ Z.$ZodSet =
+ Z.$ZodMap =
+ Z.$ZodRecord =
+ void 0;
+ Z.isValidBase64 = Gy;
+ Z.isValidBase64URL = bb;
+ Z.isValidJWT = kb;
+ var ld = sd(Qu()),
+ Te = sd(wa()),
+ tO = Jy(),
+ ja = Zy(),
+ Rt = sd(Yu()),
+ Ee = sd(ot()),
+ nO = Hy();
+ Z.$ZodType = Te.$constructor('$ZodType', (e, t) => {
+ var n;
+ e ?? (e = {}),
+ (e._zod.def = t),
+ (e._zod.bag = e._zod.bag || {}),
+ (e._zod.version = nO.version);
+ let i = [...(e._zod.def.checks ?? [])];
+ e._zod.traits.has('$ZodCheck') && i.unshift(e);
+ for (let r of i) for (let a of r._zod.onattach) a(e);
+ if (i.length === 0)
+ (n = e._zod).deferred ?? (n.deferred = []),
+ e._zod.deferred?.push(() => {
+ e._zod.run = e._zod.parse;
+ });
+ else {
+ let r = (o, s, l) => {
+ let d = Ee.aborted(o),
+ u;
+ for (let p of s) {
+ if (p._zod.def.when) {
+ if (!p._zod.def.when(o)) continue;
+ } else if (d) continue;
+ let y = o.issues.length,
+ m = p._zod.check(o);
+ if (m instanceof Promise && l?.async === !1)
+ throw new Te.$ZodAsyncError();
+ if (u || m instanceof Promise)
+ u = (u ?? Promise.resolve()).then(async () => {
+ await m, o.issues.length !== y && (d || (d = Ee.aborted(o, y)));
+ });
+ else {
+ if (o.issues.length === y) continue;
+ d || (d = Ee.aborted(o, y));
+ }
+ }
+ return u ? u.then(() => o) : o;
+ },
+ a = (o, s, l) => {
+ if (Ee.aborted(o)) return (o.aborted = !0), o;
+ let d = r(s, i, l);
+ if (d instanceof Promise) {
+ if (l.async === !1) throw new Te.$ZodAsyncError();
+ return d.then((u) => e._zod.parse(u, l));
+ }
+ return e._zod.parse(d, l);
+ };
+ e._zod.run = (o, s) => {
+ if (s.skipChecks) return e._zod.parse(o, s);
+ if (s.direction === 'backward') {
+ let d = e._zod.parse(
+ {value: o.value, issues: []},
+ {...s, skipChecks: !0}
+ );
+ return d instanceof Promise ? d.then((u) => a(u, o, s)) : a(d, o, s);
+ }
+ let l = e._zod.parse(o, s);
+ if (l instanceof Promise) {
+ if (s.async === !1) throw new Te.$ZodAsyncError();
+ return l.then((d) => r(d, i, s));
+ }
+ return r(l, i, s);
+ };
+ }
+ Ee.defineLazy(e, '~standard', () => ({
+ validate: (r) => {
+ try {
+ let a = (0, ja.safeParse)(e, r);
+ return a.success ? {value: a.data} : {issues: a.error?.issues};
+ } catch {
+ return (0, ja.safeParseAsync)(e, r).then((o) =>
+ o.success ? {value: o.data} : {issues: o.error?.issues}
+ );
+ }
+ },
+ vendor: 'zod',
+ version: 1,
+ }));
+ });
+ var rO = ot();
+ Object.defineProperty(Z, 'clone', {
+ enumerable: !0,
+ get: function () {
+ return rO.clone;
+ },
+ });
+ Z.$ZodString = Te.$constructor('$ZodString', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern =
+ [...(e?._zod.bag?.patterns ?? [])].pop() ?? Rt.string(e._zod.bag)),
+ (e._zod.parse = (n, i) => {
+ if (t.coerce)
+ try {
+ n.value = String(n.value);
+ } catch {}
+ return (
+ typeof n.value == 'string' ||
+ n.issues.push({
+ expected: 'string',
+ code: 'invalid_type',
+ input: n.value,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodStringFormat = Te.$constructor('$ZodStringFormat', (e, t) => {
+ ld.$ZodCheckStringFormat.init(e, t), Z.$ZodString.init(e, t);
+ });
+ Z.$ZodGUID = Te.$constructor('$ZodGUID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.guid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodUUID = Te.$constructor('$ZodUUID', (e, t) => {
+ if (t.version) {
+ let i = {v1: 1, v2: 2, v3: 3, v4: 4, v5: 5, v6: 6, v7: 7, v8: 8}[
+ t.version
+ ];
+ if (i === void 0) throw new Error(`Invalid UUID version: "${t.version}"`);
+ t.pattern ?? (t.pattern = Rt.uuid(i));
+ } else t.pattern ?? (t.pattern = Rt.uuid());
+ Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodEmail = Te.$constructor('$ZodEmail', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.email), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodURL = Te.$constructor('$ZodURL', (e, t) => {
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.check = (n) => {
+ try {
+ let i = n.value.trim(),
+ r = new URL(i);
+ t.hostname &&
+ ((t.hostname.lastIndex = 0),
+ t.hostname.test(r.hostname) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'url',
+ note: 'Invalid hostname',
+ pattern: t.hostname.source,
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ })),
+ t.protocol &&
+ ((t.protocol.lastIndex = 0),
+ t.protocol.test(
+ r.protocol.endsWith(':') ? r.protocol.slice(0, -1) : r.protocol
+ ) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'url',
+ note: 'Invalid protocol',
+ pattern: t.protocol.source,
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ })),
+ t.normalize ? (n.value = r.href) : (n.value = i);
+ return;
+ } catch {
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'url',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ }
+ });
+ });
+ Z.$ZodEmoji = Te.$constructor('$ZodEmoji', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.emoji()), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodNanoID = Te.$constructor('$ZodNanoID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.nanoid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodCUID = Te.$constructor('$ZodCUID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.cuid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodCUID2 = Te.$constructor('$ZodCUID2', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.cuid2), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodULID = Te.$constructor('$ZodULID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.ulid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodXID = Te.$constructor('$ZodXID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.xid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodKSUID = Te.$constructor('$ZodKSUID', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.ksuid), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodISODateTime = Te.$constructor('$ZodISODateTime', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.datetime(t)), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodISODate = Te.$constructor('$ZodISODate', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.date), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodISOTime = Te.$constructor('$ZodISOTime', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.time(t)), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodISODuration = Te.$constructor('$ZodISODuration', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.duration), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodIPv4 = Te.$constructor('$ZodIPv4', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.ipv4),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.bag.format = 'ipv4');
+ });
+ Z.$ZodIPv6 = Te.$constructor('$ZodIPv6', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.ipv6),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.bag.format = 'ipv6'),
+ (e._zod.check = (n) => {
+ try {
+ new URL(`http://[${n.value}]`);
+ } catch {
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'ipv6',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ }
+ });
+ });
+ Z.$ZodMAC = Te.$constructor('$ZodMAC', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.mac(t.delimiter)),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.bag.format = 'mac');
+ });
+ Z.$ZodCIDRv4 = Te.$constructor('$ZodCIDRv4', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.cidrv4), Z.$ZodStringFormat.init(e, t);
+ });
+ Z.$ZodCIDRv6 = Te.$constructor('$ZodCIDRv6', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.cidrv6),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.check = (n) => {
+ let i = n.value.split('/');
+ try {
+ if (i.length !== 2) throw new Error();
+ let [r, a] = i;
+ if (!a) throw new Error();
+ let o = Number(a);
+ if (`${o}` !== a) throw new Error();
+ if (o < 0 || o > 128) throw new Error();
+ new URL(`http://[${r}]`);
+ } catch {
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'cidrv6',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ }
+ });
+ });
+ function Gy(e) {
+ if (e === '') return !0;
+ if (e.length % 4 !== 0) return !1;
+ try {
+ return atob(e), !0;
+ } catch {
+ return !1;
+ }
+ }
+ Z.$ZodBase64 = Te.$constructor('$ZodBase64', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.base64),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.bag.contentEncoding = 'base64'),
+ (e._zod.check = (n) => {
+ Gy(n.value) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'base64',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ function bb(e) {
+ if (!Rt.base64url.test(e)) return !1;
+ let t = e.replace(/[-_]/g, (i) => (i === '-' ? '+' : '/')),
+ n = t.padEnd(Math.ceil(t.length / 4) * 4, '=');
+ return Gy(n);
+ }
+ Z.$ZodBase64URL = Te.$constructor('$ZodBase64URL', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.base64url),
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.bag.contentEncoding = 'base64url'),
+ (e._zod.check = (n) => {
+ bb(n.value) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'base64url',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Z.$ZodE164 = Te.$constructor('$ZodE164', (e, t) => {
+ t.pattern ?? (t.pattern = Rt.e164), Z.$ZodStringFormat.init(e, t);
+ });
+ function kb(e, t = null) {
+ try {
+ let n = e.split('.');
+ if (n.length !== 3) return !1;
+ let [i] = n;
+ if (!i) return !1;
+ let r = JSON.parse(atob(i));
+ return !(
+ ('typ' in r && r?.typ !== 'JWT') ||
+ !r.alg ||
+ (t && (!('alg' in r) || r.alg !== t))
+ );
+ } catch {
+ return !1;
+ }
+ }
+ Z.$ZodJWT = Te.$constructor('$ZodJWT', (e, t) => {
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.check = (n) => {
+ kb(n.value, t.alg) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: 'jwt',
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ });
+ Z.$ZodCustomStringFormat = Te.$constructor(
+ '$ZodCustomStringFormat',
+ (e, t) => {
+ Z.$ZodStringFormat.init(e, t),
+ (e._zod.check = (n) => {
+ t.fn(n.value) ||
+ n.issues.push({
+ code: 'invalid_format',
+ format: t.format,
+ input: n.value,
+ inst: e,
+ continue: !t.abort,
+ });
+ });
+ }
+ );
+ Z.$ZodNumber = Te.$constructor('$ZodNumber', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern = e._zod.bag.pattern ?? Rt.number),
+ (e._zod.parse = (n, i) => {
+ if (t.coerce)
+ try {
+ n.value = Number(n.value);
+ } catch {}
+ let r = n.value;
+ if (typeof r == 'number' && !Number.isNaN(r) && Number.isFinite(r))
+ return n;
+ let a =
+ typeof r == 'number'
+ ? Number.isNaN(r)
+ ? 'NaN'
+ : Number.isFinite(r)
+ ? void 0
+ : 'Infinity'
+ : void 0;
+ return (
+ n.issues.push({
+ expected: 'number',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ ...(a ? {received: a} : {}),
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodNumberFormat = Te.$constructor('$ZodNumberFormat', (e, t) => {
+ ld.$ZodCheckNumberFormat.init(e, t), Z.$ZodNumber.init(e, t);
+ });
+ Z.$ZodBoolean = Te.$constructor('$ZodBoolean', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern = Rt.boolean),
+ (e._zod.parse = (n, i) => {
+ if (t.coerce)
+ try {
+ n.value = !!n.value;
+ } catch {}
+ let r = n.value;
+ return (
+ typeof r == 'boolean' ||
+ n.issues.push({
+ expected: 'boolean',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodBigInt = Te.$constructor('$ZodBigInt', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern = Rt.bigint),
+ (e._zod.parse = (n, i) => {
+ if (t.coerce)
+ try {
+ n.value = BigInt(n.value);
+ } catch {}
+ return (
+ typeof n.value == 'bigint' ||
+ n.issues.push({
+ expected: 'bigint',
+ code: 'invalid_type',
+ input: n.value,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodBigIntFormat = Te.$constructor('$ZodBigIntFormat', (e, t) => {
+ ld.$ZodCheckBigIntFormat.init(e, t), Z.$ZodBigInt.init(e, t);
+ });
+ Z.$ZodSymbol = Te.$constructor('$ZodSymbol', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ return (
+ typeof r == 'symbol' ||
+ n.issues.push({
+ expected: 'symbol',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodUndefined = Te.$constructor('$ZodUndefined', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern = Rt.undefined),
+ (e._zod.values = new Set([void 0])),
+ (e._zod.optin = 'optional'),
+ (e._zod.optout = 'optional'),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ return (
+ typeof r > 'u' ||
+ n.issues.push({
+ expected: 'undefined',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodNull = Te.$constructor('$ZodNull', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.pattern = Rt.null),
+ (e._zod.values = new Set([null])),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ return (
+ r === null ||
+ n.issues.push({
+ expected: 'null',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodAny = Te.$constructor('$ZodAny', (e, t) => {
+ Z.$ZodType.init(e, t), (e._zod.parse = (n) => n);
+ });
+ Z.$ZodUnknown = Te.$constructor('$ZodUnknown', (e, t) => {
+ Z.$ZodType.init(e, t), (e._zod.parse = (n) => n);
+ });
+ Z.$ZodNever = Te.$constructor('$ZodNever', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => (
+ n.issues.push({
+ expected: 'never',
+ code: 'invalid_type',
+ input: n.value,
+ inst: e,
+ }),
+ n
+ ));
+ });
+ Z.$ZodVoid = Te.$constructor('$ZodVoid', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ return (
+ typeof r > 'u' ||
+ n.issues.push({
+ expected: 'void',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodDate = Te.$constructor('$ZodDate', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ if (t.coerce)
+ try {
+ n.value = new Date(n.value);
+ } catch {}
+ let r = n.value,
+ a = r instanceof Date;
+ return (
+ (a && !Number.isNaN(r.getTime())) ||
+ n.issues.push({
+ expected: 'date',
+ code: 'invalid_type',
+ input: r,
+ ...(a ? {received: 'Invalid Date'} : {}),
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ function lb(e, t, n) {
+ e.issues.length && t.issues.push(...Ee.prefixIssues(n, e.issues)),
+ (t.value[n] = e.value);
+ }
+ Z.$ZodArray = Te.$constructor('$ZodArray', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ if (!Array.isArray(r))
+ return (
+ n.issues.push({
+ expected: 'array',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ n.value = Array(r.length);
+ let a = [];
+ for (let o = 0; o < r.length; o++) {
+ let s = r[o],
+ l = t.element._zod.run({value: s, issues: []}, i);
+ l instanceof Promise
+ ? a.push(l.then((d) => lb(d, n, o)))
+ : lb(l, n, o);
+ }
+ return a.length ? Promise.all(a).then(() => n) : n;
+ });
+ });
+ function od(e, t, n, i, r) {
+ if (e.issues.length) {
+ if (r && !(n in i)) return;
+ t.issues.push(...Ee.prefixIssues(n, e.issues));
+ }
+ e.value === void 0
+ ? n in i && (t.value[n] = void 0)
+ : (t.value[n] = e.value);
+ }
+ function Sb(e) {
+ let t = Object.keys(e.shape);
+ for (let i of t)
+ if (!e.shape?.[i]?._zod?.traits?.has('$ZodType'))
+ throw new Error(`Invalid element at key "${i}": expected a Zod schema`);
+ let n = Ee.optionalKeys(e.shape);
+ return {
+ ...e,
+ keys: t,
+ keySet: new Set(t),
+ numKeys: t.length,
+ optionalKeys: new Set(n),
+ };
+ }
+ function _b(e, t, n, i, r, a) {
+ let o = [],
+ s = r.keySet,
+ l = r.catchall._zod,
+ d = l.def.type,
+ u = l.optout === 'optional';
+ for (let p in t) {
+ if (s.has(p)) continue;
+ if (d === 'never') {
+ o.push(p);
+ continue;
+ }
+ let y = l.run({value: t[p], issues: []}, i);
+ y instanceof Promise
+ ? e.push(y.then((m) => od(m, n, p, t, u)))
+ : od(y, n, p, t, u);
+ }
+ return (
+ o.length &&
+ n.issues.push({code: 'unrecognized_keys', keys: o, input: t, inst: a}),
+ e.length ? Promise.all(e).then(() => n) : n
+ );
+ }
+ Z.$ZodObject = Te.$constructor('$ZodObject', (e, t) => {
+ if (
+ (Z.$ZodType.init(e, t), !Object.getOwnPropertyDescriptor(t, 'shape')?.get)
+ ) {
+ let s = t.shape;
+ Object.defineProperty(t, 'shape', {
+ get: () => {
+ let l = {...s};
+ return Object.defineProperty(t, 'shape', {value: l}), l;
+ },
+ });
+ }
+ let i = Ee.cached(() => Sb(t));
+ Ee.defineLazy(e._zod, 'propValues', () => {
+ let s = t.shape,
+ l = {};
+ for (let d in s) {
+ let u = s[d]._zod;
+ if (u.values) {
+ l[d] ?? (l[d] = new Set());
+ for (let p of u.values) l[d].add(p);
+ }
+ }
+ return l;
+ });
+ let r = Ee.isObject,
+ a = t.catchall,
+ o;
+ e._zod.parse = (s, l) => {
+ o ?? (o = i.value);
+ let d = s.value;
+ if (!r(d))
+ return (
+ s.issues.push({
+ expected: 'object',
+ code: 'invalid_type',
+ input: d,
+ inst: e,
+ }),
+ s
+ );
+ s.value = {};
+ let u = [],
+ p = o.shape;
+ for (let y of o.keys) {
+ let m = p[y],
+ g = m._zod.optout === 'optional',
+ S = m._zod.run({value: d[y], issues: []}, l);
+ S instanceof Promise
+ ? u.push(S.then((_) => od(_, s, y, d, g)))
+ : od(S, s, y, d, g);
+ }
+ return a
+ ? _b(u, d, s, l, i.value, e)
+ : u.length
+ ? Promise.all(u).then(() => s)
+ : s;
+ };
+ });
+ Z.$ZodObjectJIT = Te.$constructor('$ZodObjectJIT', (e, t) => {
+ Z.$ZodObject.init(e, t);
+ let n = e._zod.parse,
+ i = Ee.cached(() => Sb(t)),
+ r = (y) => {
+ let m = new tO.Doc(['shape', 'payload', 'ctx']),
+ g = i.value,
+ S = (M) => {
+ let w = Ee.esc(M);
+ return `shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`;
+ };
+ m.write('const input = payload.value;');
+ let _ = Object.create(null),
+ O = 0;
+ for (let M of g.keys) _[M] = `key_${O++}`;
+ m.write('const newResult = {};');
+ for (let M of g.keys) {
+ let w = _[M],
+ I = Ee.esc(M),
+ A = y[M]?._zod?.optout === 'optional';
+ m.write(`const ${w} = ${S(M)};`),
+ A
+ ? m.write(`
+ if (${w}.issues.length) {
+ if (${I} in input) {
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
+ ...iss,
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
+ })));
+ }
+ }
+
+ if (${w}.value === undefined) {
+ if (${I} in input) {
+ newResult[${I}] = undefined;
+ }
+ } else {
+ newResult[${I}] = ${w}.value;
+ }
+
+ `)
+ : m.write(`
+ if (${w}.issues.length) {
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
+ ...iss,
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
+ })));
+ }
+
+ if (${w}.value === undefined) {
+ if (${I} in input) {
+ newResult[${I}] = undefined;
+ }
+ } else {
+ newResult[${I}] = ${w}.value;
+ }
+
+ `);
+ }
+ m.write('payload.value = newResult;'), m.write('return payload;');
+ let P = m.compile();
+ return (M, w) => P(y, M, w);
+ },
+ a,
+ o = Ee.isObject,
+ s = !Te.globalConfig.jitless,
+ l = Ee.allowsEval,
+ d = s && l.value,
+ u = t.catchall,
+ p;
+ e._zod.parse = (y, m) => {
+ p ?? (p = i.value);
+ let g = y.value;
+ return o(g)
+ ? s && d && m?.async === !1 && m.jitless !== !0
+ ? (a || (a = r(t.shape)),
+ (y = a(y, m)),
+ u ? _b([], g, y, m, p, e) : y)
+ : n(y, m)
+ : (y.issues.push({
+ expected: 'object',
+ code: 'invalid_type',
+ input: g,
+ inst: e,
+ }),
+ y);
+ };
+ });
+ function cb(e, t, n, i) {
+ for (let a of e) if (a.issues.length === 0) return (t.value = a.value), t;
+ let r = e.filter((a) => !Ee.aborted(a));
+ return r.length === 1
+ ? ((t.value = r[0].value), r[0])
+ : (t.issues.push({
+ code: 'invalid_union',
+ input: t.value,
+ inst: n,
+ errors: e.map((a) =>
+ a.issues.map((o) => Ee.finalizeIssue(o, i, Te.config()))
+ ),
+ }),
+ t);
+ }
+ Z.$ZodUnion = Te.$constructor('$ZodUnion', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'optin', () =>
+ t.options.some((r) => r._zod.optin === 'optional') ? 'optional' : void 0
+ ),
+ Ee.defineLazy(e._zod, 'optout', () =>
+ t.options.some((r) => r._zod.optout === 'optional')
+ ? 'optional'
+ : void 0
+ ),
+ Ee.defineLazy(e._zod, 'values', () => {
+ if (t.options.every((r) => r._zod.values))
+ return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
+ }),
+ Ee.defineLazy(e._zod, 'pattern', () => {
+ if (t.options.every((r) => r._zod.pattern)) {
+ let r = t.options.map((a) => a._zod.pattern);
+ return new RegExp(
+ `^(${r.map((a) => Ee.cleanRegex(a.source)).join('|')})$`
+ );
+ }
+ });
+ let n = t.options.length === 1,
+ i = t.options[0]._zod.run;
+ e._zod.parse = (r, a) => {
+ if (n) return i(r, a);
+ let o = !1,
+ s = [];
+ for (let l of t.options) {
+ let d = l._zod.run({value: r.value, issues: []}, a);
+ if (d instanceof Promise) s.push(d), (o = !0);
+ else {
+ if (d.issues.length === 0) return d;
+ s.push(d);
+ }
+ }
+ return o ? Promise.all(s).then((l) => cb(l, r, e, a)) : cb(s, r, e, a);
+ };
+ });
+ function ub(e, t, n, i) {
+ let r = e.filter((a) => a.issues.length === 0);
+ return r.length === 1
+ ? ((t.value = r[0].value), t)
+ : (r.length === 0
+ ? t.issues.push({
+ code: 'invalid_union',
+ input: t.value,
+ inst: n,
+ errors: e.map((a) =>
+ a.issues.map((o) => Ee.finalizeIssue(o, i, Te.config()))
+ ),
+ })
+ : t.issues.push({
+ code: 'invalid_union',
+ input: t.value,
+ inst: n,
+ errors: [],
+ inclusive: !1,
+ }),
+ t);
+ }
+ Z.$ZodXor = Te.$constructor('$ZodXor', (e, t) => {
+ Z.$ZodUnion.init(e, t), (t.inclusive = !1);
+ let n = t.options.length === 1,
+ i = t.options[0]._zod.run;
+ e._zod.parse = (r, a) => {
+ if (n) return i(r, a);
+ let o = !1,
+ s = [];
+ for (let l of t.options) {
+ let d = l._zod.run({value: r.value, issues: []}, a);
+ d instanceof Promise ? (s.push(d), (o = !0)) : s.push(d);
+ }
+ return o ? Promise.all(s).then((l) => ub(l, r, e, a)) : ub(s, r, e, a);
+ };
+ });
+ Z.$ZodDiscriminatedUnion = Te.$constructor(
+ '$ZodDiscriminatedUnion',
+ (e, t) => {
+ (t.inclusive = !1), Z.$ZodUnion.init(e, t);
+ let n = e._zod.parse;
+ Ee.defineLazy(e._zod, 'propValues', () => {
+ let r = {};
+ for (let a of t.options) {
+ let o = a._zod.propValues;
+ if (!o || Object.keys(o).length === 0)
+ throw new Error(
+ `Invalid discriminated union option at index "${t.options.indexOf(
+ a
+ )}"`
+ );
+ for (let [s, l] of Object.entries(o)) {
+ r[s] || (r[s] = new Set());
+ for (let d of l) r[s].add(d);
+ }
+ }
+ return r;
+ });
+ let i = Ee.cached(() => {
+ let r = t.options,
+ a = new Map();
+ for (let o of r) {
+ let s = o._zod.propValues?.[t.discriminator];
+ if (!s || s.size === 0)
+ throw new Error(
+ `Invalid discriminated union option at index "${t.options.indexOf(
+ o
+ )}"`
+ );
+ for (let l of s) {
+ if (a.has(l))
+ throw new Error(`Duplicate discriminator value "${String(l)}"`);
+ a.set(l, o);
+ }
+ }
+ return a;
+ });
+ e._zod.parse = (r, a) => {
+ let o = r.value;
+ if (!Ee.isObject(o))
+ return (
+ r.issues.push({
+ code: 'invalid_type',
+ expected: 'object',
+ input: o,
+ inst: e,
+ }),
+ r
+ );
+ let s = i.value.get(o?.[t.discriminator]);
+ return s
+ ? s._zod.run(r, a)
+ : t.unionFallback
+ ? n(r, a)
+ : (r.issues.push({
+ code: 'invalid_union',
+ errors: [],
+ note: 'No matching discriminator',
+ discriminator: t.discriminator,
+ input: o,
+ path: [t.discriminator],
+ inst: e,
+ }),
+ r);
+ };
+ }
+ );
+ Z.$ZodIntersection = Te.$constructor('$ZodIntersection', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value,
+ a = t.left._zod.run({value: r, issues: []}, i),
+ o = t.right._zod.run({value: r, issues: []}, i);
+ return a instanceof Promise || o instanceof Promise
+ ? Promise.all([a, o]).then(([l, d]) => db(n, l, d))
+ : db(n, a, o);
+ });
+ });
+ function Wy(e, t) {
+ if (e === t) return {valid: !0, data: e};
+ if (e instanceof Date && t instanceof Date && +e == +t)
+ return {valid: !0, data: e};
+ if (Ee.isPlainObject(e) && Ee.isPlainObject(t)) {
+ let n = Object.keys(t),
+ i = Object.keys(e).filter((a) => n.indexOf(a) !== -1),
+ r = {...e, ...t};
+ for (let a of i) {
+ let o = Wy(e[a], t[a]);
+ if (!o.valid)
+ return {valid: !1, mergeErrorPath: [a, ...o.mergeErrorPath]};
+ r[a] = o.data;
+ }
+ return {valid: !0, data: r};
+ }
+ if (Array.isArray(e) && Array.isArray(t)) {
+ if (e.length !== t.length) return {valid: !1, mergeErrorPath: []};
+ let n = [];
+ for (let i = 0; i < e.length; i++) {
+ let r = e[i],
+ a = t[i],
+ o = Wy(r, a);
+ if (!o.valid)
+ return {valid: !1, mergeErrorPath: [i, ...o.mergeErrorPath]};
+ n.push(o.data);
+ }
+ return {valid: !0, data: n};
+ }
+ return {valid: !1, mergeErrorPath: []};
+ }
+ function db(e, t, n) {
+ let i = new Map(),
+ r;
+ for (let s of t.issues)
+ if (s.code === 'unrecognized_keys') {
+ r ?? (r = s);
+ for (let l of s.keys) i.has(l) || i.set(l, {}), (i.get(l).l = !0);
+ } else e.issues.push(s);
+ for (let s of n.issues)
+ if (s.code === 'unrecognized_keys')
+ for (let l of s.keys) i.has(l) || i.set(l, {}), (i.get(l).r = !0);
+ else e.issues.push(s);
+ let a = [...i].filter(([, s]) => s.l && s.r).map(([s]) => s);
+ if ((a.length && r && e.issues.push({...r, keys: a}), Ee.aborted(e)))
+ return e;
+ let o = Wy(t.value, n.value);
+ if (!o.valid)
+ throw new Error(
+ `Unmergable intersection. Error path: ${JSON.stringify(
+ o.mergeErrorPath
+ )}`
+ );
+ return (e.value = o.data), e;
+ }
+ Z.$ZodTuple = Te.$constructor('$ZodTuple', (e, t) => {
+ Z.$ZodType.init(e, t);
+ let n = t.items;
+ e._zod.parse = (i, r) => {
+ let a = i.value;
+ if (!Array.isArray(a))
+ return (
+ i.issues.push({
+ input: a,
+ inst: e,
+ expected: 'tuple',
+ code: 'invalid_type',
+ }),
+ i
+ );
+ i.value = [];
+ let o = [],
+ s = [...n].reverse().findIndex((u) => u._zod.optin !== 'optional'),
+ l = s === -1 ? 0 : n.length - s;
+ if (!t.rest) {
+ let u = a.length > n.length,
+ p = a.length < l - 1;
+ if (u || p)
+ return (
+ i.issues.push({
+ ...(u
+ ? {code: 'too_big', maximum: n.length, inclusive: !0}
+ : {code: 'too_small', minimum: n.length}),
+ input: a,
+ inst: e,
+ origin: 'array',
+ }),
+ i
+ );
+ }
+ let d = -1;
+ for (let u of n) {
+ if ((d++, d >= a.length && d >= l)) continue;
+ let p = u._zod.run({value: a[d], issues: []}, r);
+ p instanceof Promise ? o.push(p.then((y) => nd(y, i, d))) : nd(p, i, d);
+ }
+ if (t.rest) {
+ let u = a.slice(n.length);
+ for (let p of u) {
+ d++;
+ let y = t.rest._zod.run({value: p, issues: []}, r);
+ y instanceof Promise
+ ? o.push(y.then((m) => nd(m, i, d)))
+ : nd(y, i, d);
+ }
+ }
+ return o.length ? Promise.all(o).then(() => i) : i;
+ };
+ });
+ function nd(e, t, n) {
+ e.issues.length && t.issues.push(...Ee.prefixIssues(n, e.issues)),
+ (t.value[n] = e.value);
+ }
+ Z.$ZodRecord = Te.$constructor('$ZodRecord', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ if (!Ee.isPlainObject(r))
+ return (
+ n.issues.push({
+ expected: 'record',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ let a = [],
+ o = t.keyType._zod.values;
+ if (o) {
+ n.value = {};
+ let s = new Set();
+ for (let d of o)
+ if (
+ typeof d == 'string' ||
+ typeof d == 'number' ||
+ typeof d == 'symbol'
+ ) {
+ s.add(typeof d == 'number' ? d.toString() : d);
+ let u = t.valueType._zod.run({value: r[d], issues: []}, i);
+ u instanceof Promise
+ ? a.push(
+ u.then((p) => {
+ p.issues.length &&
+ n.issues.push(...Ee.prefixIssues(d, p.issues)),
+ (n.value[d] = p.value);
+ })
+ )
+ : (u.issues.length &&
+ n.issues.push(...Ee.prefixIssues(d, u.issues)),
+ (n.value[d] = u.value));
+ }
+ let l;
+ for (let d in r) s.has(d) || ((l = l ?? []), l.push(d));
+ l &&
+ l.length > 0 &&
+ n.issues.push({
+ code: 'unrecognized_keys',
+ input: r,
+ inst: e,
+ keys: l,
+ });
+ } else {
+ n.value = {};
+ for (let s of Reflect.ownKeys(r)) {
+ if (s === '__proto__') continue;
+ let l = t.keyType._zod.run({value: s, issues: []}, i);
+ if (l instanceof Promise)
+ throw new Error(
+ 'Async schemas not supported in object keys currently'
+ );
+ if (typeof s == 'string' && Rt.number.test(s) && l.issues.length) {
+ let p = t.keyType._zod.run({value: Number(s), issues: []}, i);
+ if (p instanceof Promise)
+ throw new Error(
+ 'Async schemas not supported in object keys currently'
+ );
+ p.issues.length === 0 && (l = p);
+ }
+ if (l.issues.length) {
+ t.mode === 'loose'
+ ? (n.value[s] = r[s])
+ : n.issues.push({
+ code: 'invalid_key',
+ origin: 'record',
+ issues: l.issues.map((p) =>
+ Ee.finalizeIssue(p, i, Te.config())
+ ),
+ input: s,
+ path: [s],
+ inst: e,
+ });
+ continue;
+ }
+ let u = t.valueType._zod.run({value: r[s], issues: []}, i);
+ u instanceof Promise
+ ? a.push(
+ u.then((p) => {
+ p.issues.length &&
+ n.issues.push(...Ee.prefixIssues(s, p.issues)),
+ (n.value[l.value] = p.value);
+ })
+ )
+ : (u.issues.length &&
+ n.issues.push(...Ee.prefixIssues(s, u.issues)),
+ (n.value[l.value] = u.value));
+ }
+ }
+ return a.length ? Promise.all(a).then(() => n) : n;
+ });
+ });
+ Z.$ZodMap = Te.$constructor('$ZodMap', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ if (!(r instanceof Map))
+ return (
+ n.issues.push({
+ expected: 'map',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ let a = [];
+ n.value = new Map();
+ for (let [o, s] of r) {
+ let l = t.keyType._zod.run({value: o, issues: []}, i),
+ d = t.valueType._zod.run({value: s, issues: []}, i);
+ l instanceof Promise || d instanceof Promise
+ ? a.push(
+ Promise.all([l, d]).then(([u, p]) => {
+ fb(u, p, n, o, r, e, i);
+ })
+ )
+ : fb(l, d, n, o, r, e, i);
+ }
+ return a.length ? Promise.all(a).then(() => n) : n;
+ });
+ });
+ function fb(e, t, n, i, r, a, o) {
+ e.issues.length &&
+ (Ee.propertyKeyTypes.has(typeof i)
+ ? n.issues.push(...Ee.prefixIssues(i, e.issues))
+ : n.issues.push({
+ code: 'invalid_key',
+ origin: 'map',
+ input: r,
+ inst: a,
+ issues: e.issues.map((s) => Ee.finalizeIssue(s, o, Te.config())),
+ })),
+ t.issues.length &&
+ (Ee.propertyKeyTypes.has(typeof i)
+ ? n.issues.push(...Ee.prefixIssues(i, t.issues))
+ : n.issues.push({
+ origin: 'map',
+ code: 'invalid_element',
+ input: r,
+ inst: a,
+ key: i,
+ issues: t.issues.map((s) => Ee.finalizeIssue(s, o, Te.config())),
+ })),
+ n.value.set(e.value, t.value);
+ }
+ Z.$ZodSet = Te.$constructor('$ZodSet', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ if (!(r instanceof Set))
+ return (
+ n.issues.push({
+ input: r,
+ inst: e,
+ expected: 'set',
+ code: 'invalid_type',
+ }),
+ n
+ );
+ let a = [];
+ n.value = new Set();
+ for (let o of r) {
+ let s = t.valueType._zod.run({value: o, issues: []}, i);
+ s instanceof Promise ? a.push(s.then((l) => pb(l, n))) : pb(s, n);
+ }
+ return a.length ? Promise.all(a).then(() => n) : n;
+ });
+ });
+ function pb(e, t) {
+ e.issues.length && t.issues.push(...e.issues), t.value.add(e.value);
+ }
+ Z.$ZodEnum = Te.$constructor('$ZodEnum', (e, t) => {
+ Z.$ZodType.init(e, t);
+ let n = Ee.getEnumValues(t.entries),
+ i = new Set(n);
+ (e._zod.values = i),
+ (e._zod.pattern = new RegExp(
+ `^(${n
+ .filter((r) => Ee.propertyKeyTypes.has(typeof r))
+ .map((r) => (typeof r == 'string' ? Ee.escapeRegex(r) : r.toString()))
+ .join('|')})$`
+ )),
+ (e._zod.parse = (r, a) => {
+ let o = r.value;
+ return (
+ i.has(o) ||
+ r.issues.push({
+ code: 'invalid_value',
+ values: n,
+ input: o,
+ inst: e,
+ }),
+ r
+ );
+ });
+ });
+ Z.$ZodLiteral = Te.$constructor('$ZodLiteral', (e, t) => {
+ if ((Z.$ZodType.init(e, t), t.values.length === 0))
+ throw new Error('Cannot create literal schema with no valid values');
+ let n = new Set(t.values);
+ (e._zod.values = n),
+ (e._zod.pattern = new RegExp(
+ `^(${t.values
+ .map((i) =>
+ typeof i == 'string'
+ ? Ee.escapeRegex(i)
+ : i
+ ? Ee.escapeRegex(i.toString())
+ : String(i)
+ )
+ .join('|')})$`
+ )),
+ (e._zod.parse = (i, r) => {
+ let a = i.value;
+ return (
+ n.has(a) ||
+ i.issues.push({
+ code: 'invalid_value',
+ values: t.values,
+ input: a,
+ inst: e,
+ }),
+ i
+ );
+ });
+ });
+ Z.$ZodFile = Te.$constructor('$ZodFile', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ let r = n.value;
+ return (
+ r instanceof File ||
+ n.issues.push({
+ expected: 'file',
+ code: 'invalid_type',
+ input: r,
+ inst: e,
+ }),
+ n
+ );
+ });
+ });
+ Z.$ZodTransform = Te.$constructor('$ZodTransform', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward')
+ throw new Te.$ZodEncodeError(e.constructor.name);
+ let r = t.transform(n.value, n);
+ if (i.async)
+ return (r instanceof Promise ? r : Promise.resolve(r)).then(
+ (o) => ((n.value = o), n)
+ );
+ if (r instanceof Promise) throw new Te.$ZodAsyncError();
+ return (n.value = r), n;
+ });
+ });
+ function mb(e, t) {
+ return e.issues.length && t === void 0 ? {issues: [], value: void 0} : e;
+ }
+ Z.$ZodOptional = Te.$constructor('$ZodOptional', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.optin = 'optional'),
+ (e._zod.optout = 'optional'),
+ Ee.defineLazy(e._zod, 'values', () =>
+ t.innerType._zod.values
+ ? new Set([...t.innerType._zod.values, void 0])
+ : void 0
+ ),
+ Ee.defineLazy(e._zod, 'pattern', () => {
+ let n = t.innerType._zod.pattern;
+ return n ? new RegExp(`^(${Ee.cleanRegex(n.source)})?$`) : void 0;
+ }),
+ (e._zod.parse = (n, i) => {
+ if (t.innerType._zod.optin === 'optional') {
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise
+ ? r.then((a) => mb(a, n.value))
+ : mb(r, n.value);
+ }
+ return n.value === void 0 ? n : t.innerType._zod.run(n, i);
+ });
+ });
+ Z.$ZodExactOptional = Te.$constructor('$ZodExactOptional', (e, t) => {
+ Z.$ZodOptional.init(e, t),
+ Ee.defineLazy(e._zod, 'values', () => t.innerType._zod.values),
+ Ee.defineLazy(e._zod, 'pattern', () => t.innerType._zod.pattern),
+ (e._zod.parse = (n, i) => t.innerType._zod.run(n, i));
+ });
+ Z.$ZodNullable = Te.$constructor('$ZodNullable', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'optin', () => t.innerType._zod.optin),
+ Ee.defineLazy(e._zod, 'optout', () => t.innerType._zod.optout),
+ Ee.defineLazy(e._zod, 'pattern', () => {
+ let n = t.innerType._zod.pattern;
+ return n ? new RegExp(`^(${Ee.cleanRegex(n.source)}|null)$`) : void 0;
+ }),
+ Ee.defineLazy(e._zod, 'values', () =>
+ t.innerType._zod.values
+ ? new Set([...t.innerType._zod.values, null])
+ : void 0
+ ),
+ (e._zod.parse = (n, i) =>
+ n.value === null ? n : t.innerType._zod.run(n, i));
+ });
+ Z.$ZodDefault = Te.$constructor('$ZodDefault', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.optin = 'optional'),
+ Ee.defineLazy(e._zod, 'values', () => t.innerType._zod.values),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward') return t.innerType._zod.run(n, i);
+ if (n.value === void 0) return (n.value = t.defaultValue), n;
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise ? r.then((a) => yb(a, t)) : yb(r, t);
+ });
+ });
+ function yb(e, t) {
+ return e.value === void 0 && (e.value = t.defaultValue), e;
+ }
+ Z.$ZodPrefault = Te.$constructor('$ZodPrefault', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.optin = 'optional'),
+ Ee.defineLazy(e._zod, 'values', () => t.innerType._zod.values),
+ (e._zod.parse = (n, i) => (
+ i.direction === 'backward' ||
+ (n.value === void 0 && (n.value = t.defaultValue)),
+ t.innerType._zod.run(n, i)
+ ));
+ });
+ Z.$ZodNonOptional = Te.$constructor('$ZodNonOptional', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'values', () => {
+ let n = t.innerType._zod.values;
+ return n ? new Set([...n].filter((i) => i !== void 0)) : void 0;
+ }),
+ (e._zod.parse = (n, i) => {
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise ? r.then((a) => gb(a, e)) : gb(r, e);
+ });
+ });
+ function gb(e, t) {
+ return (
+ !e.issues.length &&
+ e.value === void 0 &&
+ e.issues.push({
+ code: 'invalid_type',
+ expected: 'nonoptional',
+ input: e.value,
+ inst: t,
+ }),
+ e
+ );
+ }
+ Z.$ZodSuccess = Te.$constructor('$ZodSuccess', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward')
+ throw new Te.$ZodEncodeError('ZodSuccess');
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise
+ ? r.then((a) => ((n.value = a.issues.length === 0), n))
+ : ((n.value = r.issues.length === 0), n);
+ });
+ });
+ Z.$ZodCatch = Te.$constructor('$ZodCatch', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'optin', () => t.innerType._zod.optin),
+ Ee.defineLazy(e._zod, 'optout', () => t.innerType._zod.optout),
+ Ee.defineLazy(e._zod, 'values', () => t.innerType._zod.values),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward') return t.innerType._zod.run(n, i);
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise
+ ? r.then(
+ (a) => (
+ (n.value = a.value),
+ a.issues.length &&
+ ((n.value = t.catchValue({
+ ...n,
+ error: {
+ issues: a.issues.map((o) =>
+ Ee.finalizeIssue(o, i, Te.config())
+ ),
+ },
+ input: n.value,
+ })),
+ (n.issues = [])),
+ n
+ )
+ )
+ : ((n.value = r.value),
+ r.issues.length &&
+ ((n.value = t.catchValue({
+ ...n,
+ error: {
+ issues: r.issues.map((a) =>
+ Ee.finalizeIssue(a, i, Te.config())
+ ),
+ },
+ input: n.value,
+ })),
+ (n.issues = [])),
+ n);
+ });
+ });
+ Z.$ZodNaN = Te.$constructor('$ZodNaN', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => (
+ (typeof n.value != 'number' || !Number.isNaN(n.value)) &&
+ n.issues.push({
+ input: n.value,
+ inst: e,
+ expected: 'nan',
+ code: 'invalid_type',
+ }),
+ n
+ ));
+ });
+ Z.$ZodPipe = Te.$constructor('$ZodPipe', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'values', () => t.in._zod.values),
+ Ee.defineLazy(e._zod, 'optin', () => t.in._zod.optin),
+ Ee.defineLazy(e._zod, 'optout', () => t.out._zod.optout),
+ Ee.defineLazy(e._zod, 'propValues', () => t.in._zod.propValues),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward') {
+ let a = t.out._zod.run(n, i);
+ return a instanceof Promise
+ ? a.then((o) => rd(o, t.in, i))
+ : rd(a, t.in, i);
+ }
+ let r = t.in._zod.run(n, i);
+ return r instanceof Promise
+ ? r.then((a) => rd(a, t.out, i))
+ : rd(r, t.out, i);
+ });
+ });
+ function rd(e, t, n) {
+ return e.issues.length
+ ? ((e.aborted = !0), e)
+ : t._zod.run({value: e.value, issues: e.issues}, n);
+ }
+ Z.$ZodCodec = Te.$constructor('$ZodCodec', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'values', () => t.in._zod.values),
+ Ee.defineLazy(e._zod, 'optin', () => t.in._zod.optin),
+ Ee.defineLazy(e._zod, 'optout', () => t.out._zod.optout),
+ Ee.defineLazy(e._zod, 'propValues', () => t.in._zod.propValues),
+ (e._zod.parse = (n, i) => {
+ if ((i.direction || 'forward') === 'forward') {
+ let a = t.in._zod.run(n, i);
+ return a instanceof Promise
+ ? a.then((o) => id(o, t, i))
+ : id(a, t, i);
+ } else {
+ let a = t.out._zod.run(n, i);
+ return a instanceof Promise
+ ? a.then((o) => id(o, t, i))
+ : id(a, t, i);
+ }
+ });
+ });
+ function id(e, t, n) {
+ if (e.issues.length) return (e.aborted = !0), e;
+ if ((n.direction || 'forward') === 'forward') {
+ let r = t.transform(e.value, e);
+ return r instanceof Promise
+ ? r.then((a) => ad(e, a, t.out, n))
+ : ad(e, r, t.out, n);
+ } else {
+ let r = t.reverseTransform(e.value, e);
+ return r instanceof Promise
+ ? r.then((a) => ad(e, a, t.in, n))
+ : ad(e, r, t.in, n);
+ }
+ }
+ function ad(e, t, n, i) {
+ return e.issues.length
+ ? ((e.aborted = !0), e)
+ : n._zod.run({value: t, issues: e.issues}, i);
+ }
+ Z.$ZodReadonly = Te.$constructor('$ZodReadonly', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'propValues', () => t.innerType._zod.propValues),
+ Ee.defineLazy(e._zod, 'values', () => t.innerType._zod.values),
+ Ee.defineLazy(e._zod, 'optin', () => t.innerType?._zod?.optin),
+ Ee.defineLazy(e._zod, 'optout', () => t.innerType?._zod?.optout),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward') return t.innerType._zod.run(n, i);
+ let r = t.innerType._zod.run(n, i);
+ return r instanceof Promise ? r.then(vb) : vb(r);
+ });
+ });
+ function vb(e) {
+ return (e.value = Object.freeze(e.value)), e;
+ }
+ Z.$ZodTemplateLiteral = Te.$constructor('$ZodTemplateLiteral', (e, t) => {
+ Z.$ZodType.init(e, t);
+ let n = [];
+ for (let i of t.parts)
+ if (typeof i == 'object' && i !== null) {
+ if (!i._zod.pattern)
+ throw new Error(
+ `Invalid template literal part, no pattern found: ${[
+ ...i._zod.traits,
+ ].shift()}`
+ );
+ let r =
+ i._zod.pattern instanceof RegExp
+ ? i._zod.pattern.source
+ : i._zod.pattern;
+ if (!r)
+ throw new Error(`Invalid template literal part: ${i._zod.traits}`);
+ let a = r.startsWith('^') ? 1 : 0,
+ o = r.endsWith('$') ? r.length - 1 : r.length;
+ n.push(r.slice(a, o));
+ } else if (i === null || Ee.primitiveTypes.has(typeof i))
+ n.push(Ee.escapeRegex(`${i}`));
+ else throw new Error(`Invalid template literal part: ${i}`);
+ (e._zod.pattern = new RegExp(`^${n.join('')}$`)),
+ (e._zod.parse = (i, r) =>
+ typeof i.value != 'string'
+ ? (i.issues.push({
+ input: i.value,
+ inst: e,
+ expected: 'string',
+ code: 'invalid_type',
+ }),
+ i)
+ : ((e._zod.pattern.lastIndex = 0),
+ e._zod.pattern.test(i.value) ||
+ i.issues.push({
+ input: i.value,
+ inst: e,
+ code: 'invalid_format',
+ format: t.format ?? 'template_literal',
+ pattern: e._zod.pattern.source,
+ }),
+ i));
+ });
+ Z.$ZodFunction = Te.$constructor(
+ '$ZodFunction',
+ (e, t) => (
+ Z.$ZodType.init(e, t),
+ (e._def = t),
+ (e._zod.def = t),
+ (e.implement = (n) => {
+ if (typeof n != 'function')
+ throw new Error('implement() must be called with a function');
+ return function (...i) {
+ let r = e._def.input ? (0, ja.parse)(e._def.input, i) : i,
+ a = Reflect.apply(n, this, r);
+ return e._def.output ? (0, ja.parse)(e._def.output, a) : a;
+ };
+ }),
+ (e.implementAsync = (n) => {
+ if (typeof n != 'function')
+ throw new Error('implementAsync() must be called with a function');
+ return async function (...i) {
+ let r = e._def.input ? await (0, ja.parseAsync)(e._def.input, i) : i,
+ a = await Reflect.apply(n, this, r);
+ return e._def.output ? await (0, ja.parseAsync)(e._def.output, a) : a;
+ };
+ }),
+ (e._zod.parse = (n, i) =>
+ typeof n.value != 'function'
+ ? (n.issues.push({
+ code: 'invalid_type',
+ expected: 'function',
+ input: n.value,
+ inst: e,
+ }),
+ n)
+ : (e._def.output && e._def.output._zod.def.type === 'promise'
+ ? (n.value = e.implementAsync(n.value))
+ : (n.value = e.implement(n.value)),
+ n)),
+ (e.input = (...n) => {
+ let i = e.constructor;
+ return Array.isArray(n[0])
+ ? new i({
+ type: 'function',
+ input: new Z.$ZodTuple({type: 'tuple', items: n[0], rest: n[1]}),
+ output: e._def.output,
+ })
+ : new i({type: 'function', input: n[0], output: e._def.output});
+ }),
+ (e.output = (n) => {
+ let i = e.constructor;
+ return new i({type: 'function', input: e._def.input, output: n});
+ }),
+ e
+ )
+ );
+ Z.$ZodPromise = Te.$constructor('$ZodPromise', (e, t) => {
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) =>
+ Promise.resolve(n.value).then((r) =>
+ t.innerType._zod.run({value: r, issues: []}, i)
+ ));
+ });
+ Z.$ZodLazy = Te.$constructor('$ZodLazy', (e, t) => {
+ Z.$ZodType.init(e, t),
+ Ee.defineLazy(e._zod, 'innerType', () => t.getter()),
+ Ee.defineLazy(e._zod, 'pattern', () => e._zod.innerType?._zod?.pattern),
+ Ee.defineLazy(
+ e._zod,
+ 'propValues',
+ () => e._zod.innerType?._zod?.propValues
+ ),
+ Ee.defineLazy(
+ e._zod,
+ 'optin',
+ () => e._zod.innerType?._zod?.optin ?? void 0
+ ),
+ Ee.defineLazy(
+ e._zod,
+ 'optout',
+ () => e._zod.innerType?._zod?.optout ?? void 0
+ ),
+ (e._zod.parse = (n, i) => e._zod.innerType._zod.run(n, i));
+ });
+ Z.$ZodCustom = Te.$constructor('$ZodCustom', (e, t) => {
+ ld.$ZodCheck.init(e, t),
+ Z.$ZodType.init(e, t),
+ (e._zod.parse = (n, i) => n),
+ (e._zod.check = (n) => {
+ let i = n.value,
+ r = t.fn(i);
+ if (r instanceof Promise) return r.then((a) => hb(a, n, i, e));
+ hb(r, n, i, e);
+ });
+ });
+ function hb(e, t, n, i) {
+ if (!e) {
+ let r = {
+ code: 'custom',
+ input: n,
+ inst: i,
+ path: [...(i._zod.def.path ?? [])],
+ continue: !i._zod.def.abort,
+ };
+ i._zod.def.params && (r.params = i._zod.def.params),
+ t.issues.push(Ee.issue(r));
+ }
+ }
+});
+var Eb = xe((_r, Tb) => {
+ 'use strict';
+ var iO =
+ (_r && _r.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ aO =
+ (_r && _r.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ oO =
+ (_r && _r.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ iO(t, e, n);
+ return aO(t, e), t;
+ };
+ Object.defineProperty(_r, '__esModule', {value: !0});
+ _r.default = lO;
+ var cd = oO(ot()),
+ sO = () => {
+ let e = {
+ string: {
+ unit: '\u062D\u0631\u0641',
+ verb: '\u0623\u0646 \u064A\u062D\u0648\u064A',
+ },
+ file: {
+ unit: '\u0628\u0627\u064A\u062A',
+ verb: '\u0623\u0646 \u064A\u062D\u0648\u064A',
+ },
+ array: {
+ unit: '\u0639\u0646\u0635\u0631',
+ verb: '\u0623\u0646 \u064A\u062D\u0648\u064A',
+ },
+ set: {
+ unit: '\u0639\u0646\u0635\u0631',
+ verb: '\u0623\u0646 \u064A\u062D\u0648\u064A',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0645\u062F\u062E\u0644',
+ email:
+ '\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A',
+ url: '\u0631\u0627\u0628\u0637',
+ emoji: '\u0625\u064A\u0645\u0648\u062C\u064A',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ '\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO',
+ date: '\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO',
+ time: '\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO',
+ duration:
+ '\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO',
+ ipv4: '\u0639\u0646\u0648\u0627\u0646 IPv4',
+ ipv6: '\u0639\u0646\u0648\u0627\u0646 IPv6',
+ cidrv4:
+ '\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4',
+ cidrv6:
+ '\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6',
+ base64:
+ '\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded',
+ base64url:
+ '\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded',
+ json_string:
+ '\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON',
+ e164: '\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164',
+ jwt: 'JWT',
+ template_literal: '\u0645\u062F\u062E\u0644',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = cd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`
+ : `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${cd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${cd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? ` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${
+ r.origin ?? '\u0627\u0644\u0642\u064A\u0645\u0629'
+ } ${a} ${r.maximum.toString()} ${
+ o.unit ?? '\u0639\u0646\u0635\u0631'
+ }`
+ : `\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${
+ r.origin ?? '\u0627\u0644\u0642\u064A\u0645\u0629'
+ } ${a} ${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${
+ r.origin
+ } \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${r.minimum.toString()} ${
+ o.unit
+ }`
+ : `\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${
+ r.origin
+ } \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`
+ : `${
+ n[a.format] ?? r.format
+ } \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`;
+ }
+ case 'not_multiple_of':
+ return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u0645\u0639\u0631\u0641${
+ r.keys.length > 1 ? '\u0627\u062A' : ''
+ } \u063A\u0631\u064A\u0628${
+ r.keys.length > 1 ? '\u0629' : ''
+ }: ${cd.joinValues(r.keys, '\u060C ')}`;
+ case 'invalid_key':
+ return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;
+ case 'invalid_union':
+ return '\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644';
+ case 'invalid_element':
+ return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;
+ default:
+ return '\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644';
+ }
+ };
+ };
+ function lO() {
+ return {localeError: sO()};
+ }
+ Tb.exports = _r.default;
+});
+var Pb = xe((Tr, Ib) => {
+ 'use strict';
+ var cO =
+ (Tr && Tr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ uO =
+ (Tr && Tr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ dO =
+ (Tr && Tr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ cO(t, e, n);
+ return uO(t, e), t;
+ };
+ Object.defineProperty(Tr, '__esModule', {value: !0});
+ Tr.default = pO;
+ var ud = dO(ot()),
+ fO = () => {
+ let e = {
+ string: {unit: 'simvol', verb: 'olmal\u0131d\u0131r'},
+ file: {unit: 'bayt', verb: 'olmal\u0131d\u0131r'},
+ array: {unit: 'element', verb: 'olmal\u0131d\u0131r'},
+ set: {unit: 'element', verb: 'olmal\u0131d\u0131r'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'email address',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO datetime',
+ date: 'ISO date',
+ time: 'ISO time',
+ duration: 'ISO duration',
+ ipv4: 'IPv4 address',
+ ipv6: 'IPv6 address',
+ cidrv4: 'IPv4 range',
+ cidrv6: 'IPv6 range',
+ base64: 'base64-encoded string',
+ base64url: 'base64url-encoded string',
+ json_string: 'JSON string',
+ e164: 'E.164 number',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = ud.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${s}`
+ : `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ud.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${ud.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${
+ r.origin ?? 'd\u0259y\u0259r'
+ } ${a}${r.maximum.toString()} ${o.unit ?? 'element'}`
+ : `\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${
+ r.origin ?? 'd\u0259y\u0259r'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${
+ r.origin
+ } ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`
+ : a.format === 'ends_with'
+ ? `Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`
+ : a.format === 'includes'
+ ? `Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`
+ : a.format === 'regex'
+ ? `Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`
+ : `Yanl\u0131\u015F ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;
+ case 'unrecognized_keys':
+ return `Tan\u0131nmayan a\xE7ar${
+ r.keys.length > 1 ? 'lar' : ''
+ }: ${ud.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;
+ case 'invalid_union':
+ return 'Yanl\u0131\u015F d\u0259y\u0259r';
+ case 'invalid_element':
+ return `${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;
+ default:
+ return 'Yanl\u0131\u015F d\u0259y\u0259r';
+ }
+ };
+ };
+ function pO() {
+ return {localeError: fO()};
+ }
+ Ib.exports = Tr.default;
+});
+var Ob = xe((Er, wb) => {
+ 'use strict';
+ var mO =
+ (Er && Er.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ yO =
+ (Er && Er.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ gO =
+ (Er && Er.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ mO(t, e, n);
+ return yO(t, e), t;
+ };
+ Object.defineProperty(Er, '__esModule', {value: !0});
+ Er.default = hO;
+ var dd = gO(ot());
+ function xb(e, t, n, i) {
+ let r = Math.abs(e),
+ a = r % 10,
+ o = r % 100;
+ return o >= 11 && o <= 19 ? i : a === 1 ? t : a >= 2 && a <= 4 ? n : i;
+ }
+ var vO = () => {
+ let e = {
+ string: {
+ unit: {
+ one: '\u0441\u0456\u043C\u0432\u0430\u043B',
+ few: '\u0441\u0456\u043C\u0432\u0430\u043B\u044B',
+ many: '\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E',
+ },
+ verb: '\u043C\u0435\u0446\u044C',
+ },
+ array: {
+ unit: {
+ one: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442',
+ few: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B',
+ many: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E',
+ },
+ verb: '\u043C\u0435\u0446\u044C',
+ },
+ set: {
+ unit: {
+ one: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442',
+ few: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B',
+ many: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E',
+ },
+ verb: '\u043C\u0435\u0446\u044C',
+ },
+ file: {
+ unit: {
+ one: '\u0431\u0430\u0439\u0442',
+ few: '\u0431\u0430\u0439\u0442\u044B',
+ many: '\u0431\u0430\u0439\u0442\u0430\u045E',
+ },
+ verb: '\u043C\u0435\u0446\u044C',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0443\u0432\u043E\u0434',
+ email: 'email \u0430\u0434\u0440\u0430\u0441',
+ url: 'URL',
+ emoji: '\u044D\u043C\u043E\u0434\u0437\u0456',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441',
+ date: 'ISO \u0434\u0430\u0442\u0430',
+ time: 'ISO \u0447\u0430\u0441',
+ duration:
+ 'ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C',
+ ipv4: 'IPv4 \u0430\u0434\u0440\u0430\u0441',
+ ipv6: 'IPv6 \u0430\u0434\u0440\u0430\u0441',
+ cidrv4: 'IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D',
+ cidrv6: 'IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D',
+ base64:
+ '\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64',
+ base64url:
+ '\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url',
+ json_string: 'JSON \u0440\u0430\u0434\u043E\u043A',
+ e164: '\u043D\u0443\u043C\u0430\u0440 E.164',
+ jwt: 'JWT',
+ template_literal: '\u0443\u0432\u043E\u0434',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u043B\u0456\u043A',
+ array: '\u043C\u0430\u0441\u0456\u045E',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = dd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`
+ : `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${dd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${dd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.maximum),
+ l = xb(s, o.unit.one, o.unit.few, o.unit.many);
+ return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435'
+ } \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${
+ o.verb
+ } ${a}${r.maximum.toString()} ${l}`;
+ }
+ return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435'
+ } \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.minimum),
+ l = xb(s, o.unit.one, o.unit.few, o.unit.many);
+ return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${
+ r.origin
+ } \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${
+ o.verb
+ } ${a}${r.minimum.toString()} ${l}`;
+ }
+ return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${
+ r.origin
+ } \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`
+ : `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${
+ r.keys.length > 1
+ ? '\u043A\u043B\u044E\u0447\u044B'
+ : '\u043A\u043B\u044E\u0447'
+ }: ${dd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;
+ case 'invalid_union':
+ return '\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434';
+ case 'invalid_element':
+ return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;
+ default:
+ return '\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434';
+ }
+ };
+ };
+ function hO() {
+ return {localeError: vO()};
+ }
+ wb.exports = Er.default;
+});
+var jb = xe((Ir, $b) => {
+ 'use strict';
+ var bO =
+ (Ir && Ir.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ kO =
+ (Ir && Ir.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ SO =
+ (Ir && Ir.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ bO(t, e, n);
+ return kO(t, e), t;
+ };
+ Object.defineProperty(Ir, '__esModule', {value: !0});
+ Ir.default = TO;
+ var fd = SO(ot()),
+ _O = () => {
+ let e = {
+ string: {
+ unit: '\u0441\u0438\u043C\u0432\u043E\u043B\u0430',
+ verb: '\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430',
+ },
+ file: {
+ unit: '\u0431\u0430\u0439\u0442\u0430',
+ verb: '\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430',
+ },
+ array: {
+ unit: '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430',
+ verb: '\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430',
+ },
+ set: {
+ unit: '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430',
+ verb: '\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0432\u0445\u043E\u0434',
+ email:
+ '\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441',
+ url: 'URL',
+ emoji: '\u0435\u043C\u043E\u0434\u0436\u0438',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO \u0432\u0440\u0435\u043C\u0435',
+ date: 'ISO \u0434\u0430\u0442\u0430',
+ time: 'ISO \u0432\u0440\u0435\u043C\u0435',
+ duration:
+ 'ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442',
+ ipv4: 'IPv4 \u0430\u0434\u0440\u0435\u0441',
+ ipv6: 'IPv6 \u0430\u0434\u0440\u0435\u0441',
+ cidrv4: 'IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D',
+ cidrv6: 'IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D',
+ base64:
+ 'base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437',
+ base64url:
+ 'base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437',
+ json_string: 'JSON \u043D\u0438\u0437',
+ e164: 'E.164 \u043D\u043E\u043C\u0435\u0440',
+ jwt: 'JWT',
+ template_literal: '\u0432\u0445\u043E\u0434',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0447\u0438\u0441\u043B\u043E',
+ array: '\u043C\u0430\u0441\u0438\u0432',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = fd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`
+ : `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${fd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${fd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${
+ r.origin ?? '\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442'
+ } \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430'
+ }`
+ : `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${
+ r.origin ?? '\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442'
+ } \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${
+ r.origin
+ } \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${r.minimum.toString()} ${
+ o.unit
+ }`
+ : `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${
+ r.origin
+ } \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ if (a.format === 'starts_with')
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;
+ if (a.format === 'ends_with')
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;
+ if (a.format === 'includes')
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;
+ if (a.format === 'regex')
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;
+ let o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D';
+ return (
+ a.format === 'emoji' &&
+ (o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E'),
+ a.format === 'datetime' &&
+ (o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E'),
+ a.format === 'date' &&
+ (o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430'),
+ a.format === 'time' &&
+ (o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E'),
+ a.format === 'duration' &&
+ (o = '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430'),
+ `${o} ${n[a.format] ?? r.format}`
+ );
+ }
+ case 'not_multiple_of':
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${
+ r.keys.length > 1 ? '\u0438' : ''
+ } \u043A\u043B\u044E\u0447${
+ r.keys.length > 1 ? '\u043E\u0432\u0435' : ''
+ }: ${fd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;
+ case 'invalid_union':
+ return '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434';
+ case 'invalid_element':
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;
+ default:
+ return '\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434';
+ }
+ };
+ };
+ function TO() {
+ return {localeError: _O()};
+ }
+ $b.exports = Ir.default;
+});
+var Db = xe((Pr, Cb) => {
+ 'use strict';
+ var EO =
+ (Pr && Pr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ IO =
+ (Pr && Pr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ PO =
+ (Pr && Pr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ EO(t, e, n);
+ return IO(t, e), t;
+ };
+ Object.defineProperty(Pr, '__esModule', {value: !0});
+ Pr.default = wO;
+ var pd = PO(ot()),
+ xO = () => {
+ let e = {
+ string: {unit: 'car\xE0cters', verb: 'contenir'},
+ file: {unit: 'bytes', verb: 'contenir'},
+ array: {unit: 'elements', verb: 'contenir'},
+ set: {unit: 'elements', verb: 'contenir'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'entrada',
+ email: 'adre\xE7a electr\xF2nica',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'data i hora ISO',
+ date: 'data ISO',
+ time: 'hora ISO',
+ duration: 'durada ISO',
+ ipv4: 'adre\xE7a IPv4',
+ ipv6: 'adre\xE7a IPv6',
+ cidrv4: 'rang IPv4',
+ cidrv6: 'rang IPv6',
+ base64: 'cadena codificada en base64',
+ base64url: 'cadena codificada en base64url',
+ json_string: 'cadena JSON',
+ e164: 'n\xFAmero E.164',
+ jwt: 'JWT',
+ template_literal: 'entrada',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = pd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`
+ : `Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Valor inv\xE0lid: s'esperava ${pd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Opci\xF3 inv\xE0lida: s'esperava una de ${pd.joinValues(
+ r.values,
+ ' o '
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? 'com a m\xE0xim' : 'menys de',
+ o = t(r.origin);
+ return o
+ ? `Massa gran: s'esperava que ${
+ r.origin ?? 'el valor'
+ } contingu\xE9s ${a} ${r.maximum.toString()} ${
+ o.unit ?? 'elements'
+ }`
+ : `Massa gran: s'esperava que ${
+ r.origin ?? 'el valor'
+ } fos ${a} ${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? 'com a m\xEDnim' : 'm\xE9s de',
+ o = t(r.origin);
+ return o
+ ? `Massa petit: s'esperava que ${
+ r.origin
+ } contingu\xE9s ${a} ${r.minimum.toString()} ${o.unit}`
+ : `Massa petit: s'esperava que ${
+ r.origin
+ } fos ${a} ${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Format inv\xE0lid: ha d'incloure "${a.includes}"`
+ : a.format === 'regex'
+ ? `Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`
+ : `Format inv\xE0lid per a ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Clau${r.keys.length > 1 ? 's' : ''} no reconeguda${
+ r.keys.length > 1 ? 's' : ''
+ }: ${pd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Clau inv\xE0lida a ${r.origin}`;
+ case 'invalid_union':
+ return 'Entrada inv\xE0lida';
+ case 'invalid_element':
+ return `Element inv\xE0lid a ${r.origin}`;
+ default:
+ return 'Entrada inv\xE0lida';
+ }
+ };
+ };
+ function wO() {
+ return {localeError: xO()};
+ }
+ Cb.exports = Pr.default;
+});
+var Mb = xe((xr, Ab) => {
+ 'use strict';
+ var OO =
+ (xr && xr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ $O =
+ (xr && xr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ jO =
+ (xr && xr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ OO(t, e, n);
+ return $O(t, e), t;
+ };
+ Object.defineProperty(xr, '__esModule', {value: !0});
+ xr.default = DO;
+ var md = jO(ot()),
+ CO = () => {
+ let e = {
+ string: {unit: 'znak\u016F', verb: 'm\xEDt'},
+ file: {unit: 'bajt\u016F', verb: 'm\xEDt'},
+ array: {unit: 'prvk\u016F', verb: 'm\xEDt'},
+ set: {unit: 'prvk\u016F', verb: 'm\xEDt'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'regul\xE1rn\xED v\xFDraz',
+ email: 'e-mailov\xE1 adresa',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'datum a \u010Das ve form\xE1tu ISO',
+ date: 'datum ve form\xE1tu ISO',
+ time: '\u010Das ve form\xE1tu ISO',
+ duration: 'doba trv\xE1n\xED ISO',
+ ipv4: 'IPv4 adresa',
+ ipv6: 'IPv6 adresa',
+ cidrv4: 'rozsah IPv4',
+ cidrv6: 'rozsah IPv6',
+ base64: '\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64',
+ base64url:
+ '\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url',
+ json_string: '\u0159et\u011Bzec ve form\xE1tu JSON',
+ e164: '\u010D\xEDslo E.164',
+ jwt: 'JWT',
+ template_literal: 'vstup',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u010D\xEDslo',
+ string: '\u0159et\u011Bzec',
+ function: 'funkce',
+ array: 'pole',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = md.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${s}`
+ : `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${md.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${md.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${
+ r.origin ?? 'hodnota'
+ } mus\xED m\xEDt ${a}${r.maximum.toString()} ${
+ o.unit ?? 'prvk\u016F'
+ }`
+ : `Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${
+ r.origin ?? 'hodnota'
+ } mus\xED b\xFDt ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${
+ r.origin ?? 'hodnota'
+ } mus\xED m\xEDt ${a}${r.minimum.toString()} ${
+ o.unit ?? 'prvk\u016F'
+ }`
+ : `Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${
+ r.origin ?? 'hodnota'
+ } mus\xED b\xFDt ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`
+ : a.format === 'regex'
+ ? `Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`
+ : `Neplatn\xFD form\xE1t ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Nezn\xE1m\xE9 kl\xED\u010De: ${md.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `Neplatn\xFD kl\xED\u010D v ${r.origin}`;
+ case 'invalid_union':
+ return 'Neplatn\xFD vstup';
+ case 'invalid_element':
+ return `Neplatn\xE1 hodnota v ${r.origin}`;
+ default:
+ return 'Neplatn\xFD vstup';
+ }
+ };
+ };
+ function DO() {
+ return {localeError: CO()};
+ }
+ Ab.exports = xr.default;
+});
+var Rb = xe((wr, Nb) => {
+ 'use strict';
+ var AO =
+ (wr && wr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ MO =
+ (wr && wr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ NO =
+ (wr && wr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ AO(t, e, n);
+ return MO(t, e), t;
+ };
+ Object.defineProperty(wr, '__esModule', {value: !0});
+ wr.default = LO;
+ var yd = NO(ot()),
+ RO = () => {
+ let e = {
+ string: {unit: 'tegn', verb: 'havde'},
+ file: {unit: 'bytes', verb: 'havde'},
+ array: {unit: 'elementer', verb: 'indeholdt'},
+ set: {unit: 'elementer', verb: 'indeholdt'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'e-mailadresse',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO dato- og klokkesl\xE6t',
+ date: 'ISO-dato',
+ time: 'ISO-klokkesl\xE6t',
+ duration: 'ISO-varighed',
+ ipv4: 'IPv4-omr\xE5de',
+ ipv6: 'IPv6-omr\xE5de',
+ cidrv4: 'IPv4-spektrum',
+ cidrv6: 'IPv6-spektrum',
+ base64: 'base64-kodet streng',
+ base64url: 'base64url-kodet streng',
+ json_string: 'JSON-streng',
+ e164: 'E.164-nummer',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {
+ nan: 'NaN',
+ string: 'streng',
+ number: 'tal',
+ boolean: 'boolean',
+ array: 'liste',
+ object: 'objekt',
+ set: 's\xE6t',
+ file: 'fil',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = yd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`
+ : `Ugyldigt input: forventede ${a}, fik ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ugyldig v\xE6rdi: forventede ${yd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Ugyldigt valg: forventede en af f\xF8lgende ${yd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin),
+ s = i[r.origin] ?? r.origin;
+ return o
+ ? `For stor: forventede ${s ?? 'value'} ${
+ o.verb
+ } ${a} ${r.maximum.toString()} ${o.unit ?? 'elementer'}`
+ : `For stor: forventede ${
+ s ?? 'value'
+ } havde ${a} ${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin),
+ s = i[r.origin] ?? r.origin;
+ return o
+ ? `For lille: forventede ${s} ${
+ o.verb
+ } ${a} ${r.minimum.toString()} ${o.unit}`
+ : `For lille: forventede ${s} havde ${a} ${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ugyldig streng: skal starte med "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Ugyldig streng: skal ende med "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Ugyldig streng: skal indeholde "${a.includes}"`
+ : a.format === 'regex'
+ ? `Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`
+ : `Ugyldig ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1 ? 'Ukendte n\xF8gler' : 'Ukendt n\xF8gle'
+ }: ${yd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Ugyldig n\xF8gle i ${r.origin}`;
+ case 'invalid_union':
+ return 'Ugyldigt input: matcher ingen af de tilladte typer';
+ case 'invalid_element':
+ return `Ugyldig v\xE6rdi i ${r.origin}`;
+ default:
+ return 'Ugyldigt input';
+ }
+ };
+ };
+ function LO() {
+ return {localeError: RO()};
+ }
+ Nb.exports = wr.default;
+});
+var Fb = xe((Or, Lb) => {
+ 'use strict';
+ var FO =
+ (Or && Or.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ zO =
+ (Or && Or.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ BO =
+ (Or && Or.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ FO(t, e, n);
+ return zO(t, e), t;
+ };
+ Object.defineProperty(Or, '__esModule', {value: !0});
+ Or.default = ZO;
+ var gd = BO(ot()),
+ UO = () => {
+ let e = {
+ string: {unit: 'Zeichen', verb: 'zu haben'},
+ file: {unit: 'Bytes', verb: 'zu haben'},
+ array: {unit: 'Elemente', verb: 'zu haben'},
+ set: {unit: 'Elemente', verb: 'zu haben'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'Eingabe',
+ email: 'E-Mail-Adresse',
+ url: 'URL',
+ emoji: 'Emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO-Datum und -Uhrzeit',
+ date: 'ISO-Datum',
+ time: 'ISO-Uhrzeit',
+ duration: 'ISO-Dauer',
+ ipv4: 'IPv4-Adresse',
+ ipv6: 'IPv6-Adresse',
+ cidrv4: 'IPv4-Bereich',
+ cidrv6: 'IPv6-Bereich',
+ base64: 'Base64-codierter String',
+ base64url: 'Base64-URL-codierter String',
+ json_string: 'JSON-String',
+ e164: 'E.164-Nummer',
+ jwt: 'JWT',
+ template_literal: 'Eingabe',
+ },
+ i = {nan: 'NaN', number: 'Zahl', array: 'Array'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = gd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`
+ : `Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ung\xFCltige Eingabe: erwartet ${gd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Ung\xFCltige Option: erwartet eine von ${gd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Zu gro\xDF: erwartet, dass ${
+ r.origin ?? 'Wert'
+ } ${a}${r.maximum.toString()} ${o.unit ?? 'Elemente'} hat`
+ : `Zu gro\xDF: erwartet, dass ${
+ r.origin ?? 'Wert'
+ } ${a}${r.maximum.toString()} ist`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Zu klein: erwartet, dass ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit} hat`
+ : `Zu klein: erwartet, dass ${
+ r.origin
+ } ${a}${r.minimum.toString()} ist`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`
+ : a.format === 'ends_with'
+ ? `Ung\xFCltiger String: muss mit "${a.suffix}" enden`
+ : a.format === 'includes'
+ ? `Ung\xFCltiger String: muss "${a.includes}" enthalten`
+ : a.format === 'regex'
+ ? `Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`
+ : `Ung\xFCltig: ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1
+ ? 'Unbekannte Schl\xFCssel'
+ : 'Unbekannter Schl\xFCssel'
+ }: ${gd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Ung\xFCltiger Schl\xFCssel in ${r.origin}`;
+ case 'invalid_union':
+ return 'Ung\xFCltige Eingabe';
+ case 'invalid_element':
+ return `Ung\xFCltiger Wert in ${r.origin}`;
+ default:
+ return 'Ung\xFCltige Eingabe';
+ }
+ };
+ };
+ function ZO() {
+ return {localeError: UO()};
+ }
+ Lb.exports = Or.default;
+});
+var Yy = xe(($r, zb) => {
+ 'use strict';
+ var qO =
+ ($r && $r.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ KO =
+ ($r && $r.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ VO =
+ ($r && $r.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ qO(t, e, n);
+ return KO(t, e), t;
+ };
+ Object.defineProperty($r, '__esModule', {value: !0});
+ $r.default = HO;
+ var vd = VO(ot()),
+ JO = () => {
+ let e = {
+ string: {unit: 'characters', verb: 'to have'},
+ file: {unit: 'bytes', verb: 'to have'},
+ array: {unit: 'items', verb: 'to have'},
+ set: {unit: 'items', verb: 'to have'},
+ map: {unit: 'entries', verb: 'to have'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'email address',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO datetime',
+ date: 'ISO date',
+ time: 'ISO time',
+ duration: 'ISO duration',
+ ipv4: 'IPv4 address',
+ ipv6: 'IPv6 address',
+ mac: 'MAC address',
+ cidrv4: 'IPv4 range',
+ cidrv6: 'IPv6 range',
+ base64: 'base64-encoded string',
+ base64url: 'base64url-encoded string',
+ json_string: 'JSON string',
+ e164: 'E.164 number',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = vd.parsedType(r.input),
+ s = i[o] ?? o;
+ return `Invalid input: expected ${a}, received ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Invalid input: expected ${vd.stringifyPrimitive(r.values[0])}`
+ : `Invalid option: expected one of ${vd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Too big: expected ${
+ r.origin ?? 'value'
+ } to have ${a}${r.maximum.toString()} ${o.unit ?? 'elements'}`
+ : `Too big: expected ${
+ r.origin ?? 'value'
+ } to be ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Too small: expected ${
+ r.origin
+ } to have ${a}${r.minimum.toString()} ${o.unit}`
+ : `Too small: expected ${
+ r.origin
+ } to be ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Invalid string: must start with "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Invalid string: must end with "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Invalid string: must include "${a.includes}"`
+ : a.format === 'regex'
+ ? `Invalid string: must match pattern ${a.pattern}`
+ : `Invalid ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Invalid number: must be a multiple of ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Unrecognized key${
+ r.keys.length > 1 ? 's' : ''
+ }: ${vd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Invalid key in ${r.origin}`;
+ case 'invalid_union':
+ return 'Invalid input';
+ case 'invalid_element':
+ return `Invalid value in ${r.origin}`;
+ default:
+ return 'Invalid input';
+ }
+ };
+ };
+ function HO() {
+ return {localeError: JO()};
+ }
+ zb.exports = $r.default;
+});
+var Ub = xe((jr, Bb) => {
+ 'use strict';
+ var WO =
+ (jr && jr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ GO =
+ (jr && jr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ XO =
+ (jr && jr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ WO(t, e, n);
+ return GO(t, e), t;
+ };
+ Object.defineProperty(jr, '__esModule', {value: !0});
+ jr.default = QO;
+ var hd = XO(ot()),
+ YO = () => {
+ let e = {
+ string: {unit: 'karaktrojn', verb: 'havi'},
+ file: {unit: 'bajtojn', verb: 'havi'},
+ array: {unit: 'elementojn', verb: 'havi'},
+ set: {unit: 'elementojn', verb: 'havi'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'enigo',
+ email: 'retadreso',
+ url: 'URL',
+ emoji: 'emo\u011Dio',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO-datotempo',
+ date: 'ISO-dato',
+ time: 'ISO-tempo',
+ duration: 'ISO-da\u016Dro',
+ ipv4: 'IPv4-adreso',
+ ipv6: 'IPv6-adreso',
+ cidrv4: 'IPv4-rango',
+ cidrv6: 'IPv6-rango',
+ base64: '64-ume kodita karaktraro',
+ base64url: 'URL-64-ume kodita karaktraro',
+ json_string: 'JSON-karaktraro',
+ e164: 'E.164-nombro',
+ jwt: 'JWT',
+ template_literal: 'enigo',
+ },
+ i = {nan: 'NaN', number: 'nombro', array: 'tabelo', null: 'senvalora'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = hd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${s}`
+ : `Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Nevalida enigo: atendi\u011Dis ${hd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Nevalida opcio: atendi\u011Dis unu el ${hd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Tro granda: atendi\u011Dis ke ${
+ r.origin ?? 'valoro'
+ } havu ${a}${r.maximum.toString()} ${o.unit ?? 'elementojn'}`
+ : `Tro granda: atendi\u011Dis ke ${
+ r.origin ?? 'valoro'
+ } havu ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Tro malgranda: atendi\u011Dis ke ${
+ r.origin
+ } havu ${a}${r.minimum.toString()} ${o.unit}`
+ : `Tro malgranda: atendi\u011Dis ke ${
+ r.origin
+ } estu ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Nevalida karaktraro: devas inkluzivi "${a.includes}"`
+ : a.format === 'regex'
+ ? `Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`
+ : `Nevalida ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Nevalida nombro: devas esti oblo de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Nekonata${r.keys.length > 1 ? 'j' : ''} \u015Dlosilo${
+ r.keys.length > 1 ? 'j' : ''
+ }: ${hd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Nevalida \u015Dlosilo en ${r.origin}`;
+ case 'invalid_union':
+ return 'Nevalida enigo';
+ case 'invalid_element':
+ return `Nevalida valoro en ${r.origin}`;
+ default:
+ return 'Nevalida enigo';
+ }
+ };
+ };
+ function QO() {
+ return {localeError: YO()};
+ }
+ Bb.exports = jr.default;
+});
+var qb = xe((Cr, Zb) => {
+ 'use strict';
+ var e$ =
+ (Cr && Cr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ t$ =
+ (Cr && Cr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ n$ =
+ (Cr && Cr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ e$(t, e, n);
+ return t$(t, e), t;
+ };
+ Object.defineProperty(Cr, '__esModule', {value: !0});
+ Cr.default = i$;
+ var bd = n$(ot()),
+ r$ = () => {
+ let e = {
+ string: {unit: 'caracteres', verb: 'tener'},
+ file: {unit: 'bytes', verb: 'tener'},
+ array: {unit: 'elementos', verb: 'tener'},
+ set: {unit: 'elementos', verb: 'tener'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'entrada',
+ email: 'direcci\xF3n de correo electr\xF3nico',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'fecha y hora ISO',
+ date: 'fecha ISO',
+ time: 'hora ISO',
+ duration: 'duraci\xF3n ISO',
+ ipv4: 'direcci\xF3n IPv4',
+ ipv6: 'direcci\xF3n IPv6',
+ cidrv4: 'rango IPv4',
+ cidrv6: 'rango IPv6',
+ base64: 'cadena codificada en base64',
+ base64url: 'URL codificada en base64',
+ json_string: 'cadena JSON',
+ e164: 'n\xFAmero E.164',
+ jwt: 'JWT',
+ template_literal: 'entrada',
+ },
+ i = {
+ nan: 'NaN',
+ string: 'texto',
+ number: 'n\xFAmero',
+ boolean: 'booleano',
+ array: 'arreglo',
+ object: 'objeto',
+ set: 'conjunto',
+ file: 'archivo',
+ date: 'fecha',
+ bigint: 'n\xFAmero grande',
+ symbol: 's\xEDmbolo',
+ undefined: 'indefinido',
+ null: 'nulo',
+ function: 'funci\xF3n',
+ map: 'mapa',
+ record: 'registro',
+ tuple: 'tupla',
+ enum: 'enumeraci\xF3n',
+ union: 'uni\xF3n',
+ literal: 'literal',
+ promise: 'promesa',
+ void: 'vac\xEDo',
+ never: 'nunca',
+ unknown: 'desconocido',
+ any: 'cualquiera',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = bd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${s}`
+ : `Entrada inv\xE1lida: se esperaba ${a}, recibido ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Entrada inv\xE1lida: se esperaba ${bd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Opci\xF3n inv\xE1lida: se esperaba una de ${bd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin),
+ s = i[r.origin] ?? r.origin;
+ return o
+ ? `Demasiado grande: se esperaba que ${
+ s ?? 'valor'
+ } tuviera ${a}${r.maximum.toString()} ${o.unit ?? 'elementos'}`
+ : `Demasiado grande: se esperaba que ${
+ s ?? 'valor'
+ } fuera ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin),
+ s = i[r.origin] ?? r.origin;
+ return o
+ ? `Demasiado peque\xF1o: se esperaba que ${s} tuviera ${a}${r.minimum.toString()} ${
+ o.unit
+ }`
+ : `Demasiado peque\xF1o: se esperaba que ${s} fuera ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Cadena inv\xE1lida: debe terminar en "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Cadena inv\xE1lida: debe incluir "${a.includes}"`
+ : a.format === 'regex'
+ ? `Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`
+ : `Inv\xE1lido ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Llave${r.keys.length > 1 ? 's' : ''} desconocida${
+ r.keys.length > 1 ? 's' : ''
+ }: ${bd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Llave inv\xE1lida en ${i[r.origin] ?? r.origin}`;
+ case 'invalid_union':
+ return 'Entrada inv\xE1lida';
+ case 'invalid_element':
+ return `Valor inv\xE1lido en ${i[r.origin] ?? r.origin}`;
+ default:
+ return 'Entrada inv\xE1lida';
+ }
+ };
+ };
+ function i$() {
+ return {localeError: r$()};
+ }
+ Zb.exports = Cr.default;
+});
+var Vb = xe((Dr, Kb) => {
+ 'use strict';
+ var a$ =
+ (Dr && Dr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ o$ =
+ (Dr && Dr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ s$ =
+ (Dr && Dr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ a$(t, e, n);
+ return o$(t, e), t;
+ };
+ Object.defineProperty(Dr, '__esModule', {value: !0});
+ Dr.default = c$;
+ var kd = s$(ot()),
+ l$ = () => {
+ let e = {
+ string: {
+ unit: '\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631',
+ verb: '\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F',
+ },
+ file: {
+ unit: '\u0628\u0627\u06CC\u062A',
+ verb: '\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F',
+ },
+ array: {
+ unit: '\u0622\u06CC\u062A\u0645',
+ verb: '\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F',
+ },
+ set: {
+ unit: '\u0622\u06CC\u062A\u0645',
+ verb: '\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0648\u0631\u0648\u062F\u06CC',
+ email: '\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644',
+ url: 'URL',
+ emoji: '\u0627\u06CC\u0645\u0648\u062C\u06CC',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ '\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648',
+ date: '\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648',
+ time: '\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648',
+ duration:
+ '\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648',
+ ipv4: 'IPv4 \u0622\u062F\u0631\u0633',
+ ipv6: 'IPv6 \u0622\u062F\u0631\u0633',
+ cidrv4: 'IPv4 \u062F\u0627\u0645\u0646\u0647',
+ cidrv6: 'IPv6 \u062F\u0627\u0645\u0646\u0647',
+ base64: 'base64-encoded \u0631\u0634\u062A\u0647',
+ base64url: 'base64url-encoded \u0631\u0634\u062A\u0647',
+ json_string: 'JSON \u0631\u0634\u062A\u0647',
+ e164: 'E.164 \u0639\u062F\u062F',
+ jwt: 'JWT',
+ template_literal: '\u0648\u0631\u0648\u062F\u06CC',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0639\u062F\u062F',
+ array: '\u0622\u0631\u0627\u06CC\u0647',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = kd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`
+ : `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${kd.stringifyPrimitive(
+ r.values[0]
+ )} \u0645\u06CC\u200C\u0628\u0648\u062F`
+ : `\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${kd.joinValues(
+ r.values,
+ '|'
+ )} \u0645\u06CC\u200C\u0628\u0648\u062F`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${
+ r.origin ?? '\u0645\u0642\u062F\u0627\u0631'
+ } \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u0639\u0646\u0635\u0631'
+ } \u0628\u0627\u0634\u062F`
+ : `\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${
+ r.origin ?? '\u0645\u0642\u062F\u0627\u0631'
+ } \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} \u0628\u0627\u0634\u062F`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${
+ r.origin
+ } \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} ${
+ o.unit
+ } \u0628\u0627\u0634\u062F`
+ : `\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${
+ r.origin
+ } \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} \u0628\u0627\u0634\u062F`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`
+ : a.format === 'ends_with'
+ ? `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`
+ : a.format === 'includes'
+ ? `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`
+ : a.format === 'regex'
+ ? `\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`
+ : `${
+ n[a.format] ?? r.format
+ } \u0646\u0627\u0645\u0639\u062A\u0628\u0631`;
+ }
+ case 'not_multiple_of':
+ return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;
+ case 'unrecognized_keys':
+ return `\u06A9\u0644\u06CC\u062F${
+ r.keys.length > 1 ? '\u0647\u0627\u06CC' : ''
+ } \u0646\u0627\u0634\u0646\u0627\u0633: ${kd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;
+ case 'invalid_union':
+ return '\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631';
+ case 'invalid_element':
+ return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;
+ default:
+ return '\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631';
+ }
+ };
+ };
+ function c$() {
+ return {localeError: l$()};
+ }
+ Kb.exports = Dr.default;
+});
+var Hb = xe((Ar, Jb) => {
+ 'use strict';
+ var u$ =
+ (Ar && Ar.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ d$ =
+ (Ar && Ar.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ f$ =
+ (Ar && Ar.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ u$(t, e, n);
+ return d$(t, e), t;
+ };
+ Object.defineProperty(Ar, '__esModule', {value: !0});
+ Ar.default = m$;
+ var Sd = f$(ot()),
+ p$ = () => {
+ let e = {
+ string: {unit: 'merkki\xE4', subject: 'merkkijonon'},
+ file: {unit: 'tavua', subject: 'tiedoston'},
+ array: {unit: 'alkiota', subject: 'listan'},
+ set: {unit: 'alkiota', subject: 'joukon'},
+ number: {unit: '', subject: 'luvun'},
+ bigint: {unit: '', subject: 'suuren kokonaisluvun'},
+ int: {unit: '', subject: 'kokonaisluvun'},
+ date: {unit: '', subject: 'p\xE4iv\xE4m\xE4\xE4r\xE4n'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 's\xE4\xE4nn\xF6llinen lauseke',
+ email: 's\xE4hk\xF6postiosoite',
+ url: 'URL-osoite',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO-aikaleima',
+ date: 'ISO-p\xE4iv\xE4m\xE4\xE4r\xE4',
+ time: 'ISO-aika',
+ duration: 'ISO-kesto',
+ ipv4: 'IPv4-osoite',
+ ipv6: 'IPv6-osoite',
+ cidrv4: 'IPv4-alue',
+ cidrv6: 'IPv6-alue',
+ base64: 'base64-koodattu merkkijono',
+ base64url: 'base64url-koodattu merkkijono',
+ json_string: 'JSON-merkkijono',
+ e164: 'E.164-luku',
+ jwt: 'JWT',
+ template_literal: 'templaattimerkkijono',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Sd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`
+ : `Virheellinen tyyppi: odotettiin ${a}, oli ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Virheellinen sy\xF6te: t\xE4ytyy olla ${Sd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Sd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Liian suuri: ${
+ o.subject
+ } t\xE4ytyy olla ${a}${r.maximum.toString()} ${o.unit}`.trim()
+ : `Liian suuri: arvon t\xE4ytyy olla ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Liian pieni: ${
+ o.subject
+ } t\xE4ytyy olla ${a}${r.minimum.toString()} ${o.unit}`.trim()
+ : `Liian pieni: arvon t\xE4ytyy olla ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`
+ : a.format === 'regex'
+ ? `Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`
+ : `Virheellinen ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1 ? 'Tuntemattomat avaimet' : 'Tuntematon avain'
+ }: ${Sd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return 'Virheellinen avain tietueessa';
+ case 'invalid_union':
+ return 'Virheellinen unioni';
+ case 'invalid_element':
+ return 'Virheellinen arvo joukossa';
+ default:
+ return 'Virheellinen sy\xF6te';
+ }
+ };
+ };
+ function m$() {
+ return {localeError: p$()};
+ }
+ Jb.exports = Ar.default;
+});
+var Gb = xe((Mr, Wb) => {
+ 'use strict';
+ var y$ =
+ (Mr && Mr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ g$ =
+ (Mr && Mr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ v$ =
+ (Mr && Mr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ y$(t, e, n);
+ return g$(t, e), t;
+ };
+ Object.defineProperty(Mr, '__esModule', {value: !0});
+ Mr.default = b$;
+ var _d = v$(ot()),
+ h$ = () => {
+ let e = {
+ string: {unit: 'caract\xE8res', verb: 'avoir'},
+ file: {unit: 'octets', verb: 'avoir'},
+ array: {unit: '\xE9l\xE9ments', verb: 'avoir'},
+ set: {unit: '\xE9l\xE9ments', verb: 'avoir'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'entr\xE9e',
+ email: 'adresse e-mail',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'date et heure ISO',
+ date: 'date ISO',
+ time: 'heure ISO',
+ duration: 'dur\xE9e ISO',
+ ipv4: 'adresse IPv4',
+ ipv6: 'adresse IPv6',
+ cidrv4: 'plage IPv4',
+ cidrv6: 'plage IPv6',
+ base64: 'cha\xEEne encod\xE9e en base64',
+ base64url: 'cha\xEEne encod\xE9e en base64url',
+ json_string: 'cha\xEEne JSON',
+ e164: 'num\xE9ro E.164',
+ jwt: 'JWT',
+ template_literal: 'entr\xE9e',
+ },
+ i = {nan: 'NaN', number: 'nombre', array: 'tableau'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = _d.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Entr\xE9e invalide : instanceof ${r.expected} attendu, ${s} re\xE7u`
+ : `Entr\xE9e invalide : ${a} attendu, ${s} re\xE7u`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Entr\xE9e invalide : ${_d.stringifyPrimitive(
+ r.values[0]
+ )} attendu`
+ : `Option invalide : une valeur parmi ${_d.joinValues(
+ r.values,
+ '|'
+ )} attendue`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Trop grand : ${r.origin ?? 'valeur'} doit ${
+ o.verb
+ } ${a}${r.maximum.toString()} ${o.unit ?? '\xE9l\xE9ment(s)'}`
+ : `Trop grand : ${
+ r.origin ?? 'valeur'
+ } doit \xEAtre ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Trop petit : ${r.origin} doit ${
+ o.verb
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `Trop petit : ${
+ r.origin
+ } doit \xEAtre ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Cha\xEEne invalide : doit commencer par "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Cha\xEEne invalide : doit se terminer par "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Cha\xEEne invalide : doit inclure "${a.includes}"`
+ : a.format === 'regex'
+ ? `Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`
+ : `${n[a.format] ?? r.format} invalide`;
+ }
+ case 'not_multiple_of':
+ return `Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Cl\xE9${r.keys.length > 1 ? 's' : ''} non reconnue${
+ r.keys.length > 1 ? 's' : ''
+ } : ${_d.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Cl\xE9 invalide dans ${r.origin}`;
+ case 'invalid_union':
+ return 'Entr\xE9e invalide';
+ case 'invalid_element':
+ return `Valeur invalide dans ${r.origin}`;
+ default:
+ return 'Entr\xE9e invalide';
+ }
+ };
+ };
+ function b$() {
+ return {localeError: h$()};
+ }
+ Wb.exports = Mr.default;
+});
+var Yb = xe((Nr, Xb) => {
+ 'use strict';
+ var k$ =
+ (Nr && Nr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ S$ =
+ (Nr && Nr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ _$ =
+ (Nr && Nr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ k$(t, e, n);
+ return S$(t, e), t;
+ };
+ Object.defineProperty(Nr, '__esModule', {value: !0});
+ Nr.default = E$;
+ var Td = _$(ot()),
+ T$ = () => {
+ let e = {
+ string: {unit: 'caract\xE8res', verb: 'avoir'},
+ file: {unit: 'octets', verb: 'avoir'},
+ array: {unit: '\xE9l\xE9ments', verb: 'avoir'},
+ set: {unit: '\xE9l\xE9ments', verb: 'avoir'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'entr\xE9e',
+ email: 'adresse courriel',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'date-heure ISO',
+ date: 'date ISO',
+ time: 'heure ISO',
+ duration: 'dur\xE9e ISO',
+ ipv4: 'adresse IPv4',
+ ipv6: 'adresse IPv6',
+ cidrv4: 'plage IPv4',
+ cidrv6: 'plage IPv6',
+ base64: 'cha\xEEne encod\xE9e en base64',
+ base64url: 'cha\xEEne encod\xE9e en base64url',
+ json_string: 'cha\xEEne JSON',
+ e164: 'num\xE9ro E.164',
+ jwt: 'JWT',
+ template_literal: 'entr\xE9e',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Td.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${s}`
+ : `Entr\xE9e invalide : attendu ${a}, re\xE7u ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Entr\xE9e invalide : attendu ${Td.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Option invalide : attendu l'une des valeurs suivantes ${Td.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '\u2264' : '<',
+ o = t(r.origin);
+ return o
+ ? `Trop grand : attendu que ${
+ r.origin ?? 'la valeur'
+ } ait ${a}${r.maximum.toString()} ${o.unit}`
+ : `Trop grand : attendu que ${
+ r.origin ?? 'la valeur'
+ } soit ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '\u2265' : '>',
+ o = t(r.origin);
+ return o
+ ? `Trop petit : attendu que ${
+ r.origin
+ } ait ${a}${r.minimum.toString()} ${o.unit}`
+ : `Trop petit : attendu que ${
+ r.origin
+ } soit ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Cha\xEEne invalide : doit commencer par "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Cha\xEEne invalide : doit se terminer par "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Cha\xEEne invalide : doit inclure "${a.includes}"`
+ : a.format === 'regex'
+ ? `Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`
+ : `${n[a.format] ?? r.format} invalide`;
+ }
+ case 'not_multiple_of':
+ return `Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Cl\xE9${r.keys.length > 1 ? 's' : ''} non reconnue${
+ r.keys.length > 1 ? 's' : ''
+ } : ${Td.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Cl\xE9 invalide dans ${r.origin}`;
+ case 'invalid_union':
+ return 'Entr\xE9e invalide';
+ case 'invalid_element':
+ return `Valeur invalide dans ${r.origin}`;
+ default:
+ return 'Entr\xE9e invalide';
+ }
+ };
+ };
+ function E$() {
+ return {localeError: T$()};
+ }
+ Xb.exports = Nr.default;
+});
+var ek = xe((Rr, Qb) => {
+ 'use strict';
+ var I$ =
+ (Rr && Rr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ P$ =
+ (Rr && Rr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ x$ =
+ (Rr && Rr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ I$(t, e, n);
+ return P$(t, e), t;
+ };
+ Object.defineProperty(Rr, '__esModule', {value: !0});
+ Rr.default = O$;
+ var Ed = x$(ot()),
+ w$ = () => {
+ let e = {
+ string: {label: '\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA', gender: 'f'},
+ number: {label: '\u05DE\u05E1\u05E4\u05E8', gender: 'm'},
+ boolean: {
+ label:
+ '\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9',
+ gender: 'm',
+ },
+ bigint: {label: 'BigInt', gender: 'm'},
+ date: {label: '\u05EA\u05D0\u05E8\u05D9\u05DA', gender: 'm'},
+ array: {label: '\u05DE\u05E2\u05E8\u05DA', gender: 'm'},
+ object: {
+ label: '\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8',
+ gender: 'm',
+ },
+ null: {
+ label: '\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)',
+ gender: 'm',
+ },
+ undefined: {
+ label:
+ '\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)',
+ gender: 'm',
+ },
+ symbol: {
+ label: '\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)',
+ gender: 'm',
+ },
+ function: {
+ label: '\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4',
+ gender: 'f',
+ },
+ map: {label: '\u05DE\u05E4\u05D4 (Map)', gender: 'f'},
+ set: {label: '\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)', gender: 'f'},
+ file: {label: '\u05E7\u05D5\u05D1\u05E5', gender: 'm'},
+ promise: {label: 'Promise', gender: 'm'},
+ NaN: {label: 'NaN', gender: 'm'},
+ unknown: {
+ label: '\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2',
+ gender: 'm',
+ },
+ value: {label: '\u05E2\u05E8\u05DA', gender: 'm'},
+ },
+ t = {
+ string: {
+ unit: '\u05EA\u05D5\u05D5\u05D9\u05DD',
+ shortLabel: '\u05E7\u05E6\u05E8',
+ longLabel: '\u05D0\u05E8\u05D5\u05DA',
+ },
+ file: {
+ unit: '\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD',
+ shortLabel: '\u05E7\u05D8\u05DF',
+ longLabel: '\u05D2\u05D3\u05D5\u05DC',
+ },
+ array: {
+ unit: '\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD',
+ shortLabel: '\u05E7\u05D8\u05DF',
+ longLabel: '\u05D2\u05D3\u05D5\u05DC',
+ },
+ set: {
+ unit: '\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD',
+ shortLabel: '\u05E7\u05D8\u05DF',
+ longLabel: '\u05D2\u05D3\u05D5\u05DC',
+ },
+ number: {
+ unit: '',
+ shortLabel: '\u05E7\u05D8\u05DF',
+ longLabel: '\u05D2\u05D3\u05D5\u05DC',
+ },
+ },
+ n = (d) => (d ? e[d] : void 0),
+ i = (d) => {
+ let u = n(d);
+ return u ? u.label : d ?? e.unknown.label;
+ },
+ r = (d) => `\u05D4${i(d)}`,
+ a = (d) =>
+ (n(d)?.gender ?? 'm') === 'f'
+ ? '\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA'
+ : '\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA',
+ o = (d) => (d ? t[d] ?? null : null),
+ s = {
+ regex: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ email: {
+ label:
+ '\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC',
+ gender: 'f',
+ },
+ url: {
+ label: '\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA',
+ gender: 'f',
+ },
+ emoji: {label: "\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9", gender: 'm'},
+ uuid: {label: 'UUID', gender: 'm'},
+ nanoid: {label: 'nanoid', gender: 'm'},
+ guid: {label: 'GUID', gender: 'm'},
+ cuid: {label: 'cuid', gender: 'm'},
+ cuid2: {label: 'cuid2', gender: 'm'},
+ ulid: {label: 'ULID', gender: 'm'},
+ xid: {label: 'XID', gender: 'm'},
+ ksuid: {label: 'KSUID', gender: 'm'},
+ datetime: {
+ label:
+ '\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO',
+ gender: 'm',
+ },
+ date: {label: '\u05EA\u05D0\u05E8\u05D9\u05DA ISO', gender: 'm'},
+ time: {label: '\u05D6\u05DE\u05DF ISO', gender: 'm'},
+ duration: {
+ label: '\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO',
+ gender: 'm',
+ },
+ ipv4: {label: '\u05DB\u05EA\u05D5\u05D1\u05EA IPv4', gender: 'f'},
+ ipv6: {label: '\u05DB\u05EA\u05D5\u05D1\u05EA IPv6', gender: 'f'},
+ cidrv4: {label: '\u05D8\u05D5\u05D5\u05D7 IPv4', gender: 'm'},
+ cidrv6: {label: '\u05D8\u05D5\u05D5\u05D7 IPv6', gender: 'm'},
+ base64: {
+ label:
+ '\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64',
+ gender: 'f',
+ },
+ base64url: {
+ label:
+ '\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA',
+ gender: 'f',
+ },
+ json_string: {
+ label: '\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON',
+ gender: 'f',
+ },
+ e164: {label: '\u05DE\u05E1\u05E4\u05E8 E.164', gender: 'm'},
+ jwt: {label: 'JWT', gender: 'm'},
+ ends_with: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ includes: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ lowercase: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ starts_with: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ uppercase: {label: '\u05E7\u05DC\u05D8', gender: 'm'},
+ },
+ l = {nan: 'NaN'};
+ return (d) => {
+ switch (d.code) {
+ case 'invalid_type': {
+ let u = d.expected,
+ p = l[u ?? ''] ?? i(u),
+ y = Ed.parsedType(d.input),
+ m = l[y] ?? e[y]?.label ?? y;
+ return /^[A-Z]/.test(d.expected)
+ ? `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`
+ : `\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`;
+ }
+ case 'invalid_value': {
+ if (d.values.length === 1)
+ return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Ed.stringifyPrimitive(
+ d.values[0]
+ )}`;
+ let u = d.values.map((m) => Ed.stringifyPrimitive(m));
+ if (d.values.length === 2)
+ return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;
+ let p = u[u.length - 1];
+ return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u
+ .slice(0, -1)
+ .join(', ')} \u05D0\u05D5 ${p}`;
+ }
+ case 'too_big': {
+ let u = o(d.origin),
+ p = r(d.origin ?? 'value');
+ if (d.origin === 'string')
+ return `${
+ u?.longLabel ?? '\u05D0\u05E8\u05D5\u05DA'
+ } \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${
+ u?.unit ?? ''
+ } ${
+ d.inclusive
+ ? '\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA'
+ : '\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8'
+ }`.trim();
+ if (d.origin === 'number') {
+ let g = d.inclusive
+ ? `\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`
+ : `\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;
+ return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`;
+ }
+ if (d.origin === 'array' || d.origin === 'set') {
+ let g =
+ d.origin === 'set'
+ ? '\u05E6\u05E8\u05D9\u05DB\u05D4'
+ : '\u05E6\u05E8\u05D9\u05DA',
+ S = d.inclusive
+ ? `${d.maximum} ${
+ u?.unit ?? ''
+ } \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`
+ : `\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${
+ u?.unit ?? ''
+ }`;
+ return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`.trim();
+ }
+ let y = d.inclusive ? '<=' : '<',
+ m = a(d.origin ?? 'value');
+ return u?.unit
+ ? `${
+ u.longLabel
+ } \u05DE\u05D3\u05D9: ${p} ${m} ${y}${d.maximum.toString()} ${
+ u.unit
+ }`
+ : `${
+ u?.longLabel ?? '\u05D2\u05D3\u05D5\u05DC'
+ } \u05DE\u05D3\u05D9: ${p} ${m} ${y}${d.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let u = o(d.origin),
+ p = r(d.origin ?? 'value');
+ if (d.origin === 'string')
+ return `${
+ u?.shortLabel ?? '\u05E7\u05E6\u05E8'
+ } \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${
+ u?.unit ?? ''
+ } ${
+ d.inclusive
+ ? '\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8'
+ : '\u05DC\u05E4\u05D7\u05D5\u05EA'
+ }`.trim();
+ if (d.origin === 'number') {
+ let g = d.inclusive
+ ? `\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`
+ : `\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;
+ return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`;
+ }
+ if (d.origin === 'array' || d.origin === 'set') {
+ let g =
+ d.origin === 'set'
+ ? '\u05E6\u05E8\u05D9\u05DB\u05D4'
+ : '\u05E6\u05E8\u05D9\u05DA';
+ if (d.minimum === 1 && d.inclusive) {
+ let _ =
+ (d.origin === 'set',
+ '\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3');
+ return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`;
+ }
+ let S = d.inclusive
+ ? `${d.minimum} ${
+ u?.unit ?? ''
+ } \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`
+ : `\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${
+ u?.unit ?? ''
+ }`;
+ return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`.trim();
+ }
+ let y = d.inclusive ? '>=' : '>',
+ m = a(d.origin ?? 'value');
+ return u?.unit
+ ? `${
+ u.shortLabel
+ } \u05DE\u05D3\u05D9: ${p} ${m} ${y}${d.minimum.toString()} ${
+ u.unit
+ }`
+ : `${
+ u?.shortLabel ?? '\u05E7\u05D8\u05DF'
+ } \u05DE\u05D3\u05D9: ${p} ${m} ${y}${d.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let u = d;
+ if (u.format === 'starts_with')
+ return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;
+ if (u.format === 'ends_with')
+ return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;
+ if (u.format === 'includes')
+ return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;
+ if (u.format === 'regex')
+ return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;
+ let p = s[u.format],
+ y = p?.label ?? u.format,
+ g =
+ (p?.gender ?? 'm') === 'f'
+ ? '\u05EA\u05E7\u05D9\u05E0\u05D4'
+ : '\u05EA\u05E7\u05D9\u05DF';
+ return `${y} \u05DC\u05D0 ${g}`;
+ }
+ case 'not_multiple_of':
+ return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;
+ case 'unrecognized_keys':
+ return `\u05DE\u05E4\u05EA\u05D7${
+ d.keys.length > 1 ? '\u05D5\u05EA' : ''
+ } \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${
+ d.keys.length > 1 ? '\u05D9\u05DD' : '\u05D4'
+ }: ${Ed.joinValues(d.keys, ', ')}`;
+ case 'invalid_key':
+ return '\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8';
+ case 'invalid_union':
+ return '\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF';
+ case 'invalid_element':
+ return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(
+ d.origin ?? 'array'
+ )}`;
+ default:
+ return '\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF';
+ }
+ };
+ };
+ function O$() {
+ return {localeError: w$()};
+ }
+ Qb.exports = Rr.default;
+});
+var nk = xe((Lr, tk) => {
+ 'use strict';
+ var $$ =
+ (Lr && Lr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ j$ =
+ (Lr && Lr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ C$ =
+ (Lr && Lr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ $$(t, e, n);
+ return j$(t, e), t;
+ };
+ Object.defineProperty(Lr, '__esModule', {value: !0});
+ Lr.default = A$;
+ var Id = C$(ot()),
+ D$ = () => {
+ let e = {
+ string: {unit: 'karakter', verb: 'legyen'},
+ file: {unit: 'byte', verb: 'legyen'},
+ array: {unit: 'elem', verb: 'legyen'},
+ set: {unit: 'elem', verb: 'legyen'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'bemenet',
+ email: 'email c\xEDm',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO id\u0151b\xE9lyeg',
+ date: 'ISO d\xE1tum',
+ time: 'ISO id\u0151',
+ duration: 'ISO id\u0151intervallum',
+ ipv4: 'IPv4 c\xEDm',
+ ipv6: 'IPv6 c\xEDm',
+ cidrv4: 'IPv4 tartom\xE1ny',
+ cidrv6: 'IPv6 tartom\xE1ny',
+ base64: 'base64-k\xF3dolt string',
+ base64url: 'base64url-k\xF3dolt string',
+ json_string: 'JSON string',
+ e164: 'E.164 sz\xE1m',
+ jwt: 'JWT',
+ template_literal: 'bemenet',
+ },
+ i = {nan: 'NaN', number: 'sz\xE1m', array: 't\xF6mb'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Id.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${s}`
+ : `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Id.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Id.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `T\xFAl nagy: ${
+ r.origin ?? '\xE9rt\xE9k'
+ } m\xE9rete t\xFAl nagy ${a}${r.maximum.toString()} ${
+ o.unit ?? 'elem'
+ }`
+ : `T\xFAl nagy: a bemeneti \xE9rt\xE9k ${
+ r.origin ?? '\xE9rt\xE9k'
+ } t\xFAl nagy: ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${
+ r.origin
+ } m\xE9rete t\xFAl kicsi ${a}${r.minimum.toString()} ${o.unit}`
+ : `T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${
+ r.origin
+ } t\xFAl kicsi ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`
+ : a.format === 'ends_with'
+ ? `\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`
+ : a.format === 'includes'
+ ? `\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`
+ : a.format === 'regex'
+ ? `\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`
+ : `\xC9rv\xE9nytelen ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;
+ case 'unrecognized_keys':
+ return `Ismeretlen kulcs${
+ r.keys.length > 1 ? 's' : ''
+ }: ${Id.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\xC9rv\xE9nytelen kulcs ${r.origin}`;
+ case 'invalid_union':
+ return '\xC9rv\xE9nytelen bemenet';
+ case 'invalid_element':
+ return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;
+ default:
+ return '\xC9rv\xE9nytelen bemenet';
+ }
+ };
+ };
+ function A$() {
+ return {localeError: D$()};
+ }
+ tk.exports = Lr.default;
+});
+var ak = xe((Fr, ik) => {
+ 'use strict';
+ var M$ =
+ (Fr && Fr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ N$ =
+ (Fr && Fr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ R$ =
+ (Fr && Fr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ M$(t, e, n);
+ return N$(t, e), t;
+ };
+ Object.defineProperty(Fr, '__esModule', {value: !0});
+ Fr.default = F$;
+ var Pd = R$(ot());
+ function rk(e, t, n) {
+ return Math.abs(e) === 1 ? t : n;
+ }
+ function Ca(e) {
+ if (!e) return '';
+ let t = [
+ '\u0561',
+ '\u0565',
+ '\u0568',
+ '\u056B',
+ '\u0578',
+ '\u0578\u0582',
+ '\u0585',
+ ],
+ n = e[e.length - 1];
+ return e + (t.includes(n) ? '\u0576' : '\u0568');
+ }
+ var L$ = () => {
+ let e = {
+ string: {
+ unit: {
+ one: '\u0576\u0577\u0561\u0576',
+ many: '\u0576\u0577\u0561\u0576\u0576\u0565\u0580',
+ },
+ verb: '\u0578\u0582\u0576\u0565\u0576\u0561\u056C',
+ },
+ file: {
+ unit: {
+ one: '\u0562\u0561\u0575\u0569',
+ many: '\u0562\u0561\u0575\u0569\u0565\u0580',
+ },
+ verb: '\u0578\u0582\u0576\u0565\u0576\u0561\u056C',
+ },
+ array: {
+ unit: {
+ one: '\u057F\u0561\u0580\u0580',
+ many: '\u057F\u0561\u0580\u0580\u0565\u0580',
+ },
+ verb: '\u0578\u0582\u0576\u0565\u0576\u0561\u056C',
+ },
+ set: {
+ unit: {
+ one: '\u057F\u0561\u0580\u0580',
+ many: '\u057F\u0561\u0580\u0580\u0565\u0580',
+ },
+ verb: '\u0578\u0582\u0576\u0565\u0576\u0561\u056C',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0574\u0578\u0582\u057F\u0584',
+ email: '\u0567\u056C. \u0570\u0561\u057D\u0581\u0565',
+ url: 'URL',
+ emoji: '\u0567\u0574\u0578\u057B\u056B',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ 'ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574',
+ date: 'ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E',
+ time: 'ISO \u056A\u0561\u0574',
+ duration:
+ 'ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576',
+ ipv4: 'IPv4 \u0570\u0561\u057D\u0581\u0565',
+ ipv6: 'IPv6 \u0570\u0561\u057D\u0581\u0565',
+ cidrv4: 'IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584',
+ cidrv6: 'IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584',
+ base64:
+ 'base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572',
+ base64url:
+ 'base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572',
+ json_string: 'JSON \u057F\u0578\u0572',
+ e164: 'E.164 \u0570\u0561\u0574\u0561\u0580',
+ jwt: 'JWT',
+ template_literal: '\u0574\u0578\u0582\u057F\u0584',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0569\u056B\u057E',
+ array: '\u0566\u0561\u0576\u0563\u057E\u0561\u056E',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Pd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`
+ : `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Pd.stringifyPrimitive(
+ r.values[1]
+ )}`
+ : `\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${Pd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.maximum),
+ l = rk(s, o.unit.one, o.unit.many);
+ return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ca(
+ r.origin ?? '\u0561\u0580\u056A\u0565\u0584'
+ )} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${r.maximum.toString()} ${l}`;
+ }
+ return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ca(
+ r.origin ?? '\u0561\u0580\u056A\u0565\u0584'
+ )} \u056C\u056B\u0576\u056B ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.minimum),
+ l = rk(s, o.unit.one, o.unit.many);
+ return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ca(
+ r.origin
+ )} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${r.minimum.toString()} ${l}`;
+ }
+ return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ca(
+ r.origin
+ )} \u056C\u056B\u0576\u056B ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`
+ : a.format === 'ends_with'
+ ? `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`
+ : a.format === 'includes'
+ ? `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`
+ : `\u054D\u056D\u0561\u056C ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;
+ case 'unrecognized_keys':
+ return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${
+ r.keys.length > 1 ? '\u0576\u0565\u0580' : ''
+ }. ${Pd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ca(
+ r.origin
+ )}-\u0578\u0582\u0574`;
+ case 'invalid_union':
+ return '\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574';
+ case 'invalid_element':
+ return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ca(
+ r.origin
+ )}-\u0578\u0582\u0574`;
+ default:
+ return '\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574';
+ }
+ };
+ };
+ function F$() {
+ return {localeError: L$()};
+ }
+ ik.exports = Fr.default;
+});
+var sk = xe((zr, ok) => {
+ 'use strict';
+ var z$ =
+ (zr && zr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ B$ =
+ (zr && zr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ U$ =
+ (zr && zr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ z$(t, e, n);
+ return B$(t, e), t;
+ };
+ Object.defineProperty(zr, '__esModule', {value: !0});
+ zr.default = q$;
+ var xd = U$(ot()),
+ Z$ = () => {
+ let e = {
+ string: {unit: 'karakter', verb: 'memiliki'},
+ file: {unit: 'byte', verb: 'memiliki'},
+ array: {unit: 'item', verb: 'memiliki'},
+ set: {unit: 'item', verb: 'memiliki'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'alamat email',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'tanggal dan waktu format ISO',
+ date: 'tanggal format ISO',
+ time: 'jam format ISO',
+ duration: 'durasi format ISO',
+ ipv4: 'alamat IPv4',
+ ipv6: 'alamat IPv6',
+ cidrv4: 'rentang alamat IPv4',
+ cidrv6: 'rentang alamat IPv6',
+ base64: 'string dengan enkode base64',
+ base64url: 'string dengan enkode base64url',
+ json_string: 'string JSON',
+ e164: 'angka E.164',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = xd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`
+ : `Input tidak valid: diharapkan ${a}, diterima ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Input tidak valid: diharapkan ${xd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Pilihan tidak valid: diharapkan salah satu dari ${xd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Terlalu besar: diharapkan ${
+ r.origin ?? 'value'
+ } memiliki ${a}${r.maximum.toString()} ${o.unit ?? 'elemen'}`
+ : `Terlalu besar: diharapkan ${
+ r.origin ?? 'value'
+ } menjadi ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Terlalu kecil: diharapkan ${
+ r.origin
+ } memiliki ${a}${r.minimum.toString()} ${o.unit}`
+ : `Terlalu kecil: diharapkan ${
+ r.origin
+ } menjadi ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `String tidak valid: harus dimulai dengan "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `String tidak valid: harus berakhir dengan "${a.suffix}"`
+ : a.format === 'includes'
+ ? `String tidak valid: harus menyertakan "${a.includes}"`
+ : a.format === 'regex'
+ ? `String tidak valid: harus sesuai pola ${a.pattern}`
+ : `${n[a.format] ?? r.format} tidak valid`;
+ }
+ case 'not_multiple_of':
+ return `Angka tidak valid: harus kelipatan dari ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Kunci tidak dikenali ${
+ r.keys.length > 1 ? 's' : ''
+ }: ${xd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Kunci tidak valid di ${r.origin}`;
+ case 'invalid_union':
+ return 'Input tidak valid';
+ case 'invalid_element':
+ return `Nilai tidak valid di ${r.origin}`;
+ default:
+ return 'Input tidak valid';
+ }
+ };
+ };
+ function q$() {
+ return {localeError: Z$()};
+ }
+ ok.exports = zr.default;
+});
+var ck = xe((Br, lk) => {
+ 'use strict';
+ var K$ =
+ (Br && Br.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ V$ =
+ (Br && Br.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ J$ =
+ (Br && Br.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ K$(t, e, n);
+ return V$(t, e), t;
+ };
+ Object.defineProperty(Br, '__esModule', {value: !0});
+ Br.default = W$;
+ var wd = J$(ot()),
+ H$ = () => {
+ let e = {
+ string: {unit: 'stafi', verb: 'a\xF0 hafa'},
+ file: {unit: 'b\xE6ti', verb: 'a\xF0 hafa'},
+ array: {unit: 'hluti', verb: 'a\xF0 hafa'},
+ set: {unit: 'hluti', verb: 'a\xF0 hafa'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'gildi',
+ email: 'netfang',
+ url: 'vefsl\xF3\xF0',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO dagsetning og t\xEDmi',
+ date: 'ISO dagsetning',
+ time: 'ISO t\xEDmi',
+ duration: 'ISO t\xEDmalengd',
+ ipv4: 'IPv4 address',
+ ipv6: 'IPv6 address',
+ cidrv4: 'IPv4 range',
+ cidrv6: 'IPv6 range',
+ base64: 'base64-encoded strengur',
+ base64url: 'base64url-encoded strengur',
+ json_string: 'JSON strengur',
+ e164: 'E.164 t\xF6lugildi',
+ jwt: 'JWT',
+ template_literal: 'gildi',
+ },
+ i = {nan: 'NaN', number: 'n\xFAmer', array: 'fylki'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = wd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`
+ : `Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${a}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Rangt gildi: gert r\xE1\xF0 fyrir ${wd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${wd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${
+ r.origin ?? 'gildi'
+ } hafi ${a}${r.maximum.toString()} ${o.unit ?? 'hluti'}`
+ : `Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${
+ r.origin ?? 'gildi'
+ } s\xE9 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${
+ r.origin
+ } hafi ${a}${r.minimum.toString()} ${o.unit}`
+ : `Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${
+ r.origin
+ } s\xE9 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`
+ : a.format === 'regex'
+ ? `\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`
+ : `Rangt ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\xD3\xFEekkt ${
+ r.keys.length > 1 ? 'ir lyklar' : 'ur lykill'
+ }: ${wd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Rangur lykill \xED ${r.origin}`;
+ case 'invalid_union':
+ return 'Rangt gildi';
+ case 'invalid_element':
+ return `Rangt gildi \xED ${r.origin}`;
+ default:
+ return 'Rangt gildi';
+ }
+ };
+ };
+ function W$() {
+ return {localeError: H$()};
+ }
+ lk.exports = Br.default;
+});
+var dk = xe((Ur, uk) => {
+ 'use strict';
+ var G$ =
+ (Ur && Ur.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ X$ =
+ (Ur && Ur.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Y$ =
+ (Ur && Ur.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ G$(t, e, n);
+ return X$(t, e), t;
+ };
+ Object.defineProperty(Ur, '__esModule', {value: !0});
+ Ur.default = ej;
+ var Od = Y$(ot()),
+ Q$ = () => {
+ let e = {
+ string: {unit: 'caratteri', verb: 'avere'},
+ file: {unit: 'byte', verb: 'avere'},
+ array: {unit: 'elementi', verb: 'avere'},
+ set: {unit: 'elementi', verb: 'avere'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'indirizzo email',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'data e ora ISO',
+ date: 'data ISO',
+ time: 'ora ISO',
+ duration: 'durata ISO',
+ ipv4: 'indirizzo IPv4',
+ ipv6: 'indirizzo IPv6',
+ cidrv4: 'intervallo IPv4',
+ cidrv6: 'intervallo IPv6',
+ base64: 'stringa codificata in base64',
+ base64url: 'URL codificata in base64',
+ json_string: 'stringa JSON',
+ e164: 'numero E.164',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN', number: 'numero', array: 'vettore'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Od.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`
+ : `Input non valido: atteso ${a}, ricevuto ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Input non valido: atteso ${Od.stringifyPrimitive(r.values[0])}`
+ : `Opzione non valida: atteso uno tra ${Od.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Troppo grande: ${
+ r.origin ?? 'valore'
+ } deve avere ${a}${r.maximum.toString()} ${
+ o.unit ?? 'elementi'
+ }`
+ : `Troppo grande: ${
+ r.origin ?? 'valore'
+ } deve essere ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Troppo piccolo: ${
+ r.origin
+ } deve avere ${a}${r.minimum.toString()} ${o.unit}`
+ : `Troppo piccolo: ${
+ r.origin
+ } deve essere ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Stringa non valida: deve iniziare con "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Stringa non valida: deve terminare con "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Stringa non valida: deve includere "${a.includes}"`
+ : a.format === 'regex'
+ ? `Stringa non valida: deve corrispondere al pattern ${a.pattern}`
+ : `Invalid ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Numero non valido: deve essere un multiplo di ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Chiav${r.keys.length > 1 ? 'i' : 'e'} non riconosciut${
+ r.keys.length > 1 ? 'e' : 'a'
+ }: ${Od.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Chiave non valida in ${r.origin}`;
+ case 'invalid_union':
+ return 'Input non valido';
+ case 'invalid_element':
+ return `Valore non valido in ${r.origin}`;
+ default:
+ return 'Input non valido';
+ }
+ };
+ };
+ function ej() {
+ return {localeError: Q$()};
+ }
+ uk.exports = Ur.default;
+});
+var pk = xe((Zr, fk) => {
+ 'use strict';
+ var tj =
+ (Zr && Zr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ nj =
+ (Zr && Zr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ rj =
+ (Zr && Zr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ tj(t, e, n);
+ return nj(t, e), t;
+ };
+ Object.defineProperty(Zr, '__esModule', {value: !0});
+ Zr.default = aj;
+ var $d = rj(ot()),
+ ij = () => {
+ let e = {
+ string: {unit: '\u6587\u5B57', verb: '\u3067\u3042\u308B'},
+ file: {unit: '\u30D0\u30A4\u30C8', verb: '\u3067\u3042\u308B'},
+ array: {unit: '\u8981\u7D20', verb: '\u3067\u3042\u308B'},
+ set: {unit: '\u8981\u7D20', verb: '\u3067\u3042\u308B'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u5165\u529B\u5024',
+ email: '\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9',
+ url: 'URL',
+ emoji: '\u7D75\u6587\u5B57',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO\u65E5\u6642',
+ date: 'ISO\u65E5\u4ED8',
+ time: 'ISO\u6642\u523B',
+ duration: 'ISO\u671F\u9593',
+ ipv4: 'IPv4\u30A2\u30C9\u30EC\u30B9',
+ ipv6: 'IPv6\u30A2\u30C9\u30EC\u30B9',
+ cidrv4: 'IPv4\u7BC4\u56F2',
+ cidrv6: 'IPv6\u7BC4\u56F2',
+ base64: 'base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217',
+ base64url:
+ 'base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217',
+ json_string: 'JSON\u6587\u5B57\u5217',
+ e164: 'E.164\u756A\u53F7',
+ jwt: 'JWT',
+ template_literal: '\u5165\u529B\u5024',
+ },
+ i = {nan: 'NaN', number: '\u6570\u5024', array: '\u914D\u5217'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = $d.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`
+ : `\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u7121\u52B9\u306A\u5165\u529B: ${$d.stringifyPrimitive(
+ r.values[0]
+ )}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`
+ : `\u7121\u52B9\u306A\u9078\u629E: ${$d.joinValues(
+ r.values,
+ '\u3001'
+ )}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
+ case 'too_big': {
+ let a = r.inclusive
+ ? '\u4EE5\u4E0B\u3067\u3042\u308B'
+ : '\u3088\u308A\u5C0F\u3055\u3044',
+ o = t(r.origin);
+ return o
+ ? `\u5927\u304D\u3059\u304E\u308B\u5024: ${
+ r.origin ?? '\u5024'
+ }\u306F${r.maximum.toString()}${
+ o.unit ?? '\u8981\u7D20'
+ }${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : `\u5927\u304D\u3059\u304E\u308B\u5024: ${
+ r.origin ?? '\u5024'
+ }\u306F${r.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
+ }
+ case 'too_small': {
+ let a = r.inclusive
+ ? '\u4EE5\u4E0A\u3067\u3042\u308B'
+ : '\u3088\u308A\u5927\u304D\u3044',
+ o = t(r.origin);
+ return o
+ ? `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${
+ r.origin
+ }\u306F${r.minimum.toString()}${
+ o.unit
+ }${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : `\u5C0F\u3055\u3059\u304E\u308B\u5024: ${
+ r.origin
+ }\u306F${r.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : a.format === 'ends_with'
+ ? `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : a.format === 'includes'
+ ? `\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : a.format === 'regex'
+ ? `\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`
+ : `\u7121\u52B9\u306A${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;
+ case 'unrecognized_keys':
+ return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${
+ r.keys.length > 1 ? '\u7FA4' : ''
+ }: ${$d.joinValues(r.keys, '\u3001')}`;
+ case 'invalid_key':
+ return `${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;
+ case 'invalid_union':
+ return '\u7121\u52B9\u306A\u5165\u529B';
+ case 'invalid_element':
+ return `${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;
+ default:
+ return '\u7121\u52B9\u306A\u5165\u529B';
+ }
+ };
+ };
+ function aj() {
+ return {localeError: ij()};
+ }
+ fk.exports = Zr.default;
+});
+var yk = xe((qr, mk) => {
+ 'use strict';
+ var oj =
+ (qr && qr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ sj =
+ (qr && qr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ lj =
+ (qr && qr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ oj(t, e, n);
+ return sj(t, e), t;
+ };
+ Object.defineProperty(qr, '__esModule', {value: !0});
+ qr.default = uj;
+ var jd = lj(ot()),
+ cj = () => {
+ let e = {
+ string: {
+ unit: '\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD',
+ verb: '\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1',
+ },
+ file: {
+ unit: '\u10D1\u10D0\u10D8\u10E2\u10D8',
+ verb: '\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1',
+ },
+ array: {
+ unit: '\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8',
+ verb: '\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1',
+ },
+ set: {
+ unit: '\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8',
+ verb: '\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0',
+ email:
+ '\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8',
+ url: 'URL',
+ emoji: '\u10D4\u10DB\u10DD\u10EF\u10D8',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: '\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD',
+ date: '\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8',
+ time: '\u10D3\u10E0\u10DD',
+ duration:
+ '\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0',
+ ipv4: 'IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8',
+ ipv6: 'IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8',
+ cidrv4: 'IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8',
+ cidrv6: 'IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8',
+ base64:
+ 'base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8',
+ base64url:
+ 'base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8',
+ json_string: 'JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8',
+ e164: 'E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8',
+ jwt: 'JWT',
+ template_literal: '\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8',
+ string: '\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8',
+ boolean: '\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8',
+ function: '\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0',
+ array: '\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = jd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`
+ : `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${jd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${jd.joinValues(
+ r.values,
+ '|'
+ )}-\u10D3\u10D0\u10DC`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${
+ r.origin ??
+ '\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0'
+ } ${o.verb} ${a}${r.maximum.toString()} ${o.unit}`
+ : `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${
+ r.origin ??
+ '\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0'
+ } \u10D8\u10E7\u10DD\u10E1 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${
+ r.origin
+ } ${o.verb} ${a}${r.minimum.toString()} ${o.unit}`
+ : `\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${
+ r.origin
+ } \u10D8\u10E7\u10DD\u10E1 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`
+ : a.format === 'ends_with'
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`
+ : a.format === 'includes'
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`
+ : a.format === 'regex'
+ ? `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`
+ : `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;
+ case 'unrecognized_keys':
+ return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${
+ r.keys.length > 1 ? '\u10D4\u10D1\u10D8' : '\u10D8'
+ }: ${jd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;
+ case 'invalid_union':
+ return '\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0';
+ case 'invalid_element':
+ return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;
+ default:
+ return '\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0';
+ }
+ };
+ };
+ function uj() {
+ return {localeError: cj()};
+ }
+ mk.exports = qr.default;
+});
+var Qy = xe((Kr, gk) => {
+ 'use strict';
+ var dj =
+ (Kr && Kr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ fj =
+ (Kr && Kr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ pj =
+ (Kr && Kr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ dj(t, e, n);
+ return fj(t, e), t;
+ };
+ Object.defineProperty(Kr, '__esModule', {value: !0});
+ Kr.default = yj;
+ var Cd = pj(ot()),
+ mj = () => {
+ let e = {
+ string: {
+ unit: '\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A',
+ verb: '\u1782\u17BD\u179A\u1798\u17B6\u1793',
+ },
+ file: {
+ unit: '\u1794\u17C3',
+ verb: '\u1782\u17BD\u179A\u1798\u17B6\u1793',
+ },
+ array: {
+ unit: '\u1792\u17B6\u178F\u17BB',
+ verb: '\u1782\u17BD\u179A\u1798\u17B6\u1793',
+ },
+ set: {
+ unit: '\u1792\u17B6\u178F\u17BB',
+ verb: '\u1782\u17BD\u179A\u1798\u17B6\u1793',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex:
+ '\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B',
+ email:
+ '\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B',
+ url: 'URL',
+ emoji:
+ '\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ '\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO',
+ date: '\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO',
+ time: '\u1798\u17C9\u17C4\u1784 ISO',
+ duration: '\u179A\u1799\u17C8\u1796\u17C1\u179B ISO',
+ ipv4: '\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4',
+ ipv6: '\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6',
+ cidrv4:
+ '\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4',
+ cidrv6:
+ '\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6',
+ base64:
+ '\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64',
+ base64url:
+ '\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url',
+ json_string:
+ '\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON',
+ e164: '\u179B\u17C1\u1781 E.164',
+ jwt: 'JWT',
+ template_literal:
+ '\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u179B\u17C1\u1781',
+ array: '\u17A2\u17B6\u179A\u17C1 (Array)',
+ null: '\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Cd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`
+ : `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Cd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Cd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${
+ r.origin ?? '\u178F\u1798\u17D2\u179B\u17C3'
+ } ${a} ${r.maximum.toString()} ${
+ o.unit ?? '\u1792\u17B6\u178F\u17BB'
+ }`
+ : `\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${
+ r.origin ?? '\u178F\u1798\u17D2\u179B\u17C3'
+ } ${a} ${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${
+ r.origin
+ } ${a} ${r.minimum.toString()} ${o.unit}`
+ : `\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${
+ r.origin
+ } ${a} ${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`
+ : `\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Cd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;
+ case 'invalid_union':
+ return '\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C';
+ case 'invalid_element':
+ return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;
+ default:
+ return '\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C';
+ }
+ };
+ };
+ function yj() {
+ return {localeError: mj()};
+ }
+ gk.exports = Kr.default;
+});
+var hk = xe((Da, vk) => {
+ 'use strict';
+ var gj =
+ (Da && Da.__importDefault) ||
+ function (e) {
+ return e && e.__esModule ? e : {default: e};
+ };
+ Object.defineProperty(Da, '__esModule', {value: !0});
+ Da.default = hj;
+ var vj = gj(Qy());
+ function hj() {
+ return (0, vj.default)();
+ }
+ vk.exports = Da.default;
+});
+var kk = xe((Vr, bk) => {
+ 'use strict';
+ var bj =
+ (Vr && Vr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ kj =
+ (Vr && Vr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Sj =
+ (Vr && Vr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ bj(t, e, n);
+ return kj(t, e), t;
+ };
+ Object.defineProperty(Vr, '__esModule', {value: !0});
+ Vr.default = Tj;
+ var Dd = Sj(ot()),
+ _j = () => {
+ let e = {
+ string: {unit: '\uBB38\uC790', verb: 'to have'},
+ file: {unit: '\uBC14\uC774\uD2B8', verb: 'to have'},
+ array: {unit: '\uAC1C', verb: 'to have'},
+ set: {unit: '\uAC1C', verb: 'to have'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\uC785\uB825',
+ email: '\uC774\uBA54\uC77C \uC8FC\uC18C',
+ url: 'URL',
+ emoji: '\uC774\uBAA8\uC9C0',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO \uB0A0\uC9DC\uC2DC\uAC04',
+ date: 'ISO \uB0A0\uC9DC',
+ time: 'ISO \uC2DC\uAC04',
+ duration: 'ISO \uAE30\uAC04',
+ ipv4: 'IPv4 \uC8FC\uC18C',
+ ipv6: 'IPv6 \uC8FC\uC18C',
+ cidrv4: 'IPv4 \uBC94\uC704',
+ cidrv6: 'IPv6 \uBC94\uC704',
+ base64: 'base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4',
+ base64url: 'base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4',
+ json_string: 'JSON \uBB38\uC790\uC5F4',
+ e164: 'E.164 \uBC88\uD638',
+ jwt: 'JWT',
+ template_literal: '\uC785\uB825',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Dd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`
+ : `\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Dd.stringifyPrimitive(
+ r.values[0]
+ )} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`
+ : `\uC798\uBABB\uB41C \uC635\uC158: ${Dd.joinValues(
+ r.values,
+ '\uB610\uB294 '
+ )} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;
+ case 'too_big': {
+ let a = r.inclusive ? '\uC774\uD558' : '\uBBF8\uB9CC',
+ o =
+ a === '\uBBF8\uB9CC'
+ ? '\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4'
+ : '\uC5EC\uC57C \uD569\uB2C8\uB2E4',
+ s = t(r.origin),
+ l = s?.unit ?? '\uC694\uC18C';
+ return s
+ ? `${
+ r.origin ?? '\uAC12'
+ }\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${l} ${a}${o}`
+ : `${
+ r.origin ?? '\uAC12'
+ }\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${a}${o}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '\uC774\uC0C1' : '\uCD08\uACFC',
+ o =
+ a === '\uC774\uC0C1'
+ ? '\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4'
+ : '\uC5EC\uC57C \uD569\uB2C8\uB2E4',
+ s = t(r.origin),
+ l = s?.unit ?? '\uC694\uC18C';
+ return s
+ ? `${
+ r.origin ?? '\uAC12'
+ }\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${l} ${a}${o}`
+ : `${
+ r.origin ?? '\uAC12'
+ }\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${a}${o}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`
+ : a.format === 'ends_with'
+ ? `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`
+ : a.format === 'includes'
+ ? `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`
+ : a.format === 'regex'
+ ? `\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`
+ : `\uC798\uBABB\uB41C ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;
+ case 'unrecognized_keys':
+ return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Dd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;
+ case 'invalid_union':
+ return '\uC798\uBABB\uB41C \uC785\uB825';
+ case 'invalid_element':
+ return `\uC798\uBABB\uB41C \uAC12: ${r.origin}`;
+ default:
+ return '\uC798\uBABB\uB41C \uC785\uB825';
+ }
+ };
+ };
+ function Tj() {
+ return {localeError: _j()};
+ }
+ bk.exports = Vr.default;
+});
+var Tk = xe((Jr, _k) => {
+ 'use strict';
+ var Ej =
+ (Jr && Jr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Ij =
+ (Jr && Jr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Pj =
+ (Jr && Jr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Ej(t, e, n);
+ return Ij(t, e), t;
+ };
+ Object.defineProperty(Jr, '__esModule', {value: !0});
+ Jr.default = wj;
+ var Ad = Pj(ot()),
+ zc = (e) => e.charAt(0).toUpperCase() + e.slice(1);
+ function Sk(e) {
+ let t = Math.abs(e),
+ n = t % 10,
+ i = t % 100;
+ return (i >= 11 && i <= 19) || n === 0 ? 'many' : n === 1 ? 'one' : 'few';
+ }
+ var xj = () => {
+ let e = {
+ string: {
+ unit: {one: 'simbolis', few: 'simboliai', many: 'simboli\u0173'},
+ verb: {
+ smaller: {
+ inclusive: 'turi b\u016Bti ne ilgesn\u0117 kaip',
+ notInclusive: 'turi b\u016Bti trumpesn\u0117 kaip',
+ },
+ bigger: {
+ inclusive: 'turi b\u016Bti ne trumpesn\u0117 kaip',
+ notInclusive: 'turi b\u016Bti ilgesn\u0117 kaip',
+ },
+ },
+ },
+ file: {
+ unit: {one: 'baitas', few: 'baitai', many: 'bait\u0173'},
+ verb: {
+ smaller: {
+ inclusive: 'turi b\u016Bti ne didesnis kaip',
+ notInclusive: 'turi b\u016Bti ma\u017Eesnis kaip',
+ },
+ bigger: {
+ inclusive: 'turi b\u016Bti ne ma\u017Eesnis kaip',
+ notInclusive: 'turi b\u016Bti didesnis kaip',
+ },
+ },
+ },
+ array: {
+ unit: {one: 'element\u0105', few: 'elementus', many: 'element\u0173'},
+ verb: {
+ smaller: {
+ inclusive: 'turi tur\u0117ti ne daugiau kaip',
+ notInclusive: 'turi tur\u0117ti ma\u017Eiau kaip',
+ },
+ bigger: {
+ inclusive: 'turi tur\u0117ti ne ma\u017Eiau kaip',
+ notInclusive: 'turi tur\u0117ti daugiau kaip',
+ },
+ },
+ },
+ set: {
+ unit: {one: 'element\u0105', few: 'elementus', many: 'element\u0173'},
+ verb: {
+ smaller: {
+ inclusive: 'turi tur\u0117ti ne daugiau kaip',
+ notInclusive: 'turi tur\u0117ti ma\u017Eiau kaip',
+ },
+ bigger: {
+ inclusive: 'turi tur\u0117ti ne ma\u017Eiau kaip',
+ notInclusive: 'turi tur\u0117ti daugiau kaip',
+ },
+ },
+ },
+ };
+ function t(r, a, o, s) {
+ let l = e[r] ?? null;
+ return l === null
+ ? l
+ : {unit: l.unit[a], verb: l.verb[s][o ? 'inclusive' : 'notInclusive']};
+ }
+ let n = {
+ regex: '\u012Fvestis',
+ email: 'el. pa\u0161to adresas',
+ url: 'URL',
+ emoji: 'jaustukas',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO data ir laikas',
+ date: 'ISO data',
+ time: 'ISO laikas',
+ duration: 'ISO trukm\u0117',
+ ipv4: 'IPv4 adresas',
+ ipv6: 'IPv6 adresas',
+ cidrv4: 'IPv4 tinklo prefiksas (CIDR)',
+ cidrv6: 'IPv6 tinklo prefiksas (CIDR)',
+ base64: 'base64 u\u017Ekoduota eilut\u0117',
+ base64url: 'base64url u\u017Ekoduota eilut\u0117',
+ json_string: 'JSON eilut\u0117',
+ e164: 'E.164 numeris',
+ jwt: 'JWT',
+ template_literal: '\u012Fvestis',
+ },
+ i = {
+ nan: 'NaN',
+ number: 'skai\u010Dius',
+ bigint: 'sveikasis skai\u010Dius',
+ string: 'eilut\u0117',
+ boolean: 'login\u0117 reik\u0161m\u0117',
+ undefined: 'neapibr\u0117\u017Eta reik\u0161m\u0117',
+ function: 'funkcija',
+ symbol: 'simbolis',
+ array: 'masyvas',
+ object: 'objektas',
+ null: 'nulin\u0117 reik\u0161m\u0117',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Ad.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Gautas tipas ${s}, o tik\u0117tasi - instanceof ${r.expected}`
+ : `Gautas tipas ${s}, o tik\u0117tasi - ${a}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Privalo b\u016Bti ${Ad.stringifyPrimitive(r.values[0])}`
+ : `Privalo b\u016Bti vienas i\u0161 ${Ad.joinValues(
+ r.values,
+ '|'
+ )} pasirinkim\u0173`;
+ case 'too_big': {
+ let a = i[r.origin] ?? r.origin,
+ o = t(
+ r.origin,
+ Sk(Number(r.maximum)),
+ r.inclusive ?? !1,
+ 'smaller'
+ );
+ if (o?.verb)
+ return `${zc(a ?? r.origin ?? 'reik\u0161m\u0117')} ${
+ o.verb
+ } ${r.maximum.toString()} ${o.unit ?? 'element\u0173'}`;
+ let s = r.inclusive ? 'ne didesnis kaip' : 'ma\u017Eesnis kaip';
+ return `${zc(
+ a ?? r.origin ?? 'reik\u0161m\u0117'
+ )} turi b\u016Bti ${s} ${r.maximum.toString()} ${o?.unit}`;
+ }
+ case 'too_small': {
+ let a = i[r.origin] ?? r.origin,
+ o = t(r.origin, Sk(Number(r.minimum)), r.inclusive ?? !1, 'bigger');
+ if (o?.verb)
+ return `${zc(a ?? r.origin ?? 'reik\u0161m\u0117')} ${
+ o.verb
+ } ${r.minimum.toString()} ${o.unit ?? 'element\u0173'}`;
+ let s = r.inclusive ? 'ne ma\u017Eesnis kaip' : 'didesnis kaip';
+ return `${zc(
+ a ?? r.origin ?? 'reik\u0161m\u0117'
+ )} turi b\u016Bti ${s} ${r.minimum.toString()} ${o?.unit}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Eilut\u0117 privalo pasibaigti "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`
+ : a.format === 'regex'
+ ? `Eilut\u0117 privalo atitikti ${a.pattern}`
+ : `Neteisingas ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;
+ case 'unrecognized_keys':
+ return `Neatpa\u017Eint${r.keys.length > 1 ? 'i' : 'as'} rakt${
+ r.keys.length > 1 ? 'ai' : 'as'
+ }: ${Ad.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return 'Rastas klaidingas raktas';
+ case 'invalid_union':
+ return 'Klaidinga \u012Fvestis';
+ case 'invalid_element': {
+ let a = i[r.origin] ?? r.origin;
+ return `${zc(
+ a ?? r.origin ?? 'reik\u0161m\u0117'
+ )} turi klaiding\u0105 \u012Fvest\u012F`;
+ }
+ default:
+ return 'Klaidinga \u012Fvestis';
+ }
+ };
+ };
+ function wj() {
+ return {localeError: xj()};
+ }
+ _k.exports = Jr.default;
+});
+var Ik = xe((Hr, Ek) => {
+ 'use strict';
+ var Oj =
+ (Hr && Hr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ $j =
+ (Hr && Hr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ jj =
+ (Hr && Hr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Oj(t, e, n);
+ return $j(t, e), t;
+ };
+ Object.defineProperty(Hr, '__esModule', {value: !0});
+ Hr.default = Dj;
+ var Md = jj(ot()),
+ Cj = () => {
+ let e = {
+ string: {
+ unit: '\u0437\u043D\u0430\u0446\u0438',
+ verb: '\u0434\u0430 \u0438\u043C\u0430\u0430\u0442',
+ },
+ file: {
+ unit: '\u0431\u0430\u0458\u0442\u0438',
+ verb: '\u0434\u0430 \u0438\u043C\u0430\u0430\u0442',
+ },
+ array: {
+ unit: '\u0441\u0442\u0430\u0432\u043A\u0438',
+ verb: '\u0434\u0430 \u0438\u043C\u0430\u0430\u0442',
+ },
+ set: {
+ unit: '\u0441\u0442\u0430\u0432\u043A\u0438',
+ verb: '\u0434\u0430 \u0438\u043C\u0430\u0430\u0442',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0432\u043D\u0435\u0441',
+ email:
+ '\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430',
+ url: 'URL',
+ emoji: '\u0435\u043C\u043E\u045F\u0438',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ 'ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435',
+ date: 'ISO \u0434\u0430\u0442\u0443\u043C',
+ time: 'ISO \u0432\u0440\u0435\u043C\u0435',
+ duration:
+ 'ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435',
+ ipv4: 'IPv4 \u0430\u0434\u0440\u0435\u0441\u0430',
+ ipv6: 'IPv6 \u0430\u0434\u0440\u0435\u0441\u0430',
+ cidrv4: 'IPv4 \u043E\u043F\u0441\u0435\u0433',
+ cidrv6: 'IPv6 \u043E\u043F\u0441\u0435\u0433',
+ base64:
+ 'base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430',
+ base64url:
+ 'base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430',
+ json_string: 'JSON \u043D\u0438\u0437\u0430',
+ e164: 'E.164 \u0431\u0440\u043E\u0458',
+ jwt: 'JWT',
+ template_literal: '\u0432\u043D\u0435\u0441',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0431\u0440\u043E\u0458',
+ array: '\u043D\u0438\u0437\u0430',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Md.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`
+ : `\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Invalid input: expected ${Md.stringifyPrimitive(r.values[0])}`
+ : `\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Md.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${
+ r.origin ??
+ '\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430'
+ } \u0434\u0430 \u0438\u043C\u0430 ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438'
+ }`
+ : `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${
+ r.origin ??
+ '\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430'
+ } \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${
+ r.origin
+ } \u0434\u0430 \u0438\u043C\u0430 ${a}${r.minimum.toString()} ${
+ o.unit
+ }`
+ : `\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${
+ r.origin
+ } \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`
+ : `Invalid ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1
+ ? '\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438'
+ : '\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447'
+ }: ${Md.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;
+ case 'invalid_union':
+ return '\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441';
+ case 'invalid_element':
+ return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;
+ default:
+ return '\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441';
+ }
+ };
+ };
+ function Dj() {
+ return {localeError: Cj()};
+ }
+ Ek.exports = Hr.default;
+});
+var xk = xe((Wr, Pk) => {
+ 'use strict';
+ var Aj =
+ (Wr && Wr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Mj =
+ (Wr && Wr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Nj =
+ (Wr && Wr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Aj(t, e, n);
+ return Mj(t, e), t;
+ };
+ Object.defineProperty(Wr, '__esModule', {value: !0});
+ Wr.default = Lj;
+ var Nd = Nj(ot()),
+ Rj = () => {
+ let e = {
+ string: {unit: 'aksara', verb: 'mempunyai'},
+ file: {unit: 'bait', verb: 'mempunyai'},
+ array: {unit: 'elemen', verb: 'mempunyai'},
+ set: {unit: 'elemen', verb: 'mempunyai'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'alamat e-mel',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'tarikh masa ISO',
+ date: 'tarikh ISO',
+ time: 'masa ISO',
+ duration: 'tempoh ISO',
+ ipv4: 'alamat IPv4',
+ ipv6: 'alamat IPv6',
+ cidrv4: 'julat IPv4',
+ cidrv6: 'julat IPv6',
+ base64: 'string dikodkan base64',
+ base64url: 'string dikodkan base64url',
+ json_string: 'string JSON',
+ e164: 'nombor E.164',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN', number: 'nombor'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Nd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`
+ : `Input tidak sah: dijangka ${a}, diterima ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Input tidak sah: dijangka ${Nd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Pilihan tidak sah: dijangka salah satu daripada ${Nd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Terlalu besar: dijangka ${r.origin ?? 'nilai'} ${
+ o.verb
+ } ${a}${r.maximum.toString()} ${o.unit ?? 'elemen'}`
+ : `Terlalu besar: dijangka ${
+ r.origin ?? 'nilai'
+ } adalah ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Terlalu kecil: dijangka ${r.origin} ${
+ o.verb
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `Terlalu kecil: dijangka ${
+ r.origin
+ } adalah ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `String tidak sah: mesti bermula dengan "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `String tidak sah: mesti berakhir dengan "${a.suffix}"`
+ : a.format === 'includes'
+ ? `String tidak sah: mesti mengandungi "${a.includes}"`
+ : a.format === 'regex'
+ ? `String tidak sah: mesti sepadan dengan corak ${a.pattern}`
+ : `${n[a.format] ?? r.format} tidak sah`;
+ }
+ case 'not_multiple_of':
+ return `Nombor tidak sah: perlu gandaan ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Kunci tidak dikenali: ${Nd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Kunci tidak sah dalam ${r.origin}`;
+ case 'invalid_union':
+ return 'Input tidak sah';
+ case 'invalid_element':
+ return `Nilai tidak sah dalam ${r.origin}`;
+ default:
+ return 'Input tidak sah';
+ }
+ };
+ };
+ function Lj() {
+ return {localeError: Rj()};
+ }
+ Pk.exports = Wr.default;
+});
+var Ok = xe((Gr, wk) => {
+ 'use strict';
+ var Fj =
+ (Gr && Gr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ zj =
+ (Gr && Gr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Bj =
+ (Gr && Gr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Fj(t, e, n);
+ return zj(t, e), t;
+ };
+ Object.defineProperty(Gr, '__esModule', {value: !0});
+ Gr.default = Zj;
+ var Rd = Bj(ot()),
+ Uj = () => {
+ let e = {
+ string: {unit: 'tekens', verb: 'heeft'},
+ file: {unit: 'bytes', verb: 'heeft'},
+ array: {unit: 'elementen', verb: 'heeft'},
+ set: {unit: 'elementen', verb: 'heeft'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'invoer',
+ email: 'emailadres',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO datum en tijd',
+ date: 'ISO datum',
+ time: 'ISO tijd',
+ duration: 'ISO duur',
+ ipv4: 'IPv4-adres',
+ ipv6: 'IPv6-adres',
+ cidrv4: 'IPv4-bereik',
+ cidrv6: 'IPv6-bereik',
+ base64: 'base64-gecodeerde tekst',
+ base64url: 'base64 URL-gecodeerde tekst',
+ json_string: 'JSON string',
+ e164: 'E.164-nummer',
+ jwt: 'JWT',
+ template_literal: 'invoer',
+ },
+ i = {nan: 'NaN', number: 'getal'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Rd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`
+ : `Ongeldige invoer: verwacht ${a}, ontving ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ongeldige invoer: verwacht ${Rd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Ongeldige optie: verwacht \xE9\xE9n van ${Rd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin),
+ s =
+ r.origin === 'date'
+ ? 'laat'
+ : r.origin === 'string'
+ ? 'lang'
+ : 'groot';
+ return o
+ ? `Te ${s}: verwacht dat ${
+ r.origin ?? 'waarde'
+ } ${a}${r.maximum.toString()} ${o.unit ?? 'elementen'} ${
+ o.verb
+ }`
+ : `Te ${s}: verwacht dat ${
+ r.origin ?? 'waarde'
+ } ${a}${r.maximum.toString()} is`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin),
+ s =
+ r.origin === 'date'
+ ? 'vroeg'
+ : r.origin === 'string'
+ ? 'kort'
+ : 'klein';
+ return o
+ ? `Te ${s}: verwacht dat ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit} ${o.verb}`
+ : `Te ${s}: verwacht dat ${
+ r.origin
+ } ${a}${r.minimum.toString()} is`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ongeldige tekst: moet met "${a.prefix}" beginnen`
+ : a.format === 'ends_with'
+ ? `Ongeldige tekst: moet op "${a.suffix}" eindigen`
+ : a.format === 'includes'
+ ? `Ongeldige tekst: moet "${a.includes}" bevatten`
+ : a.format === 'regex'
+ ? `Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`
+ : `Ongeldig: ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;
+ case 'unrecognized_keys':
+ return `Onbekende key${
+ r.keys.length > 1 ? 's' : ''
+ }: ${Rd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Ongeldige key in ${r.origin}`;
+ case 'invalid_union':
+ return 'Ongeldige invoer';
+ case 'invalid_element':
+ return `Ongeldige waarde in ${r.origin}`;
+ default:
+ return 'Ongeldige invoer';
+ }
+ };
+ };
+ function Zj() {
+ return {localeError: Uj()};
+ }
+ wk.exports = Gr.default;
+});
+var jk = xe((Xr, $k) => {
+ 'use strict';
+ var qj =
+ (Xr && Xr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Kj =
+ (Xr && Xr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Vj =
+ (Xr && Xr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ qj(t, e, n);
+ return Kj(t, e), t;
+ };
+ Object.defineProperty(Xr, '__esModule', {value: !0});
+ Xr.default = Hj;
+ var Ld = Vj(ot()),
+ Jj = () => {
+ let e = {
+ string: {unit: 'tegn', verb: '\xE5 ha'},
+ file: {unit: 'bytes', verb: '\xE5 ha'},
+ array: {unit: 'elementer', verb: '\xE5 inneholde'},
+ set: {unit: 'elementer', verb: '\xE5 inneholde'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'input',
+ email: 'e-postadresse',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO dato- og klokkeslett',
+ date: 'ISO-dato',
+ time: 'ISO-klokkeslett',
+ duration: 'ISO-varighet',
+ ipv4: 'IPv4-omr\xE5de',
+ ipv6: 'IPv6-omr\xE5de',
+ cidrv4: 'IPv4-spekter',
+ cidrv6: 'IPv6-spekter',
+ base64: 'base64-enkodet streng',
+ base64url: 'base64url-enkodet streng',
+ json_string: 'JSON-streng',
+ e164: 'E.164-nummer',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {nan: 'NaN', number: 'tall', array: 'liste'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Ld.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`
+ : `Ugyldig input: forventet ${a}, fikk ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ugyldig verdi: forventet ${Ld.stringifyPrimitive(r.values[0])}`
+ : `Ugyldig valg: forventet en av ${Ld.joinValues(r.values, '|')}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `For stor(t): forventet ${
+ r.origin ?? 'value'
+ } til \xE5 ha ${a}${r.maximum.toString()} ${
+ o.unit ?? 'elementer'
+ }`
+ : `For stor(t): forventet ${
+ r.origin ?? 'value'
+ } til \xE5 ha ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `For lite(n): forventet ${
+ r.origin
+ } til \xE5 ha ${a}${r.minimum.toString()} ${o.unit}`
+ : `For lite(n): forventet ${
+ r.origin
+ } til \xE5 ha ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ugyldig streng: m\xE5 starte med "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Ugyldig streng: m\xE5 ende med "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Ugyldig streng: m\xE5 inneholde "${a.includes}"`
+ : a.format === 'regex'
+ ? `Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`
+ : `Ugyldig ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1 ? 'Ukjente n\xF8kler' : 'Ukjent n\xF8kkel'
+ }: ${Ld.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Ugyldig n\xF8kkel i ${r.origin}`;
+ case 'invalid_union':
+ return 'Ugyldig input';
+ case 'invalid_element':
+ return `Ugyldig verdi i ${r.origin}`;
+ default:
+ return 'Ugyldig input';
+ }
+ };
+ };
+ function Hj() {
+ return {localeError: Jj()};
+ }
+ $k.exports = Xr.default;
+});
+var Dk = xe((Yr, Ck) => {
+ 'use strict';
+ var Wj =
+ (Yr && Yr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ Gj =
+ (Yr && Yr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Xj =
+ (Yr && Yr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ Wj(t, e, n);
+ return Gj(t, e), t;
+ };
+ Object.defineProperty(Yr, '__esModule', {value: !0});
+ Yr.default = Qj;
+ var Fd = Xj(ot()),
+ Yj = () => {
+ let e = {
+ string: {unit: 'harf', verb: 'olmal\u0131d\u0131r'},
+ file: {unit: 'bayt', verb: 'olmal\u0131d\u0131r'},
+ array: {unit: 'unsur', verb: 'olmal\u0131d\u0131r'},
+ set: {unit: 'unsur', verb: 'olmal\u0131d\u0131r'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'giren',
+ email: 'epostag\xE2h',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO heng\xE2m\u0131',
+ date: 'ISO tarihi',
+ time: 'ISO zaman\u0131',
+ duration: 'ISO m\xFCddeti',
+ ipv4: 'IPv4 ni\u015F\xE2n\u0131',
+ ipv6: 'IPv6 ni\u015F\xE2n\u0131',
+ cidrv4: 'IPv4 menzili',
+ cidrv6: 'IPv6 menzili',
+ base64: 'base64-\u015Fifreli metin',
+ base64url: 'base64url-\u015Fifreli metin',
+ json_string: 'JSON metin',
+ e164: 'E.164 say\u0131s\u0131',
+ jwt: 'JWT',
+ template_literal: 'giren',
+ },
+ i = {nan: 'NaN', number: 'numara', array: 'saf', null: 'gayb'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Fd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${s}`
+ : `F\xE2sit giren: umulan ${a}, al\u0131nan ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `F\xE2sit giren: umulan ${Fd.stringifyPrimitive(r.values[0])}`
+ : `F\xE2sit tercih: m\xFBteberler ${Fd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Fazla b\xFCy\xFCk: ${
+ r.origin ?? 'value'
+ }, ${a}${r.maximum.toString()} ${
+ o.unit ?? 'elements'
+ } sahip olmal\u0131yd\u0131.`
+ : `Fazla b\xFCy\xFCk: ${
+ r.origin ?? 'value'
+ }, ${a}${r.maximum.toString()} olmal\u0131yd\u0131.`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Fazla k\xFC\xE7\xFCk: ${
+ r.origin
+ }, ${a}${r.minimum.toString()} ${
+ o.unit
+ } sahip olmal\u0131yd\u0131.`
+ : `Fazla k\xFC\xE7\xFCk: ${
+ r.origin
+ }, ${a}${r.minimum.toString()} olmal\u0131yd\u0131.`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`
+ : a.format === 'ends_with'
+ ? `F\xE2sit metin: "${a.suffix}" ile bitmeli.`
+ : a.format === 'includes'
+ ? `F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`
+ : a.format === 'regex'
+ ? `F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`
+ : `F\xE2sit ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;
+ case 'unrecognized_keys':
+ return `Tan\u0131nmayan anahtar ${
+ r.keys.length > 1 ? 's' : ''
+ }: ${Fd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;
+ case 'invalid_union':
+ return 'Giren tan\u0131namad\u0131.';
+ case 'invalid_element':
+ return `${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;
+ default:
+ return 'K\u0131ymet tan\u0131namad\u0131.';
+ }
+ };
+ };
+ function Qj() {
+ return {localeError: Yj()};
+ }
+ Ck.exports = Yr.default;
+});
+var Mk = xe((Qr, Ak) => {
+ 'use strict';
+ var eC =
+ (Qr && Qr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ tC =
+ (Qr && Qr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ nC =
+ (Qr && Qr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ eC(t, e, n);
+ return tC(t, e), t;
+ };
+ Object.defineProperty(Qr, '__esModule', {value: !0});
+ Qr.default = iC;
+ var zd = nC(ot()),
+ rC = () => {
+ let e = {
+ string: {
+ unit: '\u062A\u0648\u06A9\u064A',
+ verb: '\u0648\u0644\u0631\u064A',
+ },
+ file: {
+ unit: '\u0628\u0627\u06CC\u067C\u0633',
+ verb: '\u0648\u0644\u0631\u064A',
+ },
+ array: {
+ unit: '\u062A\u0648\u06A9\u064A',
+ verb: '\u0648\u0644\u0631\u064A',
+ },
+ set: {
+ unit: '\u062A\u0648\u06A9\u064A',
+ verb: '\u0648\u0644\u0631\u064A',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0648\u0631\u0648\u062F\u064A',
+ email: '\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9',
+ url: '\u06CC\u0648 \u0622\u0631 \u0627\u0644',
+ emoji: '\u0627\u06CC\u0645\u0648\u062C\u064A',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: '\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A',
+ date: '\u0646\u06D0\u067C\u0647',
+ time: '\u0648\u062E\u062A',
+ duration: '\u0645\u0648\u062F\u0647',
+ ipv4: '\u062F IPv4 \u067E\u062A\u0647',
+ ipv6: '\u062F IPv6 \u067E\u062A\u0647',
+ cidrv4: '\u062F IPv4 \u0633\u0627\u062D\u0647',
+ cidrv6: '\u062F IPv6 \u0633\u0627\u062D\u0647',
+ base64: 'base64-encoded \u0645\u062A\u0646',
+ base64url: 'base64url-encoded \u0645\u062A\u0646',
+ json_string: 'JSON \u0645\u062A\u0646',
+ e164: '\u062F E.164 \u0634\u0645\u06D0\u0631\u0647',
+ jwt: 'JWT',
+ template_literal: '\u0648\u0631\u0648\u062F\u064A',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0639\u062F\u062F',
+ array: '\u0627\u0631\u06D0',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = zd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`
+ : `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${zd.stringifyPrimitive(
+ r.values[0]
+ )} \u0648\u0627\u06CC`
+ : `\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${zd.joinValues(
+ r.values,
+ '|'
+ )} \u0685\u062E\u0647 \u0648\u0627\u06CC`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${
+ r.origin ?? '\u0627\u0631\u0632\u069A\u062A'
+ } \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u0639\u0646\u0635\u0631\u0648\u0646\u0647'
+ } \u0648\u0644\u0631\u064A`
+ : `\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${
+ r.origin ?? '\u0627\u0631\u0632\u069A\u062A'
+ } \u0628\u0627\u06CC\u062F ${a}${r.maximum.toString()} \u0648\u064A`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${
+ r.origin
+ } \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} ${
+ o.unit
+ } \u0648\u0644\u0631\u064A`
+ : `\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${
+ r.origin
+ } \u0628\u0627\u06CC\u062F ${a}${r.minimum.toString()} \u0648\u064A`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`
+ : a.format === 'ends_with'
+ ? `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`
+ : a.format === 'includes'
+ ? `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`
+ : a.format === 'regex'
+ ? `\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`
+ : `${
+ n[a.format] ?? r.format
+ } \u0646\u0627\u0633\u0645 \u062F\u06CC`;
+ }
+ case 'not_multiple_of':
+ return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;
+ case 'unrecognized_keys':
+ return `\u0646\u0627\u0633\u0645 ${
+ r.keys.length > 1
+ ? '\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647'
+ : '\u06A9\u0644\u06CC\u0689'
+ }: ${zd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;
+ case 'invalid_union':
+ return '\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A';
+ case 'invalid_element':
+ return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;
+ default:
+ return '\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A';
+ }
+ };
+ };
+ function iC() {
+ return {localeError: rC()};
+ }
+ Ak.exports = Qr.default;
+});
+var Rk = xe((ei, Nk) => {
+ 'use strict';
+ var aC =
+ (ei && ei.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ oC =
+ (ei && ei.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ sC =
+ (ei && ei.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ aC(t, e, n);
+ return oC(t, e), t;
+ };
+ Object.defineProperty(ei, '__esModule', {value: !0});
+ ei.default = cC;
+ var Bd = sC(ot()),
+ lC = () => {
+ let e = {
+ string: {unit: 'znak\xF3w', verb: 'mie\u0107'},
+ file: {unit: 'bajt\xF3w', verb: 'mie\u0107'},
+ array: {unit: 'element\xF3w', verb: 'mie\u0107'},
+ set: {unit: 'element\xF3w', verb: 'mie\u0107'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'wyra\u017Cenie',
+ email: 'adres email',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'data i godzina w formacie ISO',
+ date: 'data w formacie ISO',
+ time: 'godzina w formacie ISO',
+ duration: 'czas trwania ISO',
+ ipv4: 'adres IPv4',
+ ipv6: 'adres IPv6',
+ cidrv4: 'zakres IPv4',
+ cidrv6: 'zakres IPv6',
+ base64: 'ci\u0105g znak\xF3w zakodowany w formacie base64',
+ base64url: 'ci\u0105g znak\xF3w zakodowany w formacie base64url',
+ json_string: 'ci\u0105g znak\xF3w w formacie JSON',
+ e164: 'liczba E.164',
+ jwt: 'JWT',
+ template_literal: 'wej\u015Bcie',
+ },
+ i = {nan: 'NaN', number: 'liczba', array: 'tablica'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Bd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`
+ : `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Bd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Bd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${
+ r.origin ?? 'warto\u015B\u0107'
+ } b\u0119dzie mie\u0107 ${a}${r.maximum.toString()} ${
+ o.unit ?? 'element\xF3w'
+ }`
+ : `Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${
+ r.origin ?? 'warto\u015B\u0107'
+ } b\u0119dzie wynosi\u0107 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${
+ r.origin ?? 'warto\u015B\u0107'
+ } b\u0119dzie mie\u0107 ${a}${r.minimum.toString()} ${
+ o.unit ?? 'element\xF3w'
+ }`
+ : `Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${
+ r.origin ?? 'warto\u015B\u0107'
+ } b\u0119dzie wynosi\u0107 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`
+ : a.format === 'regex'
+ ? `Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`
+ : `Nieprawid\u0142ow(y/a/e) ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Nierozpoznane klucze${
+ r.keys.length > 1 ? 's' : ''
+ }: ${Bd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Nieprawid\u0142owy klucz w ${r.origin}`;
+ case 'invalid_union':
+ return 'Nieprawid\u0142owe dane wej\u015Bciowe';
+ case 'invalid_element':
+ return `Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;
+ default:
+ return 'Nieprawid\u0142owe dane wej\u015Bciowe';
+ }
+ };
+ };
+ function cC() {
+ return {localeError: lC()};
+ }
+ Nk.exports = ei.default;
+});
+var Fk = xe((ti, Lk) => {
+ 'use strict';
+ var uC =
+ (ti && ti.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ dC =
+ (ti && ti.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ fC =
+ (ti && ti.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ uC(t, e, n);
+ return dC(t, e), t;
+ };
+ Object.defineProperty(ti, '__esModule', {value: !0});
+ ti.default = mC;
+ var Ud = fC(ot()),
+ pC = () => {
+ let e = {
+ string: {unit: 'caracteres', verb: 'ter'},
+ file: {unit: 'bytes', verb: 'ter'},
+ array: {unit: 'itens', verb: 'ter'},
+ set: {unit: 'itens', verb: 'ter'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'padr\xE3o',
+ email: 'endere\xE7o de e-mail',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'data e hora ISO',
+ date: 'data ISO',
+ time: 'hora ISO',
+ duration: 'dura\xE7\xE3o ISO',
+ ipv4: 'endere\xE7o IPv4',
+ ipv6: 'endere\xE7o IPv6',
+ cidrv4: 'faixa de IPv4',
+ cidrv6: 'faixa de IPv6',
+ base64: 'texto codificado em base64',
+ base64url: 'URL codificada em base64',
+ json_string: 'texto JSON',
+ e164: 'n\xFAmero E.164',
+ jwt: 'JWT',
+ template_literal: 'entrada',
+ },
+ i = {nan: 'NaN', number: 'n\xFAmero', null: 'nulo'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Ud.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${s}`
+ : `Tipo inv\xE1lido: esperado ${a}, recebido ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Entrada inv\xE1lida: esperado ${Ud.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Op\xE7\xE3o inv\xE1lida: esperada uma das ${Ud.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Muito grande: esperado que ${
+ r.origin ?? 'valor'
+ } tivesse ${a}${r.maximum.toString()} ${o.unit ?? 'elementos'}`
+ : `Muito grande: esperado que ${
+ r.origin ?? 'valor'
+ } fosse ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Muito pequeno: esperado que ${
+ r.origin
+ } tivesse ${a}${r.minimum.toString()} ${o.unit}`
+ : `Muito pequeno: esperado que ${
+ r.origin
+ } fosse ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Texto inv\xE1lido: deve terminar com "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Texto inv\xE1lido: deve incluir "${a.includes}"`
+ : a.format === 'regex'
+ ? `Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`
+ : `${n[a.format] ?? r.format} inv\xE1lido`;
+ }
+ case 'not_multiple_of':
+ return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Chave${r.keys.length > 1 ? 's' : ''} desconhecida${
+ r.keys.length > 1 ? 's' : ''
+ }: ${Ud.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Chave inv\xE1lida em ${r.origin}`;
+ case 'invalid_union':
+ return 'Entrada inv\xE1lida';
+ case 'invalid_element':
+ return `Valor inv\xE1lido em ${r.origin}`;
+ default:
+ return 'Campo inv\xE1lido';
+ }
+ };
+ };
+ function mC() {
+ return {localeError: pC()};
+ }
+ Lk.exports = ti.default;
+});
+var Uk = xe((ni, Bk) => {
+ 'use strict';
+ var yC =
+ (ni && ni.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ gC =
+ (ni && ni.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ vC =
+ (ni && ni.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ yC(t, e, n);
+ return gC(t, e), t;
+ };
+ Object.defineProperty(ni, '__esModule', {value: !0});
+ ni.default = bC;
+ var Zd = vC(ot());
+ function zk(e, t, n, i) {
+ let r = Math.abs(e),
+ a = r % 10,
+ o = r % 100;
+ return o >= 11 && o <= 19 ? i : a === 1 ? t : a >= 2 && a <= 4 ? n : i;
+ }
+ var hC = () => {
+ let e = {
+ string: {
+ unit: {
+ one: '\u0441\u0438\u043C\u0432\u043E\u043B',
+ few: '\u0441\u0438\u043C\u0432\u043E\u043B\u0430',
+ many: '\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432',
+ },
+ verb: '\u0438\u043C\u0435\u0442\u044C',
+ },
+ file: {
+ unit: {
+ one: '\u0431\u0430\u0439\u0442',
+ few: '\u0431\u0430\u0439\u0442\u0430',
+ many: '\u0431\u0430\u0439\u0442',
+ },
+ verb: '\u0438\u043C\u0435\u0442\u044C',
+ },
+ array: {
+ unit: {
+ one: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442',
+ few: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430',
+ many: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432',
+ },
+ verb: '\u0438\u043C\u0435\u0442\u044C',
+ },
+ set: {
+ unit: {
+ one: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442',
+ few: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430',
+ many: '\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432',
+ },
+ verb: '\u0438\u043C\u0435\u0442\u044C',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0432\u0432\u043E\u0434',
+ email: 'email \u0430\u0434\u0440\u0435\u0441',
+ url: 'URL',
+ emoji: '\u044D\u043C\u043E\u0434\u0437\u0438',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ 'ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F',
+ date: 'ISO \u0434\u0430\u0442\u0430',
+ time: 'ISO \u0432\u0440\u0435\u043C\u044F',
+ duration:
+ 'ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C',
+ ipv4: 'IPv4 \u0430\u0434\u0440\u0435\u0441',
+ ipv6: 'IPv6 \u0430\u0434\u0440\u0435\u0441',
+ cidrv4: 'IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D',
+ cidrv6: 'IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D',
+ base64:
+ '\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64',
+ base64url:
+ '\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url',
+ json_string: 'JSON \u0441\u0442\u0440\u043E\u043A\u0430',
+ e164: '\u043D\u043E\u043C\u0435\u0440 E.164',
+ jwt: 'JWT',
+ template_literal: '\u0432\u0432\u043E\u0434',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0447\u0438\u0441\u043B\u043E',
+ array: '\u043C\u0430\u0441\u0441\u0438\u0432',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Zd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`
+ : `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Zd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Zd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.maximum),
+ l = zk(s, o.unit.one, o.unit.few, o.unit.many);
+ return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435'
+ } \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${r.maximum.toString()} ${l}`;
+ }
+ return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435'
+ } \u0431\u0443\u0434\u0435\u0442 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ if (o) {
+ let s = Number(r.minimum),
+ l = zk(s, o.unit.one, o.unit.few, o.unit.many);
+ return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${
+ r.origin
+ } \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${r.minimum.toString()} ${l}`;
+ }
+ return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${
+ r.origin
+ } \u0431\u0443\u0434\u0435\u0442 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`
+ : `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${
+ r.keys.length > 1 ? '\u044B\u0435' : '\u044B\u0439'
+ } \u043A\u043B\u044E\u0447${
+ r.keys.length > 1 ? '\u0438' : ''
+ }: ${Zd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;
+ case 'invalid_union':
+ return '\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435';
+ case 'invalid_element':
+ return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;
+ default:
+ return '\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435';
+ }
+ };
+ };
+ function bC() {
+ return {localeError: hC()};
+ }
+ Bk.exports = ni.default;
+});
+var qk = xe((ri, Zk) => {
+ 'use strict';
+ var kC =
+ (ri && ri.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ SC =
+ (ri && ri.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ _C =
+ (ri && ri.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ kC(t, e, n);
+ return SC(t, e), t;
+ };
+ Object.defineProperty(ri, '__esModule', {value: !0});
+ ri.default = EC;
+ var qd = _C(ot()),
+ TC = () => {
+ let e = {
+ string: {unit: 'znakov', verb: 'imeti'},
+ file: {unit: 'bajtov', verb: 'imeti'},
+ array: {unit: 'elementov', verb: 'imeti'},
+ set: {unit: 'elementov', verb: 'imeti'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'vnos',
+ email: 'e-po\u0161tni naslov',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO datum in \u010Das',
+ date: 'ISO datum',
+ time: 'ISO \u010Das',
+ duration: 'ISO trajanje',
+ ipv4: 'IPv4 naslov',
+ ipv6: 'IPv6 naslov',
+ cidrv4: 'obseg IPv4',
+ cidrv6: 'obseg IPv6',
+ base64: 'base64 kodiran niz',
+ base64url: 'base64url kodiran niz',
+ json_string: 'JSON niz',
+ e164: 'E.164 \u0161tevilka',
+ jwt: 'JWT',
+ template_literal: 'vnos',
+ },
+ i = {nan: 'NaN', number: '\u0161tevilo', array: 'tabela'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = qd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${s}`
+ : `Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Neveljaven vnos: pri\u010Dakovano ${qd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${qd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Preveliko: pri\u010Dakovano, da bo ${
+ r.origin ?? 'vrednost'
+ } imelo ${a}${r.maximum.toString()} ${o.unit ?? 'elementov'}`
+ : `Preveliko: pri\u010Dakovano, da bo ${
+ r.origin ?? 'vrednost'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Premajhno: pri\u010Dakovano, da bo ${
+ r.origin
+ } imelo ${a}${r.minimum.toString()} ${o.unit}`
+ : `Premajhno: pri\u010Dakovano, da bo ${
+ r.origin
+ } ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Neveljaven niz: mora vsebovati "${a.includes}"`
+ : a.format === 'regex'
+ ? `Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`
+ : `Neveljaven ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Neprepoznan${
+ r.keys.length > 1 ? 'i klju\u010Di' : ' klju\u010D'
+ }: ${qd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Neveljaven klju\u010D v ${r.origin}`;
+ case 'invalid_union':
+ return 'Neveljaven vnos';
+ case 'invalid_element':
+ return `Neveljavna vrednost v ${r.origin}`;
+ default:
+ return 'Neveljaven vnos';
+ }
+ };
+ };
+ function EC() {
+ return {localeError: TC()};
+ }
+ Zk.exports = ri.default;
+});
+var Vk = xe((ii, Kk) => {
+ 'use strict';
+ var IC =
+ (ii && ii.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ PC =
+ (ii && ii.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ xC =
+ (ii && ii.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ IC(t, e, n);
+ return PC(t, e), t;
+ };
+ Object.defineProperty(ii, '__esModule', {value: !0});
+ ii.default = OC;
+ var Kd = xC(ot()),
+ wC = () => {
+ let e = {
+ string: {unit: 'tecken', verb: 'att ha'},
+ file: {unit: 'bytes', verb: 'att ha'},
+ array: {unit: 'objekt', verb: 'att inneh\xE5lla'},
+ set: {unit: 'objekt', verb: 'att inneh\xE5lla'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'regulj\xE4rt uttryck',
+ email: 'e-postadress',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO-datum och tid',
+ date: 'ISO-datum',
+ time: 'ISO-tid',
+ duration: 'ISO-varaktighet',
+ ipv4: 'IPv4-intervall',
+ ipv6: 'IPv6-intervall',
+ cidrv4: 'IPv4-spektrum',
+ cidrv6: 'IPv6-spektrum',
+ base64: 'base64-kodad str\xE4ng',
+ base64url: 'base64url-kodad str\xE4ng',
+ json_string: 'JSON-str\xE4ng',
+ e164: 'E.164-nummer',
+ jwt: 'JWT',
+ template_literal: 'mall-literal',
+ },
+ i = {nan: 'NaN', number: 'antal', array: 'lista'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Kd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${s}`
+ : `Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ogiltig inmatning: f\xF6rv\xE4ntat ${Kd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Ogiltigt val: f\xF6rv\xE4ntade en av ${Kd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `F\xF6r stor(t): f\xF6rv\xE4ntade ${
+ r.origin ?? 'v\xE4rdet'
+ } att ha ${a}${r.maximum.toString()} ${o.unit ?? 'element'}`
+ : `F\xF6r stor(t): f\xF6rv\xE4ntat ${
+ r.origin ?? 'v\xE4rdet'
+ } att ha ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `F\xF6r lite(t): f\xF6rv\xE4ntade ${
+ r.origin ?? 'v\xE4rdet'
+ } att ha ${a}${r.minimum.toString()} ${o.unit}`
+ : `F\xF6r lite(t): f\xF6rv\xE4ntade ${
+ r.origin ?? 'v\xE4rdet'
+ } att ha ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`
+ : a.format === 'regex'
+ ? `Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`
+ : `Ogiltig(t) ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `${
+ r.keys.length > 1 ? 'Ok\xE4nda nycklar' : 'Ok\xE4nd nyckel'
+ }: ${Kd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `Ogiltig nyckel i ${r.origin ?? 'v\xE4rdet'}`;
+ case 'invalid_union':
+ return 'Ogiltig input';
+ case 'invalid_element':
+ return `Ogiltigt v\xE4rde i ${r.origin ?? 'v\xE4rdet'}`;
+ default:
+ return 'Ogiltig input';
+ }
+ };
+ };
+ function OC() {
+ return {localeError: wC()};
+ }
+ Kk.exports = ii.default;
+});
+var Hk = xe((ai, Jk) => {
+ 'use strict';
+ var $C =
+ (ai && ai.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ jC =
+ (ai && ai.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ CC =
+ (ai && ai.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ $C(t, e, n);
+ return jC(t, e), t;
+ };
+ Object.defineProperty(ai, '__esModule', {value: !0});
+ ai.default = AC;
+ var Vd = CC(ot()),
+ DC = () => {
+ let e = {
+ string: {
+ unit: '\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD',
+ verb: '\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD',
+ },
+ file: {
+ unit: '\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD',
+ verb: '\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD',
+ },
+ array: {
+ unit: '\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD',
+ verb: '\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD',
+ },
+ set: {
+ unit: '\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD',
+ verb: '\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1',
+ email:
+ '\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ 'ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD',
+ date: 'ISO \u0BA4\u0BC7\u0BA4\u0BBF',
+ time: 'ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD',
+ duration: 'ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1',
+ ipv4: 'IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF',
+ ipv6: 'IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF',
+ cidrv4: 'IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1',
+ cidrv6: 'IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1',
+ base64: 'base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD',
+ base64url: 'base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD',
+ json_string: 'JSON \u0B9A\u0BB0\u0BAE\u0BCD',
+ e164: 'E.164 \u0B8E\u0BA3\u0BCD',
+ jwt: 'JWT',
+ template_literal: 'input',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0B8E\u0BA3\u0BCD',
+ array: '\u0B85\u0BA3\u0BBF',
+ null: '\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Vd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`
+ : `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Vd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Vd.joinValues(
+ r.values,
+ '|'
+ )} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${
+ r.origin ?? '\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1'
+ } ${a}${r.maximum.toString()} ${
+ o.unit ??
+ '\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD'
+ } \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : `\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${
+ r.origin ?? '\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1'
+ } ${a}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${
+ o.unit
+ } \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : `\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${
+ r.origin
+ } ${a}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : a.format === 'ends_with'
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : a.format === 'includes'
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : a.format === 'regex'
+ ? `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`
+ : `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;
+ case 'unrecognized_keys':
+ return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${
+ r.keys.length > 1 ? '\u0B95\u0BB3\u0BCD' : ''
+ }: ${Vd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;
+ case 'invalid_union':
+ return '\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1';
+ case 'invalid_element':
+ return `${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;
+ default:
+ return '\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1';
+ }
+ };
+ };
+ function AC() {
+ return {localeError: DC()};
+ }
+ Jk.exports = ai.default;
+});
+var Gk = xe((oi, Wk) => {
+ 'use strict';
+ var MC =
+ (oi && oi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ NC =
+ (oi && oi.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ RC =
+ (oi && oi.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ MC(t, e, n);
+ return NC(t, e), t;
+ };
+ Object.defineProperty(oi, '__esModule', {value: !0});
+ oi.default = FC;
+ var Jd = RC(ot()),
+ LC = () => {
+ let e = {
+ string: {
+ unit: '\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23',
+ verb: '\u0E04\u0E27\u0E23\u0E21\u0E35',
+ },
+ file: {
+ unit: '\u0E44\u0E1A\u0E15\u0E4C',
+ verb: '\u0E04\u0E27\u0E23\u0E21\u0E35',
+ },
+ array: {
+ unit: '\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23',
+ verb: '\u0E04\u0E27\u0E23\u0E21\u0E35',
+ },
+ set: {
+ unit: '\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23',
+ verb: '\u0E04\u0E27\u0E23\u0E21\u0E35',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex:
+ '\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19',
+ email:
+ '\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25',
+ url: 'URL',
+ emoji: '\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ '\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO',
+ date: '\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO',
+ time: '\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO',
+ duration:
+ '\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO',
+ ipv4: '\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4',
+ ipv6: '\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6',
+ cidrv4: '\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4',
+ cidrv6: '\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6',
+ base64:
+ '\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64',
+ base64url:
+ '\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL',
+ json_string:
+ '\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON',
+ e164: '\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)',
+ jwt: '\u0E42\u0E17\u0E40\u0E04\u0E19 JWT',
+ template_literal:
+ '\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02',
+ array: '\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)',
+ null: '\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Jd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`
+ : `\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Jd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Jd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive
+ ? '\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19'
+ : '\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32',
+ o = t(r.origin);
+ return o
+ ? `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${
+ r.origin ?? '\u0E04\u0E48\u0E32'
+ } \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.maximum.toString()} ${
+ o.unit ?? '\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23'
+ }`
+ : `\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${
+ r.origin ?? '\u0E04\u0E48\u0E32'
+ } \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive
+ ? '\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22'
+ : '\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32',
+ o = t(r.origin);
+ return o
+ ? `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${
+ r.origin
+ } \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.minimum.toString()} ${
+ o.unit
+ }`
+ : `\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${
+ r.origin
+ } \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`
+ : a.format === 'regex'
+ ? `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`
+ : `\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;
+ case 'unrecognized_keys':
+ return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Jd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;
+ case 'invalid_union':
+ return '\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49';
+ case 'invalid_element':
+ return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;
+ default:
+ return '\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07';
+ }
+ };
+ };
+ function FC() {
+ return {localeError: LC()};
+ }
+ Wk.exports = oi.default;
+});
+var Yk = xe((si, Xk) => {
+ 'use strict';
+ var zC =
+ (si && si.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ BC =
+ (si && si.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ UC =
+ (si && si.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ zC(t, e, n);
+ return BC(t, e), t;
+ };
+ Object.defineProperty(si, '__esModule', {value: !0});
+ si.default = qC;
+ var Hd = UC(ot()),
+ ZC = () => {
+ let e = {
+ string: {unit: 'karakter', verb: 'olmal\u0131'},
+ file: {unit: 'bayt', verb: 'olmal\u0131'},
+ array: {unit: '\xF6\u011Fe', verb: 'olmal\u0131'},
+ set: {unit: '\xF6\u011Fe', verb: 'olmal\u0131'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'girdi',
+ email: 'e-posta adresi',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO tarih ve saat',
+ date: 'ISO tarih',
+ time: 'ISO saat',
+ duration: 'ISO s\xFCre',
+ ipv4: 'IPv4 adresi',
+ ipv6: 'IPv6 adresi',
+ cidrv4: 'IPv4 aral\u0131\u011F\u0131',
+ cidrv6: 'IPv6 aral\u0131\u011F\u0131',
+ base64: 'base64 ile \u015Fifrelenmi\u015F metin',
+ base64url: 'base64url ile \u015Fifrelenmi\u015F metin',
+ json_string: 'JSON dizesi',
+ e164: 'E.164 say\u0131s\u0131',
+ jwt: 'JWT',
+ template_literal: '\u015Eablon dizesi',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Hd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${s}`
+ : `Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Ge\xE7ersiz de\u011Fer: beklenen ${Hd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Hd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\xC7ok b\xFCy\xFCk: beklenen ${
+ r.origin ?? 'de\u011Fer'
+ } ${a}${r.maximum.toString()} ${o.unit ?? '\xF6\u011Fe'}`
+ : `\xC7ok b\xFCy\xFCk: beklenen ${
+ r.origin ?? 'de\u011Fer'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\xC7ok k\xFC\xE7\xFCk: beklenen ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `\xC7ok k\xFC\xE7\xFCk: beklenen ${
+ r.origin
+ } ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`
+ : a.format === 'ends_with'
+ ? `Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`
+ : a.format === 'includes'
+ ? `Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`
+ : a.format === 'regex'
+ ? `Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`
+ : `Ge\xE7ersiz ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;
+ case 'unrecognized_keys':
+ return `Tan\u0131nmayan anahtar${
+ r.keys.length > 1 ? 'lar' : ''
+ }: ${Hd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `${r.origin} i\xE7inde ge\xE7ersiz anahtar`;
+ case 'invalid_union':
+ return 'Ge\xE7ersiz de\u011Fer';
+ case 'invalid_element':
+ return `${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;
+ default:
+ return 'Ge\xE7ersiz de\u011Fer';
+ }
+ };
+ };
+ function qC() {
+ return {localeError: ZC()};
+ }
+ Xk.exports = si.default;
+});
+var eg = xe((li, Qk) => {
+ 'use strict';
+ var KC =
+ (li && li.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ VC =
+ (li && li.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ JC =
+ (li && li.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ KC(t, e, n);
+ return VC(t, e), t;
+ };
+ Object.defineProperty(li, '__esModule', {value: !0});
+ li.default = WC;
+ var Wd = JC(ot()),
+ HC = () => {
+ let e = {
+ string: {
+ unit: '\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432',
+ verb: '\u043C\u0430\u0442\u0438\u043C\u0435',
+ },
+ file: {
+ unit: '\u0431\u0430\u0439\u0442\u0456\u0432',
+ verb: '\u043C\u0430\u0442\u0438\u043C\u0435',
+ },
+ array: {
+ unit: '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432',
+ verb: '\u043C\u0430\u0442\u0438\u043C\u0435',
+ },
+ set: {
+ unit: '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432',
+ verb: '\u043C\u0430\u0442\u0438\u043C\u0435',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex:
+ '\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456',
+ email:
+ '\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438',
+ url: 'URL',
+ emoji: '\u0435\u043C\u043E\u0434\u0437\u0456',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime:
+ '\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO',
+ date: '\u0434\u0430\u0442\u0430 ISO',
+ time: '\u0447\u0430\u0441 ISO',
+ duration:
+ '\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO',
+ ipv4: '\u0430\u0434\u0440\u0435\u0441\u0430 IPv4',
+ ipv6: '\u0430\u0434\u0440\u0435\u0441\u0430 IPv6',
+ cidrv4: '\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4',
+ cidrv6: '\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6',
+ base64:
+ '\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64',
+ base64url:
+ '\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url',
+ json_string: '\u0440\u044F\u0434\u043E\u043A JSON',
+ e164: '\u043D\u043E\u043C\u0435\u0440 E.164',
+ jwt: 'JWT',
+ template_literal:
+ '\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0447\u0438\u0441\u043B\u043E',
+ array: '\u043C\u0430\u0441\u0438\u0432',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Wd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`
+ : `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Wd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Wd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F'
+ } ${o.verb} ${a}${r.maximum.toString()} ${
+ o.unit ??
+ '\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432'
+ }`
+ : `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${
+ r.origin ?? '\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F'
+ } \u0431\u0443\u0434\u0435 ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${
+ r.origin
+ } ${o.verb} ${a}${r.minimum.toString()} ${o.unit}`
+ : `\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${
+ r.origin
+ } \u0431\u0443\u0434\u0435 ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`
+ : `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${
+ n[a.format] ?? r.format
+ }`;
+ }
+ case 'not_multiple_of':
+ return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${
+ r.keys.length > 1 ? '\u0456' : ''
+ }: ${Wd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;
+ case 'invalid_union':
+ return '\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456';
+ case 'invalid_element':
+ return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;
+ default:
+ return '\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456';
+ }
+ };
+ };
+ function WC() {
+ return {localeError: HC()};
+ }
+ Qk.exports = li.default;
+});
+var tS = xe((Aa, eS) => {
+ 'use strict';
+ var GC =
+ (Aa && Aa.__importDefault) ||
+ function (e) {
+ return e && e.__esModule ? e : {default: e};
+ };
+ Object.defineProperty(Aa, '__esModule', {value: !0});
+ Aa.default = YC;
+ var XC = GC(eg());
+ function YC() {
+ return (0, XC.default)();
+ }
+ eS.exports = Aa.default;
+});
+var rS = xe((ci, nS) => {
+ 'use strict';
+ var QC =
+ (ci && ci.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ e1 =
+ (ci && ci.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ t1 =
+ (ci && ci.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ QC(t, e, n);
+ return e1(t, e), t;
+ };
+ Object.defineProperty(ci, '__esModule', {value: !0});
+ ci.default = r1;
+ var Gd = t1(ot()),
+ n1 = () => {
+ let e = {
+ string: {
+ unit: '\u062D\u0631\u0648\u0641',
+ verb: '\u06C1\u0648\u0646\u0627',
+ },
+ file: {
+ unit: '\u0628\u0627\u0626\u0679\u0633',
+ verb: '\u06C1\u0648\u0646\u0627',
+ },
+ array: {
+ unit: '\u0622\u0626\u0679\u0645\u0632',
+ verb: '\u06C1\u0648\u0646\u0627',
+ },
+ set: {
+ unit: '\u0622\u0626\u0679\u0645\u0632',
+ verb: '\u06C1\u0648\u0646\u0627',
+ },
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0627\u0646 \u067E\u0679',
+ email:
+ '\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633',
+ url: '\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644',
+ emoji: '\u0627\u06CC\u0645\u0648\u062C\u06CC',
+ uuid: '\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC',
+ uuidv4:
+ '\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4',
+ uuidv6:
+ '\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6',
+ nanoid: '\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC',
+ guid: '\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC',
+ cuid: '\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC',
+ cuid2: '\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2',
+ ulid: '\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC',
+ xid: '\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC',
+ ksuid:
+ '\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC',
+ datetime:
+ '\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645',
+ date: '\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E',
+ time: '\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A',
+ duration:
+ '\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A',
+ ipv4: '\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633',
+ ipv6: '\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633',
+ cidrv4:
+ '\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C',
+ cidrv6:
+ '\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C',
+ base64:
+ '\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF',
+ base64url:
+ '\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF',
+ json_string:
+ '\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF',
+ e164: '\u0627\u06CC 164 \u0646\u0645\u0628\u0631',
+ jwt: '\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC',
+ template_literal: '\u0627\u0646 \u067E\u0679',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u0646\u0645\u0628\u0631',
+ array: '\u0622\u0631\u06D2',
+ null: '\u0646\u0644',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Gd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`
+ : `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Gd.stringifyPrimitive(
+ r.values[0]
+ )} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`
+ : `\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Gd.joinValues(
+ r.values,
+ '|'
+ )} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u0628\u06C1\u062A \u0628\u0691\u0627: ${
+ r.origin ?? '\u0648\u06CC\u0644\u06CC\u0648'
+ } \u06A9\u06D2 ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u0639\u0646\u0627\u0635\u0631'
+ } \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`
+ : `\u0628\u06C1\u062A \u0628\u0691\u0627: ${
+ r.origin ?? '\u0648\u06CC\u0644\u06CC\u0648'
+ } \u06A9\u0627 ${a}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${
+ r.origin
+ } \u06A9\u06D2 ${a}${r.minimum.toString()} ${
+ o.unit
+ } \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`
+ : `\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${
+ r.origin
+ } \u06A9\u0627 ${a}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`
+ : a.format === 'ends_with'
+ ? `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`
+ : a.format === 'includes'
+ ? `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`
+ : a.format === 'regex'
+ ? `\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`
+ : `\u063A\u0644\u0637 ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;
+ case 'unrecognized_keys':
+ return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${
+ r.keys.length > 1 ? '\u0632' : ''
+ }: ${Gd.joinValues(r.keys, '\u060C ')}`;
+ case 'invalid_key':
+ return `${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;
+ case 'invalid_union':
+ return '\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679';
+ case 'invalid_element':
+ return `${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;
+ default:
+ return '\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679';
+ }
+ };
+ };
+ function r1() {
+ return {localeError: n1()};
+ }
+ nS.exports = ci.default;
+});
+var aS = xe((ui, iS) => {
+ 'use strict';
+ var i1 =
+ (ui && ui.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ a1 =
+ (ui && ui.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ o1 =
+ (ui && ui.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ i1(t, e, n);
+ return a1(t, e), t;
+ };
+ Object.defineProperty(ui, '__esModule', {value: !0});
+ ui.default = l1;
+ var Xd = o1(ot()),
+ s1 = () => {
+ let e = {
+ string: {unit: 'belgi', verb: 'bo\u2018lishi kerak'},
+ file: {unit: 'bayt', verb: 'bo\u2018lishi kerak'},
+ array: {unit: 'element', verb: 'bo\u2018lishi kerak'},
+ set: {unit: 'element', verb: 'bo\u2018lishi kerak'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: 'kirish',
+ email: 'elektron pochta manzili',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO sana va vaqti',
+ date: 'ISO sana',
+ time: 'ISO vaqt',
+ duration: 'ISO davomiylik',
+ ipv4: 'IPv4 manzil',
+ ipv6: 'IPv6 manzil',
+ mac: 'MAC manzil',
+ cidrv4: 'IPv4 diapazon',
+ cidrv6: 'IPv6 diapazon',
+ base64: 'base64 kodlangan satr',
+ base64url: 'base64url kodlangan satr',
+ json_string: 'JSON satr',
+ e164: 'E.164 raqam',
+ jwt: 'JWT',
+ template_literal: 'kirish',
+ },
+ i = {nan: 'NaN', number: 'raqam', array: 'massiv'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Xd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`
+ : `Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `Noto\u2018g\u2018ri kirish: kutilgan ${Xd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${Xd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Juda katta: kutilgan ${
+ r.origin ?? 'qiymat'
+ } ${a}${r.maximum.toString()} ${o.unit} ${o.verb}`
+ : `Juda katta: kutilgan ${
+ r.origin ?? 'qiymat'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Juda kichik: kutilgan ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit} ${o.verb}`
+ : `Juda kichik: kutilgan ${r.origin} ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`
+ : a.format === 'ends_with'
+ ? `Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`
+ : a.format === 'includes'
+ ? `Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`
+ : a.format === 'regex'
+ ? `Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`
+ : `Noto\u2018g\u2018ri ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;
+ case 'unrecognized_keys':
+ return `Noma\u2019lum kalit${
+ r.keys.length > 1 ? 'lar' : ''
+ }: ${Xd.joinValues(r.keys, ', ')}`;
+ case 'invalid_key':
+ return `${r.origin} dagi kalit noto\u2018g\u2018ri`;
+ case 'invalid_union':
+ return 'Noto\u2018g\u2018ri kirish';
+ case 'invalid_element':
+ return `${r.origin} da noto\u2018g\u2018ri qiymat`;
+ default:
+ return 'Noto\u2018g\u2018ri kirish';
+ }
+ };
+ };
+ function l1() {
+ return {localeError: s1()};
+ }
+ iS.exports = ui.default;
+});
+var sS = xe((di, oS) => {
+ 'use strict';
+ var c1 =
+ (di && di.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ u1 =
+ (di && di.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ d1 =
+ (di && di.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ c1(t, e, n);
+ return u1(t, e), t;
+ };
+ Object.defineProperty(di, '__esModule', {value: !0});
+ di.default = p1;
+ var Yd = d1(ot()),
+ f1 = () => {
+ let e = {
+ string: {unit: 'k\xFD t\u1EF1', verb: 'c\xF3'},
+ file: {unit: 'byte', verb: 'c\xF3'},
+ array: {unit: 'ph\u1EA7n t\u1EED', verb: 'c\xF3'},
+ set: {unit: 'ph\u1EA7n t\u1EED', verb: 'c\xF3'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u0111\u1EA7u v\xE0o',
+ email: '\u0111\u1ECBa ch\u1EC9 email',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ng\xE0y gi\u1EDD ISO',
+ date: 'ng\xE0y ISO',
+ time: 'gi\u1EDD ISO',
+ duration: 'kho\u1EA3ng th\u1EDDi gian ISO',
+ ipv4: '\u0111\u1ECBa ch\u1EC9 IPv4',
+ ipv6: '\u0111\u1ECBa ch\u1EC9 IPv6',
+ cidrv4: 'd\u1EA3i IPv4',
+ cidrv6: 'd\u1EA3i IPv6',
+ base64: 'chu\u1ED7i m\xE3 h\xF3a base64',
+ base64url: 'chu\u1ED7i m\xE3 h\xF3a base64url',
+ json_string: 'chu\u1ED7i JSON',
+ e164: 's\u1ED1 E.164',
+ jwt: 'JWT',
+ template_literal: '\u0111\u1EA7u v\xE0o',
+ },
+ i = {nan: 'NaN', number: 's\u1ED1', array: 'm\u1EA3ng'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Yd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`
+ : `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Yd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Yd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${
+ r.origin ?? 'gi\xE1 tr\u1ECB'
+ } ${o.verb} ${a}${r.maximum.toString()} ${
+ o.unit ?? 'ph\u1EA7n t\u1EED'
+ }`
+ : `Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${
+ r.origin ?? 'gi\xE1 tr\u1ECB'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${
+ o.verb
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${
+ r.origin
+ } ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`
+ : a.format === 'includes'
+ ? `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`
+ : a.format === 'regex'
+ ? `Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`
+ : `${n[a.format] ?? r.format} kh\xF4ng h\u1EE3p l\u1EC7`;
+ }
+ case 'not_multiple_of':
+ return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Yd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;
+ case 'invalid_union':
+ return '\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7';
+ case 'invalid_element':
+ return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;
+ default:
+ return '\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7';
+ }
+ };
+ };
+ function p1() {
+ return {localeError: f1()};
+ }
+ oS.exports = di.default;
+});
+var cS = xe((fi, lS) => {
+ 'use strict';
+ var m1 =
+ (fi && fi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ y1 =
+ (fi && fi.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ g1 =
+ (fi && fi.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ m1(t, e, n);
+ return y1(t, e), t;
+ };
+ Object.defineProperty(fi, '__esModule', {value: !0});
+ fi.default = h1;
+ var Qd = g1(ot()),
+ v1 = () => {
+ let e = {
+ string: {unit: '\u5B57\u7B26', verb: '\u5305\u542B'},
+ file: {unit: '\u5B57\u8282', verb: '\u5305\u542B'},
+ array: {unit: '\u9879', verb: '\u5305\u542B'},
+ set: {unit: '\u9879', verb: '\u5305\u542B'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u8F93\u5165',
+ email: '\u7535\u5B50\u90AE\u4EF6',
+ url: 'URL',
+ emoji: '\u8868\u60C5\u7B26\u53F7',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO\u65E5\u671F\u65F6\u95F4',
+ date: 'ISO\u65E5\u671F',
+ time: 'ISO\u65F6\u95F4',
+ duration: 'ISO\u65F6\u957F',
+ ipv4: 'IPv4\u5730\u5740',
+ ipv6: 'IPv6\u5730\u5740',
+ cidrv4: 'IPv4\u7F51\u6BB5',
+ cidrv6: 'IPv6\u7F51\u6BB5',
+ base64: 'base64\u7F16\u7801\u5B57\u7B26\u4E32',
+ base64url: 'base64url\u7F16\u7801\u5B57\u7B26\u4E32',
+ json_string: 'JSON\u5B57\u7B26\u4E32',
+ e164: 'E.164\u53F7\u7801',
+ jwt: 'JWT',
+ template_literal: '\u8F93\u5165',
+ },
+ i = {
+ nan: 'NaN',
+ number: '\u6570\u5B57',
+ array: '\u6570\u7EC4',
+ null: '\u7A7A\u503C(null)',
+ };
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = Qd.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`
+ : `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qd.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Qd.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${
+ r.origin ?? '\u503C'
+ } ${a}${r.maximum.toString()} ${o.unit ?? '\u4E2A\u5143\u7D20'}`
+ : `\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${
+ r.origin ?? '\u503C'
+ } ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${
+ r.origin
+ } ${a}${r.minimum.toString()} ${o.unit}`
+ : `\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${
+ r.origin
+ } ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`
+ : a.format === 'ends_with'
+ ? `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`
+ : a.format === 'includes'
+ ? `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`
+ : `\u65E0\u6548${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;
+ case 'unrecognized_keys':
+ return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Qd.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;
+ case 'invalid_union':
+ return '\u65E0\u6548\u8F93\u5165';
+ case 'invalid_element':
+ return `${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;
+ default:
+ return '\u65E0\u6548\u8F93\u5165';
+ }
+ };
+ };
+ function h1() {
+ return {localeError: v1()};
+ }
+ lS.exports = fi.default;
+});
+var dS = xe((pi, uS) => {
+ 'use strict';
+ var b1 =
+ (pi && pi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ k1 =
+ (pi && pi.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ S1 =
+ (pi && pi.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ b1(t, e, n);
+ return k1(t, e), t;
+ };
+ Object.defineProperty(pi, '__esModule', {value: !0});
+ pi.default = T1;
+ var ef = S1(ot()),
+ _1 = () => {
+ let e = {
+ string: {unit: '\u5B57\u5143', verb: '\u64C1\u6709'},
+ file: {unit: '\u4F4D\u5143\u7D44', verb: '\u64C1\u6709'},
+ array: {unit: '\u9805\u76EE', verb: '\u64C1\u6709'},
+ set: {unit: '\u9805\u76EE', verb: '\u64C1\u6709'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u8F38\u5165',
+ email: '\u90F5\u4EF6\u5730\u5740',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: 'ISO \u65E5\u671F\u6642\u9593',
+ date: 'ISO \u65E5\u671F',
+ time: 'ISO \u6642\u9593',
+ duration: 'ISO \u671F\u9593',
+ ipv4: 'IPv4 \u4F4D\u5740',
+ ipv6: 'IPv6 \u4F4D\u5740',
+ cidrv4: 'IPv4 \u7BC4\u570D',
+ cidrv6: 'IPv6 \u7BC4\u570D',
+ base64: 'base64 \u7DE8\u78BC\u5B57\u4E32',
+ base64url: 'base64url \u7DE8\u78BC\u5B57\u4E32',
+ json_string: 'JSON \u5B57\u4E32',
+ e164: 'E.164 \u6578\u503C',
+ jwt: 'JWT',
+ template_literal: '\u8F38\u5165',
+ },
+ i = {nan: 'NaN'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = ef.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${s}`
+ : `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ef.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${ef.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${
+ r.origin ?? '\u503C'
+ } \u61C9\u70BA ${a}${r.maximum.toString()} ${
+ o.unit ?? '\u500B\u5143\u7D20'
+ }`
+ : `\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${
+ r.origin ?? '\u503C'
+ } \u61C9\u70BA ${a}${r.maximum.toString()}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${
+ r.origin
+ } \u61C9\u70BA ${a}${r.minimum.toString()} ${o.unit}`
+ : `\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${
+ r.origin
+ } \u61C9\u70BA ${a}${r.minimum.toString()}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`
+ : a.format === 'ends_with'
+ ? `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`
+ : a.format === 'includes'
+ ? `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`
+ : `\u7121\u6548\u7684 ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;
+ case 'unrecognized_keys':
+ return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${
+ r.keys.length > 1 ? '\u5011' : ''
+ }\uFF1A${ef.joinValues(r.keys, '\u3001')}`;
+ case 'invalid_key':
+ return `${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;
+ case 'invalid_union':
+ return '\u7121\u6548\u7684\u8F38\u5165\u503C';
+ case 'invalid_element':
+ return `${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;
+ default:
+ return '\u7121\u6548\u7684\u8F38\u5165\u503C';
+ }
+ };
+ };
+ function T1() {
+ return {localeError: _1()};
+ }
+ uS.exports = pi.default;
+});
+var pS = xe((mi, fS) => {
+ 'use strict';
+ var E1 =
+ (mi && mi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ I1 =
+ (mi && mi.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ P1 =
+ (mi && mi.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ E1(t, e, n);
+ return I1(t, e), t;
+ };
+ Object.defineProperty(mi, '__esModule', {value: !0});
+ mi.default = w1;
+ var tf = P1(ot()),
+ x1 = () => {
+ let e = {
+ string: {unit: '\xE0mi', verb: 'n\xED'},
+ file: {unit: 'bytes', verb: 'n\xED'},
+ array: {unit: 'nkan', verb: 'n\xED'},
+ set: {unit: 'nkan', verb: 'n\xED'},
+ };
+ function t(r) {
+ return e[r] ?? null;
+ }
+ let n = {
+ regex: '\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9',
+ email: '\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC',
+ url: 'URL',
+ emoji: 'emoji',
+ uuid: 'UUID',
+ uuidv4: 'UUIDv4',
+ uuidv6: 'UUIDv6',
+ nanoid: 'nanoid',
+ guid: 'GUID',
+ cuid: 'cuid',
+ cuid2: 'cuid2',
+ ulid: 'ULID',
+ xid: 'XID',
+ ksuid: 'KSUID',
+ datetime: '\xE0k\xF3k\xF2 ISO',
+ date: '\u1ECDj\u1ECD\u0301 ISO',
+ time: '\xE0k\xF3k\xF2 ISO',
+ duration: '\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO',
+ ipv4: '\xE0d\xEDr\u1EB9\u0301s\xEC IPv4',
+ ipv6: '\xE0d\xEDr\u1EB9\u0301s\xEC IPv6',
+ cidrv4: '\xE0gb\xE8gb\xE8 IPv4',
+ cidrv6: '\xE0gb\xE8gb\xE8 IPv6',
+ base64:
+ '\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64',
+ base64url: '\u1ECD\u0300r\u1ECD\u0300 base64url',
+ json_string: '\u1ECD\u0300r\u1ECD\u0300 JSON',
+ e164: 'n\u1ECD\u0301mb\xE0 E.164',
+ jwt: 'JWT',
+ template_literal: '\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9',
+ },
+ i = {nan: 'NaN', number: 'n\u1ECD\u0301mb\xE0', array: 'akop\u1ECD'};
+ return (r) => {
+ switch (r.code) {
+ case 'invalid_type': {
+ let a = i[r.expected] ?? r.expected,
+ o = tf.parsedType(r.input),
+ s = i[o] ?? o;
+ return /^[A-Z]/.test(r.expected)
+ ? `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`
+ : `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${s}`;
+ }
+ case 'invalid_value':
+ return r.values.length === 1
+ ? `\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${tf.stringifyPrimitive(
+ r.values[0]
+ )}`
+ : `\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${tf.joinValues(
+ r.values,
+ '|'
+ )}`;
+ case 'too_big': {
+ let a = r.inclusive ? '<=' : '<',
+ o = t(r.origin);
+ return o
+ ? `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${
+ r.origin ?? 'iye'
+ } ${o.verb} ${a}${r.maximum} ${o.unit}`
+ : `T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${r.maximum}`;
+ }
+ case 'too_small': {
+ let a = r.inclusive ? '>=' : '>',
+ o = t(r.origin);
+ return o
+ ? `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${o.verb} ${a}${r.minimum} ${o.unit}`
+ : `K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${r.minimum}`;
+ }
+ case 'invalid_format': {
+ let a = r;
+ return a.format === 'starts_with'
+ ? `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`
+ : a.format === 'ends_with'
+ ? `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`
+ : a.format === 'includes'
+ ? `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`
+ : a.format === 'regex'
+ ? `\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`
+ : `A\u1E63\xEC\u1E63e: ${n[a.format] ?? r.format}`;
+ }
+ case 'not_multiple_of':
+ return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;
+ case 'unrecognized_keys':
+ return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${tf.joinValues(
+ r.keys,
+ ', '
+ )}`;
+ case 'invalid_key':
+ return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;
+ case 'invalid_union':
+ return '\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e';
+ case 'invalid_element':
+ return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;
+ default:
+ return '\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e';
+ }
+ };
+ };
+ function w1() {
+ return {localeError: x1()};
+ }
+ fS.exports = mi.default;
+});
+var tg = xe((ye) => {
+ 'use strict';
+ var gt =
+ (ye && ye.__importDefault) ||
+ function (e) {
+ return e && e.__esModule ? e : {default: e};
+ };
+ Object.defineProperty(ye, '__esModule', {value: !0});
+ ye.yo =
+ ye.zhTW =
+ ye.zhCN =
+ ye.vi =
+ ye.uz =
+ ye.ur =
+ ye.uk =
+ ye.ua =
+ ye.tr =
+ ye.th =
+ ye.ta =
+ ye.sv =
+ ye.sl =
+ ye.ru =
+ ye.pt =
+ ye.pl =
+ ye.ps =
+ ye.ota =
+ ye.no =
+ ye.nl =
+ ye.ms =
+ ye.mk =
+ ye.lt =
+ ye.ko =
+ ye.km =
+ ye.kh =
+ ye.ka =
+ ye.ja =
+ ye.it =
+ ye.is =
+ ye.id =
+ ye.hy =
+ ye.hu =
+ ye.he =
+ ye.frCA =
+ ye.fr =
+ ye.fi =
+ ye.fa =
+ ye.es =
+ ye.eo =
+ ye.en =
+ ye.de =
+ ye.da =
+ ye.cs =
+ ye.ca =
+ ye.bg =
+ ye.be =
+ ye.az =
+ ye.ar =
+ void 0;
+ var O1 = Eb();
+ Object.defineProperty(ye, 'ar', {
+ enumerable: !0,
+ get: function () {
+ return gt(O1).default;
+ },
+ });
+ var $1 = Pb();
+ Object.defineProperty(ye, 'az', {
+ enumerable: !0,
+ get: function () {
+ return gt($1).default;
+ },
+ });
+ var j1 = Ob();
+ Object.defineProperty(ye, 'be', {
+ enumerable: !0,
+ get: function () {
+ return gt(j1).default;
+ },
+ });
+ var C1 = jb();
+ Object.defineProperty(ye, 'bg', {
+ enumerable: !0,
+ get: function () {
+ return gt(C1).default;
+ },
+ });
+ var D1 = Db();
+ Object.defineProperty(ye, 'ca', {
+ enumerable: !0,
+ get: function () {
+ return gt(D1).default;
+ },
+ });
+ var A1 = Mb();
+ Object.defineProperty(ye, 'cs', {
+ enumerable: !0,
+ get: function () {
+ return gt(A1).default;
+ },
+ });
+ var M1 = Rb();
+ Object.defineProperty(ye, 'da', {
+ enumerable: !0,
+ get: function () {
+ return gt(M1).default;
+ },
+ });
+ var N1 = Fb();
+ Object.defineProperty(ye, 'de', {
+ enumerable: !0,
+ get: function () {
+ return gt(N1).default;
+ },
+ });
+ var R1 = Yy();
+ Object.defineProperty(ye, 'en', {
+ enumerable: !0,
+ get: function () {
+ return gt(R1).default;
+ },
+ });
+ var L1 = Ub();
+ Object.defineProperty(ye, 'eo', {
+ enumerable: !0,
+ get: function () {
+ return gt(L1).default;
+ },
+ });
+ var F1 = qb();
+ Object.defineProperty(ye, 'es', {
+ enumerable: !0,
+ get: function () {
+ return gt(F1).default;
+ },
+ });
+ var z1 = Vb();
+ Object.defineProperty(ye, 'fa', {
+ enumerable: !0,
+ get: function () {
+ return gt(z1).default;
+ },
+ });
+ var B1 = Hb();
+ Object.defineProperty(ye, 'fi', {
+ enumerable: !0,
+ get: function () {
+ return gt(B1).default;
+ },
+ });
+ var U1 = Gb();
+ Object.defineProperty(ye, 'fr', {
+ enumerable: !0,
+ get: function () {
+ return gt(U1).default;
+ },
+ });
+ var Z1 = Yb();
+ Object.defineProperty(ye, 'frCA', {
+ enumerable: !0,
+ get: function () {
+ return gt(Z1).default;
+ },
+ });
+ var q1 = ek();
+ Object.defineProperty(ye, 'he', {
+ enumerable: !0,
+ get: function () {
+ return gt(q1).default;
+ },
+ });
+ var K1 = nk();
+ Object.defineProperty(ye, 'hu', {
+ enumerable: !0,
+ get: function () {
+ return gt(K1).default;
+ },
+ });
+ var V1 = ak();
+ Object.defineProperty(ye, 'hy', {
+ enumerable: !0,
+ get: function () {
+ return gt(V1).default;
+ },
+ });
+ var J1 = sk();
+ Object.defineProperty(ye, 'id', {
+ enumerable: !0,
+ get: function () {
+ return gt(J1).default;
+ },
+ });
+ var H1 = ck();
+ Object.defineProperty(ye, 'is', {
+ enumerable: !0,
+ get: function () {
+ return gt(H1).default;
+ },
+ });
+ var W1 = dk();
+ Object.defineProperty(ye, 'it', {
+ enumerable: !0,
+ get: function () {
+ return gt(W1).default;
+ },
+ });
+ var G1 = pk();
+ Object.defineProperty(ye, 'ja', {
+ enumerable: !0,
+ get: function () {
+ return gt(G1).default;
+ },
+ });
+ var X1 = yk();
+ Object.defineProperty(ye, 'ka', {
+ enumerable: !0,
+ get: function () {
+ return gt(X1).default;
+ },
+ });
+ var Y1 = hk();
+ Object.defineProperty(ye, 'kh', {
+ enumerable: !0,
+ get: function () {
+ return gt(Y1).default;
+ },
+ });
+ var Q1 = Qy();
+ Object.defineProperty(ye, 'km', {
+ enumerable: !0,
+ get: function () {
+ return gt(Q1).default;
+ },
+ });
+ var eD = kk();
+ Object.defineProperty(ye, 'ko', {
+ enumerable: !0,
+ get: function () {
+ return gt(eD).default;
+ },
+ });
+ var tD = Tk();
+ Object.defineProperty(ye, 'lt', {
+ enumerable: !0,
+ get: function () {
+ return gt(tD).default;
+ },
+ });
+ var nD = Ik();
+ Object.defineProperty(ye, 'mk', {
+ enumerable: !0,
+ get: function () {
+ return gt(nD).default;
+ },
+ });
+ var rD = xk();
+ Object.defineProperty(ye, 'ms', {
+ enumerable: !0,
+ get: function () {
+ return gt(rD).default;
+ },
+ });
+ var iD = Ok();
+ Object.defineProperty(ye, 'nl', {
+ enumerable: !0,
+ get: function () {
+ return gt(iD).default;
+ },
+ });
+ var aD = jk();
+ Object.defineProperty(ye, 'no', {
+ enumerable: !0,
+ get: function () {
+ return gt(aD).default;
+ },
+ });
+ var oD = Dk();
+ Object.defineProperty(ye, 'ota', {
+ enumerable: !0,
+ get: function () {
+ return gt(oD).default;
+ },
+ });
+ var sD = Mk();
+ Object.defineProperty(ye, 'ps', {
+ enumerable: !0,
+ get: function () {
+ return gt(sD).default;
+ },
+ });
+ var lD = Rk();
+ Object.defineProperty(ye, 'pl', {
+ enumerable: !0,
+ get: function () {
+ return gt(lD).default;
+ },
+ });
+ var cD = Fk();
+ Object.defineProperty(ye, 'pt', {
+ enumerable: !0,
+ get: function () {
+ return gt(cD).default;
+ },
+ });
+ var uD = Uk();
+ Object.defineProperty(ye, 'ru', {
+ enumerable: !0,
+ get: function () {
+ return gt(uD).default;
+ },
+ });
+ var dD = qk();
+ Object.defineProperty(ye, 'sl', {
+ enumerable: !0,
+ get: function () {
+ return gt(dD).default;
+ },
+ });
+ var fD = Vk();
+ Object.defineProperty(ye, 'sv', {
+ enumerable: !0,
+ get: function () {
+ return gt(fD).default;
+ },
+ });
+ var pD = Hk();
+ Object.defineProperty(ye, 'ta', {
+ enumerable: !0,
+ get: function () {
+ return gt(pD).default;
+ },
+ });
+ var mD = Gk();
+ Object.defineProperty(ye, 'th', {
+ enumerable: !0,
+ get: function () {
+ return gt(mD).default;
+ },
+ });
+ var yD = Yk();
+ Object.defineProperty(ye, 'tr', {
+ enumerable: !0,
+ get: function () {
+ return gt(yD).default;
+ },
+ });
+ var gD = tS();
+ Object.defineProperty(ye, 'ua', {
+ enumerable: !0,
+ get: function () {
+ return gt(gD).default;
+ },
+ });
+ var vD = eg();
+ Object.defineProperty(ye, 'uk', {
+ enumerable: !0,
+ get: function () {
+ return gt(vD).default;
+ },
+ });
+ var hD = rS();
+ Object.defineProperty(ye, 'ur', {
+ enumerable: !0,
+ get: function () {
+ return gt(hD).default;
+ },
+ });
+ var bD = aS();
+ Object.defineProperty(ye, 'uz', {
+ enumerable: !0,
+ get: function () {
+ return gt(bD).default;
+ },
+ });
+ var kD = sS();
+ Object.defineProperty(ye, 'vi', {
+ enumerable: !0,
+ get: function () {
+ return gt(kD).default;
+ },
+ });
+ var SD = cS();
+ Object.defineProperty(ye, 'zhCN', {
+ enumerable: !0,
+ get: function () {
+ return gt(SD).default;
+ },
+ });
+ var _D = dS();
+ Object.defineProperty(ye, 'zhTW', {
+ enumerable: !0,
+ get: function () {
+ return gt(_D).default;
+ },
+ });
+ var TD = pS();
+ Object.defineProperty(ye, 'yo', {
+ enumerable: !0,
+ get: function () {
+ return gt(TD).default;
+ },
+ });
+});
+var Bc = xe((pr) => {
+ 'use strict';
+ var mS;
+ Object.defineProperty(pr, '__esModule', {value: !0});
+ pr.globalRegistry = pr.$ZodRegistry = pr.$input = pr.$output = void 0;
+ pr.registry = yS;
+ pr.$output = Symbol('ZodOutput');
+ pr.$input = Symbol('ZodInput');
+ var nf = class {
+ constructor() {
+ (this._map = new WeakMap()), (this._idmap = new Map());
+ }
+ add(t, ...n) {
+ let i = n[0];
+ return (
+ this._map.set(t, i),
+ i && typeof i == 'object' && 'id' in i && this._idmap.set(i.id, t),
+ this
+ );
+ }
+ clear() {
+ return (this._map = new WeakMap()), (this._idmap = new Map()), this;
+ }
+ remove(t) {
+ let n = this._map.get(t);
+ return (
+ n && typeof n == 'object' && 'id' in n && this._idmap.delete(n.id),
+ this._map.delete(t),
+ this
+ );
+ }
+ get(t) {
+ let n = t._zod.parent;
+ if (n) {
+ let i = {...(this.get(n) ?? {})};
+ delete i.id;
+ let r = {...i, ...this._map.get(t)};
+ return Object.keys(r).length ? r : void 0;
+ }
+ return this._map.get(t);
+ }
+ has(t) {
+ return this._map.has(t);
+ }
+ };
+ pr.$ZodRegistry = nf;
+ function yS() {
+ return new nf();
+ }
+ (mS = globalThis).__zod_globalRegistry ?? (mS.__zod_globalRegistry = yS());
+ pr.globalRegistry = globalThis.__zod_globalRegistry;
+});
+var bS = xe((te) => {
+ 'use strict';
+ var ED =
+ (te && te.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ ID =
+ (te && te.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ of =
+ (te && te.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ ED(t, e, n);
+ return ID(t, e), t;
+ };
+ Object.defineProperty(te, '__esModule', {value: !0});
+ te.TimePrecision = void 0;
+ te._string = PD;
+ te._coercedString = xD;
+ te._email = wD;
+ te._guid = OD;
+ te._uuid = $D;
+ te._uuidv4 = jD;
+ te._uuidv6 = CD;
+ te._uuidv7 = DD;
+ te._url = AD;
+ te._emoji = MD;
+ te._nanoid = ND;
+ te._cuid = RD;
+ te._cuid2 = LD;
+ te._ulid = FD;
+ te._xid = zD;
+ te._ksuid = BD;
+ te._ipv4 = UD;
+ te._ipv6 = ZD;
+ te._mac = qD;
+ te._cidrv4 = KD;
+ te._cidrv6 = VD;
+ te._base64 = JD;
+ te._base64url = HD;
+ te._e164 = WD;
+ te._jwt = GD;
+ te._isoDateTime = XD;
+ te._isoDate = YD;
+ te._isoTime = QD;
+ te._isoDuration = eA;
+ te._number = tA;
+ te._coercedNumber = nA;
+ te._int = rA;
+ te._float32 = iA;
+ te._float64 = aA;
+ te._int32 = oA;
+ te._uint32 = sA;
+ te._boolean = lA;
+ te._coercedBoolean = cA;
+ te._bigint = uA;
+ te._coercedBigint = dA;
+ te._int64 = fA;
+ te._uint64 = pA;
+ te._symbol = mA;
+ te._undefined = yA;
+ te._null = gA;
+ te._any = vA;
+ te._unknown = hA;
+ te._never = bA;
+ te._void = kA;
+ te._date = SA;
+ te._coercedDate = _A;
+ te._nan = TA;
+ te._lt = gS;
+ te._lte = Uc;
+ te._max = Uc;
+ te._lte = Uc;
+ te._max = Uc;
+ te._gt = vS;
+ te._gte = Zc;
+ te._min = Zc;
+ te._gte = Zc;
+ te._min = Zc;
+ te._positive = EA;
+ te._negative = IA;
+ te._nonpositive = PA;
+ te._nonnegative = xA;
+ te._multipleOf = wA;
+ te._maxSize = OA;
+ te._minSize = $A;
+ te._size = jA;
+ te._maxLength = CA;
+ te._minLength = DA;
+ te._length = AA;
+ te._regex = MA;
+ te._lowercase = NA;
+ te._uppercase = RA;
+ te._includes = LA;
+ te._startsWith = FA;
+ te._endsWith = zA;
+ te._property = BA;
+ te._mime = UA;
+ te._overwrite = Ma;
+ te._normalize = ZA;
+ te._trim = qA;
+ te._toLowerCase = KA;
+ te._toUpperCase = VA;
+ te._slugify = JA;
+ te._array = HA;
+ te._union = WA;
+ te._xor = GA;
+ te._discriminatedUnion = XA;
+ te._intersection = YA;
+ te._tuple = QA;
+ te._record = eM;
+ te._map = tM;
+ te._set = nM;
+ te._enum = rM;
+ te._nativeEnum = iM;
+ te._literal = aM;
+ te._file = oM;
+ te._transform = sM;
+ te._optional = lM;
+ te._nullable = cM;
+ te._default = uM;
+ te._nonoptional = dM;
+ te._success = fM;
+ te._catch = pM;
+ te._pipe = mM;
+ te._readonly = yM;
+ te._templateLiteral = gM;
+ te._lazy = vM;
+ te._promise = hM;
+ te._custom = bM;
+ te._refine = kM;
+ te._superRefine = SM;
+ te._check = hS;
+ te.describe = _M;
+ te.meta = TM;
+ te._stringbool = EM;
+ te._stringFormat = IM;
+ var en = of(Qu()),
+ af = of(Bc()),
+ rf = of(Xy()),
+ Se = of(ot());
+ function PD(e, t) {
+ return new e({type: 'string', ...Se.normalizeParams(t)});
+ }
+ function xD(e, t) {
+ return new e({type: 'string', coerce: !0, ...Se.normalizeParams(t)});
+ }
+ function wD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'email',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function OD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'guid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function $D(e, t) {
+ return new e({
+ type: 'string',
+ format: 'uuid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function jD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'uuid',
+ check: 'string_format',
+ abort: !1,
+ version: 'v4',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function CD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'uuid',
+ check: 'string_format',
+ abort: !1,
+ version: 'v6',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function DD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'uuid',
+ check: 'string_format',
+ abort: !1,
+ version: 'v7',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function AD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'url',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function MD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'emoji',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function ND(e, t) {
+ return new e({
+ type: 'string',
+ format: 'nanoid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function RD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'cuid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function LD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'cuid2',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function FD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'ulid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function zD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'xid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function BD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'ksuid',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function UD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'ipv4',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function ZD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'ipv6',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function qD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'mac',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function KD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'cidrv4',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function VD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'cidrv6',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function JD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'base64',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function HD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'base64url',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function WD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'e164',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function GD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'jwt',
+ check: 'string_format',
+ abort: !1,
+ ...Se.normalizeParams(t),
+ });
+ }
+ te.TimePrecision = {
+ Any: null,
+ Minute: -1,
+ Second: 0,
+ Millisecond: 3,
+ Microsecond: 6,
+ };
+ function XD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'datetime',
+ check: 'string_format',
+ offset: !1,
+ local: !1,
+ precision: null,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function YD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'date',
+ check: 'string_format',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function QD(e, t) {
+ return new e({
+ type: 'string',
+ format: 'time',
+ check: 'string_format',
+ precision: null,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function eA(e, t) {
+ return new e({
+ type: 'string',
+ format: 'duration',
+ check: 'string_format',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function tA(e, t) {
+ return new e({type: 'number', checks: [], ...Se.normalizeParams(t)});
+ }
+ function nA(e, t) {
+ return new e({
+ type: 'number',
+ coerce: !0,
+ checks: [],
+ ...Se.normalizeParams(t),
+ });
+ }
+ function rA(e, t) {
+ return new e({
+ type: 'number',
+ check: 'number_format',
+ abort: !1,
+ format: 'safeint',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function iA(e, t) {
+ return new e({
+ type: 'number',
+ check: 'number_format',
+ abort: !1,
+ format: 'float32',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function aA(e, t) {
+ return new e({
+ type: 'number',
+ check: 'number_format',
+ abort: !1,
+ format: 'float64',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function oA(e, t) {
+ return new e({
+ type: 'number',
+ check: 'number_format',
+ abort: !1,
+ format: 'int32',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function sA(e, t) {
+ return new e({
+ type: 'number',
+ check: 'number_format',
+ abort: !1,
+ format: 'uint32',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function lA(e, t) {
+ return new e({type: 'boolean', ...Se.normalizeParams(t)});
+ }
+ function cA(e, t) {
+ return new e({type: 'boolean', coerce: !0, ...Se.normalizeParams(t)});
+ }
+ function uA(e, t) {
+ return new e({type: 'bigint', ...Se.normalizeParams(t)});
+ }
+ function dA(e, t) {
+ return new e({type: 'bigint', coerce: !0, ...Se.normalizeParams(t)});
+ }
+ function fA(e, t) {
+ return new e({
+ type: 'bigint',
+ check: 'bigint_format',
+ abort: !1,
+ format: 'int64',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function pA(e, t) {
+ return new e({
+ type: 'bigint',
+ check: 'bigint_format',
+ abort: !1,
+ format: 'uint64',
+ ...Se.normalizeParams(t),
+ });
+ }
+ function mA(e, t) {
+ return new e({type: 'symbol', ...Se.normalizeParams(t)});
+ }
+ function yA(e, t) {
+ return new e({type: 'undefined', ...Se.normalizeParams(t)});
+ }
+ function gA(e, t) {
+ return new e({type: 'null', ...Se.normalizeParams(t)});
+ }
+ function vA(e) {
+ return new e({type: 'any'});
+ }
+ function hA(e) {
+ return new e({type: 'unknown'});
+ }
+ function bA(e, t) {
+ return new e({type: 'never', ...Se.normalizeParams(t)});
+ }
+ function kA(e, t) {
+ return new e({type: 'void', ...Se.normalizeParams(t)});
+ }
+ function SA(e, t) {
+ return new e({type: 'date', ...Se.normalizeParams(t)});
+ }
+ function _A(e, t) {
+ return new e({type: 'date', coerce: !0, ...Se.normalizeParams(t)});
+ }
+ function TA(e, t) {
+ return new e({type: 'nan', ...Se.normalizeParams(t)});
+ }
+ function gS(e, t) {
+ return new en.$ZodCheckLessThan({
+ check: 'less_than',
+ ...Se.normalizeParams(t),
+ value: e,
+ inclusive: !1,
+ });
+ }
+ function Uc(e, t) {
+ return new en.$ZodCheckLessThan({
+ check: 'less_than',
+ ...Se.normalizeParams(t),
+ value: e,
+ inclusive: !0,
+ });
+ }
+ function vS(e, t) {
+ return new en.$ZodCheckGreaterThan({
+ check: 'greater_than',
+ ...Se.normalizeParams(t),
+ value: e,
+ inclusive: !1,
+ });
+ }
+ function Zc(e, t) {
+ return new en.$ZodCheckGreaterThan({
+ check: 'greater_than',
+ ...Se.normalizeParams(t),
+ value: e,
+ inclusive: !0,
+ });
+ }
+ function EA(e) {
+ return vS(0, e);
+ }
+ function IA(e) {
+ return gS(0, e);
+ }
+ function PA(e) {
+ return Uc(0, e);
+ }
+ function xA(e) {
+ return Zc(0, e);
+ }
+ function wA(e, t) {
+ return new en.$ZodCheckMultipleOf({
+ check: 'multiple_of',
+ ...Se.normalizeParams(t),
+ value: e,
+ });
+ }
+ function OA(e, t) {
+ return new en.$ZodCheckMaxSize({
+ check: 'max_size',
+ ...Se.normalizeParams(t),
+ maximum: e,
+ });
+ }
+ function $A(e, t) {
+ return new en.$ZodCheckMinSize({
+ check: 'min_size',
+ ...Se.normalizeParams(t),
+ minimum: e,
+ });
+ }
+ function jA(e, t) {
+ return new en.$ZodCheckSizeEquals({
+ check: 'size_equals',
+ ...Se.normalizeParams(t),
+ size: e,
+ });
+ }
+ function CA(e, t) {
+ return new en.$ZodCheckMaxLength({
+ check: 'max_length',
+ ...Se.normalizeParams(t),
+ maximum: e,
+ });
+ }
+ function DA(e, t) {
+ return new en.$ZodCheckMinLength({
+ check: 'min_length',
+ ...Se.normalizeParams(t),
+ minimum: e,
+ });
+ }
+ function AA(e, t) {
+ return new en.$ZodCheckLengthEquals({
+ check: 'length_equals',
+ ...Se.normalizeParams(t),
+ length: e,
+ });
+ }
+ function MA(e, t) {
+ return new en.$ZodCheckRegex({
+ check: 'string_format',
+ format: 'regex',
+ ...Se.normalizeParams(t),
+ pattern: e,
+ });
+ }
+ function NA(e) {
+ return new en.$ZodCheckLowerCase({
+ check: 'string_format',
+ format: 'lowercase',
+ ...Se.normalizeParams(e),
+ });
+ }
+ function RA(e) {
+ return new en.$ZodCheckUpperCase({
+ check: 'string_format',
+ format: 'uppercase',
+ ...Se.normalizeParams(e),
+ });
+ }
+ function LA(e, t) {
+ return new en.$ZodCheckIncludes({
+ check: 'string_format',
+ format: 'includes',
+ ...Se.normalizeParams(t),
+ includes: e,
+ });
+ }
+ function FA(e, t) {
+ return new en.$ZodCheckStartsWith({
+ check: 'string_format',
+ format: 'starts_with',
+ ...Se.normalizeParams(t),
+ prefix: e,
+ });
+ }
+ function zA(e, t) {
+ return new en.$ZodCheckEndsWith({
+ check: 'string_format',
+ format: 'ends_with',
+ ...Se.normalizeParams(t),
+ suffix: e,
+ });
+ }
+ function BA(e, t, n) {
+ return new en.$ZodCheckProperty({
+ check: 'property',
+ property: e,
+ schema: t,
+ ...Se.normalizeParams(n),
+ });
+ }
+ function UA(e, t) {
+ return new en.$ZodCheckMimeType({
+ check: 'mime_type',
+ mime: e,
+ ...Se.normalizeParams(t),
+ });
+ }
+ function Ma(e) {
+ return new en.$ZodCheckOverwrite({check: 'overwrite', tx: e});
+ }
+ function ZA(e) {
+ return Ma((t) => t.normalize(e));
+ }
+ function qA() {
+ return Ma((e) => e.trim());
+ }
+ function KA() {
+ return Ma((e) => e.toLowerCase());
+ }
+ function VA() {
+ return Ma((e) => e.toUpperCase());
+ }
+ function JA() {
+ return Ma((e) => Se.slugify(e));
+ }
+ function HA(e, t, n) {
+ return new e({type: 'array', element: t, ...Se.normalizeParams(n)});
+ }
+ function WA(e, t, n) {
+ return new e({type: 'union', options: t, ...Se.normalizeParams(n)});
+ }
+ function GA(e, t, n) {
+ return new e({
+ type: 'union',
+ options: t,
+ inclusive: !1,
+ ...Se.normalizeParams(n),
+ });
+ }
+ function XA(e, t, n, i) {
+ return new e({
+ type: 'union',
+ options: n,
+ discriminator: t,
+ ...Se.normalizeParams(i),
+ });
+ }
+ function YA(e, t, n) {
+ return new e({type: 'intersection', left: t, right: n});
+ }
+ function QA(e, t, n, i) {
+ let r = n instanceof rf.$ZodType,
+ a = r ? i : n,
+ o = r ? n : null;
+ return new e({type: 'tuple', items: t, rest: o, ...Se.normalizeParams(a)});
+ }
+ function eM(e, t, n, i) {
+ return new e({
+ type: 'record',
+ keyType: t,
+ valueType: n,
+ ...Se.normalizeParams(i),
+ });
+ }
+ function tM(e, t, n, i) {
+ return new e({
+ type: 'map',
+ keyType: t,
+ valueType: n,
+ ...Se.normalizeParams(i),
+ });
+ }
+ function nM(e, t, n) {
+ return new e({type: 'set', valueType: t, ...Se.normalizeParams(n)});
+ }
+ function rM(e, t, n) {
+ let i = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, r])) : t;
+ return new e({type: 'enum', entries: i, ...Se.normalizeParams(n)});
+ }
+ function iM(e, t, n) {
+ return new e({type: 'enum', entries: t, ...Se.normalizeParams(n)});
+ }
+ function aM(e, t, n) {
+ return new e({
+ type: 'literal',
+ values: Array.isArray(t) ? t : [t],
+ ...Se.normalizeParams(n),
+ });
+ }
+ function oM(e, t) {
+ return new e({type: 'file', ...Se.normalizeParams(t)});
+ }
+ function sM(e, t) {
+ return new e({type: 'transform', transform: t});
+ }
+ function lM(e, t) {
+ return new e({type: 'optional', innerType: t});
+ }
+ function cM(e, t) {
+ return new e({type: 'nullable', innerType: t});
+ }
+ function uM(e, t, n) {
+ return new e({
+ type: 'default',
+ innerType: t,
+ get defaultValue() {
+ return typeof n == 'function' ? n() : Se.shallowClone(n);
+ },
+ });
+ }
+ function dM(e, t, n) {
+ return new e({type: 'nonoptional', innerType: t, ...Se.normalizeParams(n)});
+ }
+ function fM(e, t) {
+ return new e({type: 'success', innerType: t});
+ }
+ function pM(e, t, n) {
+ return new e({
+ type: 'catch',
+ innerType: t,
+ catchValue: typeof n == 'function' ? n : () => n,
+ });
+ }
+ function mM(e, t, n) {
+ return new e({type: 'pipe', in: t, out: n});
+ }
+ function yM(e, t) {
+ return new e({type: 'readonly', innerType: t});
+ }
+ function gM(e, t, n) {
+ return new e({
+ type: 'template_literal',
+ parts: t,
+ ...Se.normalizeParams(n),
+ });
+ }
+ function vM(e, t) {
+ return new e({type: 'lazy', getter: t});
+ }
+ function hM(e, t) {
+ return new e({type: 'promise', innerType: t});
+ }
+ function bM(e, t, n) {
+ let i = Se.normalizeParams(n);
+ return (
+ i.abort ?? (i.abort = !0),
+ new e({type: 'custom', check: 'custom', fn: t, ...i})
+ );
+ }
+ function kM(e, t, n) {
+ return new e({
+ type: 'custom',
+ check: 'custom',
+ fn: t,
+ ...Se.normalizeParams(n),
+ });
+ }
+ function SM(e) {
+ let t = hS(
+ (n) => (
+ (n.addIssue = (i) => {
+ if (typeof i == 'string')
+ n.issues.push(Se.issue(i, n.value, t._zod.def));
+ else {
+ let r = i;
+ r.fatal && (r.continue = !1),
+ r.code ?? (r.code = 'custom'),
+ r.input ?? (r.input = n.value),
+ r.inst ?? (r.inst = t),
+ r.continue ?? (r.continue = !t._zod.def.abort),
+ n.issues.push(Se.issue(r));
+ }
+ }),
+ e(n.value, n)
+ )
+ );
+ return t;
+ }
+ function hS(e, t) {
+ let n = new en.$ZodCheck({check: 'custom', ...Se.normalizeParams(t)});
+ return (n._zod.check = e), n;
+ }
+ function _M(e) {
+ let t = new en.$ZodCheck({check: 'describe'});
+ return (
+ (t._zod.onattach = [
+ (n) => {
+ let i = af.globalRegistry.get(n) ?? {};
+ af.globalRegistry.add(n, {...i, description: e});
+ },
+ ]),
+ (t._zod.check = () => {}),
+ t
+ );
+ }
+ function TM(e) {
+ let t = new en.$ZodCheck({check: 'meta'});
+ return (
+ (t._zod.onattach = [
+ (n) => {
+ let i = af.globalRegistry.get(n) ?? {};
+ af.globalRegistry.add(n, {...i, ...e});
+ },
+ ]),
+ (t._zod.check = () => {}),
+ t
+ );
+ }
+ function EM(e, t) {
+ let n = Se.normalizeParams(t),
+ i = n.truthy ?? ['true', '1', 'yes', 'on', 'y', 'enabled'],
+ r = n.falsy ?? ['false', '0', 'no', 'off', 'n', 'disabled'];
+ n.case !== 'sensitive' &&
+ ((i = i.map((m) => (typeof m == 'string' ? m.toLowerCase() : m))),
+ (r = r.map((m) => (typeof m == 'string' ? m.toLowerCase() : m))));
+ let a = new Set(i),
+ o = new Set(r),
+ s = e.Codec ?? rf.$ZodCodec,
+ l = e.Boolean ?? rf.$ZodBoolean,
+ d = e.String ?? rf.$ZodString,
+ u = new d({type: 'string', error: n.error}),
+ p = new l({type: 'boolean', error: n.error}),
+ y = new s({
+ type: 'pipe',
+ in: u,
+ out: p,
+ transform: (m, g) => {
+ let S = m;
+ return (
+ n.case !== 'sensitive' && (S = S.toLowerCase()),
+ a.has(S)
+ ? !0
+ : o.has(S)
+ ? !1
+ : (g.issues.push({
+ code: 'invalid_value',
+ expected: 'stringbool',
+ values: [...a, ...o],
+ input: g.value,
+ inst: y,
+ continue: !1,
+ }),
+ {})
+ );
+ },
+ reverseTransform: (m, g) =>
+ m === !0 ? i[0] || 'true' : r[0] || 'false',
+ error: n.error,
+ });
+ return y;
+ }
+ function IM(e, t, n, i = {}) {
+ let r = Se.normalizeParams(i),
+ a = {
+ ...Se.normalizeParams(i),
+ check: 'string_format',
+ type: 'string',
+ format: t,
+ fn: typeof n == 'function' ? n : (s) => n.test(s),
+ ...r,
+ };
+ return n instanceof RegExp && (a.pattern = n), new e(a);
+ }
+});
+var qc = xe((tr) => {
+ 'use strict';
+ Object.defineProperty(tr, '__esModule', {value: !0});
+ tr.createStandardJSONSchemaMethod = tr.createToJSONSchemaMethod = void 0;
+ tr.initializeContext = ng;
+ tr.process = sf;
+ tr.extractDefs = rg;
+ tr.finalize = ig;
+ var PM = Bc();
+ function ng(e) {
+ let t = e?.target ?? 'draft-2020-12';
+ return (
+ t === 'draft-4' && (t = 'draft-04'),
+ t === 'draft-7' && (t = 'draft-07'),
+ {
+ processors: e.processors ?? {},
+ metadataRegistry: e?.metadata ?? PM.globalRegistry,
+ target: t,
+ unrepresentable: e?.unrepresentable ?? 'throw',
+ override: e?.override ?? (() => {}),
+ io: e?.io ?? 'output',
+ counter: 0,
+ seen: new Map(),
+ cycles: e?.cycles ?? 'ref',
+ reused: e?.reused ?? 'inline',
+ external: e?.external ?? void 0,
+ }
+ );
+ }
+ function sf(e, t, n = {path: [], schemaPath: []}) {
+ var i;
+ let r = e._zod.def,
+ a = t.seen.get(e);
+ if (a)
+ return (
+ a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema
+ );
+ let o = {schema: {}, count: 1, cycle: void 0, path: n.path};
+ t.seen.set(e, o);
+ let s = e._zod.toJSONSchema?.();
+ if (s) o.schema = s;
+ else {
+ let u = {...n, schemaPath: [...n.schemaPath, e], path: n.path};
+ if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, u);
+ else {
+ let y = o.schema,
+ m = t.processors[r.type];
+ if (!m)
+ throw new Error(
+ `[toJSONSchema]: Non-representable type encountered: ${r.type}`
+ );
+ m(e, t, y, u);
+ }
+ let p = e._zod.parent;
+ p && (o.ref || (o.ref = p), sf(p, t, u), (t.seen.get(p).isParent = !0));
+ }
+ let l = t.metadataRegistry.get(e);
+ return (
+ l && Object.assign(o.schema, l),
+ t.io === 'input' &&
+ Sn(e) &&
+ (delete o.schema.examples, delete o.schema.default),
+ t.io === 'input' &&
+ o.schema._prefault &&
+ ((i = o.schema).default ?? (i.default = o.schema._prefault)),
+ delete o.schema._prefault,
+ t.seen.get(e).schema
+ );
+ }
+ function rg(e, t) {
+ let n = e.seen.get(t);
+ if (!n) throw new Error('Unprocessed schema. This is a bug in Zod.');
+ let i = new Map();
+ for (let o of e.seen.entries()) {
+ let s = e.metadataRegistry.get(o[0])?.id;
+ if (s) {
+ let l = i.get(s);
+ if (l && l !== o[0])
+ throw new Error(
+ `Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`
+ );
+ i.set(s, o[0]);
+ }
+ }
+ let r = (o) => {
+ let s = e.target === 'draft-2020-12' ? '$defs' : 'definitions';
+ if (e.external) {
+ let p = e.external.registry.get(o[0])?.id,
+ y = e.external.uri ?? ((g) => g);
+ if (p) return {ref: y(p)};
+ let m = o[1].defId ?? o[1].schema.id ?? `schema${e.counter++}`;
+ return (
+ (o[1].defId = m), {defId: m, ref: `${y('__shared')}#/${s}/${m}`}
+ );
+ }
+ if (o[1] === n) return {ref: '#'};
+ let d = `#/${s}/`,
+ u = o[1].schema.id ?? `__schema${e.counter++}`;
+ return {defId: u, ref: d + u};
+ },
+ a = (o) => {
+ if (o[1].schema.$ref) return;
+ let s = o[1],
+ {ref: l, defId: d} = r(o);
+ (s.def = {...s.schema}), d && (s.defId = d);
+ let u = s.schema;
+ for (let p in u) delete u[p];
+ u.$ref = l;
+ };
+ if (e.cycles === 'throw')
+ for (let o of e.seen.entries()) {
+ let s = o[1];
+ if (s.cycle)
+ throw new Error(`Cycle detected: #/${s.cycle?.join('/')}/
+
+Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
+ }
+ for (let o of e.seen.entries()) {
+ let s = o[1];
+ if (t === o[0]) {
+ a(o);
+ continue;
+ }
+ if (e.external) {
+ let d = e.external.registry.get(o[0])?.id;
+ if (t !== o[0] && d) {
+ a(o);
+ continue;
+ }
+ }
+ if (e.metadataRegistry.get(o[0])?.id) {
+ a(o);
+ continue;
+ }
+ if (s.cycle) {
+ a(o);
+ continue;
+ }
+ if (s.count > 1 && e.reused === 'ref') {
+ a(o);
+ continue;
+ }
+ }
+ }
+ function ig(e, t) {
+ let n = e.seen.get(t);
+ if (!n) throw new Error('Unprocessed schema. This is a bug in Zod.');
+ let i = (o) => {
+ let s = e.seen.get(o);
+ if (s.ref === null) return;
+ let l = s.def ?? s.schema,
+ d = {...l},
+ u = s.ref;
+ if (((s.ref = null), u)) {
+ i(u);
+ let y = e.seen.get(u),
+ m = y.schema;
+ if (
+ (m.$ref &&
+ (e.target === 'draft-07' ||
+ e.target === 'draft-04' ||
+ e.target === 'openapi-3.0')
+ ? ((l.allOf = l.allOf ?? []), l.allOf.push(m))
+ : Object.assign(l, m),
+ Object.assign(l, d),
+ o._zod.parent === u)
+ )
+ for (let S in l)
+ S === '$ref' || S === 'allOf' || S in d || delete l[S];
+ if (m.$ref && y.def)
+ for (let S in l)
+ S === '$ref' ||
+ S === 'allOf' ||
+ (S in y.def &&
+ JSON.stringify(l[S]) === JSON.stringify(y.def[S]) &&
+ delete l[S]);
+ }
+ let p = o._zod.parent;
+ if (p && p !== u) {
+ i(p);
+ let y = e.seen.get(p);
+ if (y?.schema.$ref && ((l.$ref = y.schema.$ref), y.def))
+ for (let m in l)
+ m === '$ref' ||
+ m === 'allOf' ||
+ (m in y.def &&
+ JSON.stringify(l[m]) === JSON.stringify(y.def[m]) &&
+ delete l[m]);
+ }
+ e.override({zodSchema: o, jsonSchema: l, path: s.path ?? []});
+ };
+ for (let o of [...e.seen.entries()].reverse()) i(o[0]);
+ let r = {};
+ if (
+ (e.target === 'draft-2020-12'
+ ? (r.$schema = 'https://json-schema.org/draft/2020-12/schema')
+ : e.target === 'draft-07'
+ ? (r.$schema = 'http://json-schema.org/draft-07/schema#')
+ : e.target === 'draft-04'
+ ? (r.$schema = 'http://json-schema.org/draft-04/schema#')
+ : e.target,
+ e.external?.uri)
+ ) {
+ let o = e.external.registry.get(t)?.id;
+ if (!o) throw new Error('Schema is missing an `id` property');
+ r.$id = e.external.uri(o);
+ }
+ Object.assign(r, n.def ?? n.schema);
+ let a = e.external?.defs ?? {};
+ for (let o of e.seen.entries()) {
+ let s = o[1];
+ s.def && s.defId && (a[s.defId] = s.def);
+ }
+ e.external ||
+ (Object.keys(a).length > 0 &&
+ (e.target === 'draft-2020-12' ? (r.$defs = a) : (r.definitions = a)));
+ try {
+ let o = JSON.parse(JSON.stringify(r));
+ return (
+ Object.defineProperty(o, '~standard', {
+ value: {
+ ...t['~standard'],
+ jsonSchema: {
+ input: (0, tr.createStandardJSONSchemaMethod)(
+ t,
+ 'input',
+ e.processors
+ ),
+ output: (0, tr.createStandardJSONSchemaMethod)(
+ t,
+ 'output',
+ e.processors
+ ),
+ },
+ },
+ enumerable: !1,
+ writable: !1,
+ }),
+ o
+ );
+ } catch {
+ throw new Error('Error converting schema to JSON.');
+ }
+ }
+ function Sn(e, t) {
+ let n = t ?? {seen: new Set()};
+ if (n.seen.has(e)) return !1;
+ n.seen.add(e);
+ let i = e._zod.def;
+ if (i.type === 'transform') return !0;
+ if (i.type === 'array') return Sn(i.element, n);
+ if (i.type === 'set') return Sn(i.valueType, n);
+ if (i.type === 'lazy') return Sn(i.getter(), n);
+ if (
+ i.type === 'promise' ||
+ i.type === 'optional' ||
+ i.type === 'nonoptional' ||
+ i.type === 'nullable' ||
+ i.type === 'readonly' ||
+ i.type === 'default' ||
+ i.type === 'prefault'
+ )
+ return Sn(i.innerType, n);
+ if (i.type === 'intersection') return Sn(i.left, n) || Sn(i.right, n);
+ if (i.type === 'record' || i.type === 'map')
+ return Sn(i.keyType, n) || Sn(i.valueType, n);
+ if (i.type === 'pipe') return Sn(i.in, n) || Sn(i.out, n);
+ if (i.type === 'object') {
+ for (let r in i.shape) if (Sn(i.shape[r], n)) return !0;
+ return !1;
+ }
+ if (i.type === 'union') {
+ for (let r of i.options) if (Sn(r, n)) return !0;
+ return !1;
+ }
+ if (i.type === 'tuple') {
+ for (let r of i.items) if (Sn(r, n)) return !0;
+ return !!(i.rest && Sn(i.rest, n));
+ }
+ return !1;
+ }
+ var xM =
+ (e, t = {}) =>
+ (n) => {
+ let i = ng({...n, processors: t});
+ return sf(e, i), rg(i, e), ig(i, e);
+ };
+ tr.createToJSONSchemaMethod = xM;
+ var wM =
+ (e, t, n = {}) =>
+ (i) => {
+ let {libraryOptions: r, target: a} = i ?? {},
+ o = ng({...(r ?? {}), target: a, io: t, processors: n});
+ return sf(e, o), rg(o, e), ig(o, e);
+ };
+ tr.createStandardJSONSchemaMethod = wM;
+});
+var Kc = xe((ie) => {
+ 'use strict';
+ Object.defineProperty(ie, '__esModule', {value: !0});
+ ie.allProcessors =
+ ie.lazyProcessor =
+ ie.optionalProcessor =
+ ie.promiseProcessor =
+ ie.readonlyProcessor =
+ ie.pipeProcessor =
+ ie.catchProcessor =
+ ie.prefaultProcessor =
+ ie.defaultProcessor =
+ ie.nonoptionalProcessor =
+ ie.nullableProcessor =
+ ie.recordProcessor =
+ ie.tupleProcessor =
+ ie.intersectionProcessor =
+ ie.unionProcessor =
+ ie.objectProcessor =
+ ie.arrayProcessor =
+ ie.setProcessor =
+ ie.mapProcessor =
+ ie.transformProcessor =
+ ie.functionProcessor =
+ ie.customProcessor =
+ ie.successProcessor =
+ ie.fileProcessor =
+ ie.templateLiteralProcessor =
+ ie.nanProcessor =
+ ie.literalProcessor =
+ ie.enumProcessor =
+ ie.dateProcessor =
+ ie.unknownProcessor =
+ ie.anyProcessor =
+ ie.neverProcessor =
+ ie.voidProcessor =
+ ie.undefinedProcessor =
+ ie.nullProcessor =
+ ie.symbolProcessor =
+ ie.bigintProcessor =
+ ie.booleanProcessor =
+ ie.numberProcessor =
+ ie.stringProcessor =
+ void 0;
+ ie.toJSONSchema = gN;
+ var zt = qc(),
+ OM = ot(),
+ $M = {
+ guid: 'uuid',
+ url: 'uri',
+ datetime: 'date-time',
+ json_string: 'json-string',
+ regex: '',
+ },
+ jM = (e, t, n, i) => {
+ let r = n;
+ r.type = 'string';
+ let {
+ minimum: a,
+ maximum: o,
+ format: s,
+ patterns: l,
+ contentEncoding: d,
+ } = e._zod.bag;
+ if (
+ (typeof a == 'number' && (r.minLength = a),
+ typeof o == 'number' && (r.maxLength = o),
+ s &&
+ ((r.format = $M[s] ?? s),
+ r.format === '' && delete r.format,
+ s === 'time' && delete r.format),
+ d && (r.contentEncoding = d),
+ l && l.size > 0)
+ ) {
+ let u = [...l];
+ u.length === 1
+ ? (r.pattern = u[0].source)
+ : u.length > 1 &&
+ (r.allOf = [
+ ...u.map((p) => ({
+ ...(t.target === 'draft-07' ||
+ t.target === 'draft-04' ||
+ t.target === 'openapi-3.0'
+ ? {type: 'string'}
+ : {}),
+ pattern: p.source,
+ })),
+ ]);
+ }
+ };
+ ie.stringProcessor = jM;
+ var CM = (e, t, n, i) => {
+ let r = n,
+ {
+ minimum: a,
+ maximum: o,
+ format: s,
+ multipleOf: l,
+ exclusiveMaximum: d,
+ exclusiveMinimum: u,
+ } = e._zod.bag;
+ typeof s == 'string' && s.includes('int')
+ ? (r.type = 'integer')
+ : (r.type = 'number'),
+ typeof u == 'number' &&
+ (t.target === 'draft-04' || t.target === 'openapi-3.0'
+ ? ((r.minimum = u), (r.exclusiveMinimum = !0))
+ : (r.exclusiveMinimum = u)),
+ typeof a == 'number' &&
+ ((r.minimum = a),
+ typeof u == 'number' &&
+ t.target !== 'draft-04' &&
+ (u >= a ? delete r.minimum : delete r.exclusiveMinimum)),
+ typeof d == 'number' &&
+ (t.target === 'draft-04' || t.target === 'openapi-3.0'
+ ? ((r.maximum = d), (r.exclusiveMaximum = !0))
+ : (r.exclusiveMaximum = d)),
+ typeof o == 'number' &&
+ ((r.maximum = o),
+ typeof d == 'number' &&
+ t.target !== 'draft-04' &&
+ (d <= o ? delete r.maximum : delete r.exclusiveMaximum)),
+ typeof l == 'number' && (r.multipleOf = l);
+ };
+ ie.numberProcessor = CM;
+ var DM = (e, t, n, i) => {
+ n.type = 'boolean';
+ };
+ ie.booleanProcessor = DM;
+ var AM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('BigInt cannot be represented in JSON Schema');
+ };
+ ie.bigintProcessor = AM;
+ var MM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Symbols cannot be represented in JSON Schema');
+ };
+ ie.symbolProcessor = MM;
+ var NM = (e, t, n, i) => {
+ t.target === 'openapi-3.0'
+ ? ((n.type = 'string'), (n.nullable = !0), (n.enum = [null]))
+ : (n.type = 'null');
+ };
+ ie.nullProcessor = NM;
+ var RM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Undefined cannot be represented in JSON Schema');
+ };
+ ie.undefinedProcessor = RM;
+ var LM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Void cannot be represented in JSON Schema');
+ };
+ ie.voidProcessor = LM;
+ var FM = (e, t, n, i) => {
+ n.not = {};
+ };
+ ie.neverProcessor = FM;
+ var zM = (e, t, n, i) => {};
+ ie.anyProcessor = zM;
+ var BM = (e, t, n, i) => {};
+ ie.unknownProcessor = BM;
+ var UM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Date cannot be represented in JSON Schema');
+ };
+ ie.dateProcessor = UM;
+ var ZM = (e, t, n, i) => {
+ let r = e._zod.def,
+ a = (0, OM.getEnumValues)(r.entries);
+ a.every((o) => typeof o == 'number') && (n.type = 'number'),
+ a.every((o) => typeof o == 'string') && (n.type = 'string'),
+ (n.enum = a);
+ };
+ ie.enumProcessor = ZM;
+ var qM = (e, t, n, i) => {
+ let r = e._zod.def,
+ a = [];
+ for (let o of r.values)
+ if (o === void 0) {
+ if (t.unrepresentable === 'throw')
+ throw new Error(
+ 'Literal `undefined` cannot be represented in JSON Schema'
+ );
+ } else if (typeof o == 'bigint') {
+ if (t.unrepresentable === 'throw')
+ throw new Error(
+ 'BigInt literals cannot be represented in JSON Schema'
+ );
+ a.push(Number(o));
+ } else a.push(o);
+ if (a.length !== 0)
+ if (a.length === 1) {
+ let o = a[0];
+ (n.type = o === null ? 'null' : typeof o),
+ t.target === 'draft-04' || t.target === 'openapi-3.0'
+ ? (n.enum = [o])
+ : (n.const = o);
+ } else
+ a.every((o) => typeof o == 'number') && (n.type = 'number'),
+ a.every((o) => typeof o == 'string') && (n.type = 'string'),
+ a.every((o) => typeof o == 'boolean') && (n.type = 'boolean'),
+ a.every((o) => o === null) && (n.type = 'null'),
+ (n.enum = a);
+ };
+ ie.literalProcessor = qM;
+ var KM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('NaN cannot be represented in JSON Schema');
+ };
+ ie.nanProcessor = KM;
+ var VM = (e, t, n, i) => {
+ let r = n,
+ a = e._zod.pattern;
+ if (!a) throw new Error('Pattern not found in template literal');
+ (r.type = 'string'), (r.pattern = a.source);
+ };
+ ie.templateLiteralProcessor = VM;
+ var JM = (e, t, n, i) => {
+ let r = n,
+ a = {type: 'string', format: 'binary', contentEncoding: 'binary'},
+ {minimum: o, maximum: s, mime: l} = e._zod.bag;
+ o !== void 0 && (a.minLength = o),
+ s !== void 0 && (a.maxLength = s),
+ l
+ ? l.length === 1
+ ? ((a.contentMediaType = l[0]), Object.assign(r, a))
+ : (Object.assign(r, a),
+ (r.anyOf = l.map((d) => ({contentMediaType: d}))))
+ : Object.assign(r, a);
+ };
+ ie.fileProcessor = JM;
+ var HM = (e, t, n, i) => {
+ n.type = 'boolean';
+ };
+ ie.successProcessor = HM;
+ var WM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Custom types cannot be represented in JSON Schema');
+ };
+ ie.customProcessor = WM;
+ var GM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Function types cannot be represented in JSON Schema');
+ };
+ ie.functionProcessor = GM;
+ var XM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Transforms cannot be represented in JSON Schema');
+ };
+ ie.transformProcessor = XM;
+ var YM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Map cannot be represented in JSON Schema');
+ };
+ ie.mapProcessor = YM;
+ var QM = (e, t, n, i) => {
+ if (t.unrepresentable === 'throw')
+ throw new Error('Set cannot be represented in JSON Schema');
+ };
+ ie.setProcessor = QM;
+ var eN = (e, t, n, i) => {
+ let r = n,
+ a = e._zod.def,
+ {minimum: o, maximum: s} = e._zod.bag;
+ typeof o == 'number' && (r.minItems = o),
+ typeof s == 'number' && (r.maxItems = s),
+ (r.type = 'array'),
+ (r.items = (0, zt.process)(a.element, t, {
+ ...i,
+ path: [...i.path, 'items'],
+ }));
+ };
+ ie.arrayProcessor = eN;
+ var tN = (e, t, n, i) => {
+ let r = n,
+ a = e._zod.def;
+ (r.type = 'object'), (r.properties = {});
+ let o = a.shape;
+ for (let d in o)
+ r.properties[d] = (0, zt.process)(o[d], t, {
+ ...i,
+ path: [...i.path, 'properties', d],
+ });
+ let s = new Set(Object.keys(o)),
+ l = new Set(
+ [...s].filter((d) => {
+ let u = a.shape[d]._zod;
+ return t.io === 'input' ? u.optin === void 0 : u.optout === void 0;
+ })
+ );
+ l.size > 0 && (r.required = Array.from(l)),
+ a.catchall?._zod.def.type === 'never'
+ ? (r.additionalProperties = !1)
+ : a.catchall
+ ? a.catchall &&
+ (r.additionalProperties = (0, zt.process)(a.catchall, t, {
+ ...i,
+ path: [...i.path, 'additionalProperties'],
+ }))
+ : t.io === 'output' && (r.additionalProperties = !1);
+ };
+ ie.objectProcessor = tN;
+ var nN = (e, t, n, i) => {
+ let r = e._zod.def,
+ a = r.inclusive === !1,
+ o = r.options.map((s, l) =>
+ (0, zt.process)(s, t, {
+ ...i,
+ path: [...i.path, a ? 'oneOf' : 'anyOf', l],
+ })
+ );
+ a ? (n.oneOf = o) : (n.anyOf = o);
+ };
+ ie.unionProcessor = nN;
+ var rN = (e, t, n, i) => {
+ let r = e._zod.def,
+ a = (0, zt.process)(r.left, t, {...i, path: [...i.path, 'allOf', 0]}),
+ o = (0, zt.process)(r.right, t, {...i, path: [...i.path, 'allOf', 1]}),
+ s = (d) => 'allOf' in d && Object.keys(d).length === 1,
+ l = [...(s(a) ? a.allOf : [a]), ...(s(o) ? o.allOf : [o])];
+ n.allOf = l;
+ };
+ ie.intersectionProcessor = rN;
+ var iN = (e, t, n, i) => {
+ let r = n,
+ a = e._zod.def;
+ r.type = 'array';
+ let o = t.target === 'draft-2020-12' ? 'prefixItems' : 'items',
+ s =
+ t.target === 'draft-2020-12' || t.target === 'openapi-3.0'
+ ? 'items'
+ : 'additionalItems',
+ l = a.items.map((y, m) =>
+ (0, zt.process)(y, t, {...i, path: [...i.path, o, m]})
+ ),
+ d = a.rest
+ ? (0, zt.process)(a.rest, t, {
+ ...i,
+ path: [
+ ...i.path,
+ s,
+ ...(t.target === 'openapi-3.0' ? [a.items.length] : []),
+ ],
+ })
+ : null;
+ t.target === 'draft-2020-12'
+ ? ((r.prefixItems = l), d && (r.items = d))
+ : t.target === 'openapi-3.0'
+ ? ((r.items = {anyOf: l}),
+ d && r.items.anyOf.push(d),
+ (r.minItems = l.length),
+ d || (r.maxItems = l.length))
+ : ((r.items = l), d && (r.additionalItems = d));
+ let {minimum: u, maximum: p} = e._zod.bag;
+ typeof u == 'number' && (r.minItems = u),
+ typeof p == 'number' && (r.maxItems = p);
+ };
+ ie.tupleProcessor = iN;
+ var aN = (e, t, n, i) => {
+ let r = n,
+ a = e._zod.def;
+ r.type = 'object';
+ let o = a.keyType,
+ l = o._zod.bag?.patterns;
+ if (a.mode === 'loose' && l && l.size > 0) {
+ let u = (0, zt.process)(a.valueType, t, {
+ ...i,
+ path: [...i.path, 'patternProperties', '*'],
+ });
+ r.patternProperties = {};
+ for (let p of l) r.patternProperties[p.source] = u;
+ } else
+ (t.target === 'draft-07' || t.target === 'draft-2020-12') &&
+ (r.propertyNames = (0, zt.process)(a.keyType, t, {
+ ...i,
+ path: [...i.path, 'propertyNames'],
+ })),
+ (r.additionalProperties = (0, zt.process)(a.valueType, t, {
+ ...i,
+ path: [...i.path, 'additionalProperties'],
+ }));
+ let d = o._zod.values;
+ if (d) {
+ let u = [...d].filter(
+ (p) => typeof p == 'string' || typeof p == 'number'
+ );
+ u.length > 0 && (r.required = u);
+ }
+ };
+ ie.recordProcessor = aN;
+ var oN = (e, t, n, i) => {
+ let r = e._zod.def,
+ a = (0, zt.process)(r.innerType, t, i),
+ o = t.seen.get(e);
+ t.target === 'openapi-3.0'
+ ? ((o.ref = r.innerType), (n.nullable = !0))
+ : (n.anyOf = [a, {type: 'null'}]);
+ };
+ ie.nullableProcessor = oN;
+ var sN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ a.ref = r.innerType;
+ };
+ ie.nonoptionalProcessor = sN;
+ var lN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ (a.ref = r.innerType),
+ (n.default = JSON.parse(JSON.stringify(r.defaultValue)));
+ };
+ ie.defaultProcessor = lN;
+ var cN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ (a.ref = r.innerType),
+ t.io === 'input' &&
+ (n._prefault = JSON.parse(JSON.stringify(r.defaultValue)));
+ };
+ ie.prefaultProcessor = cN;
+ var uN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ a.ref = r.innerType;
+ let o;
+ try {
+ o = r.catchValue(void 0);
+ } catch {
+ throw new Error('Dynamic catch values are not supported in JSON Schema');
+ }
+ n.default = o;
+ };
+ ie.catchProcessor = uN;
+ var dN = (e, t, n, i) => {
+ let r = e._zod.def,
+ a =
+ t.io === 'input'
+ ? r.in._zod.def.type === 'transform'
+ ? r.out
+ : r.in
+ : r.out;
+ (0, zt.process)(a, t, i);
+ let o = t.seen.get(e);
+ o.ref = a;
+ };
+ ie.pipeProcessor = dN;
+ var fN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ (a.ref = r.innerType), (n.readOnly = !0);
+ };
+ ie.readonlyProcessor = fN;
+ var pN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ a.ref = r.innerType;
+ };
+ ie.promiseProcessor = pN;
+ var mN = (e, t, n, i) => {
+ let r = e._zod.def;
+ (0, zt.process)(r.innerType, t, i);
+ let a = t.seen.get(e);
+ a.ref = r.innerType;
+ };
+ ie.optionalProcessor = mN;
+ var yN = (e, t, n, i) => {
+ let r = e._zod.innerType;
+ (0, zt.process)(r, t, i);
+ let a = t.seen.get(e);
+ a.ref = r;
+ };
+ ie.lazyProcessor = yN;
+ ie.allProcessors = {
+ string: ie.stringProcessor,
+ number: ie.numberProcessor,
+ boolean: ie.booleanProcessor,
+ bigint: ie.bigintProcessor,
+ symbol: ie.symbolProcessor,
+ null: ie.nullProcessor,
+ undefined: ie.undefinedProcessor,
+ void: ie.voidProcessor,
+ never: ie.neverProcessor,
+ any: ie.anyProcessor,
+ unknown: ie.unknownProcessor,
+ date: ie.dateProcessor,
+ enum: ie.enumProcessor,
+ literal: ie.literalProcessor,
+ nan: ie.nanProcessor,
+ template_literal: ie.templateLiteralProcessor,
+ file: ie.fileProcessor,
+ success: ie.successProcessor,
+ custom: ie.customProcessor,
+ function: ie.functionProcessor,
+ transform: ie.transformProcessor,
+ map: ie.mapProcessor,
+ set: ie.setProcessor,
+ array: ie.arrayProcessor,
+ object: ie.objectProcessor,
+ union: ie.unionProcessor,
+ intersection: ie.intersectionProcessor,
+ tuple: ie.tupleProcessor,
+ record: ie.recordProcessor,
+ nullable: ie.nullableProcessor,
+ nonoptional: ie.nonoptionalProcessor,
+ default: ie.defaultProcessor,
+ prefault: ie.prefaultProcessor,
+ catch: ie.catchProcessor,
+ pipe: ie.pipeProcessor,
+ readonly: ie.readonlyProcessor,
+ promise: ie.promiseProcessor,
+ optional: ie.optionalProcessor,
+ lazy: ie.lazyProcessor,
+ };
+ function gN(e, t) {
+ if ('_idmap' in e) {
+ let i = e,
+ r = (0, zt.initializeContext)({...t, processors: ie.allProcessors}),
+ a = {};
+ for (let l of i._idmap.entries()) {
+ let [d, u] = l;
+ (0, zt.process)(u, r);
+ }
+ let o = {},
+ s = {registry: i, uri: t?.uri, defs: a};
+ r.external = s;
+ for (let l of i._idmap.entries()) {
+ let [d, u] = l;
+ (0, zt.extractDefs)(r, u), (o[d] = (0, zt.finalize)(r, u));
+ }
+ if (Object.keys(a).length > 0) {
+ let l = r.target === 'draft-2020-12' ? '$defs' : 'definitions';
+ o.__shared = {[l]: a};
+ }
+ return {schemas: o};
+ }
+ let n = (0, zt.initializeContext)({...t, processors: ie.allProcessors});
+ return (
+ (0, zt.process)(e, n), (0, zt.extractDefs)(n, e), (0, zt.finalize)(n, e)
+ );
+ }
+});
+var kS = xe((cf) => {
+ 'use strict';
+ Object.defineProperty(cf, '__esModule', {value: !0});
+ cf.JSONSchemaGenerator = void 0;
+ var vN = Kc(),
+ lf = qc(),
+ ag = class {
+ get metadataRegistry() {
+ return this.ctx.metadataRegistry;
+ }
+ get target() {
+ return this.ctx.target;
+ }
+ get unrepresentable() {
+ return this.ctx.unrepresentable;
+ }
+ get override() {
+ return this.ctx.override;
+ }
+ get io() {
+ return this.ctx.io;
+ }
+ get counter() {
+ return this.ctx.counter;
+ }
+ set counter(t) {
+ this.ctx.counter = t;
+ }
+ get seen() {
+ return this.ctx.seen;
+ }
+ constructor(t) {
+ let n = t?.target ?? 'draft-2020-12';
+ n === 'draft-4' && (n = 'draft-04'),
+ n === 'draft-7' && (n = 'draft-07'),
+ (this.ctx = (0, lf.initializeContext)({
+ processors: vN.allProcessors,
+ target: n,
+ ...(t?.metadata && {metadata: t.metadata}),
+ ...(t?.unrepresentable && {unrepresentable: t.unrepresentable}),
+ ...(t?.override && {override: t.override}),
+ ...(t?.io && {io: t.io}),
+ }));
+ }
+ process(t, n = {path: [], schemaPath: []}) {
+ return (0, lf.process)(t, this.ctx, n);
+ }
+ emit(t, n) {
+ n &&
+ (n.cycles && (this.ctx.cycles = n.cycles),
+ n.reused && (this.ctx.reused = n.reused),
+ n.external && (this.ctx.external = n.external)),
+ (0, lf.extractDefs)(this.ctx, t);
+ let i = (0, lf.finalize)(this.ctx, t),
+ {'~standard': r, ...a} = i;
+ return a;
+ }
+ };
+ cf.JSONSchemaGenerator = ag;
+});
+var _S = xe((SS) => {
+ 'use strict';
+ Object.defineProperty(SS, '__esModule', {value: !0});
+});
+var _n = xe((Mt) => {
+ 'use strict';
+ var TS =
+ (Mt && Mt.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ hN =
+ (Mt && Mt.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ yi =
+ (Mt && Mt.__exportStar) ||
+ function (e, t) {
+ for (var n in e)
+ n !== 'default' &&
+ !Object.prototype.hasOwnProperty.call(t, n) &&
+ TS(t, e, n);
+ },
+ uf =
+ (Mt && Mt.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ TS(t, e, n);
+ return hN(t, e), t;
+ };
+ Object.defineProperty(Mt, '__esModule', {value: !0});
+ Mt.JSONSchema =
+ Mt.JSONSchemaGenerator =
+ Mt.toJSONSchema =
+ Mt.locales =
+ Mt.regexes =
+ Mt.util =
+ void 0;
+ yi(wa(), Mt);
+ yi(Zy(), Mt);
+ yi(By(), Mt);
+ yi(Xy(), Mt);
+ yi(Qu(), Mt);
+ yi(Hy(), Mt);
+ Mt.util = uf(ot());
+ Mt.regexes = uf(Yu());
+ Mt.locales = uf(tg());
+ yi(Bc(), Mt);
+ yi(Jy(), Mt);
+ yi(bS(), Mt);
+ yi(qc(), Mt);
+ var bN = Kc();
+ Object.defineProperty(Mt, 'toJSONSchema', {
+ enumerable: !0,
+ get: function () {
+ return bN.toJSONSchema;
+ },
+ });
+ var kN = kS();
+ Object.defineProperty(Mt, 'JSONSchemaGenerator', {
+ enumerable: !0,
+ get: function () {
+ return kN.JSONSchemaGenerator;
+ },
+ });
+ Mt.JSONSchema = uf(_S());
+});
+var df = xe((nt) => {
+ 'use strict';
+ Object.defineProperty(nt, '__esModule', {value: !0});
+ nt.slugify =
+ nt.toUpperCase =
+ nt.toLowerCase =
+ nt.trim =
+ nt.normalize =
+ nt.overwrite =
+ nt.mime =
+ nt.property =
+ nt.endsWith =
+ nt.startsWith =
+ nt.includes =
+ nt.uppercase =
+ nt.lowercase =
+ nt.regex =
+ nt.length =
+ nt.minLength =
+ nt.maxLength =
+ nt.size =
+ nt.minSize =
+ nt.maxSize =
+ nt.multipleOf =
+ nt.nonnegative =
+ nt.nonpositive =
+ nt.negative =
+ nt.positive =
+ nt.gte =
+ nt.gt =
+ nt.lte =
+ nt.lt =
+ void 0;
+ var Bt = _n();
+ Object.defineProperty(nt, 'lt', {
+ enumerable: !0,
+ get: function () {
+ return Bt._lt;
+ },
+ });
+ Object.defineProperty(nt, 'lte', {
+ enumerable: !0,
+ get: function () {
+ return Bt._lte;
+ },
+ });
+ Object.defineProperty(nt, 'gt', {
+ enumerable: !0,
+ get: function () {
+ return Bt._gt;
+ },
+ });
+ Object.defineProperty(nt, 'gte', {
+ enumerable: !0,
+ get: function () {
+ return Bt._gte;
+ },
+ });
+ Object.defineProperty(nt, 'positive', {
+ enumerable: !0,
+ get: function () {
+ return Bt._positive;
+ },
+ });
+ Object.defineProperty(nt, 'negative', {
+ enumerable: !0,
+ get: function () {
+ return Bt._negative;
+ },
+ });
+ Object.defineProperty(nt, 'nonpositive', {
+ enumerable: !0,
+ get: function () {
+ return Bt._nonpositive;
+ },
+ });
+ Object.defineProperty(nt, 'nonnegative', {
+ enumerable: !0,
+ get: function () {
+ return Bt._nonnegative;
+ },
+ });
+ Object.defineProperty(nt, 'multipleOf', {
+ enumerable: !0,
+ get: function () {
+ return Bt._multipleOf;
+ },
+ });
+ Object.defineProperty(nt, 'maxSize', {
+ enumerable: !0,
+ get: function () {
+ return Bt._maxSize;
+ },
+ });
+ Object.defineProperty(nt, 'minSize', {
+ enumerable: !0,
+ get: function () {
+ return Bt._minSize;
+ },
+ });
+ Object.defineProperty(nt, 'size', {
+ enumerable: !0,
+ get: function () {
+ return Bt._size;
+ },
+ });
+ Object.defineProperty(nt, 'maxLength', {
+ enumerable: !0,
+ get: function () {
+ return Bt._maxLength;
+ },
+ });
+ Object.defineProperty(nt, 'minLength', {
+ enumerable: !0,
+ get: function () {
+ return Bt._minLength;
+ },
+ });
+ Object.defineProperty(nt, 'length', {
+ enumerable: !0,
+ get: function () {
+ return Bt._length;
+ },
+ });
+ Object.defineProperty(nt, 'regex', {
+ enumerable: !0,
+ get: function () {
+ return Bt._regex;
+ },
+ });
+ Object.defineProperty(nt, 'lowercase', {
+ enumerable: !0,
+ get: function () {
+ return Bt._lowercase;
+ },
+ });
+ Object.defineProperty(nt, 'uppercase', {
+ enumerable: !0,
+ get: function () {
+ return Bt._uppercase;
+ },
+ });
+ Object.defineProperty(nt, 'includes', {
+ enumerable: !0,
+ get: function () {
+ return Bt._includes;
+ },
+ });
+ Object.defineProperty(nt, 'startsWith', {
+ enumerable: !0,
+ get: function () {
+ return Bt._startsWith;
+ },
+ });
+ Object.defineProperty(nt, 'endsWith', {
+ enumerable: !0,
+ get: function () {
+ return Bt._endsWith;
+ },
+ });
+ Object.defineProperty(nt, 'property', {
+ enumerable: !0,
+ get: function () {
+ return Bt._property;
+ },
+ });
+ Object.defineProperty(nt, 'mime', {
+ enumerable: !0,
+ get: function () {
+ return Bt._mime;
+ },
+ });
+ Object.defineProperty(nt, 'overwrite', {
+ enumerable: !0,
+ get: function () {
+ return Bt._overwrite;
+ },
+ });
+ Object.defineProperty(nt, 'normalize', {
+ enumerable: !0,
+ get: function () {
+ return Bt._normalize;
+ },
+ });
+ Object.defineProperty(nt, 'trim', {
+ enumerable: !0,
+ get: function () {
+ return Bt._trim;
+ },
+ });
+ Object.defineProperty(nt, 'toLowerCase', {
+ enumerable: !0,
+ get: function () {
+ return Bt._toLowerCase;
+ },
+ });
+ Object.defineProperty(nt, 'toUpperCase', {
+ enumerable: !0,
+ get: function () {
+ return Bt._toUpperCase;
+ },
+ });
+ Object.defineProperty(nt, 'slugify', {
+ enumerable: !0,
+ get: function () {
+ return Bt._slugify;
+ },
+ });
+});
+var Vc = xe((Xt) => {
+ 'use strict';
+ var SN =
+ (Xt && Xt.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ _N =
+ (Xt && Xt.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ ES =
+ (Xt && Xt.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ SN(t, e, n);
+ return _N(t, e), t;
+ };
+ Object.defineProperty(Xt, '__esModule', {value: !0});
+ Xt.ZodISODuration =
+ Xt.ZodISOTime =
+ Xt.ZodISODate =
+ Xt.ZodISODateTime =
+ void 0;
+ Xt.datetime = TN;
+ Xt.date = EN;
+ Xt.time = IN;
+ Xt.duration = PN;
+ var nr = ES(_n()),
+ ff = ES(Jc());
+ Xt.ZodISODateTime = nr.$constructor('ZodISODateTime', (e, t) => {
+ nr.$ZodISODateTime.init(e, t), ff.ZodStringFormat.init(e, t);
+ });
+ function TN(e) {
+ return nr._isoDateTime(Xt.ZodISODateTime, e);
+ }
+ Xt.ZodISODate = nr.$constructor('ZodISODate', (e, t) => {
+ nr.$ZodISODate.init(e, t), ff.ZodStringFormat.init(e, t);
+ });
+ function EN(e) {
+ return nr._isoDate(Xt.ZodISODate, e);
+ }
+ Xt.ZodISOTime = nr.$constructor('ZodISOTime', (e, t) => {
+ nr.$ZodISOTime.init(e, t), ff.ZodStringFormat.init(e, t);
+ });
+ function IN(e) {
+ return nr._isoTime(Xt.ZodISOTime, e);
+ }
+ Xt.ZodISODuration = nr.$constructor('ZodISODuration', (e, t) => {
+ nr.$ZodISODuration.init(e, t), ff.ZodStringFormat.init(e, t);
+ });
+ function PN(e) {
+ return nr._isoDuration(Xt.ZodISODuration, e);
+ }
+});
+var og = xe((rr) => {
+ 'use strict';
+ var xN =
+ (rr && rr.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ wN =
+ (rr && rr.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ PS =
+ (rr && rr.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ xN(t, e, n);
+ return wN(t, e), t;
+ };
+ Object.defineProperty(rr, '__esModule', {value: !0});
+ rr.ZodRealError = rr.ZodError = void 0;
+ var pf = PS(_n()),
+ ON = _n(),
+ IS = PS(ot()),
+ xS = (e, t) => {
+ ON.$ZodError.init(e, t),
+ (e.name = 'ZodError'),
+ Object.defineProperties(e, {
+ format: {value: (n) => pf.formatError(e, n)},
+ flatten: {value: (n) => pf.flattenError(e, n)},
+ addIssue: {
+ value: (n) => {
+ e.issues.push(n),
+ (e.message = JSON.stringify(
+ e.issues,
+ IS.jsonStringifyReplacer,
+ 2
+ ));
+ },
+ },
+ addIssues: {
+ value: (n) => {
+ e.issues.push(...n),
+ (e.message = JSON.stringify(
+ e.issues,
+ IS.jsonStringifyReplacer,
+ 2
+ ));
+ },
+ },
+ isEmpty: {
+ get() {
+ return e.issues.length === 0;
+ },
+ },
+ });
+ };
+ rr.ZodError = pf.$constructor('ZodError', xS);
+ rr.ZodRealError = pf.$constructor('ZodError', xS, {Parent: Error});
+});
+var sg = xe((Nt) => {
+ 'use strict';
+ var $N =
+ (Nt && Nt.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ jN =
+ (Nt && Nt.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ CN =
+ (Nt && Nt.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ $N(t, e, n);
+ return jN(t, e), t;
+ };
+ Object.defineProperty(Nt, '__esModule', {value: !0});
+ Nt.safeDecodeAsync =
+ Nt.safeEncodeAsync =
+ Nt.safeDecode =
+ Nt.safeEncode =
+ Nt.decodeAsync =
+ Nt.encodeAsync =
+ Nt.decode =
+ Nt.encode =
+ Nt.safeParseAsync =
+ Nt.safeParse =
+ Nt.parseAsync =
+ Nt.parse =
+ void 0;
+ var ir = CN(_n()),
+ ar = og();
+ Nt.parse = ir._parse(ar.ZodRealError);
+ Nt.parseAsync = ir._parseAsync(ar.ZodRealError);
+ Nt.safeParse = ir._safeParse(ar.ZodRealError);
+ Nt.safeParseAsync = ir._safeParseAsync(ar.ZodRealError);
+ Nt.encode = ir._encode(ar.ZodRealError);
+ Nt.decode = ir._decode(ar.ZodRealError);
+ Nt.encodeAsync = ir._encodeAsync(ar.ZodRealError);
+ Nt.decodeAsync = ir._decodeAsync(ar.ZodRealError);
+ Nt.safeEncode = ir._safeEncode(ar.ZodRealError);
+ Nt.safeDecode = ir._safeDecode(ar.ZodRealError);
+ Nt.safeEncodeAsync = ir._safeEncodeAsync(ar.ZodRealError);
+ Nt.safeDecodeAsync = ir._safeDecodeAsync(ar.ZodRealError);
+});
+var Jc = xe((T) => {
+ 'use strict';
+ var DN =
+ (T && T.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ AN =
+ (T && T.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ Hc =
+ (T && T.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ DN(t, e, n);
+ return AN(t, e), t;
+ };
+ Object.defineProperty(T, '__esModule', {value: !0});
+ T.ZodLiteral =
+ T.ZodEnum =
+ T.ZodSet =
+ T.ZodMap =
+ T.ZodRecord =
+ T.ZodTuple =
+ T.ZodIntersection =
+ T.ZodDiscriminatedUnion =
+ T.ZodXor =
+ T.ZodUnion =
+ T.ZodObject =
+ T.ZodArray =
+ T.ZodDate =
+ T.ZodVoid =
+ T.ZodNever =
+ T.ZodUnknown =
+ T.ZodAny =
+ T.ZodNull =
+ T.ZodUndefined =
+ T.ZodSymbol =
+ T.ZodBigIntFormat =
+ T.ZodBigInt =
+ T.ZodBoolean =
+ T.ZodNumberFormat =
+ T.ZodNumber =
+ T.ZodCustomStringFormat =
+ T.ZodJWT =
+ T.ZodE164 =
+ T.ZodBase64URL =
+ T.ZodBase64 =
+ T.ZodCIDRv6 =
+ T.ZodCIDRv4 =
+ T.ZodIPv6 =
+ T.ZodMAC =
+ T.ZodIPv4 =
+ T.ZodKSUID =
+ T.ZodXID =
+ T.ZodULID =
+ T.ZodCUID2 =
+ T.ZodCUID =
+ T.ZodNanoID =
+ T.ZodEmoji =
+ T.ZodURL =
+ T.ZodUUID =
+ T.ZodGUID =
+ T.ZodEmail =
+ T.ZodStringFormat =
+ T.ZodString =
+ T._ZodString =
+ T.ZodType =
+ void 0;
+ T.stringbool =
+ T.meta =
+ T.describe =
+ T.ZodCustom =
+ T.ZodFunction =
+ T.ZodPromise =
+ T.ZodLazy =
+ T.ZodTemplateLiteral =
+ T.ZodReadonly =
+ T.ZodCodec =
+ T.ZodPipe =
+ T.ZodNaN =
+ T.ZodCatch =
+ T.ZodSuccess =
+ T.ZodNonOptional =
+ T.ZodPrefault =
+ T.ZodDefault =
+ T.ZodNullable =
+ T.ZodExactOptional =
+ T.ZodOptional =
+ T.ZodTransform =
+ T.ZodFile =
+ void 0;
+ T.string = cg;
+ T.email = MN;
+ T.guid = NN;
+ T.uuid = RN;
+ T.uuidv4 = LN;
+ T.uuidv6 = FN;
+ T.uuidv7 = zN;
+ T.url = BN;
+ T.httpUrl = UN;
+ T.emoji = ZN;
+ T.nanoid = qN;
+ T.cuid = KN;
+ T.cuid2 = VN;
+ T.ulid = JN;
+ T.xid = HN;
+ T.ksuid = WN;
+ T.ipv4 = GN;
+ T.mac = XN;
+ T.ipv6 = YN;
+ T.cidrv4 = QN;
+ T.cidrv6 = eR;
+ T.base64 = tR;
+ T.base64url = nR;
+ T.e164 = rR;
+ T.jwt = iR;
+ T.stringFormat = aR;
+ T.hostname = oR;
+ T.hex = sR;
+ T.hash = lR;
+ T.number = wS;
+ T.int = ug;
+ T.float32 = cR;
+ T.float64 = uR;
+ T.int32 = dR;
+ T.uint32 = fR;
+ T.boolean = OS;
+ T.bigint = pR;
+ T.int64 = mR;
+ T.uint64 = yR;
+ T.symbol = gR;
+ T.undefined = vR;
+ T.null = $S;
+ T.any = hR;
+ T.unknown = Na;
+ T.never = dg;
+ T.void = bR;
+ T.date = kR;
+ T.array = hf;
+ T.keyof = SR;
+ T.object = _R;
+ T.strictObject = TR;
+ T.looseObject = ER;
+ T.union = fg;
+ T.xor = IR;
+ T.discriminatedUnion = PR;
+ T.intersection = jS;
+ T.tuple = CS;
+ T.record = DS;
+ T.partialRecord = xR;
+ T.looseRecord = wR;
+ T.map = OR;
+ T.set = $R;
+ T.enum = pg;
+ T.nativeEnum = jR;
+ T.literal = CR;
+ T.file = DR;
+ T.transform = mg;
+ T.optional = yf;
+ T.exactOptional = AS;
+ T.nullable = gf;
+ T.nullish = AR;
+ T._default = MS;
+ T.prefault = NS;
+ T.nonoptional = RS;
+ T.success = MR;
+ T.catch = LS;
+ T.nan = NR;
+ T.pipe = vf;
+ T.codec = RR;
+ T.readonly = FS;
+ T.templateLiteral = LR;
+ T.lazy = zS;
+ T.promise = FR;
+ T._function = bf;
+ T.function = bf;
+ T._function = bf;
+ T.function = bf;
+ T.check = zR;
+ T.custom = BR;
+ T.refine = BS;
+ T.superRefine = US;
+ T.instanceof = UR;
+ T.json = qR;
+ T.preprocess = KR;
+ var B = Hc(_n()),
+ jt = _n(),
+ xt = Hc(Kc()),
+ lg = qc(),
+ kt = Hc(df()),
+ mf = Hc(Vc()),
+ or = Hc(sg());
+ T.ZodType = B.$constructor(
+ 'ZodType',
+ (e, t) => (
+ B.$ZodType.init(e, t),
+ Object.assign(e['~standard'], {
+ jsonSchema: {
+ input: (0, lg.createStandardJSONSchemaMethod)(e, 'input'),
+ output: (0, lg.createStandardJSONSchemaMethod)(e, 'output'),
+ },
+ }),
+ (e.toJSONSchema = (0, lg.createToJSONSchemaMethod)(e, {})),
+ (e.def = t),
+ (e.type = t.type),
+ Object.defineProperty(e, '_def', {value: t}),
+ (e.check = (...n) =>
+ e.clone(
+ jt.util.mergeDefs(t, {
+ checks: [
+ ...(t.checks ?? []),
+ ...n.map((i) =>
+ typeof i == 'function'
+ ? {_zod: {check: i, def: {check: 'custom'}, onattach: []}}
+ : i
+ ),
+ ],
+ }),
+ {parent: !0}
+ )),
+ (e.with = e.check),
+ (e.clone = (n, i) => B.clone(e, n, i)),
+ (e.brand = () => e),
+ (e.register = (n, i) => (n.add(e, i), e)),
+ (e.parse = (n, i) => or.parse(e, n, i, {callee: e.parse})),
+ (e.safeParse = (n, i) => or.safeParse(e, n, i)),
+ (e.parseAsync = async (n, i) =>
+ or.parseAsync(e, n, i, {callee: e.parseAsync})),
+ (e.safeParseAsync = async (n, i) => or.safeParseAsync(e, n, i)),
+ (e.spa = e.safeParseAsync),
+ (e.encode = (n, i) => or.encode(e, n, i)),
+ (e.decode = (n, i) => or.decode(e, n, i)),
+ (e.encodeAsync = async (n, i) => or.encodeAsync(e, n, i)),
+ (e.decodeAsync = async (n, i) => or.decodeAsync(e, n, i)),
+ (e.safeEncode = (n, i) => or.safeEncode(e, n, i)),
+ (e.safeDecode = (n, i) => or.safeDecode(e, n, i)),
+ (e.safeEncodeAsync = async (n, i) => or.safeEncodeAsync(e, n, i)),
+ (e.safeDecodeAsync = async (n, i) => or.safeDecodeAsync(e, n, i)),
+ (e.refine = (n, i) => e.check(BS(n, i))),
+ (e.superRefine = (n) => e.check(US(n))),
+ (e.overwrite = (n) => e.check(kt.overwrite(n))),
+ (e.optional = () => yf(e)),
+ (e.exactOptional = () => AS(e)),
+ (e.nullable = () => gf(e)),
+ (e.nullish = () => yf(gf(e))),
+ (e.nonoptional = (n) => RS(e, n)),
+ (e.array = () => hf(e)),
+ (e.or = (n) => fg([e, n])),
+ (e.and = (n) => jS(e, n)),
+ (e.transform = (n) => vf(e, mg(n))),
+ (e.default = (n) => MS(e, n)),
+ (e.prefault = (n) => NS(e, n)),
+ (e.catch = (n) => LS(e, n)),
+ (e.pipe = (n) => vf(e, n)),
+ (e.readonly = () => FS(e)),
+ (e.describe = (n) => {
+ let i = e.clone();
+ return B.globalRegistry.add(i, {description: n}), i;
+ }),
+ Object.defineProperty(e, 'description', {
+ get() {
+ return B.globalRegistry.get(e)?.description;
+ },
+ configurable: !0,
+ }),
+ (e.meta = (...n) => {
+ if (n.length === 0) return B.globalRegistry.get(e);
+ let i = e.clone();
+ return B.globalRegistry.add(i, n[0]), i;
+ }),
+ (e.isOptional = () => e.safeParse(void 0).success),
+ (e.isNullable = () => e.safeParse(null).success),
+ (e.apply = (n) => n(e)),
+ e
+ )
+ );
+ T._ZodString = B.$constructor('_ZodString', (e, t) => {
+ B.$ZodString.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (i, r, a) => xt.stringProcessor(e, i, r, a));
+ let n = e._zod.bag;
+ (e.format = n.format ?? null),
+ (e.minLength = n.minimum ?? null),
+ (e.maxLength = n.maximum ?? null),
+ (e.regex = (...i) => e.check(kt.regex(...i))),
+ (e.includes = (...i) => e.check(kt.includes(...i))),
+ (e.startsWith = (...i) => e.check(kt.startsWith(...i))),
+ (e.endsWith = (...i) => e.check(kt.endsWith(...i))),
+ (e.min = (...i) => e.check(kt.minLength(...i))),
+ (e.max = (...i) => e.check(kt.maxLength(...i))),
+ (e.length = (...i) => e.check(kt.length(...i))),
+ (e.nonempty = (...i) => e.check(kt.minLength(1, ...i))),
+ (e.lowercase = (i) => e.check(kt.lowercase(i))),
+ (e.uppercase = (i) => e.check(kt.uppercase(i))),
+ (e.trim = () => e.check(kt.trim())),
+ (e.normalize = (...i) => e.check(kt.normalize(...i))),
+ (e.toLowerCase = () => e.check(kt.toLowerCase())),
+ (e.toUpperCase = () => e.check(kt.toUpperCase())),
+ (e.slugify = () => e.check(kt.slugify()));
+ });
+ T.ZodString = B.$constructor('ZodString', (e, t) => {
+ B.$ZodString.init(e, t),
+ T._ZodString.init(e, t),
+ (e.email = (n) => e.check(B._email(T.ZodEmail, n))),
+ (e.url = (n) => e.check(B._url(T.ZodURL, n))),
+ (e.jwt = (n) => e.check(B._jwt(T.ZodJWT, n))),
+ (e.emoji = (n) => e.check(B._emoji(T.ZodEmoji, n))),
+ (e.guid = (n) => e.check(B._guid(T.ZodGUID, n))),
+ (e.uuid = (n) => e.check(B._uuid(T.ZodUUID, n))),
+ (e.uuidv4 = (n) => e.check(B._uuidv4(T.ZodUUID, n))),
+ (e.uuidv6 = (n) => e.check(B._uuidv6(T.ZodUUID, n))),
+ (e.uuidv7 = (n) => e.check(B._uuidv7(T.ZodUUID, n))),
+ (e.nanoid = (n) => e.check(B._nanoid(T.ZodNanoID, n))),
+ (e.guid = (n) => e.check(B._guid(T.ZodGUID, n))),
+ (e.cuid = (n) => e.check(B._cuid(T.ZodCUID, n))),
+ (e.cuid2 = (n) => e.check(B._cuid2(T.ZodCUID2, n))),
+ (e.ulid = (n) => e.check(B._ulid(T.ZodULID, n))),
+ (e.base64 = (n) => e.check(B._base64(T.ZodBase64, n))),
+ (e.base64url = (n) => e.check(B._base64url(T.ZodBase64URL, n))),
+ (e.xid = (n) => e.check(B._xid(T.ZodXID, n))),
+ (e.ksuid = (n) => e.check(B._ksuid(T.ZodKSUID, n))),
+ (e.ipv4 = (n) => e.check(B._ipv4(T.ZodIPv4, n))),
+ (e.ipv6 = (n) => e.check(B._ipv6(T.ZodIPv6, n))),
+ (e.cidrv4 = (n) => e.check(B._cidrv4(T.ZodCIDRv4, n))),
+ (e.cidrv6 = (n) => e.check(B._cidrv6(T.ZodCIDRv6, n))),
+ (e.e164 = (n) => e.check(B._e164(T.ZodE164, n))),
+ (e.datetime = (n) => e.check(mf.datetime(n))),
+ (e.date = (n) => e.check(mf.date(n))),
+ (e.time = (n) => e.check(mf.time(n))),
+ (e.duration = (n) => e.check(mf.duration(n)));
+ });
+ function cg(e) {
+ return B._string(T.ZodString, e);
+ }
+ T.ZodStringFormat = B.$constructor('ZodStringFormat', (e, t) => {
+ B.$ZodStringFormat.init(e, t), T._ZodString.init(e, t);
+ });
+ T.ZodEmail = B.$constructor('ZodEmail', (e, t) => {
+ B.$ZodEmail.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function MN(e) {
+ return B._email(T.ZodEmail, e);
+ }
+ T.ZodGUID = B.$constructor('ZodGUID', (e, t) => {
+ B.$ZodGUID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function NN(e) {
+ return B._guid(T.ZodGUID, e);
+ }
+ T.ZodUUID = B.$constructor('ZodUUID', (e, t) => {
+ B.$ZodUUID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function RN(e) {
+ return B._uuid(T.ZodUUID, e);
+ }
+ function LN(e) {
+ return B._uuidv4(T.ZodUUID, e);
+ }
+ function FN(e) {
+ return B._uuidv6(T.ZodUUID, e);
+ }
+ function zN(e) {
+ return B._uuidv7(T.ZodUUID, e);
+ }
+ T.ZodURL = B.$constructor('ZodURL', (e, t) => {
+ B.$ZodURL.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function BN(e) {
+ return B._url(T.ZodURL, e);
+ }
+ function UN(e) {
+ return B._url(T.ZodURL, {
+ protocol: /^https?$/,
+ hostname: B.regexes.domain,
+ ...jt.util.normalizeParams(e),
+ });
+ }
+ T.ZodEmoji = B.$constructor('ZodEmoji', (e, t) => {
+ B.$ZodEmoji.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function ZN(e) {
+ return B._emoji(T.ZodEmoji, e);
+ }
+ T.ZodNanoID = B.$constructor('ZodNanoID', (e, t) => {
+ B.$ZodNanoID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function qN(e) {
+ return B._nanoid(T.ZodNanoID, e);
+ }
+ T.ZodCUID = B.$constructor('ZodCUID', (e, t) => {
+ B.$ZodCUID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function KN(e) {
+ return B._cuid(T.ZodCUID, e);
+ }
+ T.ZodCUID2 = B.$constructor('ZodCUID2', (e, t) => {
+ B.$ZodCUID2.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function VN(e) {
+ return B._cuid2(T.ZodCUID2, e);
+ }
+ T.ZodULID = B.$constructor('ZodULID', (e, t) => {
+ B.$ZodULID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function JN(e) {
+ return B._ulid(T.ZodULID, e);
+ }
+ T.ZodXID = B.$constructor('ZodXID', (e, t) => {
+ B.$ZodXID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function HN(e) {
+ return B._xid(T.ZodXID, e);
+ }
+ T.ZodKSUID = B.$constructor('ZodKSUID', (e, t) => {
+ B.$ZodKSUID.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function WN(e) {
+ return B._ksuid(T.ZodKSUID, e);
+ }
+ T.ZodIPv4 = B.$constructor('ZodIPv4', (e, t) => {
+ B.$ZodIPv4.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function GN(e) {
+ return B._ipv4(T.ZodIPv4, e);
+ }
+ T.ZodMAC = B.$constructor('ZodMAC', (e, t) => {
+ B.$ZodMAC.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function XN(e) {
+ return B._mac(T.ZodMAC, e);
+ }
+ T.ZodIPv6 = B.$constructor('ZodIPv6', (e, t) => {
+ B.$ZodIPv6.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function YN(e) {
+ return B._ipv6(T.ZodIPv6, e);
+ }
+ T.ZodCIDRv4 = B.$constructor('ZodCIDRv4', (e, t) => {
+ B.$ZodCIDRv4.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function QN(e) {
+ return B._cidrv4(T.ZodCIDRv4, e);
+ }
+ T.ZodCIDRv6 = B.$constructor('ZodCIDRv6', (e, t) => {
+ B.$ZodCIDRv6.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function eR(e) {
+ return B._cidrv6(T.ZodCIDRv6, e);
+ }
+ T.ZodBase64 = B.$constructor('ZodBase64', (e, t) => {
+ B.$ZodBase64.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function tR(e) {
+ return B._base64(T.ZodBase64, e);
+ }
+ T.ZodBase64URL = B.$constructor('ZodBase64URL', (e, t) => {
+ B.$ZodBase64URL.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function nR(e) {
+ return B._base64url(T.ZodBase64URL, e);
+ }
+ T.ZodE164 = B.$constructor('ZodE164', (e, t) => {
+ B.$ZodE164.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function rR(e) {
+ return B._e164(T.ZodE164, e);
+ }
+ T.ZodJWT = B.$constructor('ZodJWT', (e, t) => {
+ B.$ZodJWT.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function iR(e) {
+ return B._jwt(T.ZodJWT, e);
+ }
+ T.ZodCustomStringFormat = B.$constructor('ZodCustomStringFormat', (e, t) => {
+ B.$ZodCustomStringFormat.init(e, t), T.ZodStringFormat.init(e, t);
+ });
+ function aR(e, t, n = {}) {
+ return B._stringFormat(T.ZodCustomStringFormat, e, t, n);
+ }
+ function oR(e) {
+ return B._stringFormat(
+ T.ZodCustomStringFormat,
+ 'hostname',
+ B.regexes.hostname,
+ e
+ );
+ }
+ function sR(e) {
+ return B._stringFormat(T.ZodCustomStringFormat, 'hex', B.regexes.hex, e);
+ }
+ function lR(e, t) {
+ let n = t?.enc ?? 'hex',
+ i = `${e}_${n}`,
+ r = B.regexes[i];
+ if (!r) throw new Error(`Unrecognized hash format: ${i}`);
+ return B._stringFormat(T.ZodCustomStringFormat, i, r, t);
+ }
+ T.ZodNumber = B.$constructor('ZodNumber', (e, t) => {
+ B.$ZodNumber.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (i, r, a) => xt.numberProcessor(e, i, r, a)),
+ (e.gt = (i, r) => e.check(kt.gt(i, r))),
+ (e.gte = (i, r) => e.check(kt.gte(i, r))),
+ (e.min = (i, r) => e.check(kt.gte(i, r))),
+ (e.lt = (i, r) => e.check(kt.lt(i, r))),
+ (e.lte = (i, r) => e.check(kt.lte(i, r))),
+ (e.max = (i, r) => e.check(kt.lte(i, r))),
+ (e.int = (i) => e.check(ug(i))),
+ (e.safe = (i) => e.check(ug(i))),
+ (e.positive = (i) => e.check(kt.gt(0, i))),
+ (e.nonnegative = (i) => e.check(kt.gte(0, i))),
+ (e.negative = (i) => e.check(kt.lt(0, i))),
+ (e.nonpositive = (i) => e.check(kt.lte(0, i))),
+ (e.multipleOf = (i, r) => e.check(kt.multipleOf(i, r))),
+ (e.step = (i, r) => e.check(kt.multipleOf(i, r))),
+ (e.finite = () => e);
+ let n = e._zod.bag;
+ (e.minValue =
+ Math.max(
+ n.minimum ?? Number.NEGATIVE_INFINITY,
+ n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY
+ ) ?? null),
+ (e.maxValue =
+ Math.min(
+ n.maximum ?? Number.POSITIVE_INFINITY,
+ n.exclusiveMaximum ?? Number.POSITIVE_INFINITY
+ ) ?? null),
+ (e.isInt =
+ (n.format ?? '').includes('int') ||
+ Number.isSafeInteger(n.multipleOf ?? 0.5)),
+ (e.isFinite = !0),
+ (e.format = n.format ?? null);
+ });
+ function wS(e) {
+ return B._number(T.ZodNumber, e);
+ }
+ T.ZodNumberFormat = B.$constructor('ZodNumberFormat', (e, t) => {
+ B.$ZodNumberFormat.init(e, t), T.ZodNumber.init(e, t);
+ });
+ function ug(e) {
+ return B._int(T.ZodNumberFormat, e);
+ }
+ function cR(e) {
+ return B._float32(T.ZodNumberFormat, e);
+ }
+ function uR(e) {
+ return B._float64(T.ZodNumberFormat, e);
+ }
+ function dR(e) {
+ return B._int32(T.ZodNumberFormat, e);
+ }
+ function fR(e) {
+ return B._uint32(T.ZodNumberFormat, e);
+ }
+ T.ZodBoolean = B.$constructor('ZodBoolean', (e, t) => {
+ B.$ZodBoolean.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.booleanProcessor(e, n, i, r));
+ });
+ function OS(e) {
+ return B._boolean(T.ZodBoolean, e);
+ }
+ T.ZodBigInt = B.$constructor('ZodBigInt', (e, t) => {
+ B.$ZodBigInt.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (i, r, a) => xt.bigintProcessor(e, i, r, a)),
+ (e.gte = (i, r) => e.check(kt.gte(i, r))),
+ (e.min = (i, r) => e.check(kt.gte(i, r))),
+ (e.gt = (i, r) => e.check(kt.gt(i, r))),
+ (e.gte = (i, r) => e.check(kt.gte(i, r))),
+ (e.min = (i, r) => e.check(kt.gte(i, r))),
+ (e.lt = (i, r) => e.check(kt.lt(i, r))),
+ (e.lte = (i, r) => e.check(kt.lte(i, r))),
+ (e.max = (i, r) => e.check(kt.lte(i, r))),
+ (e.positive = (i) => e.check(kt.gt(BigInt(0), i))),
+ (e.negative = (i) => e.check(kt.lt(BigInt(0), i))),
+ (e.nonpositive = (i) => e.check(kt.lte(BigInt(0), i))),
+ (e.nonnegative = (i) => e.check(kt.gte(BigInt(0), i))),
+ (e.multipleOf = (i, r) => e.check(kt.multipleOf(i, r)));
+ let n = e._zod.bag;
+ (e.minValue = n.minimum ?? null),
+ (e.maxValue = n.maximum ?? null),
+ (e.format = n.format ?? null);
+ });
+ function pR(e) {
+ return B._bigint(T.ZodBigInt, e);
+ }
+ T.ZodBigIntFormat = B.$constructor('ZodBigIntFormat', (e, t) => {
+ B.$ZodBigIntFormat.init(e, t), T.ZodBigInt.init(e, t);
+ });
+ function mR(e) {
+ return B._int64(T.ZodBigIntFormat, e);
+ }
+ function yR(e) {
+ return B._uint64(T.ZodBigIntFormat, e);
+ }
+ T.ZodSymbol = B.$constructor('ZodSymbol', (e, t) => {
+ B.$ZodSymbol.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.symbolProcessor(e, n, i, r));
+ });
+ function gR(e) {
+ return B._symbol(T.ZodSymbol, e);
+ }
+ T.ZodUndefined = B.$constructor('ZodUndefined', (e, t) => {
+ B.$ZodUndefined.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.undefinedProcessor(e, n, i, r));
+ });
+ function vR(e) {
+ return B._undefined(T.ZodUndefined, e);
+ }
+ T.ZodNull = B.$constructor('ZodNull', (e, t) => {
+ B.$ZodNull.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.nullProcessor(e, n, i, r));
+ });
+ function $S(e) {
+ return B._null(T.ZodNull, e);
+ }
+ T.ZodAny = B.$constructor('ZodAny', (e, t) => {
+ B.$ZodAny.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.anyProcessor(e, n, i, r));
+ });
+ function hR() {
+ return B._any(T.ZodAny);
+ }
+ T.ZodUnknown = B.$constructor('ZodUnknown', (e, t) => {
+ B.$ZodUnknown.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.unknownProcessor(e, n, i, r));
+ });
+ function Na() {
+ return B._unknown(T.ZodUnknown);
+ }
+ T.ZodNever = B.$constructor('ZodNever', (e, t) => {
+ B.$ZodNever.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.neverProcessor(e, n, i, r));
+ });
+ function dg(e) {
+ return B._never(T.ZodNever, e);
+ }
+ T.ZodVoid = B.$constructor('ZodVoid', (e, t) => {
+ B.$ZodVoid.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.voidProcessor(e, n, i, r));
+ });
+ function bR(e) {
+ return B._void(T.ZodVoid, e);
+ }
+ T.ZodDate = B.$constructor('ZodDate', (e, t) => {
+ B.$ZodDate.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (i, r, a) => xt.dateProcessor(e, i, r, a)),
+ (e.min = (i, r) => e.check(kt.gte(i, r))),
+ (e.max = (i, r) => e.check(kt.lte(i, r)));
+ let n = e._zod.bag;
+ (e.minDate = n.minimum ? new Date(n.minimum) : null),
+ (e.maxDate = n.maximum ? new Date(n.maximum) : null);
+ });
+ function kR(e) {
+ return B._date(T.ZodDate, e);
+ }
+ T.ZodArray = B.$constructor('ZodArray', (e, t) => {
+ B.$ZodArray.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.arrayProcessor(e, n, i, r)),
+ (e.element = t.element),
+ (e.min = (n, i) => e.check(kt.minLength(n, i))),
+ (e.nonempty = (n) => e.check(kt.minLength(1, n))),
+ (e.max = (n, i) => e.check(kt.maxLength(n, i))),
+ (e.length = (n, i) => e.check(kt.length(n, i))),
+ (e.unwrap = () => e.element);
+ });
+ function hf(e, t) {
+ return B._array(T.ZodArray, e, t);
+ }
+ function SR(e) {
+ let t = e._zod.def.shape;
+ return pg(Object.keys(t));
+ }
+ T.ZodObject = B.$constructor('ZodObject', (e, t) => {
+ B.$ZodObjectJIT.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.objectProcessor(e, n, i, r)),
+ jt.util.defineLazy(e, 'shape', () => t.shape),
+ (e.keyof = () => pg(Object.keys(e._zod.def.shape))),
+ (e.catchall = (n) => e.clone({...e._zod.def, catchall: n})),
+ (e.passthrough = () => e.clone({...e._zod.def, catchall: Na()})),
+ (e.loose = () => e.clone({...e._zod.def, catchall: Na()})),
+ (e.strict = () => e.clone({...e._zod.def, catchall: dg()})),
+ (e.strip = () => e.clone({...e._zod.def, catchall: void 0})),
+ (e.extend = (n) => jt.util.extend(e, n)),
+ (e.safeExtend = (n) => jt.util.safeExtend(e, n)),
+ (e.merge = (n) => jt.util.merge(e, n)),
+ (e.pick = (n) => jt.util.pick(e, n)),
+ (e.omit = (n) => jt.util.omit(e, n)),
+ (e.partial = (...n) => jt.util.partial(T.ZodOptional, e, n[0])),
+ (e.required = (...n) => jt.util.required(T.ZodNonOptional, e, n[0]));
+ });
+ function _R(e, t) {
+ let n = {type: 'object', shape: e ?? {}, ...jt.util.normalizeParams(t)};
+ return new T.ZodObject(n);
+ }
+ function TR(e, t) {
+ return new T.ZodObject({
+ type: 'object',
+ shape: e,
+ catchall: dg(),
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ function ER(e, t) {
+ return new T.ZodObject({
+ type: 'object',
+ shape: e,
+ catchall: Na(),
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodUnion = B.$constructor('ZodUnion', (e, t) => {
+ B.$ZodUnion.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.unionProcessor(e, n, i, r)),
+ (e.options = t.options);
+ });
+ function fg(e, t) {
+ return new T.ZodUnion({
+ type: 'union',
+ options: e,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodXor = B.$constructor('ZodXor', (e, t) => {
+ T.ZodUnion.init(e, t),
+ B.$ZodXor.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.unionProcessor(e, n, i, r)),
+ (e.options = t.options);
+ });
+ function IR(e, t) {
+ return new T.ZodXor({
+ type: 'union',
+ options: e,
+ inclusive: !1,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodDiscriminatedUnion = B.$constructor('ZodDiscriminatedUnion', (e, t) => {
+ T.ZodUnion.init(e, t), B.$ZodDiscriminatedUnion.init(e, t);
+ });
+ function PR(e, t, n) {
+ return new T.ZodDiscriminatedUnion({
+ type: 'union',
+ options: t,
+ discriminator: e,
+ ...jt.util.normalizeParams(n),
+ });
+ }
+ T.ZodIntersection = B.$constructor('ZodIntersection', (e, t) => {
+ B.$ZodIntersection.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.intersectionProcessor(e, n, i, r));
+ });
+ function jS(e, t) {
+ return new T.ZodIntersection({type: 'intersection', left: e, right: t});
+ }
+ T.ZodTuple = B.$constructor('ZodTuple', (e, t) => {
+ B.$ZodTuple.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.tupleProcessor(e, n, i, r)),
+ (e.rest = (n) => e.clone({...e._zod.def, rest: n}));
+ });
+ function CS(e, t, n) {
+ let i = t instanceof B.$ZodType,
+ r = i ? n : t,
+ a = i ? t : null;
+ return new T.ZodTuple({
+ type: 'tuple',
+ items: e,
+ rest: a,
+ ...jt.util.normalizeParams(r),
+ });
+ }
+ T.ZodRecord = B.$constructor('ZodRecord', (e, t) => {
+ B.$ZodRecord.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.recordProcessor(e, n, i, r)),
+ (e.keyType = t.keyType),
+ (e.valueType = t.valueType);
+ });
+ function DS(e, t, n) {
+ return new T.ZodRecord({
+ type: 'record',
+ keyType: e,
+ valueType: t,
+ ...jt.util.normalizeParams(n),
+ });
+ }
+ function xR(e, t, n) {
+ let i = B.clone(e);
+ return (
+ (i._zod.values = void 0),
+ new T.ZodRecord({
+ type: 'record',
+ keyType: i,
+ valueType: t,
+ ...jt.util.normalizeParams(n),
+ })
+ );
+ }
+ function wR(e, t, n) {
+ return new T.ZodRecord({
+ type: 'record',
+ keyType: e,
+ valueType: t,
+ mode: 'loose',
+ ...jt.util.normalizeParams(n),
+ });
+ }
+ T.ZodMap = B.$constructor('ZodMap', (e, t) => {
+ B.$ZodMap.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.mapProcessor(e, n, i, r)),
+ (e.keyType = t.keyType),
+ (e.valueType = t.valueType),
+ (e.min = (...n) => e.check(B._minSize(...n))),
+ (e.nonempty = (n) => e.check(B._minSize(1, n))),
+ (e.max = (...n) => e.check(B._maxSize(...n))),
+ (e.size = (...n) => e.check(B._size(...n)));
+ });
+ function OR(e, t, n) {
+ return new T.ZodMap({
+ type: 'map',
+ keyType: e,
+ valueType: t,
+ ...jt.util.normalizeParams(n),
+ });
+ }
+ T.ZodSet = B.$constructor('ZodSet', (e, t) => {
+ B.$ZodSet.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.setProcessor(e, n, i, r)),
+ (e.min = (...n) => e.check(B._minSize(...n))),
+ (e.nonempty = (n) => e.check(B._minSize(1, n))),
+ (e.max = (...n) => e.check(B._maxSize(...n))),
+ (e.size = (...n) => e.check(B._size(...n)));
+ });
+ function $R(e, t) {
+ return new T.ZodSet({
+ type: 'set',
+ valueType: e,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodEnum = B.$constructor('ZodEnum', (e, t) => {
+ B.$ZodEnum.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (i, r, a) => xt.enumProcessor(e, i, r, a)),
+ (e.enum = t.entries),
+ (e.options = Object.values(t.entries));
+ let n = new Set(Object.keys(t.entries));
+ (e.extract = (i, r) => {
+ let a = {};
+ for (let o of i)
+ if (n.has(o)) a[o] = t.entries[o];
+ else throw new Error(`Key ${o} not found in enum`);
+ return new T.ZodEnum({
+ ...t,
+ checks: [],
+ ...jt.util.normalizeParams(r),
+ entries: a,
+ });
+ }),
+ (e.exclude = (i, r) => {
+ let a = {...t.entries};
+ for (let o of i)
+ if (n.has(o)) delete a[o];
+ else throw new Error(`Key ${o} not found in enum`);
+ return new T.ZodEnum({
+ ...t,
+ checks: [],
+ ...jt.util.normalizeParams(r),
+ entries: a,
+ });
+ });
+ });
+ function pg(e, t) {
+ let n = Array.isArray(e) ? Object.fromEntries(e.map((i) => [i, i])) : e;
+ return new T.ZodEnum({
+ type: 'enum',
+ entries: n,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ function jR(e, t) {
+ return new T.ZodEnum({
+ type: 'enum',
+ entries: e,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodLiteral = B.$constructor('ZodLiteral', (e, t) => {
+ B.$ZodLiteral.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.literalProcessor(e, n, i, r)),
+ (e.values = new Set(t.values)),
+ Object.defineProperty(e, 'value', {
+ get() {
+ if (t.values.length > 1)
+ throw new Error(
+ 'This schema contains multiple valid literal values. Use `.values` instead.'
+ );
+ return t.values[0];
+ },
+ });
+ });
+ function CR(e, t) {
+ return new T.ZodLiteral({
+ type: 'literal',
+ values: Array.isArray(e) ? e : [e],
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodFile = B.$constructor('ZodFile', (e, t) => {
+ B.$ZodFile.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.fileProcessor(e, n, i, r)),
+ (e.min = (n, i) => e.check(B._minSize(n, i))),
+ (e.max = (n, i) => e.check(B._maxSize(n, i))),
+ (e.mime = (n, i) => e.check(B._mime(Array.isArray(n) ? n : [n], i)));
+ });
+ function DR(e) {
+ return B._file(T.ZodFile, e);
+ }
+ T.ZodTransform = B.$constructor('ZodTransform', (e, t) => {
+ B.$ZodTransform.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.transformProcessor(e, n, i, r)),
+ (e._zod.parse = (n, i) => {
+ if (i.direction === 'backward')
+ throw new B.$ZodEncodeError(e.constructor.name);
+ n.addIssue = (a) => {
+ if (typeof a == 'string') n.issues.push(jt.util.issue(a, n.value, t));
+ else {
+ let o = a;
+ o.fatal && (o.continue = !1),
+ o.code ?? (o.code = 'custom'),
+ o.input ?? (o.input = n.value),
+ o.inst ?? (o.inst = e),
+ n.issues.push(jt.util.issue(o));
+ }
+ };
+ let r = t.transform(n.value, n);
+ return r instanceof Promise
+ ? r.then((a) => ((n.value = a), n))
+ : ((n.value = r), n);
+ });
+ });
+ function mg(e) {
+ return new T.ZodTransform({type: 'transform', transform: e});
+ }
+ T.ZodOptional = B.$constructor('ZodOptional', (e, t) => {
+ B.$ZodOptional.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.optionalProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function yf(e) {
+ return new T.ZodOptional({type: 'optional', innerType: e});
+ }
+ T.ZodExactOptional = B.$constructor('ZodExactOptional', (e, t) => {
+ B.$ZodExactOptional.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.optionalProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function AS(e) {
+ return new T.ZodExactOptional({type: 'optional', innerType: e});
+ }
+ T.ZodNullable = B.$constructor('ZodNullable', (e, t) => {
+ B.$ZodNullable.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.nullableProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function gf(e) {
+ return new T.ZodNullable({type: 'nullable', innerType: e});
+ }
+ function AR(e) {
+ return yf(gf(e));
+ }
+ T.ZodDefault = B.$constructor('ZodDefault', (e, t) => {
+ B.$ZodDefault.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.defaultProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType),
+ (e.removeDefault = e.unwrap);
+ });
+ function MS(e, t) {
+ return new T.ZodDefault({
+ type: 'default',
+ innerType: e,
+ get defaultValue() {
+ return typeof t == 'function' ? t() : jt.util.shallowClone(t);
+ },
+ });
+ }
+ T.ZodPrefault = B.$constructor('ZodPrefault', (e, t) => {
+ B.$ZodPrefault.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.prefaultProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function NS(e, t) {
+ return new T.ZodPrefault({
+ type: 'prefault',
+ innerType: e,
+ get defaultValue() {
+ return typeof t == 'function' ? t() : jt.util.shallowClone(t);
+ },
+ });
+ }
+ T.ZodNonOptional = B.$constructor('ZodNonOptional', (e, t) => {
+ B.$ZodNonOptional.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.nonoptionalProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function RS(e, t) {
+ return new T.ZodNonOptional({
+ type: 'nonoptional',
+ innerType: e,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodSuccess = B.$constructor('ZodSuccess', (e, t) => {
+ B.$ZodSuccess.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.successProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function MR(e) {
+ return new T.ZodSuccess({type: 'success', innerType: e});
+ }
+ T.ZodCatch = B.$constructor('ZodCatch', (e, t) => {
+ B.$ZodCatch.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.catchProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType),
+ (e.removeCatch = e.unwrap);
+ });
+ function LS(e, t) {
+ return new T.ZodCatch({
+ type: 'catch',
+ innerType: e,
+ catchValue: typeof t == 'function' ? t : () => t,
+ });
+ }
+ T.ZodNaN = B.$constructor('ZodNaN', (e, t) => {
+ B.$ZodNaN.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.nanProcessor(e, n, i, r));
+ });
+ function NR(e) {
+ return B._nan(T.ZodNaN, e);
+ }
+ T.ZodPipe = B.$constructor('ZodPipe', (e, t) => {
+ B.$ZodPipe.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.pipeProcessor(e, n, i, r)),
+ (e.in = t.in),
+ (e.out = t.out);
+ });
+ function vf(e, t) {
+ return new T.ZodPipe({type: 'pipe', in: e, out: t});
+ }
+ T.ZodCodec = B.$constructor('ZodCodec', (e, t) => {
+ T.ZodPipe.init(e, t), B.$ZodCodec.init(e, t);
+ });
+ function RR(e, t, n) {
+ return new T.ZodCodec({
+ type: 'pipe',
+ in: e,
+ out: t,
+ transform: n.decode,
+ reverseTransform: n.encode,
+ });
+ }
+ T.ZodReadonly = B.$constructor('ZodReadonly', (e, t) => {
+ B.$ZodReadonly.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.readonlyProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function FS(e) {
+ return new T.ZodReadonly({type: 'readonly', innerType: e});
+ }
+ T.ZodTemplateLiteral = B.$constructor('ZodTemplateLiteral', (e, t) => {
+ B.$ZodTemplateLiteral.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.templateLiteralProcessor(e, n, i, r));
+ });
+ function LR(e, t) {
+ return new T.ZodTemplateLiteral({
+ type: 'template_literal',
+ parts: e,
+ ...jt.util.normalizeParams(t),
+ });
+ }
+ T.ZodLazy = B.$constructor('ZodLazy', (e, t) => {
+ B.$ZodLazy.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.lazyProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.getter());
+ });
+ function zS(e) {
+ return new T.ZodLazy({type: 'lazy', getter: e});
+ }
+ T.ZodPromise = B.$constructor('ZodPromise', (e, t) => {
+ B.$ZodPromise.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.promiseProcessor(e, n, i, r)),
+ (e.unwrap = () => e._zod.def.innerType);
+ });
+ function FR(e) {
+ return new T.ZodPromise({type: 'promise', innerType: e});
+ }
+ T.ZodFunction = B.$constructor('ZodFunction', (e, t) => {
+ B.$ZodFunction.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) =>
+ xt.functionProcessor(e, n, i, r));
+ });
+ function bf(e) {
+ return new T.ZodFunction({
+ type: 'function',
+ input: Array.isArray(e?.input) ? CS(e?.input) : e?.input ?? hf(Na()),
+ output: e?.output ?? Na(),
+ });
+ }
+ T.ZodCustom = B.$constructor('ZodCustom', (e, t) => {
+ B.$ZodCustom.init(e, t),
+ T.ZodType.init(e, t),
+ (e._zod.processJSONSchema = (n, i, r) => xt.customProcessor(e, n, i, r));
+ });
+ function zR(e) {
+ let t = new B.$ZodCheck({check: 'custom'});
+ return (t._zod.check = e), t;
+ }
+ function BR(e, t) {
+ return B._custom(T.ZodCustom, e ?? (() => !0), t);
+ }
+ function BS(e, t = {}) {
+ return B._refine(T.ZodCustom, e, t);
+ }
+ function US(e) {
+ return B._superRefine(e);
+ }
+ T.describe = B.describe;
+ T.meta = B.meta;
+ function UR(e, t = {}) {
+ let n = new T.ZodCustom({
+ type: 'custom',
+ check: 'custom',
+ fn: (i) => i instanceof e,
+ abort: !0,
+ ...jt.util.normalizeParams(t),
+ });
+ return (
+ (n._zod.bag.Class = e),
+ (n._zod.check = (i) => {
+ i.value instanceof e ||
+ i.issues.push({
+ code: 'invalid_type',
+ expected: e.name,
+ input: i.value,
+ inst: n,
+ path: [...(n._zod.def.path ?? [])],
+ });
+ }),
+ n
+ );
+ }
+ var ZR = (...e) =>
+ B._stringbool(
+ {Codec: T.ZodCodec, Boolean: T.ZodBoolean, String: T.ZodString},
+ ...e
+ );
+ T.stringbool = ZR;
+ function qR(e) {
+ let t = zS(() => fg([cg(e), wS(), OS(), $S(), hf(t), DS(cg(), t)]));
+ return t;
+ }
+ function KR(e, t) {
+ return vf(mg(e), t);
+ }
+});
+var VS = xe((mn) => {
+ 'use strict';
+ var VR =
+ (mn && mn.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ JR =
+ (mn && mn.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ HR =
+ (mn && mn.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ VR(t, e, n);
+ return JR(t, e), t;
+ };
+ Object.defineProperty(mn, '__esModule', {value: !0});
+ mn.ZodFirstPartyTypeKind = mn.config = mn.$brand = mn.ZodIssueCode = void 0;
+ mn.setErrorMap = WR;
+ mn.getErrorMap = GR;
+ var qS = HR(_n());
+ mn.ZodIssueCode = {
+ invalid_type: 'invalid_type',
+ too_big: 'too_big',
+ too_small: 'too_small',
+ invalid_format: 'invalid_format',
+ not_multiple_of: 'not_multiple_of',
+ unrecognized_keys: 'unrecognized_keys',
+ invalid_union: 'invalid_union',
+ invalid_key: 'invalid_key',
+ invalid_element: 'invalid_element',
+ invalid_value: 'invalid_value',
+ custom: 'custom',
+ };
+ var KS = _n();
+ Object.defineProperty(mn, '$brand', {
+ enumerable: !0,
+ get: function () {
+ return KS.$brand;
+ },
+ });
+ Object.defineProperty(mn, 'config', {
+ enumerable: !0,
+ get: function () {
+ return KS.config;
+ },
+ });
+ function WR(e) {
+ qS.config({customError: e});
+ }
+ function GR() {
+ return qS.config().customError;
+ }
+ var ZS;
+ ZS || (mn.ZodFirstPartyTypeKind = ZS = {});
+});
+var HS = xe((Pi) => {
+ 'use strict';
+ var XR =
+ (Pi && Pi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ YR =
+ (Pi && Pi.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ yg =
+ (Pi && Pi.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ XR(t, e, n);
+ return YR(t, e), t;
+ };
+ Object.defineProperty(Pi, '__esModule', {value: !0});
+ Pi.fromJSONSchema = oL;
+ var QR = Bc(),
+ eL = yg(df()),
+ tL = yg(Vc()),
+ nL = yg(Jc()),
+ Le = {...nL, ...eL, iso: tL},
+ rL = new Set([
+ '$schema',
+ '$ref',
+ '$defs',
+ 'definitions',
+ '$id',
+ 'id',
+ '$comment',
+ '$anchor',
+ '$vocabulary',
+ '$dynamicRef',
+ '$dynamicAnchor',
+ 'type',
+ 'enum',
+ 'const',
+ 'anyOf',
+ 'oneOf',
+ 'allOf',
+ 'not',
+ 'properties',
+ 'required',
+ 'additionalProperties',
+ 'patternProperties',
+ 'propertyNames',
+ 'minProperties',
+ 'maxProperties',
+ 'items',
+ 'prefixItems',
+ 'additionalItems',
+ 'minItems',
+ 'maxItems',
+ 'uniqueItems',
+ 'contains',
+ 'minContains',
+ 'maxContains',
+ 'minLength',
+ 'maxLength',
+ 'pattern',
+ 'format',
+ 'minimum',
+ 'maximum',
+ 'exclusiveMinimum',
+ 'exclusiveMaximum',
+ 'multipleOf',
+ 'description',
+ 'default',
+ 'contentEncoding',
+ 'contentMediaType',
+ 'contentSchema',
+ 'unevaluatedItems',
+ 'unevaluatedProperties',
+ 'if',
+ 'then',
+ 'else',
+ 'dependentSchemas',
+ 'dependentRequired',
+ 'nullable',
+ 'readOnly',
+ ]);
+ function iL(e, t) {
+ let n = e.$schema;
+ return n === 'https://json-schema.org/draft/2020-12/schema'
+ ? 'draft-2020-12'
+ : n === 'http://json-schema.org/draft-07/schema#'
+ ? 'draft-7'
+ : n === 'http://json-schema.org/draft-04/schema#'
+ ? 'draft-4'
+ : t ?? 'draft-2020-12';
+ }
+ function aL(e, t) {
+ if (!e.startsWith('#'))
+ throw new Error(
+ 'External $ref is not supported, only local refs (#/...) are allowed'
+ );
+ let n = e.slice(1).split('/').filter(Boolean);
+ if (n.length === 0) return t.rootSchema;
+ let i = t.version === 'draft-2020-12' ? '$defs' : 'definitions';
+ if (n[0] === i) {
+ let r = n[1];
+ if (!r || !t.defs[r]) throw new Error(`Reference not found: ${e}`);
+ return t.defs[r];
+ }
+ throw new Error(`Reference not found: ${e}`);
+ }
+ function JS(e, t) {
+ if (e.not !== void 0) {
+ if (typeof e.not == 'object' && Object.keys(e.not).length === 0)
+ return Le.never();
+ throw new Error(
+ 'not is not supported in Zod (except { not: {} } for never)'
+ );
+ }
+ if (e.unevaluatedItems !== void 0)
+ throw new Error('unevaluatedItems is not supported');
+ if (e.unevaluatedProperties !== void 0)
+ throw new Error('unevaluatedProperties is not supported');
+ if (e.if !== void 0 || e.then !== void 0 || e.else !== void 0)
+ throw new Error('Conditional schemas (if/then/else) are not supported');
+ if (e.dependentSchemas !== void 0 || e.dependentRequired !== void 0)
+ throw new Error(
+ 'dependentSchemas and dependentRequired are not supported'
+ );
+ if (e.$ref) {
+ let r = e.$ref;
+ if (t.refs.has(r)) return t.refs.get(r);
+ if (t.processing.has(r))
+ return Le.lazy(() => {
+ if (!t.refs.has(r))
+ throw new Error(`Circular reference not resolved: ${r}`);
+ return t.refs.get(r);
+ });
+ t.processing.add(r);
+ let a = aL(r, t),
+ o = bn(a, t);
+ return t.refs.set(r, o), t.processing.delete(r), o;
+ }
+ if (e.enum !== void 0) {
+ let r = e.enum;
+ if (
+ t.version === 'openapi-3.0' &&
+ e.nullable === !0 &&
+ r.length === 1 &&
+ r[0] === null
+ )
+ return Le.null();
+ if (r.length === 0) return Le.never();
+ if (r.length === 1) return Le.literal(r[0]);
+ if (r.every((o) => typeof o == 'string')) return Le.enum(r);
+ let a = r.map((o) => Le.literal(o));
+ return a.length < 2 ? a[0] : Le.union([a[0], a[1], ...a.slice(2)]);
+ }
+ if (e.const !== void 0) return Le.literal(e.const);
+ let n = e.type;
+ if (Array.isArray(n)) {
+ let r = n.map((a) => {
+ let o = {...e, type: a};
+ return JS(o, t);
+ });
+ return r.length === 0 ? Le.never() : r.length === 1 ? r[0] : Le.union(r);
+ }
+ if (!n) return Le.any();
+ let i;
+ switch (n) {
+ case 'string': {
+ let r = Le.string();
+ if (e.format) {
+ let a = e.format;
+ a === 'email'
+ ? (r = r.check(Le.email()))
+ : a === 'uri' || a === 'uri-reference'
+ ? (r = r.check(Le.url()))
+ : a === 'uuid' || a === 'guid'
+ ? (r = r.check(Le.uuid()))
+ : a === 'date-time'
+ ? (r = r.check(Le.iso.datetime()))
+ : a === 'date'
+ ? (r = r.check(Le.iso.date()))
+ : a === 'time'
+ ? (r = r.check(Le.iso.time()))
+ : a === 'duration'
+ ? (r = r.check(Le.iso.duration()))
+ : a === 'ipv4'
+ ? (r = r.check(Le.ipv4()))
+ : a === 'ipv6'
+ ? (r = r.check(Le.ipv6()))
+ : a === 'mac'
+ ? (r = r.check(Le.mac()))
+ : a === 'cidr'
+ ? (r = r.check(Le.cidrv4()))
+ : a === 'cidr-v6'
+ ? (r = r.check(Le.cidrv6()))
+ : a === 'base64'
+ ? (r = r.check(Le.base64()))
+ : a === 'base64url'
+ ? (r = r.check(Le.base64url()))
+ : a === 'e164'
+ ? (r = r.check(Le.e164()))
+ : a === 'jwt'
+ ? (r = r.check(Le.jwt()))
+ : a === 'emoji'
+ ? (r = r.check(Le.emoji()))
+ : a === 'nanoid'
+ ? (r = r.check(Le.nanoid()))
+ : a === 'cuid'
+ ? (r = r.check(Le.cuid()))
+ : a === 'cuid2'
+ ? (r = r.check(Le.cuid2()))
+ : a === 'ulid'
+ ? (r = r.check(Le.ulid()))
+ : a === 'xid'
+ ? (r = r.check(Le.xid()))
+ : a === 'ksuid' && (r = r.check(Le.ksuid()));
+ }
+ typeof e.minLength == 'number' && (r = r.min(e.minLength)),
+ typeof e.maxLength == 'number' && (r = r.max(e.maxLength)),
+ e.pattern && (r = r.regex(new RegExp(e.pattern))),
+ (i = r);
+ break;
+ }
+ case 'number':
+ case 'integer': {
+ let r = n === 'integer' ? Le.number().int() : Le.number();
+ typeof e.minimum == 'number' && (r = r.min(e.minimum)),
+ typeof e.maximum == 'number' && (r = r.max(e.maximum)),
+ typeof e.exclusiveMinimum == 'number'
+ ? (r = r.gt(e.exclusiveMinimum))
+ : e.exclusiveMinimum === !0 &&
+ typeof e.minimum == 'number' &&
+ (r = r.gt(e.minimum)),
+ typeof e.exclusiveMaximum == 'number'
+ ? (r = r.lt(e.exclusiveMaximum))
+ : e.exclusiveMaximum === !0 &&
+ typeof e.maximum == 'number' &&
+ (r = r.lt(e.maximum)),
+ typeof e.multipleOf == 'number' && (r = r.multipleOf(e.multipleOf)),
+ (i = r);
+ break;
+ }
+ case 'boolean': {
+ i = Le.boolean();
+ break;
+ }
+ case 'null': {
+ i = Le.null();
+ break;
+ }
+ case 'object': {
+ let r = {},
+ a = e.properties || {},
+ o = new Set(e.required || []);
+ for (let [l, d] of Object.entries(a)) {
+ let u = bn(d, t);
+ r[l] = o.has(l) ? u : u.optional();
+ }
+ if (e.propertyNames) {
+ let l = bn(e.propertyNames, t),
+ d =
+ e.additionalProperties &&
+ typeof e.additionalProperties == 'object'
+ ? bn(e.additionalProperties, t)
+ : Le.any();
+ if (Object.keys(r).length === 0) {
+ i = Le.record(l, d);
+ break;
+ }
+ let u = Le.object(r).passthrough(),
+ p = Le.looseRecord(l, d);
+ i = Le.intersection(u, p);
+ break;
+ }
+ if (e.patternProperties) {
+ let l = e.patternProperties,
+ d = Object.keys(l),
+ u = [];
+ for (let y of d) {
+ let m = bn(l[y], t),
+ g = Le.string().regex(new RegExp(y));
+ u.push(Le.looseRecord(g, m));
+ }
+ let p = [];
+ if (
+ (Object.keys(r).length > 0 && p.push(Le.object(r).passthrough()),
+ p.push(...u),
+ p.length === 0)
+ )
+ i = Le.object({}).passthrough();
+ else if (p.length === 1) i = p[0];
+ else {
+ let y = Le.intersection(p[0], p[1]);
+ for (let m = 2; m < p.length; m++) y = Le.intersection(y, p[m]);
+ i = y;
+ }
+ break;
+ }
+ let s = Le.object(r);
+ e.additionalProperties === !1
+ ? (i = s.strict())
+ : typeof e.additionalProperties == 'object'
+ ? (i = s.catchall(bn(e.additionalProperties, t)))
+ : (i = s.passthrough());
+ break;
+ }
+ case 'array': {
+ let r = e.prefixItems,
+ a = e.items;
+ if (r && Array.isArray(r)) {
+ let o = r.map((l) => bn(l, t)),
+ s =
+ a && typeof a == 'object' && !Array.isArray(a)
+ ? bn(a, t)
+ : void 0;
+ s ? (i = Le.tuple(o).rest(s)) : (i = Le.tuple(o)),
+ typeof e.minItems == 'number' &&
+ (i = i.check(Le.minLength(e.minItems))),
+ typeof e.maxItems == 'number' &&
+ (i = i.check(Le.maxLength(e.maxItems)));
+ } else if (Array.isArray(a)) {
+ let o = a.map((l) => bn(l, t)),
+ s =
+ e.additionalItems && typeof e.additionalItems == 'object'
+ ? bn(e.additionalItems, t)
+ : void 0;
+ s ? (i = Le.tuple(o).rest(s)) : (i = Le.tuple(o)),
+ typeof e.minItems == 'number' &&
+ (i = i.check(Le.minLength(e.minItems))),
+ typeof e.maxItems == 'number' &&
+ (i = i.check(Le.maxLength(e.maxItems)));
+ } else if (a !== void 0) {
+ let o = bn(a, t),
+ s = Le.array(o);
+ typeof e.minItems == 'number' && (s = s.min(e.minItems)),
+ typeof e.maxItems == 'number' && (s = s.max(e.maxItems)),
+ (i = s);
+ } else i = Le.array(Le.any());
+ break;
+ }
+ default:
+ throw new Error(`Unsupported type: ${n}`);
+ }
+ return (
+ e.description && (i = i.describe(e.description)),
+ e.default !== void 0 && (i = i.default(e.default)),
+ i
+ );
+ }
+ function bn(e, t) {
+ if (typeof e == 'boolean') return e ? Le.any() : Le.never();
+ let n = JS(e, t),
+ i = e.type || e.enum !== void 0 || e.const !== void 0;
+ if (e.anyOf && Array.isArray(e.anyOf)) {
+ let s = e.anyOf.map((d) => bn(d, t)),
+ l = Le.union(s);
+ n = i ? Le.intersection(n, l) : l;
+ }
+ if (e.oneOf && Array.isArray(e.oneOf)) {
+ let s = e.oneOf.map((d) => bn(d, t)),
+ l = Le.xor(s);
+ n = i ? Le.intersection(n, l) : l;
+ }
+ if (e.allOf && Array.isArray(e.allOf))
+ if (e.allOf.length === 0) n = i ? n : Le.any();
+ else {
+ let s = i ? n : bn(e.allOf[0], t),
+ l = i ? 0 : 1;
+ for (let d = l; d < e.allOf.length; d++)
+ s = Le.intersection(s, bn(e.allOf[d], t));
+ n = s;
+ }
+ e.nullable === !0 && t.version === 'openapi-3.0' && (n = Le.nullable(n)),
+ e.readOnly === !0 && (n = Le.readonly(n));
+ let r = {},
+ a = [
+ '$id',
+ 'id',
+ '$comment',
+ '$anchor',
+ '$vocabulary',
+ '$dynamicRef',
+ '$dynamicAnchor',
+ ];
+ for (let s of a) s in e && (r[s] = e[s]);
+ let o = ['contentEncoding', 'contentMediaType', 'contentSchema'];
+ for (let s of o) s in e && (r[s] = e[s]);
+ for (let s of Object.keys(e)) rL.has(s) || (r[s] = e[s]);
+ return Object.keys(r).length > 0 && t.registry.add(n, r), n;
+ }
+ function oL(e, t) {
+ if (typeof e == 'boolean') return e ? Le.any() : Le.never();
+ let n = iL(e, t?.defaultTarget),
+ i = e.$defs || e.definitions || {},
+ r = {
+ version: n,
+ defs: i,
+ refs: new Map(),
+ processing: new Set(),
+ rootSchema: e,
+ registry: t?.registry ?? QR.globalRegistry,
+ };
+ return bn(e, r);
+ }
+});
+var GS = xe((Zn) => {
+ 'use strict';
+ var sL =
+ (Zn && Zn.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ lL =
+ (Zn && Zn.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ WS =
+ (Zn && Zn.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ sL(t, e, n);
+ return lL(t, e), t;
+ };
+ Object.defineProperty(Zn, '__esModule', {value: !0});
+ Zn.string = cL;
+ Zn.number = uL;
+ Zn.boolean = dL;
+ Zn.bigint = fL;
+ Zn.date = pL;
+ var Wc = WS(_n()),
+ Gc = WS(Jc());
+ function cL(e) {
+ return Wc._coercedString(Gc.ZodString, e);
+ }
+ function uL(e) {
+ return Wc._coercedNumber(Gc.ZodNumber, e);
+ }
+ function dL(e) {
+ return Wc._coercedBoolean(Gc.ZodBoolean, e);
+ }
+ function fL(e) {
+ return Wc._coercedBigint(Gc.ZodBigInt, e);
+ }
+ function pL(e) {
+ return Wc._coercedDate(Gc.ZodDate, e);
+ }
+});
+var gg = xe((We) => {
+ 'use strict';
+ var XS =
+ (We && We.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ mL =
+ (We && We.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ kf =
+ (We && We.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ XS(t, e, n);
+ return mL(t, e), t;
+ },
+ Xc =
+ (We && We.__exportStar) ||
+ function (e, t) {
+ for (var n in e)
+ n !== 'default' &&
+ !Object.prototype.hasOwnProperty.call(t, n) &&
+ XS(t, e, n);
+ },
+ yL =
+ (We && We.__importDefault) ||
+ function (e) {
+ return e && e.__esModule ? e : {default: e};
+ };
+ Object.defineProperty(We, '__esModule', {value: !0});
+ We.coerce =
+ We.iso =
+ We.ZodISODuration =
+ We.ZodISOTime =
+ We.ZodISODate =
+ We.ZodISODateTime =
+ We.locales =
+ We.fromJSONSchema =
+ We.toJSONSchema =
+ We.NEVER =
+ We.util =
+ We.TimePrecision =
+ We.flattenError =
+ We.formatError =
+ We.prettifyError =
+ We.treeifyError =
+ We.regexes =
+ We.clone =
+ We.$brand =
+ We.$input =
+ We.$output =
+ We.config =
+ We.registry =
+ We.globalRegistry =
+ We.core =
+ void 0;
+ We.core = kf(_n());
+ Xc(Jc(), We);
+ Xc(df(), We);
+ Xc(og(), We);
+ Xc(sg(), We);
+ Xc(VS(), We);
+ var gL = _n(),
+ vL = yL(Yy());
+ (0, gL.config)((0, vL.default)());
+ var Tn = _n();
+ Object.defineProperty(We, 'globalRegistry', {
+ enumerable: !0,
+ get: function () {
+ return Tn.globalRegistry;
+ },
+ });
+ Object.defineProperty(We, 'registry', {
+ enumerable: !0,
+ get: function () {
+ return Tn.registry;
+ },
+ });
+ Object.defineProperty(We, 'config', {
+ enumerable: !0,
+ get: function () {
+ return Tn.config;
+ },
+ });
+ Object.defineProperty(We, '$output', {
+ enumerable: !0,
+ get: function () {
+ return Tn.$output;
+ },
+ });
+ Object.defineProperty(We, '$input', {
+ enumerable: !0,
+ get: function () {
+ return Tn.$input;
+ },
+ });
+ Object.defineProperty(We, '$brand', {
+ enumerable: !0,
+ get: function () {
+ return Tn.$brand;
+ },
+ });
+ Object.defineProperty(We, 'clone', {
+ enumerable: !0,
+ get: function () {
+ return Tn.clone;
+ },
+ });
+ Object.defineProperty(We, 'regexes', {
+ enumerable: !0,
+ get: function () {
+ return Tn.regexes;
+ },
+ });
+ Object.defineProperty(We, 'treeifyError', {
+ enumerable: !0,
+ get: function () {
+ return Tn.treeifyError;
+ },
+ });
+ Object.defineProperty(We, 'prettifyError', {
+ enumerable: !0,
+ get: function () {
+ return Tn.prettifyError;
+ },
+ });
+ Object.defineProperty(We, 'formatError', {
+ enumerable: !0,
+ get: function () {
+ return Tn.formatError;
+ },
+ });
+ Object.defineProperty(We, 'flattenError', {
+ enumerable: !0,
+ get: function () {
+ return Tn.flattenError;
+ },
+ });
+ Object.defineProperty(We, 'TimePrecision', {
+ enumerable: !0,
+ get: function () {
+ return Tn.TimePrecision;
+ },
+ });
+ Object.defineProperty(We, 'util', {
+ enumerable: !0,
+ get: function () {
+ return Tn.util;
+ },
+ });
+ Object.defineProperty(We, 'NEVER', {
+ enumerable: !0,
+ get: function () {
+ return Tn.NEVER;
+ },
+ });
+ var hL = Kc();
+ Object.defineProperty(We, 'toJSONSchema', {
+ enumerable: !0,
+ get: function () {
+ return hL.toJSONSchema;
+ },
+ });
+ var bL = HS();
+ Object.defineProperty(We, 'fromJSONSchema', {
+ enumerable: !0,
+ get: function () {
+ return bL.fromJSONSchema;
+ },
+ });
+ We.locales = kf(tg());
+ var Sf = Vc();
+ Object.defineProperty(We, 'ZodISODateTime', {
+ enumerable: !0,
+ get: function () {
+ return Sf.ZodISODateTime;
+ },
+ });
+ Object.defineProperty(We, 'ZodISODate', {
+ enumerable: !0,
+ get: function () {
+ return Sf.ZodISODate;
+ },
+ });
+ Object.defineProperty(We, 'ZodISOTime', {
+ enumerable: !0,
+ get: function () {
+ return Sf.ZodISOTime;
+ },
+ });
+ Object.defineProperty(We, 'ZodISODuration', {
+ enumerable: !0,
+ get: function () {
+ return Sf.ZodISODuration;
+ },
+ });
+ We.iso = kf(Vc());
+ We.coerce = kf(GS());
+});
+var vg = xe((jn) => {
+ 'use strict';
+ var YS =
+ (jn && jn.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ kL =
+ (jn && jn.__setModuleDefault) ||
+ (Object.create
+ ? function (e, t) {
+ Object.defineProperty(e, 'default', {enumerable: !0, value: t});
+ }
+ : function (e, t) {
+ e.default = t;
+ }),
+ SL =
+ (jn && jn.__importStar) ||
+ function (e) {
+ if (e && e.__esModule) return e;
+ var t = {};
+ if (e != null)
+ for (var n in e)
+ n !== 'default' &&
+ Object.prototype.hasOwnProperty.call(e, n) &&
+ YS(t, e, n);
+ return kL(t, e), t;
+ },
+ _L =
+ (jn && jn.__exportStar) ||
+ function (e, t) {
+ for (var n in e)
+ n !== 'default' &&
+ !Object.prototype.hasOwnProperty.call(t, n) &&
+ YS(t, e, n);
+ };
+ Object.defineProperty(jn, '__esModule', {value: !0});
+ jn.z = void 0;
+ var QS = SL(gg());
+ jn.z = QS;
+ _L(gg(), jn);
+ jn.default = QS;
+});
+var e_ = xe((gi) => {
+ 'use strict';
+ var TL =
+ (gi && gi.__createBinding) ||
+ (Object.create
+ ? function (e, t, n, i) {
+ i === void 0 && (i = n);
+ var r = Object.getOwnPropertyDescriptor(t, n);
+ (!r ||
+ ('get' in r ? !t.__esModule : r.writable || r.configurable)) &&
+ (r = {
+ enumerable: !0,
+ get: function () {
+ return t[n];
+ },
+ }),
+ Object.defineProperty(e, i, r);
+ }
+ : function (e, t, n, i) {
+ i === void 0 && (i = n), (e[i] = t[n]);
+ }),
+ EL =
+ (gi && gi.__exportStar) ||
+ function (e, t) {
+ for (var n in e)
+ n !== 'default' &&
+ !Object.prototype.hasOwnProperty.call(t, n) &&
+ TL(t, e, n);
+ },
+ IL =
+ (gi && gi.__importDefault) ||
+ function (e) {
+ return e && e.__esModule ? e : {default: e};
+ };
+ Object.defineProperty(gi, '__esModule', {value: !0});
+ var PL = IL(vg());
+ EL(vg(), gi);
+ gi.default = PL.default;
+});
+var d_ = xe((kK, u_) => {
+ 'use strict';
+ var xL = Object.create,
+ _f = Object.defineProperty,
+ wL = Object.getOwnPropertyDescriptor,
+ OL = Object.getOwnPropertyNames,
+ $L = Object.getPrototypeOf,
+ jL = Object.prototype.hasOwnProperty,
+ CL = (e, t) => {
+ for (var n in t) _f(e, n, {get: t[n], enumerable: !0});
+ },
+ t_ = (e, t, n, i) => {
+ if ((t && typeof t == 'object') || typeof t == 'function')
+ for (let r of OL(t))
+ !jL.call(e, r) &&
+ r !== n &&
+ _f(e, r, {
+ get: () => t[r],
+ enumerable: !(i = wL(t, r)) || i.enumerable,
+ });
+ return e;
+ },
+ DL = (e, t, n) => (
+ (n = e != null ? xL($L(e)) : {}),
+ t_(
+ t || !e || !e.__esModule
+ ? _f(n, 'default', {value: e, enumerable: !0})
+ : n,
+ e
+ )
+ ),
+ AL = (e) => t_(_f({}, '__esModule', {value: !0}), e),
+ n_ = {};
+ CL(n_, {
+ ValidationError: () => Ra,
+ createErrorMap: () => lF,
+ createMessageBuilder: () => kg,
+ fromError: () => c_,
+ fromZodError: () => mF,
+ fromZodIssue: () => vF,
+ isValidationError: () => NL,
+ isValidationErrorLike: () => RL,
+ isZodErrorLike: () => Tf,
+ toValidationError: () => l_,
+ });
+ u_.exports = AL(n_);
+ function Tf(e) {
+ return (
+ e instanceof Object &&
+ 'name' in e &&
+ (e.name === 'ZodError' || e.name === '$ZodError') &&
+ 'issues' in e &&
+ Array.isArray(e.issues)
+ );
+ }
+ var r_ = 'ZodValidationError',
+ Ra = class extends Error {
+ name;
+ details;
+ constructor(e, t) {
+ super(e, t), (this.name = r_), (this.details = ML(t));
+ }
+ toString() {
+ return this.message;
+ }
+ };
+ function ML(e) {
+ if (e) {
+ let t = e.cause;
+ if (Tf(t)) return t.issues;
+ }
+ return [];
+ }
+ function NL(e) {
+ return e instanceof Ra;
+ }
+ function RL(e) {
+ return e instanceof Error && e.name === r_;
+ }
+ function LL(e) {
+ return {type: e.code, path: e.path, message: e.message ?? 'Invalid input'};
+ }
+ function FL(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `unexpected element in ${e.origin}`,
+ };
+ }
+ function zL(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `unexpected key in ${e.origin}`,
+ };
+ }
+ function BL(e, t = {displayInvalidFormatDetails: !1}) {
+ switch (e.format) {
+ case 'lowercase':
+ case 'uppercase':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must be in ${e.format} format`,
+ };
+ default:
+ return UL(e)
+ ? ZL(e)
+ : qL(e)
+ ? KL(e)
+ : VL(e)
+ ? JL(e)
+ : HL(e)
+ ? WL(e, t)
+ : GL(e)
+ ? XL(e, t)
+ : {type: e.code, path: e.path, message: `invalid ${e.format}`};
+ }
+ }
+ function UL(e) {
+ return e.format === 'starts_with';
+ }
+ function ZL(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must start with "${e.prefix}"`,
+ };
+ }
+ function qL(e) {
+ return e.format === 'ends_with';
+ }
+ function KL(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must end with "${e.suffix}"`,
+ };
+ }
+ function VL(e) {
+ return e.format === 'includes';
+ }
+ function JL(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must include "${e.includes}"`,
+ };
+ }
+ function HL(e) {
+ return e.format === 'regex';
+ }
+ function WL(e, t = {displayInvalidFormatDetails: !1}) {
+ let n = 'value must match pattern';
+ return (
+ t.displayInvalidFormatDetails && (n += ` "${e.pattern}"`),
+ {type: e.code, path: e.path, message: n}
+ );
+ }
+ function GL(e) {
+ return e.format === 'jwt';
+ }
+ function XL(e, t = {displayInvalidFormatDetails: !1}) {
+ return {
+ type: e.code,
+ path: e.path,
+ message:
+ t.displayInvalidFormatDetails && e.algorithm
+ ? `invalid jwt/${e.algorithm}`
+ : 'invalid jwt',
+ };
+ }
+ function YL(e) {
+ let t = `expected ${e.expected}`;
+ return (
+ 'input' in e && (t += `, received ${QL(e.input)}`),
+ {type: e.code, path: e.path, message: t}
+ );
+ }
+ function QL(e) {
+ return typeof e == 'object'
+ ? e === null
+ ? 'null'
+ : e === void 0
+ ? 'undefined'
+ : Array.isArray(e)
+ ? 'array'
+ : e instanceof Date
+ ? 'date'
+ : e instanceof RegExp
+ ? 'regexp'
+ : e instanceof Map
+ ? 'map'
+ : e instanceof Set
+ ? 'set'
+ : e instanceof Error
+ ? 'error'
+ : e instanceof Function
+ ? 'function'
+ : 'object'
+ : typeof e;
+ }
+ function eF(e) {
+ return {type: e.code, path: e.path, message: e.message ?? 'Invalid input'};
+ }
+ function hg(e) {
+ return e.description ?? '';
+ }
+ function La(e, t = {}) {
+ switch (typeof e) {
+ case 'symbol':
+ return hg(e);
+ case 'bigint':
+ case 'number':
+ switch (t.localization) {
+ case !0:
+ return e.toLocaleString();
+ case !1:
+ return e.toString();
+ default:
+ return e.toLocaleString(t.localization);
+ }
+ case 'string':
+ return t.wrapStringValueInQuote ? `"${e}"` : e;
+ default: {
+ if (e instanceof Date)
+ switch (t.localization) {
+ case !0:
+ return e.toLocaleString();
+ case !1:
+ return e.toISOString();
+ default:
+ return e.toLocaleString(t.localization);
+ }
+ return String(e);
+ }
+ }
+ }
+ function i_(e, t) {
+ let n = (t.maxValuesToDisplay ? e.slice(0, t.maxValuesToDisplay) : e).map(
+ (i) => La(i, {wrapStringValueInQuote: t.wrapStringValuesInQuote})
+ );
+ return (
+ n.length < e.length && n.push(`${e.length - n.length} more value(s)`),
+ n.reduce(
+ (i, r, a) => (
+ a > 0 &&
+ (a === n.length - 1 && t.lastSeparator
+ ? (i += t.lastSeparator)
+ : (i += t.separator)),
+ (i += r),
+ i
+ ),
+ ''
+ )
+ );
+ }
+ function tF(e, t) {
+ let n;
+ return (
+ e.values.length === 0
+ ? (n = 'invalid value')
+ : e.values.length === 1
+ ? (n = `expected value to be ${La(e.values[0], {
+ wrapStringValueInQuote: !0,
+ })}`)
+ : (n = `expected value to be one of ${i_(e.values, {
+ separator: t.allowedValuesSeparator,
+ lastSeparator: t.allowedValuesLastSeparator,
+ wrapStringValuesInQuote: t.wrapAllowedValuesInQuote,
+ maxValuesToDisplay: t.maxAllowedValuesToDisplay,
+ })}`),
+ {type: e.code, path: e.path, message: n}
+ );
+ }
+ function nF(e) {
+ return {
+ type: e.code,
+ path: e.path,
+ message: `expected multiple of ${e.divisor}`,
+ };
+ }
+ function rF(e, t) {
+ let n =
+ e.origin === 'date'
+ ? La(new Date(e.maximum), {localization: t.dateLocalization})
+ : La(e.maximum, {localization: t.numberLocalization});
+ switch (e.origin) {
+ case 'number':
+ case 'int':
+ case 'bigint':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `number must be less than${
+ e.inclusive ? ' or equal to' : ''
+ } ${n}`,
+ };
+ case 'string':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `string must contain at most ${n} character(s)`,
+ };
+ case 'date':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `date must be ${
+ e.inclusive ? 'prior or equal to' : 'prior to'
+ } "${n}"`,
+ };
+ case 'array':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `array must contain at most ${n} item(s)`,
+ };
+ case 'set':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `set must contain at most ${n} item(s)`,
+ };
+ case 'file':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `file must not exceed ${n} byte(s) in size`,
+ };
+ default:
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must be less than${
+ e.inclusive ? ' or equal to' : ''
+ } ${n}`,
+ };
+ }
+ }
+ function iF(e, t) {
+ let n =
+ e.origin === 'date'
+ ? La(new Date(e.minimum), {localization: t.dateLocalization})
+ : La(e.minimum, {localization: t.numberLocalization});
+ switch (e.origin) {
+ case 'number':
+ case 'int':
+ case 'bigint':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `number must be greater than${
+ e.inclusive ? ' or equal to' : ''
+ } ${n}`,
+ };
+ case 'date':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `date must be ${
+ e.inclusive ? 'later or equal to' : 'later to'
+ } "${n}"`,
+ };
+ case 'string':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `string must contain at least ${n} character(s)`,
+ };
+ case 'array':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `array must contain at least ${n} item(s)`,
+ };
+ case 'set':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `set must contain at least ${n} item(s)`,
+ };
+ case 'file':
+ return {
+ type: e.code,
+ path: e.path,
+ message: `file must be at least ${n} byte(s) in size`,
+ };
+ default:
+ return {
+ type: e.code,
+ path: e.path,
+ message: `value must be greater than${
+ e.inclusive ? ' or equal to' : ''
+ } ${n}`,
+ };
+ }
+ }
+ function aF(e, t) {
+ let n = i_(e.keys, {
+ separator: t.unrecognizedKeysSeparator,
+ lastSeparator: t.unrecognizedKeysLastSeparator,
+ wrapStringValuesInQuote: t.wrapUnrecognizedKeysInQuote,
+ maxValuesToDisplay: t.maxUnrecognizedKeysToDisplay,
+ });
+ return {
+ type: e.code,
+ path: e.path,
+ message: `unrecognized key(s) ${n} in object`,
+ };
+ }
+ var oF = {
+ invalid_type: YL,
+ too_big: rF,
+ too_small: iF,
+ invalid_format: BL,
+ invalid_value: tF,
+ invalid_element: FL,
+ not_multiple_of: nF,
+ unrecognized_keys: aF,
+ invalid_key: zL,
+ custom: LL,
+ invalid_union: eF,
+ },
+ sF = {
+ displayInvalidFormatDetails: !1,
+ allowedValuesSeparator: ', ',
+ allowedValuesLastSeparator: ' or ',
+ wrapAllowedValuesInQuote: !0,
+ maxAllowedValuesToDisplay: 10,
+ unrecognizedKeysSeparator: ', ',
+ unrecognizedKeysLastSeparator: ' and ',
+ wrapUnrecognizedKeysInQuote: !0,
+ maxUnrecognizedKeysToDisplay: 5,
+ dateLocalization: !0,
+ numberLocalization: !0,
+ };
+ function lF(e = {}) {
+ let t = {...sF, ...e};
+ return (i) => {
+ if (i.code === void 0) return 'Not supported issue type';
+ let r = oF[i.code];
+ return r(i, t).message;
+ };
+ }
+ function bg(e) {
+ return e.length !== 0;
+ }
+ var cF = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
+ function uF(e) {
+ if (e.length === 1) {
+ let t = e[0];
+ return typeof t == 'symbol' && (t = hg(t)), t.toString() || '""';
+ }
+ return e.reduce((t, n) => {
+ if (typeof n == 'number') return t + '[' + n.toString() + ']';
+ if ((typeof n == 'symbol' && (n = hg(n)), n.includes('"')))
+ return t + '["' + dF(n) + '"]';
+ if (!cF.test(n)) return t + '["' + n + '"]';
+ let i = t.length === 0 ? '' : '.';
+ return t + i + n;
+ }, '');
+ }
+ function dF(e) {
+ return e.replace(/"/g, '\\"');
+ }
+ function fF(e) {
+ return e.length === 0 ? e : e.charAt(0).toUpperCase() + e.slice(1);
+ }
+ var a_ = {
+ prefix: 'Validation error',
+ prefixSeparator: ': ',
+ maxIssuesInMessage: 99,
+ unionSeparator: ' or ',
+ issueSeparator: '; ',
+ includePath: !0,
+ forceTitleCase: !0,
+ };
+ function kg(e = {}) {
+ let t = {...a_, ...e};
+ return function (i) {
+ let r = i
+ .slice(0, t.maxIssuesInMessage)
+ .map((a) => o_(a, t))
+ .join(t.issueSeparator);
+ return pF(r, t);
+ };
+ }
+ function o_(e, t) {
+ if (e.code === 'invalid_union' && bg(e.errors)) {
+ let i = e.errors.map((r) =>
+ r
+ .map((a) => o_({...a, path: e.path.concat(a.path)}, t))
+ .join(t.issueSeparator)
+ );
+ return Array.from(new Set(i)).join(t.unionSeparator);
+ }
+ let n = [];
+ t.forceTitleCase ? n.push(fF(e.message)) : n.push(e.message);
+ e: if (t.includePath && e.path !== void 0 && bg(e.path)) {
+ if (e.path.length === 1) {
+ let i = e.path[0];
+ if (typeof i == 'number') {
+ n.push(` at index ${i}`);
+ break e;
+ }
+ }
+ n.push(` at "${uF(e.path)}"`);
+ }
+ return n.join('');
+ }
+ function pF(e, t) {
+ return t.prefix != null
+ ? e.length > 0
+ ? [t.prefix, e].join(t.prefixSeparator)
+ : t.prefix
+ : e.length > 0
+ ? e
+ : a_.prefix;
+ }
+ function mF(e, t = {}) {
+ if (!Tf(e))
+ throw new TypeError(
+ `Invalid zodError param; expected instance of ZodError. Did you mean to use the "${c_.name}" method instead?`
+ );
+ return s_(e, t);
+ }
+ function s_(e, t = {}) {
+ let n = e.issues,
+ i;
+ return bg(n) ? (i = yF(t)(n)) : (i = e.message), new Ra(i, {cause: e});
+ }
+ function yF(e) {
+ return 'messageBuilder' in e ? e.messageBuilder : kg(e);
+ }
+ var l_ =
+ (e = {}) =>
+ (t) =>
+ Tf(t)
+ ? s_(t, e)
+ : t instanceof Error
+ ? new Ra(t.message, {cause: t})
+ : new Ra('Unknown error');
+ function c_(e, t = {}) {
+ return l_(t)(e);
+ }
+ var gF = DL(_n());
+ function vF(e, t = {}) {
+ let i = hF(t)([e]);
+ return new Ra(i, {cause: new gF.$ZodRealError([e])});
+ }
+ function hF(e) {
+ return 'messageBuilder' in e ? e.messageBuilder : kg(e);
+ }
+});
+var p_ = xe((_K, f_) => {
+ var Yc = new Proxy(
+ function () {
+ return Yc;
+ },
+ {
+ get(e, t) {
+ if (t === Symbol.toPrimitive) return () => '';
+ if (t === 'toString') return () => '';
+ if (t === 'valueOf') return () => '';
+ if (t !== 'then') return Yc;
+ },
+ apply() {
+ return Yc;
+ },
+ construct() {
+ return Yc;
+ },
+ }
+ );
+ f_.exports = Yc;
+});
+var y_ = xe((TK, m_) => {
+ var Qc = new Proxy(
+ function () {
+ return Qc;
+ },
+ {
+ get(e, t) {
+ if (t === Symbol.toPrimitive) return () => '';
+ if (t === 'toString') return () => '';
+ if (t === 'valueOf') return () => '';
+ if (t !== 'then') return Qc;
+ },
+ apply() {
+ return Qc;
+ },
+ construct() {
+ return Qc;
+ },
+ }
+ );
+ m_.exports = Qc;
+});
+var v_ = xe((EK, g_) => {
+ var eu = new Proxy(
+ function () {
+ return eu;
+ },
+ {
+ get(e, t) {
+ if (t === Symbol.toPrimitive) return () => '';
+ if (t === 'toString') return () => '';
+ if (t === 'valueOf') return () => '';
+ if (t !== 'then') return eu;
+ },
+ apply() {
+ return eu;
+ },
+ construct() {
+ return eu;
+ },
+ }
+ );
+ g_.exports = eu;
+});
+var bx = xe((qK, hx) => {
+ 'use strict';
+ var bF = Jh(),
+ kF = Wh(),
+ W = e_(),
+ ju = d_(),
+ SF = p_(),
+ _F = y_(),
+ TF = v_(),
+ EF = 'react-hooks',
+ IF = 'additionalEffectHooks';
+ function T0(e) {
+ var t;
+ let n = (t = e[EF]) === null || t === void 0 ? void 0 : t[IF];
+ if (n != null && typeof n == 'string') return new RegExp(n);
+ }
+ var PF = {
+ meta: {
+ type: 'suggestion',
+ docs: {
+ description:
+ 'verifies the list of dependencies for Hooks like useEffect and similar',
+ recommended: !0,
+ url: 'https://github.com/facebook/react/issues/14920',
+ },
+ fixable: 'code',
+ hasSuggestions: !0,
+ schema: [
+ {
+ type: 'object',
+ additionalProperties: !1,
+ enableDangerousAutofixThisMayCauseInfiniteLoops: !1,
+ properties: {
+ additionalHooks: {type: 'string'},
+ enableDangerousAutofixThisMayCauseInfiniteLoops: {type: 'boolean'},
+ experimental_autoDependenciesHooks: {
+ type: 'array',
+ items: {type: 'string'},
+ },
+ requireExplicitEffectDeps: {type: 'boolean'},
+ },
+ },
+ ],
+ },
+ create(e) {
+ let t = e.options && e.options[0],
+ n = e.settings || {},
+ i = t && t.additionalHooks ? new RegExp(t.additionalHooks) : T0(n),
+ r = (t && t.enableDangerousAutofixThisMayCauseInfiniteLoops) || !1,
+ a =
+ t && Array.isArray(t.experimental_autoDependenciesHooks)
+ ? t.experimental_autoDependenciesHooks
+ : [],
+ o = (t && t.requireExplicitEffectDeps) || !1,
+ s = {
+ additionalHooks: i,
+ experimental_autoDependenciesHooks: a,
+ enableDangerousAutofixThisMayCauseInfiniteLoops: r,
+ requireExplicitEffectDeps: o,
+ };
+ function l(w) {
+ r &&
+ Array.isArray(w.suggest) &&
+ w.suggest.length > 0 &&
+ w.suggest[0] &&
+ (w.fix = w.suggest[0].fix),
+ e.report(w);
+ }
+ let d =
+ typeof e.getSourceCode == 'function'
+ ? () => e.getSourceCode()
+ : () => e.sourceCode,
+ u =
+ typeof e.getScope == 'function'
+ ? () => e.getScope()
+ : (w) => e.sourceCode.getScope(w),
+ p = d().scopeManager,
+ y = new WeakMap(),
+ m = new WeakSet(),
+ g = new WeakMap(),
+ S = new WeakMap(),
+ _ = new WeakSet();
+ function O(w, I) {
+ return function (U) {
+ if (I.has(U)) return I.get(U);
+ let A = w(U);
+ return I.set(U, A), A;
+ };
+ }
+ function P(w, I, U, A, q, ae) {
+ q &&
+ w.async &&
+ l({
+ node: w,
+ message: `Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
+
+useEffect(() => {
+ async function fetchData() {
+ // You can await here
+ const response = await MyAPI.getData(someId);
+ // ...
+ }
+ fetchData();
+}, [someId]); // Or [] if effect doesn't need props or state
+
+Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`,
+ });
+ let le = p.acquire(w);
+ if (!le)
+ throw new Error(
+ 'Unable to acquire scope for the current node. This is a bug in eslint-plugin-react-hooks, please file an issue.'
+ );
+ let G = new Set(),
+ ve = null;
+ {
+ let X = le.upper;
+ for (
+ ;
+ X &&
+ (G.add(X),
+ !(
+ X.type === 'function' ||
+ X.type === 'hook' ||
+ X.type === 'component'
+ ));
+
+ )
+ X = X.upper;
+ if (!X) return;
+ ve = X;
+ }
+ let de = Array.isArray;
+ function oe(X) {
+ if (!de(X.defs)) return !1;
+ let ee = X.defs[0];
+ if (ee == null) return !1;
+ let ge = ee.node;
+ if (ge.type !== 'VariableDeclarator') return !1;
+ let fe = ge.init;
+ if (fe == null) return !1;
+ for (; fe.type === 'TSAsExpression' || fe.type === 'AsExpression'; )
+ fe = fe.expression;
+ let we = ge.parent;
+ if (
+ we == null &&
+ ve != null &&
+ (Tg(ve.block, ee.node.id), (we = ee.node.parent), we == null)
+ )
+ return !1;
+ if (
+ we != null &&
+ 'kind' in we &&
+ we.kind === 'const' &&
+ fe.type === 'Literal' &&
+ (typeof fe.value == 'string' ||
+ typeof fe.value == 'number' ||
+ fe.value === null)
+ )
+ return !0;
+ if (fe.type !== 'CallExpression') return !1;
+ let me = fe.callee;
+ if (
+ (me.type === 'MemberExpression' &&
+ 'name' in me.object &&
+ me.object.name === 'React' &&
+ me.property != null &&
+ !me.computed &&
+ (me = me.property),
+ me.type !== 'Identifier')
+ )
+ return !1;
+ let Ce = ee.node.id,
+ {name: lt} = me;
+ if (lt === 'useRef' && Ce.type === 'Identifier') return !0;
+ if (jF(me) && Ce.type === 'Identifier') {
+ for (let ne of X.references) ne !== Ce && _.add(ne.identifier);
+ return !0;
+ } else if (
+ lt === 'useState' ||
+ lt === 'useReducer' ||
+ lt === 'useActionState'
+ ) {
+ if (
+ Ce.type === 'ArrayPattern' &&
+ Ce.elements.length === 2 &&
+ de(X.identifiers)
+ ) {
+ if (Ce.elements[1] === X.identifiers[0]) {
+ if (lt === 'useState') {
+ let ne = X.references,
+ he = 0;
+ for (let Ke of ne) {
+ if ((Ke.isWrite() && he++, he > 1)) return !1;
+ y.set(Ke.identifier, Ce.elements[0]);
+ }
+ }
+ return !0;
+ } else if (Ce.elements[0] === X.identifiers[0]) {
+ if (lt === 'useState') {
+ let ne = X.references;
+ for (let he of ne) m.add(he.identifier);
+ }
+ return !1;
+ }
+ }
+ } else if (
+ lt === 'useTransition' &&
+ Ce.type === 'ArrayPattern' &&
+ Ce.elements.length === 2 &&
+ Array.isArray(X.identifiers) &&
+ Ce.elements[1] === X.identifiers[0]
+ )
+ return !0;
+ return !1;
+ }
+ function be(X) {
+ if (!de(X.defs)) return !1;
+ let ee = X.defs[0];
+ if (ee == null || ee.node == null || ee.node.id == null) return !1;
+ let ge = ee.node,
+ fe = ve?.childScopes || [],
+ we = null;
+ for (let me of fe) {
+ let ze = me.block;
+ if (
+ (ge.type === 'FunctionDeclaration' && ze === ge) ||
+ (ge.type === 'VariableDeclarator' && ze.parent === ge)
+ ) {
+ we = me;
+ break;
+ }
+ }
+ if (we == null) return !1;
+ for (let me of we.through)
+ if (
+ me.resolved != null &&
+ G.has(me.resolved.scope) &&
+ !$e(me.resolved)
+ )
+ return !1;
+ return !0;
+ }
+ let $e = O(oe, g),
+ Ie = O(be, S),
+ Pe = new Map();
+ function ke(X) {
+ let ee = X.from,
+ ge = !1;
+ for (; ee != null && ee.block !== w; )
+ ee.type === 'function' &&
+ (ge =
+ ee.block.parent != null &&
+ ee.block.parent.type === 'ReturnStatement'),
+ (ee = ee.upper);
+ return ge;
+ }
+ let je = new Map(),
+ Ae = new Map();
+ Ye(le);
+ function Ye(X) {
+ var ee, ge, fe, we, me;
+ for (let ze of X.references) {
+ if (!ze.resolved || !G.has(ze.resolved.scope)) continue;
+ let Ce = Tg(w, ze.identifier);
+ if (Ce == null) continue;
+ let lt = E0(Ce),
+ ne = zi(lt, Ae);
+ if (
+ (q &&
+ lt.type === 'Identifier' &&
+ (((ee = lt.parent) === null || ee === void 0
+ ? void 0
+ : ee.type) === 'MemberExpression' ||
+ ((ge = lt.parent) === null || ge === void 0
+ ? void 0
+ : ge.type) === 'OptionalMemberExpression') &&
+ !lt.parent.computed &&
+ lt.parent.property.type === 'Identifier' &&
+ lt.parent.property.name === 'current' &&
+ ke(ze) &&
+ Pe.set(ne, {reference: ze, dependencyNode: lt}),
+ ((fe = lt.parent) === null || fe === void 0
+ ? void 0
+ : fe.type) === 'TSTypeQuery' ||
+ ((we = lt.parent) === null || we === void 0
+ ? void 0
+ : we.type) === 'TSTypeReference')
+ )
+ continue;
+ let he = ze.resolved.defs[0];
+ if (
+ he != null &&
+ !(he.node != null && he.node.init === w.parent) &&
+ he.type !== 'TypeParameter'
+ )
+ if (je.has(ne))
+ (me = je.get(ne)) === null ||
+ me === void 0 ||
+ me.references.push(ze);
+ else {
+ let Ke = ze.resolved,
+ Ge = $e(Ke) || Ie(Ke);
+ je.set(ne, {isStable: Ge, references: [ze]});
+ }
+ }
+ for (let ze of X.childScopes) Ye(ze);
+ }
+ Pe.forEach(({reference: X, dependencyNode: ee}, ge) => {
+ var fe, we;
+ let me =
+ ((fe = X.resolved) === null || fe === void 0
+ ? void 0
+ : fe.references) || [],
+ ze = !1;
+ for (let Ce of me) {
+ let {identifier: lt} = Ce,
+ {parent: ne} = lt;
+ if (
+ ne != null &&
+ ne.type === 'MemberExpression' &&
+ !ne.computed &&
+ ne.property.type === 'Identifier' &&
+ ne.property.name === 'current' &&
+ ((we = ne.parent) === null || we === void 0
+ ? void 0
+ : we.type) === 'AssignmentExpression' &&
+ ne.parent.left === ne
+ ) {
+ ze = !0;
+ break;
+ }
+ }
+ ze ||
+ l({
+ node: ee.parent.property,
+ message: `The ref value '${ge}.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy '${ge}.current' to a variable inside the effect, and use that variable in the cleanup function.`,
+ });
+ });
+ let bt = new Set();
+ function st(X, ee) {
+ bt.has(ee) ||
+ (bt.add(ee),
+ l({
+ node: X,
+ message: `Assignments to the '${ee}' variable from inside React Hook ${d().getText(
+ U
+ )} will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside ${d().getText(
+ U
+ )}.`,
+ }));
+ }
+ let tt = new Set();
+ if (
+ (je.forEach(({isStable: X, references: ee}, ge) => {
+ X && tt.add(ge),
+ ee.forEach((fe) => {
+ fe.writeExpr && st(fe.writeExpr, ge);
+ });
+ }),
+ bt.size > 0)
+ )
+ return;
+ if (!I) {
+ if (ae) return;
+ let X = null;
+ if (
+ (je.forEach(({references: ee}, ge) => {
+ X ||
+ ee.forEach((fe) => {
+ if (X) return;
+ let we = fe.identifier;
+ if (!y.has(we)) return;
+ let ze = fe.from;
+ for (; ze != null && ze.type !== 'function'; ) ze = ze.upper;
+ ze?.block === w && (X = ge);
+ });
+ }),
+ X)
+ ) {
+ let {suggestedDependencies: ee} = Sg({
+ dependencies: je,
+ declaredDependencies: [],
+ stableDependencies: tt,
+ externalDependencies: new Set(),
+ isEffect: !0,
+ });
+ l({
+ node: U,
+ message:
+ `React Hook ${A} contains a call to '${X}'. Without a list of dependencies, this can lead to an infinite chain of updates. To fix this, pass [` +
+ ee.join(', ') +
+ `] as a second argument to the ${A} Hook.`,
+ suggest: [
+ {
+ desc: `Add dependencies array: [${ee.join(', ')}]`,
+ fix(ge) {
+ return ge.insertTextAfter(w, `, [${ee.join(', ')}]`);
+ },
+ },
+ ],
+ });
+ }
+ return;
+ }
+ if (ae && I.type === 'Literal' && I.value === null) return;
+ let yt = [],
+ dt = new Set(),
+ qt = I.type === 'ArrayExpression',
+ J =
+ I.type === 'TSAsExpression' &&
+ I.expression.type === 'ArrayExpression';
+ !qt && !J
+ ? l({
+ node: I,
+ message: `React Hook ${d().getText(
+ U
+ )} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.`,
+ })
+ : (J ? I.expression : I).elements.forEach((ee) => {
+ if (ee === null) return;
+ if (ee.type === 'SpreadElement') {
+ l({
+ node: ee,
+ message: `React Hook ${d().getText(
+ U
+ )} has a spread element in its dependency array. This means we can't statically verify whether you've passed the correct dependencies.`,
+ });
+ return;
+ }
+ _.has(ee) &&
+ l({
+ node: ee,
+ message: `Functions returned from \`useEffectEvent\` must not be included in the dependency array. Remove \`${d().getText(
+ ee
+ )}\` from the list.`,
+ suggest: [
+ {
+ desc: `Remove the dependency \`${d().getText(ee)}\``,
+ fix(me) {
+ return me.removeRange(ee.range);
+ },
+ },
+ ],
+ });
+ let ge;
+ try {
+ ge = zi(ee, null);
+ } catch (me) {
+ if (
+ me instanceof Error &&
+ /Unsupported node type/.test(me.message)
+ ) {
+ ee.type === 'Literal'
+ ? ee.value && je.has(ee.value)
+ ? l({
+ node: ee,
+ message: `The ${ee.raw} literal is not a valid dependency because it never changes. Did you mean to include ${ee.value} in the array instead?`,
+ })
+ : l({
+ node: ee,
+ message: `The ${ee.raw} literal is not a valid dependency because it never changes. You can safely remove it.`,
+ })
+ : l({
+ node: ee,
+ message: `React Hook ${d().getText(
+ U
+ )} has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.`,
+ });
+ return;
+ } else throw me;
+ }
+ let fe = ee;
+ for (
+ ;
+ fe.type === 'MemberExpression' ||
+ fe.type === 'OptionalMemberExpression' ||
+ fe.type === 'ChainExpression';
+
+ )
+ fe = fe.object || fe.expression.object;
+ let we = !ve.through.some((me) => me.identifier === fe);
+ yt.push({key: ge, node: ee}), we || dt.add(ge);
+ });
+ let {
+ suggestedDependencies: Xe,
+ unnecessaryDependencies: it,
+ missingDependencies: mt,
+ duplicateDependencies: Et,
+ } = Sg({
+ dependencies: je,
+ declaredDependencies: yt,
+ stableDependencies: tt,
+ externalDependencies: dt,
+ isEffect: q,
+ }),
+ ft = Xe;
+ if (Et.size + mt.size + it.size === 0) {
+ xF({
+ declaredDependencies: yt,
+ declaredDependenciesNode: I,
+ componentScope: ve,
+ scope: le,
+ }).forEach(
+ ({construction: ee, isUsedOutsideOfHook: ge, depType: fe}) => {
+ var we;
+ let me = fe === 'function' ? 'useCallback' : 'useMemo',
+ ze = fe === 'function' ? 'definition' : 'initialization',
+ Ce = `wrap the ${ze} of '${ee.name.name}' in its own ${me}() Hook.`,
+ lt = ge
+ ? `To fix this, ${Ce}`
+ : `Move it inside the ${A} callback. Alternatively, ${Ce}`,
+ ne =
+ fe === 'conditional' || fe === 'logical expression'
+ ? 'could make'
+ : 'makes',
+ he = `The '${
+ ee.name.name
+ }' ${fe} ${ne} the dependencies of ${A} Hook (at line ${
+ (we = I.loc) === null || we === void 0
+ ? void 0
+ : we.start.line
+ }) change on every render. ${lt}`,
+ Ke;
+ ge &&
+ ee.type === 'Variable' &&
+ fe === 'function' &&
+ (Ke = [
+ {
+ desc: `Wrap the ${ze} of '${ee.name.name}' in its own ${me}() Hook.`,
+ fix(Ge) {
+ let [Qe, se] =
+ me === 'useMemo'
+ ? ['useMemo(() => { return ', '; })']
+ : ['useCallback(', ')'];
+ return [
+ Ge.insertTextBefore(ee.node.init, Qe),
+ Ge.insertTextAfter(ee.node.init, se),
+ ];
+ },
+ },
+ ]),
+ l({node: ee.node, message: he, suggest: Ke});
+ }
+ );
+ return;
+ }
+ !q &&
+ mt.size > 0 &&
+ (ft = Sg({
+ dependencies: je,
+ declaredDependencies: [],
+ stableDependencies: tt,
+ externalDependencies: dt,
+ isEffect: q,
+ }).suggestedDependencies);
+ function Y() {
+ if (yt.length === 0) return !0;
+ let X = yt.map((ge) => ge.key),
+ ee = X.slice().sort();
+ return X.join(',') === ee.join(',');
+ }
+ Y() && ft.sort();
+ function ce(X) {
+ let ee = X.split('.'),
+ ge = '';
+ for (let fe = 0; fe < ee.length; fe++) {
+ if (fe !== 0) {
+ let we = ee.slice(0, fe + 1).join('.'),
+ me = Ae.get(we) === !0;
+ ge += me ? '?.' : '.';
+ }
+ ge += ee[fe];
+ }
+ return ge;
+ }
+ function Ze(X, ee, ge, fe) {
+ return X.size === 0
+ ? null
+ : (X.size > 1 ? '' : ee + ' ') +
+ ge +
+ ' ' +
+ (X.size > 1 ? 'dependencies' : 'dependency') +
+ ': ' +
+ OF(
+ Array.from(X)
+ .sort()
+ .map((we) => "'" + ce(we) + "'")
+ ) +
+ `. Either ${fe} ${
+ X.size > 1 ? 'them' : 'it'
+ } or remove the dependency array.`;
+ }
+ let Ne = '';
+ if (it.size > 0) {
+ let X = null;
+ if (
+ (Array.from(it.keys()).forEach((ee) => {
+ X === null && ee.endsWith('.current') && (X = ee);
+ }),
+ X !== null)
+ )
+ Ne = ` Mutable values like '${X}' aren't valid dependencies because mutating them doesn't re-render the component.`;
+ else if (dt.size > 0) {
+ let ee = Array.from(dt)[0];
+ le.set.has(ee) ||
+ (Ne = ` Outer scope values like '${ee}' aren't valid dependencies because mutating them doesn't re-render the component.`);
+ }
+ }
+ if (!Ne && mt.has('props')) {
+ let X = je.get('props');
+ if (X == null) return;
+ let ee = X.references;
+ if (!Array.isArray(ee)) return;
+ let ge = !0;
+ for (let fe of ee) {
+ let we = Tg(ve.block, fe.identifier);
+ if (!we) {
+ ge = !1;
+ break;
+ }
+ let me = we.parent;
+ if (me == null) {
+ ge = !1;
+ break;
+ }
+ if (
+ me.type !== 'MemberExpression' &&
+ me.type !== 'OptionalMemberExpression'
+ ) {
+ ge = !1;
+ break;
+ }
+ }
+ ge &&
+ (Ne = ` However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the ${A} call and refer to those specific props inside ${d().getText(
+ U
+ )}.`);
+ }
+ if (!Ne && mt.size > 0) {
+ let X = null;
+ mt.forEach((ee) => {
+ var ge;
+ if (X) return;
+ let fe = ve.set.get(ee),
+ we = je.get(ee);
+ if (
+ !we?.references ||
+ ((ge = we?.references[0]) === null || ge === void 0
+ ? void 0
+ : ge.resolved) !== fe
+ )
+ return;
+ let me = fe?.defs[0];
+ if (me == null || me.name == null || me.type !== 'Parameter')
+ return;
+ let ze = !1,
+ Ce;
+ for (let lt of we.references)
+ if (
+ ((Ce = lt.identifier),
+ Ce != null &&
+ Ce.parent != null &&
+ (Ce.parent.type === 'CallExpression' ||
+ Ce.parent.type === 'OptionalCallExpression') &&
+ Ce.parent.callee === Ce)
+ ) {
+ ze = !0;
+ break;
+ }
+ ze && (X = ee);
+ }),
+ X !== null &&
+ (Ne = ` If '${X}' changes too often, find the parent component that defines it and wrap that definition in useCallback.`);
+ }
+ if (!Ne && mt.size > 0) {
+ let X = null;
+ for (let ee of mt) {
+ if (X !== null) break;
+ let fe = je.get(ee).references,
+ we,
+ me;
+ for (let ze of fe) {
+ for (
+ we = ze.identifier, me = we.parent;
+ me != null && me !== ve.block;
+
+ ) {
+ if (me.type === 'CallExpression') {
+ let Ce = y.get(me.callee);
+ if (Ce != null) {
+ if ('name' in Ce && Ce.name === ee)
+ X = {
+ missingDep: ee,
+ setter: 'name' in me.callee ? me.callee.name : '',
+ form: 'updater',
+ };
+ else if (m.has(we))
+ X = {
+ missingDep: ee,
+ setter: 'name' in me.callee ? me.callee.name : '',
+ form: 'reducer',
+ };
+ else {
+ let lt = ze.resolved;
+ if (lt != null) {
+ let ne = lt.defs[0];
+ ne != null &&
+ ne.type === 'Parameter' &&
+ (X = {
+ missingDep: ee,
+ setter: 'name' in me.callee ? me.callee.name : '',
+ form: 'inlineReducer',
+ });
+ }
+ }
+ break;
+ }
+ }
+ me = me.parent;
+ }
+ if (X !== null) break;
+ }
+ }
+ if (X !== null)
+ switch (X.form) {
+ case 'reducer':
+ Ne = ` You can also replace multiple useState variables with useReducer if '${X.setter}' needs the current value of '${X.missingDep}'.`;
+ break;
+ case 'inlineReducer':
+ Ne = ` If '${X.setter}' needs the current value of '${X.missingDep}', you can also switch to useReducer instead of useState and read '${X.missingDep}' in the reducer.`;
+ break;
+ case 'updater':
+ Ne = ` You can also do a functional update '${
+ X.setter
+ }(${X.missingDep.slice(0, 1)} => ...)' if you only need '${
+ X.missingDep
+ }' in the '${X.setter}' call.`;
+ break;
+ default:
+ throw new Error('Unknown case.');
+ }
+ }
+ l({
+ node: I,
+ message:
+ `React Hook ${d().getText(U)} has ` +
+ (Ze(mt, 'a', 'missing', 'include') ||
+ Ze(it, 'an', 'unnecessary', 'exclude') ||
+ Ze(Et, 'a', 'duplicate', 'omit')) +
+ Ne,
+ suggest: [
+ {
+ desc: `Update the dependencies array to be: [${ft
+ .map(ce)
+ .join(', ')}]`,
+ fix(X) {
+ return X.replaceText(I, `[${ft.map(ce).join(', ')}]`);
+ },
+ },
+ ],
+ });
+ }
+ function M(w) {
+ let I = wF(w.callee, s);
+ if (I === -1) return;
+ let U = w.arguments[I],
+ A = w.callee,
+ q = I0(A),
+ ae = 'name' in q ? q.name : '',
+ le = w.arguments[I + 1],
+ G =
+ le && !(le.type === 'Identifier' && le.name === 'undefined')
+ ? le
+ : void 0,
+ ve = /Effect($|[^a-z])/g.test(ae);
+ if (!U) {
+ l({
+ node: A,
+ message: `React Hook ${ae} requires an effect callback. Did you forget to pass a callback to the hook?`,
+ });
+ return;
+ }
+ !le &&
+ ve &&
+ s.requireExplicitEffectDeps &&
+ l({
+ node: A,
+ message: `React Hook ${ae} always requires dependencies. Please add a dependency array or an explicit \`undefined\``,
+ });
+ let de = s.experimental_autoDependenciesHooks.includes(ae);
+ if ((!G || (de && G.type === 'Literal' && G.value === null)) && !ve) {
+ (ae === 'useMemo' || ae === 'useCallback') &&
+ l({
+ node: A,
+ message: `React Hook ${ae} does nothing when called with only one argument. Did you forget to pass an array of dependencies?`,
+ });
+ return;
+ }
+ for (; U.type === 'TSAsExpression' || U.type === 'AsExpression'; )
+ U = U.expression;
+ switch (U.type) {
+ case 'FunctionExpression':
+ case 'ArrowFunctionExpression':
+ P(U, G, A, ae, ve, de);
+ return;
+ case 'Identifier':
+ if (
+ !G ||
+ (de && G.type === 'Literal' && G.value === null) ||
+ ('elements' in G &&
+ G.elements &&
+ G.elements.some(
+ ($e) => $e && $e.type === 'Identifier' && $e.name === U.name
+ ))
+ )
+ return;
+ let oe = u(U).set.get(U.name);
+ if (oe == null || oe.defs == null) return;
+ let be = oe.defs[0];
+ if (!be || !be.node) break;
+ if (be.type === 'Parameter') {
+ l({node: A, message: b_(ae)});
+ return;
+ }
+ if (be.type !== 'Variable' && be.type !== 'FunctionName') break;
+ switch (be.node.type) {
+ case 'FunctionDeclaration':
+ P(be.node, G, A, ae, ve, de);
+ return;
+ case 'VariableDeclarator':
+ let $e = be.node.init;
+ if (!$e) break;
+ switch ($e.type) {
+ case 'ArrowFunctionExpression':
+ case 'FunctionExpression':
+ P($e, G, A, ae, ve, de);
+ return;
+ }
+ break;
+ }
+ break;
+ default:
+ l({node: A, message: b_(ae)});
+ return;
+ }
+ l({
+ node: A,
+ message: `React Hook ${ae} has a missing dependency: '${U.name}'. Either include it or remove the dependency array.`,
+ suggest: [
+ {
+ desc: `Update the dependencies array to be: [${U.name}]`,
+ fix(oe) {
+ return oe.replaceText(G, `[${U.name}]`);
+ },
+ },
+ ],
+ });
+ }
+ return {CallExpression: M};
+ },
+ };
+ function Sg({
+ dependencies: e,
+ declaredDependencies: t,
+ stableDependencies: n,
+ externalDependencies: i,
+ isEffect: r,
+ }) {
+ let a = o();
+ function o() {
+ return {
+ isUsed: !1,
+ isSatisfiedRecursively: !1,
+ isSubtreeUsed: !1,
+ children: new Map(),
+ };
+ }
+ e.forEach((S, _) => {
+ let O = s(a, _);
+ (O.isUsed = !0),
+ l(a, _, (P) => {
+ P.isSubtreeUsed = !0;
+ });
+ }),
+ t.forEach(({key: S}) => {
+ let _ = s(a, S);
+ _.isSatisfiedRecursively = !0;
+ }),
+ n.forEach((S) => {
+ let _ = s(a, S);
+ _.isSatisfiedRecursively = !0;
+ });
+ function s(S, _) {
+ let O = _.split('.'),
+ P = S;
+ for (let M of O) {
+ let w = P.children.get(M);
+ w || ((w = o()), P.children.set(M, w)), (P = w);
+ }
+ return P;
+ }
+ function l(S, _, O) {
+ let P = _.split('.'),
+ M = S;
+ for (let w of P) {
+ let I = M.children.get(w);
+ if (!I) return;
+ O(I), (M = I);
+ }
+ }
+ let d = new Set(),
+ u = new Set();
+ p(a, d, u, (S) => S);
+ function p(S, _, O, P) {
+ S.children.forEach((M, w) => {
+ let I = P(w);
+ if (M.isSatisfiedRecursively) {
+ M.isSubtreeUsed && O.add(I);
+ return;
+ }
+ if (M.isUsed) {
+ _.add(I);
+ return;
+ }
+ p(M, _, O, (U) => I + '.' + U);
+ });
+ }
+ let y = [],
+ m = new Set(),
+ g = new Set();
+ return (
+ t.forEach(({key: S}) => {
+ u.has(S)
+ ? y.indexOf(S) === -1
+ ? y.push(S)
+ : g.add(S)
+ : r && !S.endsWith('.current') && !i.has(S)
+ ? y.indexOf(S) === -1 && y.push(S)
+ : m.add(S);
+ }),
+ d.forEach((S) => {
+ y.push(S);
+ }),
+ {
+ suggestedDependencies: y,
+ unnecessaryDependencies: m,
+ duplicateDependencies: g,
+ missingDependencies: d,
+ }
+ );
+ }
+ function sa(e) {
+ switch (e.type) {
+ case 'ObjectExpression':
+ return 'object';
+ case 'ArrayExpression':
+ return 'array';
+ case 'ArrowFunctionExpression':
+ case 'FunctionExpression':
+ return 'function';
+ case 'ClassExpression':
+ return 'class';
+ case 'ConditionalExpression':
+ return sa(e.consequent) != null || sa(e.alternate) != null
+ ? 'conditional'
+ : null;
+ case 'LogicalExpression':
+ return sa(e.left) != null || sa(e.right) != null
+ ? 'logical expression'
+ : null;
+ case 'JSXFragment':
+ return 'JSX fragment';
+ case 'JSXElement':
+ return 'JSX element';
+ case 'AssignmentExpression':
+ return sa(e.right) != null ? 'assignment expression' : null;
+ case 'NewExpression':
+ return 'object construction';
+ case 'Literal':
+ return e.value instanceof RegExp ? 'regular expression' : null;
+ case 'TypeCastExpression':
+ case 'AsExpression':
+ case 'TSAsExpression':
+ return sa(e.expression);
+ }
+ return null;
+ }
+ function xF({
+ declaredDependencies: e,
+ declaredDependenciesNode: t,
+ componentScope: n,
+ scope: i,
+ }) {
+ let r = e
+ .map(({key: o}) => {
+ let s = n.variables.find((d) => d.name === o);
+ if (s == null) return null;
+ let l = s.defs[0];
+ if (l == null) return null;
+ if (
+ l.type === 'Variable' &&
+ l.node.type === 'VariableDeclarator' &&
+ l.node.id.type === 'Identifier' &&
+ l.node.init != null
+ ) {
+ let d = sa(l.node.init);
+ if (d) return [s, d];
+ }
+ return l.type === 'FunctionName' &&
+ l.node.type === 'FunctionDeclaration'
+ ? [s, 'function']
+ : l.type === 'ClassName' && l.node.type === 'ClassDeclaration'
+ ? [s, 'class']
+ : null;
+ })
+ .filter(Boolean);
+ function a(o) {
+ let s = !1;
+ for (let l of o.references) {
+ if (l.writeExpr) {
+ if (s) return !0;
+ s = !0;
+ continue;
+ }
+ let d = l.from;
+ for (; d !== i && d != null; ) d = d.upper;
+ if (d !== i && !P0(t, l.identifier)) return !0;
+ }
+ return !1;
+ }
+ return r.map(([o, s]) => ({
+ construction: o.defs[0],
+ depType: s,
+ isUsedOutsideOfHook: a(o),
+ }));
+ }
+ function E0(e) {
+ return e.parent &&
+ (e.parent.type === 'MemberExpression' ||
+ e.parent.type === 'OptionalMemberExpression') &&
+ e.parent.object === e &&
+ 'name' in e.parent.property &&
+ e.parent.property.name !== 'current' &&
+ !e.parent.computed &&
+ !(
+ e.parent.parent != null &&
+ (e.parent.parent.type === 'CallExpression' ||
+ e.parent.parent.type === 'OptionalCallExpression') &&
+ e.parent.parent.callee === e.parent
+ )
+ ? E0(e.parent)
+ : e.type === 'MemberExpression' &&
+ e.parent &&
+ e.parent.type === 'AssignmentExpression' &&
+ e.parent.left === e
+ ? e.object
+ : e;
+ }
+ function _g(e, t, n) {
+ t &&
+ ('optional' in e && e.optional ? t.has(n) || t.set(n, !0) : t.set(n, !1));
+ }
+ function zi(e, t) {
+ if (e.type === 'Identifier' || e.type === 'JSXIdentifier') {
+ let n = e.name;
+ return t && t.set(n, !1), n;
+ } else if (e.type === 'MemberExpression' && !e.computed) {
+ let n = zi(e.object, t),
+ i = zi(e.property, null),
+ r = `${n}.${i}`;
+ return _g(e, t, r), r;
+ } else if (e.type === 'OptionalMemberExpression' && !e.computed) {
+ let n = zi(e.object, t),
+ i = zi(e.property, null),
+ r = `${n}.${i}`;
+ return _g(e, t, r), r;
+ } else if (
+ e.type === 'ChainExpression' &&
+ (!('computed' in e) || !e.computed)
+ ) {
+ let n = e.expression;
+ if (n.type === 'CallExpression')
+ throw new Error(`Unsupported node type: ${n.type}`);
+ let i = zi(n.object, t),
+ r = zi(n.property, null),
+ a = `${i}.${r}`;
+ return _g(n, t, a), a;
+ } else throw new Error(`Unsupported node type: ${e.type}`);
+ }
+ function I0(e) {
+ return e.type === 'MemberExpression' &&
+ e.object.type === 'Identifier' &&
+ e.object.name === 'React' &&
+ e.property.type === 'Identifier' &&
+ !e.computed
+ ? e.property
+ : e;
+ }
+ function wF(e, t) {
+ let n = I0(e);
+ if (n.type !== 'Identifier') return -1;
+ switch (n.name) {
+ case 'useEffect':
+ case 'useLayoutEffect':
+ case 'useCallback':
+ case 'useMemo':
+ return 0;
+ case 'useImperativeHandle':
+ return 1;
+ default:
+ if (n === e && t && t.additionalHooks) {
+ let i;
+ try {
+ i = zi(n, null);
+ } catch (r) {
+ if (r instanceof Error && /Unsupported node type/.test(r.message))
+ return 0;
+ throw r;
+ }
+ return t.additionalHooks.test(i) ? 0 : -1;
+ } else return -1;
+ }
+ }
+ function Tg(e, t) {
+ let n = [e],
+ i;
+ for (; n.length; ) {
+ if (((i = n.shift()), $F(i, t))) return i;
+ if (P0(i, t))
+ for (let [r, a] of Object.entries(i))
+ r !== 'parent' &&
+ (h_(a)
+ ? ((a.parent = i), n.push(a))
+ : Array.isArray(a) &&
+ a.forEach((o) => {
+ h_(o) && ((o.parent = i), n.push(o));
+ }));
+ }
+ return null;
+ }
+ function OF(e) {
+ let t = '';
+ for (let n = 0; n < e.length; n++)
+ (t += e[n]),
+ n === 0 && e.length === 2
+ ? (t += ' and ')
+ : n === e.length - 2 && e.length > 2
+ ? (t += ', and ')
+ : n < e.length - 1 && (t += ', ');
+ return t;
+ }
+ function h_(e) {
+ return (
+ typeof e == 'object' &&
+ e !== null &&
+ !Array.isArray(e) &&
+ 'type' in e &&
+ typeof e.type == 'string'
+ );
+ }
+ function $F(e, t) {
+ return (
+ (e.type === 'Identifier' || e.type === 'JSXIdentifier') &&
+ e.type === t.type &&
+ e.name === t.name &&
+ !!e.range &&
+ !!t.range &&
+ e.range[0] === t.range[0] &&
+ e.range[1] === t.range[1]
+ );
+ }
+ function P0(e, t) {
+ return (
+ !!e.range &&
+ !!t.range &&
+ e.range[0] <= t.range[0] &&
+ e.range[1] >= t.range[1]
+ );
+ }
+ function jF(e) {
+ return e.type === 'Identifier' && e.name === 'useEffectEvent';
+ }
+ function b_(e) {
+ return `React Hook ${e} received a function whose dependencies are unknown. Pass an inline function instead.`;
+ }
+ var co =
+ typeof globalThis < 'u'
+ ? globalThis
+ : typeof window < 'u'
+ ? window
+ : typeof global < 'u'
+ ? global
+ : typeof self < 'u'
+ ? self
+ : {};
+ function ah(e) {
+ return e &&
+ e.__esModule &&
+ Object.prototype.hasOwnProperty.call(e, 'default')
+ ? e.default
+ : e;
+ }
+ var Eg, k_;
+ function CF() {
+ if (k_) return Eg;
+ k_ = 1;
+ var e = function (t, n, i, r, a, o, s, l) {
+ if (!t) {
+ var d;
+ if (n === void 0)
+ d = new Error(
+ 'Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.'
+ );
+ else {
+ var u = [i, r, a, o, s, l],
+ p = 0;
+ (d = new Error(
+ n.replace(/%s/g, function () {
+ return u[p++];
+ })
+ )),
+ (d.name = 'Invariant Violation');
+ }
+ throw ((d.framesToPop = 1), d);
+ }
+ };
+ return (Eg = e), Eg;
+ }
+ var DF = CF(),
+ so = ah(DF),
+ Ig = {},
+ tu = {},
+ Ef = {},
+ If = {},
+ N = {},
+ Pf = {},
+ S_;
+ function oh() {
+ if (S_) return Pf;
+ (S_ = 1),
+ Object.defineProperty(Pf, '__esModule', {value: !0}),
+ (Pf.default = e);
+ function e(t, n) {
+ let i = Object.keys(n);
+ for (let r of i) if (t[r] !== n[r]) return !1;
+ return !0;
+ }
+ return Pf;
+ }
+ var xf = {},
+ __;
+ function Bm() {
+ if (__) return xf;
+ (__ = 1),
+ Object.defineProperty(xf, '__esModule', {value: !0}),
+ (xf.default = t);
+ let e = new Set();
+ function t(i, r, a = '') {
+ if (e.has(i)) return;
+ e.add(i);
+ let {internal: o, trace: s} = n(1, 2);
+ o ||
+ console.warn(`${a}\`${i}\` has been deprecated, please migrate to \`${r}\`
+${s}`);
+ }
+ function n(i, r) {
+ let {stackTraceLimit: a, prepareStackTrace: o} = Error,
+ s;
+ if (
+ ((Error.stackTraceLimit = 1 + i + r),
+ (Error.prepareStackTrace = function (d, u) {
+ s = u;
+ }),
+ (Error.stackTraceLimit = a),
+ (Error.prepareStackTrace = o),
+ !s)
+ )
+ return {internal: !1, trace: ''};
+ let l = s.slice(1 + i, 1 + i + r);
+ return {
+ internal: /[\\/]@babel[\\/]/.test(l[1].getFileName()),
+ trace: l.map((d) => ` at ${d}`).join(`
+`),
+ };
+ }
+ return xf;
+ }
+ var T_;
+ function ln() {
+ if (T_) return N;
+ (T_ = 1),
+ Object.defineProperty(N, '__esModule', {value: !0}),
+ (N.isAccessor = gy),
+ (N.isAnyTypeAnnotation = wo),
+ (N.isArgumentPlaceholder = rl),
+ (N.isArrayExpression = n),
+ (N.isArrayPattern = Ze),
+ (N.isArrayTypeAnnotation = Oo),
+ (N.isArrowFunctionExpression = Ne),
+ (N.isAssignmentExpression = i),
+ (N.isAssignmentPattern = ce),
+ (N.isAwaitExpression = pn),
+ (N.isBigIntLiteral = ho),
+ (N.isBinary = $c),
+ (N.isBinaryExpression = r),
+ (N.isBindExpression = il),
+ (N.isBlock = Dc),
+ (N.isBlockParent = Cc),
+ (N.isBlockStatement = l),
+ (N.isBooleanLiteral = de),
+ (N.isBooleanLiteralTypeAnnotation = jo),
+ (N.isBooleanTypeAnnotation = $o),
+ (N.isBreakStatement = d),
+ (N.isCallExpression = u),
+ (N.isCatchClause = p),
+ (N.isClass = py),
+ (N.isClassAccessorProperty = To),
+ (N.isClassBody = X),
+ (N.isClassDeclaration = ge),
+ (N.isClassExpression = ee),
+ (N.isClassImplements = Do),
+ (N.isClassMethod = se),
+ (N.isClassPrivateMethod = Io),
+ (N.isClassPrivateProperty = Eo),
+ (N.isClassProperty = _o),
+ (N.isCompletionStatement = h),
+ (N.isConditional = k),
+ (N.isConditionalExpression = y),
+ (N.isContinueStatement = m),
+ (N.isDebuggerStatement = g),
+ (N.isDecimalLiteral = dl),
+ (N.isDeclaration = ty),
+ (N.isDeclareClass = Ao),
+ (N.isDeclareExportAllDeclaration = Zo),
+ (N.isDeclareExportDeclaration = Uo),
+ (N.isDeclareFunction = Mo),
+ (N.isDeclareInterface = No),
+ (N.isDeclareModule = Ro),
+ (N.isDeclareModuleExports = Lo),
+ (N.isDeclareOpaqueType = zo),
+ (N.isDeclareTypeAlias = Fo),
+ (N.isDeclareVariable = Bo),
+ (N.isDeclaredPredicate = qo),
+ (N.isDecorator = ol),
+ (N.isDirective = o),
+ (N.isDirectiveLiteral = s),
+ (N.isDoExpression = sl),
+ (N.isDoWhileStatement = S),
+ (N.isEmptyStatement = _),
+ (N.isEmptyTypeAnnotation = ts),
+ (N.isEnumBody = Ty),
+ (N.isEnumBooleanBody = Os),
+ (N.isEnumBooleanMember = Ds),
+ (N.isEnumDeclaration = ws),
+ (N.isEnumDefaultedMember = Ns),
+ (N.isEnumMember = Ey),
+ (N.isEnumNumberBody = $s),
+ (N.isEnumNumberMember = As),
+ (N.isEnumStringBody = js),
+ (N.isEnumStringMember = Ms),
+ (N.isEnumSymbolBody = Cs),
+ (N.isExistsTypeAnnotation = Ko),
+ (N.isExportAllDeclaration = fe),
+ (N.isExportDeclaration = my),
+ (N.isExportDefaultDeclaration = we),
+ (N.isExportDefaultSpecifier = ll),
+ (N.isExportNamedDeclaration = me),
+ (N.isExportNamespaceSpecifier = bo),
+ (N.isExportSpecifier = ze),
+ (N.isExpression = Oc),
+ (N.isExpressionStatement = O),
+ (N.isExpressionWrapper = H),
+ (N.isFile = P),
+ (N.isFlow = hy),
+ (N.isFlowBaseAnnotation = ky),
+ (N.isFlowDeclaration = Sy),
+ (N.isFlowPredicate = _y),
+ (N.isFlowType = by),
+ (N.isFor = He),
+ (N.isForInStatement = M),
+ (N.isForOfStatement = Ce),
+ (N.isForStatement = w),
+ (N.isForXStatement = Ft),
+ (N.isFunction = on),
+ (N.isFunctionDeclaration = I),
+ (N.isFunctionExpression = U),
+ (N.isFunctionParent = er),
+ (N.isFunctionTypeAnnotation = Vo),
+ (N.isFunctionTypeParam = Jo),
+ (N.isGenericTypeAnnotation = Ho),
+ (N.isIdentifier = A),
+ (N.isIfStatement = q),
+ (N.isImmutable = oy),
+ (N.isImport = Sr),
+ (N.isImportAttribute = al),
+ (N.isImportDeclaration = lt),
+ (N.isImportDefaultSpecifier = ne),
+ (N.isImportExpression = Ge),
+ (N.isImportNamespaceSpecifier = he),
+ (N.isImportOrExportDeclaration = Gu),
+ (N.isImportSpecifier = Ke),
+ (N.isIndexedAccessType = Rs),
+ (N.isInferredPredicate = Wo),
+ (N.isInterfaceDeclaration = Xo),
+ (N.isInterfaceExtends = Go),
+ (N.isInterfaceTypeAnnotation = Yo),
+ (N.isInterpreterDirective = a),
+ (N.isIntersectionTypeAnnotation = Qo),
+ (N.isJSX = Iy),
+ (N.isJSXAttribute = Fs),
+ (N.isJSXClosingElement = zs),
+ (N.isJSXClosingFragment = Qs),
+ (N.isJSXElement = Bs),
+ (N.isJSXEmptyExpression = Us),
+ (N.isJSXExpressionContainer = Zs),
+ (N.isJSXFragment = Xs),
+ (N.isJSXIdentifier = Ks),
+ (N.isJSXMemberExpression = Vs),
+ (N.isJSXNamespacedName = Js),
+ (N.isJSXOpeningElement = Hs),
+ (N.isJSXOpeningFragment = Ys),
+ (N.isJSXSpreadAttribute = Ws),
+ (N.isJSXSpreadChild = qs),
+ (N.isJSXText = Gs),
+ (N.isLVal = ry),
+ (N.isLabeledStatement = ae),
+ (N.isLiteral = ay),
+ (N.isLogicalExpression = be),
+ (N.isLoop = E),
+ (N.isMemberExpression = $e),
+ (N.isMetaProperty = Qe),
+ (N.isMethod = ly),
+ (N.isMiscellaneous = Py),
+ (N.isMixedTypeAnnotation = es),
+ (N.isModuleDeclaration = My),
+ (N.isModuleExpression = fl),
+ (N.isModuleSpecifier = yy),
+ (N.isNewExpression = Ie),
+ (N.isNoop = el),
+ (N.isNullLiteral = ve),
+ (N.isNullLiteralTypeAnnotation = Co),
+ (N.isNullableTypeAnnotation = ns),
+ (N.isNumberLiteral = jy),
+ (N.isNumberLiteralTypeAnnotation = rs),
+ (N.isNumberTypeAnnotation = is),
+ (N.isNumericLiteral = G),
+ (N.isObjectExpression = ke),
+ (N.isObjectMember = cy),
+ (N.isObjectMethod = je),
+ (N.isObjectPattern = It),
+ (N.isObjectProperty = Ae),
+ (N.isObjectTypeAnnotation = as),
+ (N.isObjectTypeCallProperty = ss),
+ (N.isObjectTypeIndexer = ls),
+ (N.isObjectTypeInternalSlot = os),
+ (N.isObjectTypeProperty = cs),
+ (N.isObjectTypeSpreadProperty = us),
+ (N.isOpaqueType = ds),
+ (N.isOptionalCallExpression = So),
+ (N.isOptionalIndexedAccessType = Ls),
+ (N.isOptionalMemberExpression = ko),
+ (N.isParenthesizedExpression = tt),
+ (N.isPattern = fy),
+ (N.isPatternLike = ny),
+ (N.isPipelineBareFunction = yl),
+ (N.isPipelinePrimaryTopicReference = gl),
+ (N.isPipelineTopicExpression = ml),
+ (N.isPlaceholder = tl),
+ (N.isPrivate = vy),
+ (N.isPrivateName = Po),
+ (N.isProgram = Pe),
+ (N.isProperty = uy),
+ (N.isPureish = ey),
+ (N.isQualifiedTypeIdentifier = fs),
+ (N.isRecordExpression = cl),
+ (N.isRegExpLiteral = oe),
+ (N.isRegexLiteral = Cy),
+ (N.isRestElement = Ye),
+ (N.isRestProperty = Dy),
+ (N.isReturnStatement = bt),
+ (N.isScopable = jc),
+ (N.isSequenceExpression = st),
+ (N.isSpreadElement = pt),
+ (N.isSpreadProperty = Ay),
+ (N.isStandardized = wc),
+ (N.isStatement = Ac),
+ (N.isStaticBlock = xo),
+ (N.isStringLiteral = le),
+ (N.isStringLiteralTypeAnnotation = ps),
+ (N.isStringTypeAnnotation = ms),
+ (N.isSuper = Ve),
+ (N.isSwitchCase = yt),
+ (N.isSwitchStatement = dt),
+ (N.isSymbolTypeAnnotation = ys),
+ (N.isTSAnyKeyword = Pl),
+ (N.isTSArrayType = Vl),
+ (N.isTSAsExpression = dc),
+ (N.isTSBaseType = $y),
+ (N.isTSBigIntKeyword = wl),
+ (N.isTSBooleanKeyword = xl),
+ (N.isTSCallSignatureDeclaration = Sl),
+ (N.isTSConditionalType = Ql),
+ (N.isTSConstructSignatureDeclaration = _l),
+ (N.isTSConstructorType = Bl),
+ (N.isTSDeclareFunction = hl),
+ (N.isTSDeclareMethod = bl),
+ (N.isTSEntityName = iy),
+ (N.isTSEnumDeclaration = mc),
+ (N.isTSEnumMember = yc),
+ (N.isTSExportAssignment = _c),
+ (N.isTSExpressionWithTypeArguments = oc),
+ (N.isTSExternalModuleReference = kc),
+ (N.isTSFunctionType = zl),
+ (N.isTSImportEqualsDeclaration = bc),
+ (N.isTSImportType = hc),
+ (N.isTSIndexSignature = Il),
+ (N.isTSIndexedAccessType = rc),
+ (N.isTSInferType = ec),
+ (N.isTSInstantiationExpression = uc),
+ (N.isTSInterfaceBody = lc),
+ (N.isTSInterfaceDeclaration = sc),
+ (N.isTSIntersectionType = Yl),
+ (N.isTSIntrinsicKeyword = Ol),
+ (N.isTSLiteralType = ac),
+ (N.isTSMappedType = ic),
+ (N.isTSMethodSignature = El),
+ (N.isTSModuleBlock = vc),
+ (N.isTSModuleDeclaration = gc),
+ (N.isTSNamedTupleMember = Gl),
+ (N.isTSNamespaceExportDeclaration = Tc),
+ (N.isTSNeverKeyword = $l),
+ (N.isTSNonNullExpression = Sc),
+ (N.isTSNullKeyword = jl),
+ (N.isTSNumberKeyword = Cl),
+ (N.isTSObjectKeyword = Dl),
+ (N.isTSOptionalType = Hl),
+ (N.isTSParameterProperty = vl),
+ (N.isTSParenthesizedType = tc),
+ (N.isTSPropertySignature = Tl),
+ (N.isTSQualifiedName = kl),
+ (N.isTSRestType = Wl),
+ (N.isTSSatisfiesExpression = fc),
+ (N.isTSStringKeyword = Al),
+ (N.isTSSymbolKeyword = Ml),
+ (N.isTSThisType = Fl),
+ (N.isTSTupleType = Jl),
+ (N.isTSType = Oy),
+ (N.isTSTypeAliasDeclaration = cc),
+ (N.isTSTypeAnnotation = Ec),
+ (N.isTSTypeAssertion = pc),
+ (N.isTSTypeElement = wy),
+ (N.isTSTypeLiteral = Kl),
+ (N.isTSTypeOperator = nc),
+ (N.isTSTypeParameter = xc),
+ (N.isTSTypeParameterDeclaration = Pc),
+ (N.isTSTypeParameterInstantiation = Ic),
+ (N.isTSTypePredicate = Zl),
+ (N.isTSTypeQuery = ql),
+ (N.isTSTypeReference = Ul),
+ (N.isTSUndefinedKeyword = Nl),
+ (N.isTSUnionType = Xl),
+ (N.isTSUnknownKeyword = Rl),
+ (N.isTSVoidKeyword = Ll),
+ (N.isTaggedTemplateExpression = et),
+ (N.isTemplateElement = $t),
+ (N.isTemplateLiteral = an),
+ (N.isTerminatorless = v),
+ (N.isThisExpression = qt),
+ (N.isThisTypeAnnotation = gs),
+ (N.isThrowStatement = J),
+ (N.isTopicReference = pl),
+ (N.isTryStatement = Xe),
+ (N.isTupleExpression = ul),
+ (N.isTupleTypeAnnotation = vs),
+ (N.isTypeAlias = bs),
+ (N.isTypeAnnotation = ks),
+ (N.isTypeCastExpression = Ss),
+ (N.isTypeParameter = _s),
+ (N.isTypeParameterDeclaration = Ts),
+ (N.isTypeParameterInstantiation = Es),
+ (N.isTypeScript = xy),
+ (N.isTypeofTypeAnnotation = hs),
+ (N.isUnaryExpression = it),
+ (N.isUnaryLike = dy),
+ (N.isUnionTypeAnnotation = Is),
+ (N.isUpdateExpression = mt),
+ (N.isUserWhitespacable = sy),
+ (N.isV8IntrinsicIdentifier = nl),
+ (N.isVariableDeclaration = Et),
+ (N.isVariableDeclarator = ft),
+ (N.isVariance = Ps),
+ (N.isVoidTypeAnnotation = xs),
+ (N.isWhile = L),
+ (N.isWhileStatement = De),
+ (N.isWithStatement = Y),
+ (N.isYieldExpression = Jt);
+ var e = oh(),
+ t = Bm();
+ function n(f, c) {
+ return !f || f.type !== 'ArrayExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function i(f, c) {
+ return !f || f.type !== 'AssignmentExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function r(f, c) {
+ return !f || f.type !== 'BinaryExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function a(f, c) {
+ return !f || f.type !== 'InterpreterDirective'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function o(f, c) {
+ return !f || f.type !== 'Directive'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function s(f, c) {
+ return !f || f.type !== 'DirectiveLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function l(f, c) {
+ return !f || f.type !== 'BlockStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function d(f, c) {
+ return !f || f.type !== 'BreakStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function u(f, c) {
+ return !f || f.type !== 'CallExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function p(f, c) {
+ return !f || f.type !== 'CatchClause'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function y(f, c) {
+ return !f || f.type !== 'ConditionalExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function m(f, c) {
+ return !f || f.type !== 'ContinueStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function g(f, c) {
+ return !f || f.type !== 'DebuggerStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function S(f, c) {
+ return !f || f.type !== 'DoWhileStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function _(f, c) {
+ return !f || f.type !== 'EmptyStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function O(f, c) {
+ return !f || f.type !== 'ExpressionStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function P(f, c) {
+ return !f || f.type !== 'File' ? !1 : c == null || (0, e.default)(f, c);
+ }
+ function M(f, c) {
+ return !f || f.type !== 'ForInStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function w(f, c) {
+ return !f || f.type !== 'ForStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function I(f, c) {
+ return !f || f.type !== 'FunctionDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function U(f, c) {
+ return !f || f.type !== 'FunctionExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function A(f, c) {
+ return !f || f.type !== 'Identifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function q(f, c) {
+ return !f || f.type !== 'IfStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ae(f, c) {
+ return !f || f.type !== 'LabeledStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function le(f, c) {
+ return !f || f.type !== 'StringLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function G(f, c) {
+ return !f || f.type !== 'NumericLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ve(f, c) {
+ return !f || f.type !== 'NullLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function de(f, c) {
+ return !f || f.type !== 'BooleanLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function oe(f, c) {
+ return !f || f.type !== 'RegExpLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function be(f, c) {
+ return !f || f.type !== 'LogicalExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function $e(f, c) {
+ return !f || f.type !== 'MemberExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ie(f, c) {
+ return !f || f.type !== 'NewExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Pe(f, c) {
+ return !f || f.type !== 'Program'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ke(f, c) {
+ return !f || f.type !== 'ObjectExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function je(f, c) {
+ return !f || f.type !== 'ObjectMethod'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ae(f, c) {
+ return !f || f.type !== 'ObjectProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ye(f, c) {
+ return !f || f.type !== 'RestElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function bt(f, c) {
+ return !f || f.type !== 'ReturnStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function st(f, c) {
+ return !f || f.type !== 'SequenceExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function tt(f, c) {
+ return !f || f.type !== 'ParenthesizedExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function yt(f, c) {
+ return !f || f.type !== 'SwitchCase'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function dt(f, c) {
+ return !f || f.type !== 'SwitchStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function qt(f, c) {
+ return !f || f.type !== 'ThisExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function J(f, c) {
+ return !f || f.type !== 'ThrowStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Xe(f, c) {
+ return !f || f.type !== 'TryStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function it(f, c) {
+ return !f || f.type !== 'UnaryExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function mt(f, c) {
+ return !f || f.type !== 'UpdateExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Et(f, c) {
+ return !f || f.type !== 'VariableDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ft(f, c) {
+ return !f || f.type !== 'VariableDeclarator'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function De(f, c) {
+ return !f || f.type !== 'WhileStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Y(f, c) {
+ return !f || f.type !== 'WithStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ce(f, c) {
+ return !f || f.type !== 'AssignmentPattern'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ze(f, c) {
+ return !f || f.type !== 'ArrayPattern'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ne(f, c) {
+ return !f || f.type !== 'ArrowFunctionExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function X(f, c) {
+ return !f || f.type !== 'ClassBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ee(f, c) {
+ return !f || f.type !== 'ClassExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ge(f, c) {
+ return !f || f.type !== 'ClassDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function fe(f, c) {
+ return !f || f.type !== 'ExportAllDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function we(f, c) {
+ return !f || f.type !== 'ExportDefaultDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function me(f, c) {
+ return !f || f.type !== 'ExportNamedDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ze(f, c) {
+ return !f || f.type !== 'ExportSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ce(f, c) {
+ return !f || f.type !== 'ForOfStatement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function lt(f, c) {
+ return !f || f.type !== 'ImportDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ne(f, c) {
+ return !f || f.type !== 'ImportDefaultSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function he(f, c) {
+ return !f || f.type !== 'ImportNamespaceSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ke(f, c) {
+ return !f || f.type !== 'ImportSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ge(f, c) {
+ return !f || f.type !== 'ImportExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Qe(f, c) {
+ return !f || f.type !== 'MetaProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function se(f, c) {
+ return !f || f.type !== 'ClassMethod'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function It(f, c) {
+ return !f || f.type !== 'ObjectPattern'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function pt(f, c) {
+ return !f || f.type !== 'SpreadElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ve(f, c) {
+ return !f || f.type !== 'Super' ? !1 : c == null || (0, e.default)(f, c);
+ }
+ function et(f, c) {
+ return !f || f.type !== 'TaggedTemplateExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function $t(f, c) {
+ return !f || f.type !== 'TemplateElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function an(f, c) {
+ return !f || f.type !== 'TemplateLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Jt(f, c) {
+ return !f || f.type !== 'YieldExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function pn(f, c) {
+ return !f || f.type !== 'AwaitExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Sr(f, c) {
+ return !f || f.type !== 'Import' ? !1 : c == null || (0, e.default)(f, c);
+ }
+ function ho(f, c) {
+ return !f || f.type !== 'BigIntLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function bo(f, c) {
+ return !f || f.type !== 'ExportNamespaceSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ko(f, c) {
+ return !f || f.type !== 'OptionalMemberExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function So(f, c) {
+ return !f || f.type !== 'OptionalCallExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function _o(f, c) {
+ return !f || f.type !== 'ClassProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function To(f, c) {
+ return !f || f.type !== 'ClassAccessorProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Eo(f, c) {
+ return !f || f.type !== 'ClassPrivateProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Io(f, c) {
+ return !f || f.type !== 'ClassPrivateMethod'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Po(f, c) {
+ return !f || f.type !== 'PrivateName'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function xo(f, c) {
+ return !f || f.type !== 'StaticBlock'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function wo(f, c) {
+ return !f || f.type !== 'AnyTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Oo(f, c) {
+ return !f || f.type !== 'ArrayTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function $o(f, c) {
+ return !f || f.type !== 'BooleanTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function jo(f, c) {
+ return !f || f.type !== 'BooleanLiteralTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Co(f, c) {
+ return !f || f.type !== 'NullLiteralTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Do(f, c) {
+ return !f || f.type !== 'ClassImplements'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ao(f, c) {
+ return !f || f.type !== 'DeclareClass'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Mo(f, c) {
+ return !f || f.type !== 'DeclareFunction'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function No(f, c) {
+ return !f || f.type !== 'DeclareInterface'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ro(f, c) {
+ return !f || f.type !== 'DeclareModule'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Lo(f, c) {
+ return !f || f.type !== 'DeclareModuleExports'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Fo(f, c) {
+ return !f || f.type !== 'DeclareTypeAlias'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function zo(f, c) {
+ return !f || f.type !== 'DeclareOpaqueType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Bo(f, c) {
+ return !f || f.type !== 'DeclareVariable'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Uo(f, c) {
+ return !f || f.type !== 'DeclareExportDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Zo(f, c) {
+ return !f || f.type !== 'DeclareExportAllDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function qo(f, c) {
+ return !f || f.type !== 'DeclaredPredicate'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ko(f, c) {
+ return !f || f.type !== 'ExistsTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Vo(f, c) {
+ return !f || f.type !== 'FunctionTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Jo(f, c) {
+ return !f || f.type !== 'FunctionTypeParam'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ho(f, c) {
+ return !f || f.type !== 'GenericTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Wo(f, c) {
+ return !f || f.type !== 'InferredPredicate'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Go(f, c) {
+ return !f || f.type !== 'InterfaceExtends'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Xo(f, c) {
+ return !f || f.type !== 'InterfaceDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Yo(f, c) {
+ return !f || f.type !== 'InterfaceTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Qo(f, c) {
+ return !f || f.type !== 'IntersectionTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function es(f, c) {
+ return !f || f.type !== 'MixedTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ts(f, c) {
+ return !f || f.type !== 'EmptyTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ns(f, c) {
+ return !f || f.type !== 'NullableTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function rs(f, c) {
+ return !f || f.type !== 'NumberLiteralTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function is(f, c) {
+ return !f || f.type !== 'NumberTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function as(f, c) {
+ return !f || f.type !== 'ObjectTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function os(f, c) {
+ return !f || f.type !== 'ObjectTypeInternalSlot'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ss(f, c) {
+ return !f || f.type !== 'ObjectTypeCallProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ls(f, c) {
+ return !f || f.type !== 'ObjectTypeIndexer'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function cs(f, c) {
+ return !f || f.type !== 'ObjectTypeProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function us(f, c) {
+ return !f || f.type !== 'ObjectTypeSpreadProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ds(f, c) {
+ return !f || f.type !== 'OpaqueType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function fs(f, c) {
+ return !f || f.type !== 'QualifiedTypeIdentifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ps(f, c) {
+ return !f || f.type !== 'StringLiteralTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ms(f, c) {
+ return !f || f.type !== 'StringTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ys(f, c) {
+ return !f || f.type !== 'SymbolTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function gs(f, c) {
+ return !f || f.type !== 'ThisTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function vs(f, c) {
+ return !f || f.type !== 'TupleTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function hs(f, c) {
+ return !f || f.type !== 'TypeofTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function bs(f, c) {
+ return !f || f.type !== 'TypeAlias'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ks(f, c) {
+ return !f || f.type !== 'TypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ss(f, c) {
+ return !f || f.type !== 'TypeCastExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function _s(f, c) {
+ return !f || f.type !== 'TypeParameter'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ts(f, c) {
+ return !f || f.type !== 'TypeParameterDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Es(f, c) {
+ return !f || f.type !== 'TypeParameterInstantiation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Is(f, c) {
+ return !f || f.type !== 'UnionTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ps(f, c) {
+ return !f || f.type !== 'Variance'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function xs(f, c) {
+ return !f || f.type !== 'VoidTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ws(f, c) {
+ return !f || f.type !== 'EnumDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Os(f, c) {
+ return !f || f.type !== 'EnumBooleanBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function $s(f, c) {
+ return !f || f.type !== 'EnumNumberBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function js(f, c) {
+ return !f || f.type !== 'EnumStringBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Cs(f, c) {
+ return !f || f.type !== 'EnumSymbolBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ds(f, c) {
+ return !f || f.type !== 'EnumBooleanMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function As(f, c) {
+ return !f || f.type !== 'EnumNumberMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ms(f, c) {
+ return !f || f.type !== 'EnumStringMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ns(f, c) {
+ return !f || f.type !== 'EnumDefaultedMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Rs(f, c) {
+ return !f || f.type !== 'IndexedAccessType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ls(f, c) {
+ return !f || f.type !== 'OptionalIndexedAccessType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Fs(f, c) {
+ return !f || f.type !== 'JSXAttribute'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function zs(f, c) {
+ return !f || f.type !== 'JSXClosingElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Bs(f, c) {
+ return !f || f.type !== 'JSXElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Us(f, c) {
+ return !f || f.type !== 'JSXEmptyExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Zs(f, c) {
+ return !f || f.type !== 'JSXExpressionContainer'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function qs(f, c) {
+ return !f || f.type !== 'JSXSpreadChild'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ks(f, c) {
+ return !f || f.type !== 'JSXIdentifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Vs(f, c) {
+ return !f || f.type !== 'JSXMemberExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Js(f, c) {
+ return !f || f.type !== 'JSXNamespacedName'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Hs(f, c) {
+ return !f || f.type !== 'JSXOpeningElement'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ws(f, c) {
+ return !f || f.type !== 'JSXSpreadAttribute'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Gs(f, c) {
+ return !f || f.type !== 'JSXText'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Xs(f, c) {
+ return !f || f.type !== 'JSXFragment'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ys(f, c) {
+ return !f || f.type !== 'JSXOpeningFragment'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Qs(f, c) {
+ return !f || f.type !== 'JSXClosingFragment'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function el(f, c) {
+ return !f || f.type !== 'Noop' ? !1 : c == null || (0, e.default)(f, c);
+ }
+ function tl(f, c) {
+ return !f || f.type !== 'Placeholder'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function nl(f, c) {
+ return !f || f.type !== 'V8IntrinsicIdentifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function rl(f, c) {
+ return !f || f.type !== 'ArgumentPlaceholder'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function il(f, c) {
+ return !f || f.type !== 'BindExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function al(f, c) {
+ return !f || f.type !== 'ImportAttribute'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ol(f, c) {
+ return !f || f.type !== 'Decorator'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function sl(f, c) {
+ return !f || f.type !== 'DoExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ll(f, c) {
+ return !f || f.type !== 'ExportDefaultSpecifier'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function cl(f, c) {
+ return !f || f.type !== 'RecordExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ul(f, c) {
+ return !f || f.type !== 'TupleExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function dl(f, c) {
+ return !f || f.type !== 'DecimalLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function fl(f, c) {
+ return !f || f.type !== 'ModuleExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function pl(f, c) {
+ return !f || f.type !== 'TopicReference'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ml(f, c) {
+ return !f || f.type !== 'PipelineTopicExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function yl(f, c) {
+ return !f || f.type !== 'PipelineBareFunction'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function gl(f, c) {
+ return !f || f.type !== 'PipelinePrimaryTopicReference'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function vl(f, c) {
+ return !f || f.type !== 'TSParameterProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function hl(f, c) {
+ return !f || f.type !== 'TSDeclareFunction'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function bl(f, c) {
+ return !f || f.type !== 'TSDeclareMethod'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function kl(f, c) {
+ return !f || f.type !== 'TSQualifiedName'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Sl(f, c) {
+ return !f || f.type !== 'TSCallSignatureDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function _l(f, c) {
+ return !f || f.type !== 'TSConstructSignatureDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Tl(f, c) {
+ return !f || f.type !== 'TSPropertySignature'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function El(f, c) {
+ return !f || f.type !== 'TSMethodSignature'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Il(f, c) {
+ return !f || f.type !== 'TSIndexSignature'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Pl(f, c) {
+ return !f || f.type !== 'TSAnyKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function xl(f, c) {
+ return !f || f.type !== 'TSBooleanKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function wl(f, c) {
+ return !f || f.type !== 'TSBigIntKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ol(f, c) {
+ return !f || f.type !== 'TSIntrinsicKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function $l(f, c) {
+ return !f || f.type !== 'TSNeverKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function jl(f, c) {
+ return !f || f.type !== 'TSNullKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Cl(f, c) {
+ return !f || f.type !== 'TSNumberKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Dl(f, c) {
+ return !f || f.type !== 'TSObjectKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Al(f, c) {
+ return !f || f.type !== 'TSStringKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ml(f, c) {
+ return !f || f.type !== 'TSSymbolKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Nl(f, c) {
+ return !f || f.type !== 'TSUndefinedKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Rl(f, c) {
+ return !f || f.type !== 'TSUnknownKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ll(f, c) {
+ return !f || f.type !== 'TSVoidKeyword'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Fl(f, c) {
+ return !f || f.type !== 'TSThisType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function zl(f, c) {
+ return !f || f.type !== 'TSFunctionType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Bl(f, c) {
+ return !f || f.type !== 'TSConstructorType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ul(f, c) {
+ return !f || f.type !== 'TSTypeReference'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Zl(f, c) {
+ return !f || f.type !== 'TSTypePredicate'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ql(f, c) {
+ return !f || f.type !== 'TSTypeQuery'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Kl(f, c) {
+ return !f || f.type !== 'TSTypeLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Vl(f, c) {
+ return !f || f.type !== 'TSArrayType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Jl(f, c) {
+ return !f || f.type !== 'TSTupleType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Hl(f, c) {
+ return !f || f.type !== 'TSOptionalType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Wl(f, c) {
+ return !f || f.type !== 'TSRestType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Gl(f, c) {
+ return !f || f.type !== 'TSNamedTupleMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Xl(f, c) {
+ return !f || f.type !== 'TSUnionType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Yl(f, c) {
+ return !f || f.type !== 'TSIntersectionType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ql(f, c) {
+ return !f || f.type !== 'TSConditionalType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ec(f, c) {
+ return !f || f.type !== 'TSInferType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function tc(f, c) {
+ return !f || f.type !== 'TSParenthesizedType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function nc(f, c) {
+ return !f || f.type !== 'TSTypeOperator'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function rc(f, c) {
+ return !f || f.type !== 'TSIndexedAccessType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ic(f, c) {
+ return !f || f.type !== 'TSMappedType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function ac(f, c) {
+ return !f || f.type !== 'TSLiteralType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function oc(f, c) {
+ return !f || f.type !== 'TSExpressionWithTypeArguments'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function sc(f, c) {
+ return !f || f.type !== 'TSInterfaceDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function lc(f, c) {
+ return !f || f.type !== 'TSInterfaceBody'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function cc(f, c) {
+ return !f || f.type !== 'TSTypeAliasDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function uc(f, c) {
+ return !f || f.type !== 'TSInstantiationExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function dc(f, c) {
+ return !f || f.type !== 'TSAsExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function fc(f, c) {
+ return !f || f.type !== 'TSSatisfiesExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function pc(f, c) {
+ return !f || f.type !== 'TSTypeAssertion'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function mc(f, c) {
+ return !f || f.type !== 'TSEnumDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function yc(f, c) {
+ return !f || f.type !== 'TSEnumMember'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function gc(f, c) {
+ return !f || f.type !== 'TSModuleDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function vc(f, c) {
+ return !f || f.type !== 'TSModuleBlock'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function hc(f, c) {
+ return !f || f.type !== 'TSImportType'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function bc(f, c) {
+ return !f || f.type !== 'TSImportEqualsDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function kc(f, c) {
+ return !f || f.type !== 'TSExternalModuleReference'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Sc(f, c) {
+ return !f || f.type !== 'TSNonNullExpression'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function _c(f, c) {
+ return !f || f.type !== 'TSExportAssignment'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Tc(f, c) {
+ return !f || f.type !== 'TSNamespaceExportDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ec(f, c) {
+ return !f || f.type !== 'TSTypeAnnotation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Ic(f, c) {
+ return !f || f.type !== 'TSTypeParameterInstantiation'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function Pc(f, c) {
+ return !f || f.type !== 'TSTypeParameterDeclaration'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function xc(f, c) {
+ return !f || f.type !== 'TSTypeParameter'
+ ? !1
+ : c == null || (0, e.default)(f, c);
+ }
+ function wc(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ArrayExpression':
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'InterpreterDirective':
+ case 'Directive':
+ case 'DirectiveLiteral':
+ case 'BlockStatement':
+ case 'BreakStatement':
+ case 'CallExpression':
+ case 'CatchClause':
+ case 'ConditionalExpression':
+ case 'ContinueStatement':
+ case 'DebuggerStatement':
+ case 'DoWhileStatement':
+ case 'EmptyStatement':
+ case 'ExpressionStatement':
+ case 'File':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Identifier':
+ case 'IfStatement':
+ case 'LabeledStatement':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'LogicalExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'Program':
+ case 'ObjectExpression':
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ case 'RestElement':
+ case 'ReturnStatement':
+ case 'SequenceExpression':
+ case 'ParenthesizedExpression':
+ case 'SwitchCase':
+ case 'SwitchStatement':
+ case 'ThisExpression':
+ case 'ThrowStatement':
+ case 'TryStatement':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ case 'VariableDeclaration':
+ case 'VariableDeclarator':
+ case 'WhileStatement':
+ case 'WithStatement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ArrowFunctionExpression':
+ case 'ClassBody':
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ExportSpecifier':
+ case 'ForOfStatement':
+ case 'ImportDeclaration':
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ case 'ImportExpression':
+ case 'MetaProperty':
+ case 'ClassMethod':
+ case 'ObjectPattern':
+ case 'SpreadElement':
+ case 'Super':
+ case 'TaggedTemplateExpression':
+ case 'TemplateElement':
+ case 'TemplateLiteral':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ case 'Import':
+ case 'BigIntLiteral':
+ case 'ExportNamespaceSpecifier':
+ case 'OptionalMemberExpression':
+ case 'OptionalCallExpression':
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ case 'ClassPrivateProperty':
+ case 'ClassPrivateMethod':
+ case 'PrivateName':
+ case 'StaticBlock':
+ break;
+ case 'Placeholder':
+ switch (f.expectedNode) {
+ case 'Identifier':
+ case 'StringLiteral':
+ case 'BlockStatement':
+ case 'ClassBody':
+ break;
+ default:
+ return !1;
+ }
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Oc(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ArrayExpression':
+ case 'AssignmentExpression':
+ case 'BinaryExpression':
+ case 'CallExpression':
+ case 'ConditionalExpression':
+ case 'FunctionExpression':
+ case 'Identifier':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'LogicalExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'ObjectExpression':
+ case 'SequenceExpression':
+ case 'ParenthesizedExpression':
+ case 'ThisExpression':
+ case 'UnaryExpression':
+ case 'UpdateExpression':
+ case 'ArrowFunctionExpression':
+ case 'ClassExpression':
+ case 'ImportExpression':
+ case 'MetaProperty':
+ case 'Super':
+ case 'TaggedTemplateExpression':
+ case 'TemplateLiteral':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ case 'Import':
+ case 'BigIntLiteral':
+ case 'OptionalMemberExpression':
+ case 'OptionalCallExpression':
+ case 'TypeCastExpression':
+ case 'JSXElement':
+ case 'JSXFragment':
+ case 'BindExpression':
+ case 'DoExpression':
+ case 'RecordExpression':
+ case 'TupleExpression':
+ case 'DecimalLiteral':
+ case 'ModuleExpression':
+ case 'TopicReference':
+ case 'PipelineTopicExpression':
+ case 'PipelineBareFunction':
+ case 'PipelinePrimaryTopicReference':
+ case 'TSInstantiationExpression':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (f.expectedNode) {
+ case 'Expression':
+ case 'Identifier':
+ case 'StringLiteral':
+ break;
+ default:
+ return !1;
+ }
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function $c(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BinaryExpression':
+ case 'LogicalExpression':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function jc(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BlockStatement':
+ case 'CatchClause':
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Program':
+ case 'ObjectMethod':
+ case 'SwitchStatement':
+ case 'WhileStatement':
+ case 'ArrowFunctionExpression':
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ case 'ForOfStatement':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'BlockStatement') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Cc(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BlockStatement':
+ case 'CatchClause':
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'Program':
+ case 'ObjectMethod':
+ case 'SwitchStatement':
+ case 'WhileStatement':
+ case 'ArrowFunctionExpression':
+ case 'ForOfStatement':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'BlockStatement') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Dc(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BlockStatement':
+ case 'Program':
+ case 'TSModuleBlock':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'BlockStatement') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Ac(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BlockStatement':
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'DebuggerStatement':
+ case 'DoWhileStatement':
+ case 'EmptyStatement':
+ case 'ExpressionStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'FunctionDeclaration':
+ case 'IfStatement':
+ case 'LabeledStatement':
+ case 'ReturnStatement':
+ case 'SwitchStatement':
+ case 'ThrowStatement':
+ case 'TryStatement':
+ case 'VariableDeclaration':
+ case 'WhileStatement':
+ case 'WithStatement':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ForOfStatement':
+ case 'ImportDeclaration':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ case 'EnumDeclaration':
+ case 'TSDeclareFunction':
+ case 'TSInterfaceDeclaration':
+ case 'TSTypeAliasDeclaration':
+ case 'TSEnumDeclaration':
+ case 'TSModuleDeclaration':
+ case 'TSImportEqualsDeclaration':
+ case 'TSExportAssignment':
+ case 'TSNamespaceExportDeclaration':
+ break;
+ case 'Placeholder':
+ switch (f.expectedNode) {
+ case 'Statement':
+ case 'Declaration':
+ case 'BlockStatement':
+ break;
+ default:
+ return !1;
+ }
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function v(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'ReturnStatement':
+ case 'ThrowStatement':
+ case 'YieldExpression':
+ case 'AwaitExpression':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function h(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'ReturnStatement':
+ case 'ThrowStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function k(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function E(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'DoWhileStatement':
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'WhileStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function L(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'DoWhileStatement':
+ case 'WhileStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function H(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ExpressionStatement':
+ case 'ParenthesizedExpression':
+ case 'TypeCastExpression':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function He(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ForInStatement':
+ case 'ForStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Ft(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function on(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'ObjectMethod':
+ case 'ArrowFunctionExpression':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function er(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'ObjectMethod':
+ case 'ArrowFunctionExpression':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'StaticBlock':
+ case 'TSModuleBlock':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ey(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'ArrowFunctionExpression':
+ case 'BigIntLiteral':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'StringLiteral') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ty(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'FunctionDeclaration':
+ case 'VariableDeclaration':
+ case 'ClassDeclaration':
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ case 'EnumDeclaration':
+ case 'TSDeclareFunction':
+ case 'TSInterfaceDeclaration':
+ case 'TSTypeAliasDeclaration':
+ case 'TSEnumDeclaration':
+ case 'TSModuleDeclaration':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'Declaration') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ny(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'Identifier':
+ case 'RestElement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (f.expectedNode) {
+ case 'Pattern':
+ case 'Identifier':
+ break;
+ default:
+ return !1;
+ }
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ry(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'Identifier':
+ case 'MemberExpression':
+ case 'RestElement':
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ case 'TSParameterProperty':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSNonNullExpression':
+ break;
+ case 'Placeholder':
+ switch (f.expectedNode) {
+ case 'Pattern':
+ case 'Identifier':
+ break;
+ default:
+ return !1;
+ }
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function iy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'Identifier':
+ case 'TSQualifiedName':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'Identifier') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ay(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'RegExpLiteral':
+ case 'TemplateLiteral':
+ case 'BigIntLiteral':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'StringLiteral') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function oy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'BigIntLiteral':
+ case 'JSXAttribute':
+ case 'JSXClosingElement':
+ case 'JSXElement':
+ case 'JSXExpressionContainer':
+ case 'JSXSpreadChild':
+ case 'JSXOpeningElement':
+ case 'JSXText':
+ case 'JSXFragment':
+ case 'JSXOpeningFragment':
+ case 'JSXClosingFragment':
+ case 'DecimalLiteral':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'StringLiteral') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function sy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ case 'ObjectTypeInternalSlot':
+ case 'ObjectTypeCallProperty':
+ case 'ObjectTypeIndexer':
+ case 'ObjectTypeProperty':
+ case 'ObjectTypeSpreadProperty':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ly(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ObjectMethod':
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function cy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ObjectMethod':
+ case 'ObjectProperty':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function uy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ObjectProperty':
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ case 'ClassPrivateProperty':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function dy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'UnaryExpression':
+ case 'SpreadElement':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function fy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'AssignmentPattern':
+ case 'ArrayPattern':
+ case 'ObjectPattern':
+ break;
+ case 'Placeholder':
+ if (f.expectedNode === 'Pattern') break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function py(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ClassExpression':
+ case 'ClassDeclaration':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Gu(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function my(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function yy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ExportSpecifier':
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ case 'ExportNamespaceSpecifier':
+ case 'ExportDefaultSpecifier':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function gy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ClassAccessorProperty':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function vy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'ClassPrivateProperty':
+ case 'ClassPrivateMethod':
+ case 'PrivateName':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function hy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'AnyTypeAnnotation':
+ case 'ArrayTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'BooleanLiteralTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'ClassImplements':
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'DeclaredPredicate':
+ case 'ExistsTypeAnnotation':
+ case 'FunctionTypeAnnotation':
+ case 'FunctionTypeParam':
+ case 'GenericTypeAnnotation':
+ case 'InferredPredicate':
+ case 'InterfaceExtends':
+ case 'InterfaceDeclaration':
+ case 'InterfaceTypeAnnotation':
+ case 'IntersectionTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NullableTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'ObjectTypeAnnotation':
+ case 'ObjectTypeInternalSlot':
+ case 'ObjectTypeCallProperty':
+ case 'ObjectTypeIndexer':
+ case 'ObjectTypeProperty':
+ case 'ObjectTypeSpreadProperty':
+ case 'OpaqueType':
+ case 'QualifiedTypeIdentifier':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'TupleTypeAnnotation':
+ case 'TypeofTypeAnnotation':
+ case 'TypeAlias':
+ case 'TypeAnnotation':
+ case 'TypeCastExpression':
+ case 'TypeParameter':
+ case 'TypeParameterDeclaration':
+ case 'TypeParameterInstantiation':
+ case 'UnionTypeAnnotation':
+ case 'Variance':
+ case 'VoidTypeAnnotation':
+ case 'EnumDeclaration':
+ case 'EnumBooleanBody':
+ case 'EnumNumberBody':
+ case 'EnumStringBody':
+ case 'EnumSymbolBody':
+ case 'EnumBooleanMember':
+ case 'EnumNumberMember':
+ case 'EnumStringMember':
+ case 'EnumDefaultedMember':
+ case 'IndexedAccessType':
+ case 'OptionalIndexedAccessType':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function by(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'AnyTypeAnnotation':
+ case 'ArrayTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'BooleanLiteralTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'ExistsTypeAnnotation':
+ case 'FunctionTypeAnnotation':
+ case 'GenericTypeAnnotation':
+ case 'InterfaceTypeAnnotation':
+ case 'IntersectionTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NullableTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'ObjectTypeAnnotation':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'TupleTypeAnnotation':
+ case 'TypeofTypeAnnotation':
+ case 'UnionTypeAnnotation':
+ case 'VoidTypeAnnotation':
+ case 'IndexedAccessType':
+ case 'OptionalIndexedAccessType':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function ky(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'AnyTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'MixedTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'VoidTypeAnnotation':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Sy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'DeclareClass':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareTypeAlias':
+ case 'DeclareOpaqueType':
+ case 'DeclareVariable':
+ case 'DeclareExportDeclaration':
+ case 'DeclareExportAllDeclaration':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TypeAlias':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function _y(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'DeclaredPredicate':
+ case 'InferredPredicate':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Ty(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'EnumBooleanBody':
+ case 'EnumNumberBody':
+ case 'EnumStringBody':
+ case 'EnumSymbolBody':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Ey(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'EnumBooleanMember':
+ case 'EnumNumberMember':
+ case 'EnumStringMember':
+ case 'EnumDefaultedMember':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Iy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'JSXAttribute':
+ case 'JSXClosingElement':
+ case 'JSXElement':
+ case 'JSXEmptyExpression':
+ case 'JSXExpressionContainer':
+ case 'JSXSpreadChild':
+ case 'JSXIdentifier':
+ case 'JSXMemberExpression':
+ case 'JSXNamespacedName':
+ case 'JSXOpeningElement':
+ case 'JSXSpreadAttribute':
+ case 'JSXText':
+ case 'JSXFragment':
+ case 'JSXOpeningFragment':
+ case 'JSXClosingFragment':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Py(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'Noop':
+ case 'Placeholder':
+ case 'V8IntrinsicIdentifier':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function xy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'TSParameterProperty':
+ case 'TSDeclareFunction':
+ case 'TSDeclareMethod':
+ case 'TSQualifiedName':
+ case 'TSCallSignatureDeclaration':
+ case 'TSConstructSignatureDeclaration':
+ case 'TSPropertySignature':
+ case 'TSMethodSignature':
+ case 'TSIndexSignature':
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSFunctionType':
+ case 'TSConstructorType':
+ case 'TSTypeReference':
+ case 'TSTypePredicate':
+ case 'TSTypeQuery':
+ case 'TSTypeLiteral':
+ case 'TSArrayType':
+ case 'TSTupleType':
+ case 'TSOptionalType':
+ case 'TSRestType':
+ case 'TSNamedTupleMember':
+ case 'TSUnionType':
+ case 'TSIntersectionType':
+ case 'TSConditionalType':
+ case 'TSInferType':
+ case 'TSParenthesizedType':
+ case 'TSTypeOperator':
+ case 'TSIndexedAccessType':
+ case 'TSMappedType':
+ case 'TSLiteralType':
+ case 'TSExpressionWithTypeArguments':
+ case 'TSInterfaceDeclaration':
+ case 'TSInterfaceBody':
+ case 'TSTypeAliasDeclaration':
+ case 'TSInstantiationExpression':
+ case 'TSAsExpression':
+ case 'TSSatisfiesExpression':
+ case 'TSTypeAssertion':
+ case 'TSEnumDeclaration':
+ case 'TSEnumMember':
+ case 'TSModuleDeclaration':
+ case 'TSModuleBlock':
+ case 'TSImportType':
+ case 'TSImportEqualsDeclaration':
+ case 'TSExternalModuleReference':
+ case 'TSNonNullExpression':
+ case 'TSExportAssignment':
+ case 'TSNamespaceExportDeclaration':
+ case 'TSTypeAnnotation':
+ case 'TSTypeParameterInstantiation':
+ case 'TSTypeParameterDeclaration':
+ case 'TSTypeParameter':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function wy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'TSCallSignatureDeclaration':
+ case 'TSConstructSignatureDeclaration':
+ case 'TSPropertySignature':
+ case 'TSMethodSignature':
+ case 'TSIndexSignature':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function Oy(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSFunctionType':
+ case 'TSConstructorType':
+ case 'TSTypeReference':
+ case 'TSTypePredicate':
+ case 'TSTypeQuery':
+ case 'TSTypeLiteral':
+ case 'TSArrayType':
+ case 'TSTupleType':
+ case 'TSOptionalType':
+ case 'TSRestType':
+ case 'TSUnionType':
+ case 'TSIntersectionType':
+ case 'TSConditionalType':
+ case 'TSInferType':
+ case 'TSParenthesizedType':
+ case 'TSTypeOperator':
+ case 'TSIndexedAccessType':
+ case 'TSMappedType':
+ case 'TSLiteralType':
+ case 'TSExpressionWithTypeArguments':
+ case 'TSImportType':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function $y(f, c) {
+ if (!f) return !1;
+ switch (f.type) {
+ case 'TSAnyKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSBigIntKeyword':
+ case 'TSIntrinsicKeyword':
+ case 'TSNeverKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSObjectKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSUnknownKeyword':
+ case 'TSVoidKeyword':
+ case 'TSThisType':
+ case 'TSLiteralType':
+ break;
+ default:
+ return !1;
+ }
+ return c == null || (0, e.default)(f, c);
+ }
+ function jy(f, c) {
+ return (
+ (0, t.default)('isNumberLiteral', 'isNumericLiteral'),
+ !f || f.type !== 'NumberLiteral'
+ ? !1
+ : c == null || (0, e.default)(f, c)
+ );
+ }
+ function Cy(f, c) {
+ return (
+ (0, t.default)('isRegexLiteral', 'isRegExpLiteral'),
+ !f || f.type !== 'RegexLiteral' ? !1 : c == null || (0, e.default)(f, c)
+ );
+ }
+ function Dy(f, c) {
+ return (
+ (0, t.default)('isRestProperty', 'isRestElement'),
+ !f || f.type !== 'RestProperty' ? !1 : c == null || (0, e.default)(f, c)
+ );
+ }
+ function Ay(f, c) {
+ return (
+ (0, t.default)('isSpreadProperty', 'isSpreadElement'),
+ !f || f.type !== 'SpreadProperty'
+ ? !1
+ : c == null || (0, e.default)(f, c)
+ );
+ }
+ function My(f, c) {
+ return (
+ (0, t.default)('isModuleDeclaration', 'isImportOrExportDeclaration'),
+ Gu(f, c)
+ );
+ }
+ return N;
+ }
+ var E_;
+ function x0() {
+ if (E_) return If;
+ (E_ = 1),
+ Object.defineProperty(If, '__esModule', {value: !0}),
+ (If.default = t);
+ var e = ln();
+ function t(n, i, r) {
+ if (!(0, e.isMemberExpression)(n)) return !1;
+ let a = Array.isArray(i) ? i : i.split('.'),
+ o = [],
+ s;
+ for (s = n; (0, e.isMemberExpression)(s); s = s.object)
+ o.push(s.property);
+ if ((o.push(s), o.length < a.length || (!r && o.length > a.length)))
+ return !1;
+ for (let l = 0, d = o.length - 1; l < a.length; l++, d--) {
+ let u = o[d],
+ p;
+ if ((0, e.isIdentifier)(u)) p = u.name;
+ else if ((0, e.isStringLiteral)(u)) p = u.value;
+ else if ((0, e.isThisExpression)(u)) p = 'this';
+ else return !1;
+ if (a[l] !== p) return !1;
+ }
+ return !0;
+ }
+ return If;
+ }
+ var I_;
+ function w0() {
+ if (I_) return Ef;
+ (I_ = 1),
+ Object.defineProperty(Ef, '__esModule', {value: !0}),
+ (Ef.default = t);
+ var e = x0();
+ function t(n, i) {
+ let r = n.split('.');
+ return (a) => (0, e.default)(a, r, i);
+ }
+ return Ef;
+ }
+ var P_;
+ function AF() {
+ if (P_) return tu;
+ (P_ = 1),
+ Object.defineProperty(tu, '__esModule', {value: !0}),
+ (tu.default = void 0);
+ var e = w0();
+ let t = (0, e.default)('React.Component');
+ return (tu.default = t), tu;
+ }
+ var wf = {},
+ x_;
+ function MF() {
+ if (x_) return wf;
+ (x_ = 1),
+ Object.defineProperty(wf, '__esModule', {value: !0}),
+ (wf.default = e);
+ function e(t) {
+ return !!t && /^[a-z]/.test(t);
+ }
+ return wf;
+ }
+ var Of = {},
+ $f = {},
+ C = {},
+ aa = {},
+ Pg = {},
+ gn = {},
+ jf = {},
+ Cf = {},
+ w_;
+ function sh() {
+ if (w_) return Cf;
+ (w_ = 1),
+ Object.defineProperty(Cf, '__esModule', {value: !0}),
+ (Cf.default = t);
+ var e = br();
+ function t(n, i) {
+ if (n === i) return !0;
+ if (n == null || e.ALIAS_KEYS[i]) return !1;
+ let r = e.FLIPPED_ALIAS_KEYS[i];
+ if (r) {
+ if (r[0] === n) return !0;
+ for (let a of r) if (n === a) return !0;
+ }
+ return !1;
+ }
+ return Cf;
+ }
+ var Df = {},
+ O_;
+ function O0() {
+ if (O_) return Df;
+ (O_ = 1),
+ Object.defineProperty(Df, '__esModule', {value: !0}),
+ (Df.default = t);
+ var e = br();
+ function t(n, i) {
+ if (n === i) return !0;
+ let r = e.PLACEHOLDERS_ALIAS[n];
+ if (r) {
+ for (let a of r) if (i === a) return !0;
+ }
+ return !1;
+ }
+ return Df;
+ }
+ var $_;
+ function Zu() {
+ if ($_) return jf;
+ ($_ = 1),
+ Object.defineProperty(jf, '__esModule', {value: !0}),
+ (jf.default = r);
+ var e = oh(),
+ t = sh(),
+ n = O0(),
+ i = br();
+ function r(a, o, s) {
+ return o
+ ? (0, t.default)(o.type, a)
+ ? s === void 0
+ ? !0
+ : (0, e.default)(o, s)
+ : !s && o.type === 'Placeholder' && a in i.FLIPPED_ALIAS_KEYS
+ ? (0, n.default)(o.expectedNode, a)
+ : !1
+ : !1;
+ }
+ return jf;
+ }
+ var Af = {},
+ xg = {},
+ Fa = {},
+ j_;
+ function NF() {
+ if (j_) return Fa;
+ (j_ = 1),
+ Object.defineProperty(Fa, '__esModule', {value: !0}),
+ (Fa.isIdentifierChar = l),
+ (Fa.isIdentifierName = d),
+ (Fa.isIdentifierStart = s);
+ let e =
+ '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC',
+ t =
+ '\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65',
+ n = new RegExp('[' + e + ']'),
+ i = new RegExp('[' + e + t + ']');
+ e = t = null;
+ let r = [
+ 0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4,
+ 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35,
+ 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2,
+ 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2,
+ 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71,
+ 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28,
+ 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10,
+ 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22,
+ 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0,
+ 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2,
+ 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13,
+ 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2,
+ 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72,
+ 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2,
+ 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0,
+ 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22,
+ 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80,
+ 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582,
+ 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6,
+ 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9,
+ 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9,
+ 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3,
+ 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0,
+ 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2,
+ 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322,
+ 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196,
+ 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0,
+ 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0,
+ 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2,
+ 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467,
+ 541, 1507, 4938, 6, 4191,
+ ],
+ a = [
+ 509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166,
+ 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54,
+ 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1,
+ 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7,
+ 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0,
+ 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3,
+ 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14,
+ 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9,
+ 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21,
+ 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9,
+ 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27,
+ 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0,
+ 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31,
+ 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6,
+ 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13,
+ 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239,
+ ];
+ function o(u, p) {
+ let y = 65536;
+ for (let m = 0, g = p.length; m < g; m += 2) {
+ if (((y += p[m]), y > u)) return !1;
+ if (((y += p[m + 1]), y >= u)) return !0;
+ }
+ return !1;
+ }
+ function s(u) {
+ return u < 65
+ ? u === 36
+ : u <= 90
+ ? !0
+ : u < 97
+ ? u === 95
+ : u <= 122
+ ? !0
+ : u <= 65535
+ ? u >= 170 && n.test(String.fromCharCode(u))
+ : o(u, r);
+ }
+ function l(u) {
+ return u < 48
+ ? u === 36
+ : u < 58
+ ? !0
+ : u < 65
+ ? !1
+ : u <= 90
+ ? !0
+ : u < 97
+ ? u === 95
+ : u <= 122
+ ? !0
+ : u <= 65535
+ ? u >= 170 && i.test(String.fromCharCode(u))
+ : o(u, r) || o(u, a);
+ }
+ function d(u) {
+ let p = !0;
+ for (let y = 0; y < u.length; y++) {
+ let m = u.charCodeAt(y);
+ if ((m & 64512) === 55296 && y + 1 < u.length) {
+ let g = u.charCodeAt(++y);
+ (g & 64512) === 56320 &&
+ (m = 65536 + ((m & 1023) << 10) + (g & 1023));
+ }
+ if (p) {
+ if (((p = !1), !s(m))) return !1;
+ } else if (!l(m)) return !1;
+ }
+ return !p;
+ }
+ return Fa;
+ }
+ var Ji = {},
+ C_;
+ function RF() {
+ if (C_) return Ji;
+ (C_ = 1),
+ Object.defineProperty(Ji, '__esModule', {value: !0}),
+ (Ji.isKeyword = l),
+ (Ji.isReservedWord = r),
+ (Ji.isStrictBindOnlyReservedWord = o),
+ (Ji.isStrictBindReservedWord = s),
+ (Ji.isStrictReservedWord = a);
+ let e = {
+ keyword: [
+ 'break',
+ 'case',
+ 'catch',
+ 'continue',
+ 'debugger',
+ 'default',
+ 'do',
+ 'else',
+ 'finally',
+ 'for',
+ 'function',
+ 'if',
+ 'return',
+ 'switch',
+ 'throw',
+ 'try',
+ 'var',
+ 'const',
+ 'while',
+ 'with',
+ 'new',
+ 'this',
+ 'super',
+ 'class',
+ 'extends',
+ 'export',
+ 'import',
+ 'null',
+ 'true',
+ 'false',
+ 'in',
+ 'instanceof',
+ 'typeof',
+ 'void',
+ 'delete',
+ ],
+ strict: [
+ 'implements',
+ 'interface',
+ 'let',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'static',
+ 'yield',
+ ],
+ strictBind: ['eval', 'arguments'],
+ },
+ t = new Set(e.keyword),
+ n = new Set(e.strict),
+ i = new Set(e.strictBind);
+ function r(d, u) {
+ return (u && d === 'await') || d === 'enum';
+ }
+ function a(d, u) {
+ return r(d, u) || n.has(d);
+ }
+ function o(d) {
+ return i.has(d);
+ }
+ function s(d, u) {
+ return a(d, u) || o(d);
+ }
+ function l(d) {
+ return t.has(d);
+ }
+ return Ji;
+ }
+ var D_;
+ function Um() {
+ return (
+ D_ ||
+ ((D_ = 1),
+ (function (e) {
+ Object.defineProperty(e, '__esModule', {value: !0}),
+ Object.defineProperty(e, 'isIdentifierChar', {
+ enumerable: !0,
+ get: function () {
+ return t.isIdentifierChar;
+ },
+ }),
+ Object.defineProperty(e, 'isIdentifierName', {
+ enumerable: !0,
+ get: function () {
+ return t.isIdentifierName;
+ },
+ }),
+ Object.defineProperty(e, 'isIdentifierStart', {
+ enumerable: !0,
+ get: function () {
+ return t.isIdentifierStart;
+ },
+ }),
+ Object.defineProperty(e, 'isKeyword', {
+ enumerable: !0,
+ get: function () {
+ return n.isKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'isReservedWord', {
+ enumerable: !0,
+ get: function () {
+ return n.isReservedWord;
+ },
+ }),
+ Object.defineProperty(e, 'isStrictBindOnlyReservedWord', {
+ enumerable: !0,
+ get: function () {
+ return n.isStrictBindOnlyReservedWord;
+ },
+ }),
+ Object.defineProperty(e, 'isStrictBindReservedWord', {
+ enumerable: !0,
+ get: function () {
+ return n.isStrictBindReservedWord;
+ },
+ }),
+ Object.defineProperty(e, 'isStrictReservedWord', {
+ enumerable: !0,
+ get: function () {
+ return n.isStrictReservedWord;
+ },
+ });
+ var t = NF(),
+ n = RF();
+ })(xg)),
+ xg
+ );
+ }
+ var A_;
+ function qu() {
+ if (A_) return Af;
+ (A_ = 1),
+ Object.defineProperty(Af, '__esModule', {value: !0}),
+ (Af.default = t);
+ var e = Um();
+ function t(n, i = !0) {
+ return typeof n != 'string' ||
+ (i && ((0, e.isKeyword)(n) || (0, e.isStrictReservedWord)(n, !0)))
+ ? !1
+ : (0, e.isIdentifierName)(n);
+ }
+ return Af;
+ }
+ var za = {},
+ M_;
+ function LF() {
+ if (M_) return za;
+ (M_ = 1),
+ Object.defineProperty(za, '__esModule', {value: !0}),
+ (za.readCodePoint = l),
+ (za.readInt = s),
+ (za.readStringContents = i);
+ var e = function (u) {
+ return u >= 48 && u <= 57;
+ };
+ let t = {
+ decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
+ hex: new Set([46, 88, 95, 120]),
+ },
+ n = {
+ bin: (d) => d === 48 || d === 49,
+ oct: (d) => d >= 48 && d <= 55,
+ dec: (d) => d >= 48 && d <= 57,
+ hex: (d) =>
+ (d >= 48 && d <= 57) || (d >= 65 && d <= 70) || (d >= 97 && d <= 102),
+ };
+ function i(d, u, p, y, m, g) {
+ let S = p,
+ _ = y,
+ O = m,
+ P = '',
+ M = null,
+ w = p,
+ {length: I} = u;
+ for (;;) {
+ if (p >= I) {
+ g.unterminated(S, _, O), (P += u.slice(w, p));
+ break;
+ }
+ let U = u.charCodeAt(p);
+ if (r(d, U, u, p)) {
+ P += u.slice(w, p);
+ break;
+ }
+ if (U === 92) {
+ P += u.slice(w, p);
+ let A = a(u, p, y, m, d === 'template', g);
+ A.ch === null && !M
+ ? (M = {pos: p, lineStart: y, curLine: m})
+ : (P += A.ch),
+ ({pos: p, lineStart: y, curLine: m} = A),
+ (w = p);
+ } else
+ U === 8232 || U === 8233
+ ? (++p, ++m, (y = p))
+ : U === 10 || U === 13
+ ? d === 'template'
+ ? ((P +=
+ u.slice(w, p) +
+ `
+`),
+ ++p,
+ U === 13 && u.charCodeAt(p) === 10 && ++p,
+ ++m,
+ (w = y = p))
+ : g.unterminated(S, _, O)
+ : ++p;
+ }
+ return {
+ pos: p,
+ str: P,
+ firstInvalidLoc: M,
+ lineStart: y,
+ curLine: m,
+ containsInvalid: !!M,
+ };
+ }
+ function r(d, u, p, y) {
+ return d === 'template'
+ ? u === 96 || (u === 36 && p.charCodeAt(y + 1) === 123)
+ : u === (d === 'double' ? 34 : 39);
+ }
+ function a(d, u, p, y, m, g) {
+ let S = !m;
+ u++;
+ let _ = (P) => ({pos: u, ch: P, lineStart: p, curLine: y}),
+ O = d.charCodeAt(u++);
+ switch (O) {
+ case 110:
+ return _(`
+`);
+ case 114:
+ return _('\r');
+ case 120: {
+ let P;
+ return (
+ ({code: P, pos: u} = o(d, u, p, y, 2, !1, S, g)),
+ _(P === null ? null : String.fromCharCode(P))
+ );
+ }
+ case 117: {
+ let P;
+ return (
+ ({code: P, pos: u} = l(d, u, p, y, S, g)),
+ _(P === null ? null : String.fromCodePoint(P))
+ );
+ }
+ case 116:
+ return _(' ');
+ case 98:
+ return _('\b');
+ case 118:
+ return _('\v');
+ case 102:
+ return _('\f');
+ case 13:
+ d.charCodeAt(u) === 10 && ++u;
+ case 10:
+ (p = u), ++y;
+ case 8232:
+ case 8233:
+ return _('');
+ case 56:
+ case 57:
+ if (m) return _(null);
+ g.strictNumericEscape(u - 1, p, y);
+ default:
+ if (O >= 48 && O <= 55) {
+ let P = u - 1,
+ w = /^[0-7]+/.exec(d.slice(P, u + 2))[0],
+ I = parseInt(w, 8);
+ I > 255 && ((w = w.slice(0, -1)), (I = parseInt(w, 8))),
+ (u += w.length - 1);
+ let U = d.charCodeAt(u);
+ if (w !== '0' || U === 56 || U === 57) {
+ if (m) return _(null);
+ g.strictNumericEscape(P, p, y);
+ }
+ return _(String.fromCharCode(I));
+ }
+ return _(String.fromCharCode(O));
+ }
+ }
+ function o(d, u, p, y, m, g, S, _) {
+ let O = u,
+ P;
+ return (
+ ({n: P, pos: u} = s(d, u, p, y, 16, m, g, !1, _, !S)),
+ P === null && (S ? _.invalidEscapeSequence(O, p, y) : (u = O - 1)),
+ {code: P, pos: u}
+ );
+ }
+ function s(d, u, p, y, m, g, S, _, O, P) {
+ let M = u,
+ w = m === 16 ? t.hex : t.decBinOct,
+ I = m === 16 ? n.hex : m === 10 ? n.dec : m === 8 ? n.oct : n.bin,
+ U = !1,
+ A = 0;
+ for (let q = 0, ae = g ?? 1 / 0; q < ae; ++q) {
+ let le = d.charCodeAt(u),
+ G;
+ if (le === 95 && _ !== 'bail') {
+ let ve = d.charCodeAt(u - 1),
+ de = d.charCodeAt(u + 1);
+ if (_) {
+ if (Number.isNaN(de) || !I(de) || w.has(ve) || w.has(de)) {
+ if (P) return {n: null, pos: u};
+ O.unexpectedNumericSeparator(u, p, y);
+ }
+ } else {
+ if (P) return {n: null, pos: u};
+ O.numericSeparatorInEscapeSequence(u, p, y);
+ }
+ ++u;
+ continue;
+ }
+ if (
+ (le >= 97
+ ? (G = le - 97 + 10)
+ : le >= 65
+ ? (G = le - 65 + 10)
+ : e(le)
+ ? (G = le - 48)
+ : (G = 1 / 0),
+ G >= m)
+ ) {
+ if (G <= 9 && P) return {n: null, pos: u};
+ if (G <= 9 && O.invalidDigit(u, p, y, m)) G = 0;
+ else if (S) (G = 0), (U = !0);
+ else break;
+ }
+ ++u, (A = A * m + G);
+ }
+ return u === M || (g != null && u - M !== g) || U
+ ? {n: null, pos: u}
+ : {n: A, pos: u};
+ }
+ function l(d, u, p, y, m, g) {
+ let S = d.charCodeAt(u),
+ _;
+ if (S === 123) {
+ if (
+ (++u,
+ ({code: _, pos: u} = o(d, u, p, y, d.indexOf('}', u) - u, !0, m, g)),
+ ++u,
+ _ !== null && _ > 1114111)
+ )
+ if (m) g.invalidCodePoint(u, p, y);
+ else return {code: null, pos: u};
+ } else ({code: _, pos: u} = o(d, u, p, y, 4, !1, m, g));
+ return {code: _, pos: u};
+ }
+ return za;
+ }
+ var Pt = {},
+ N_;
+ function Ea() {
+ if (N_) return Pt;
+ (N_ = 1),
+ Object.defineProperty(Pt, '__esModule', {value: !0}),
+ (Pt.UPDATE_OPERATORS =
+ Pt.UNARY_OPERATORS =
+ Pt.STRING_UNARY_OPERATORS =
+ Pt.STATEMENT_OR_BLOCK_KEYS =
+ Pt.NUMBER_UNARY_OPERATORS =
+ Pt.NUMBER_BINARY_OPERATORS =
+ Pt.NOT_LOCAL_BINDING =
+ Pt.LOGICAL_OPERATORS =
+ Pt.INHERIT_KEYS =
+ Pt.FOR_INIT_KEYS =
+ Pt.FLATTENABLE_KEYS =
+ Pt.EQUALITY_BINARY_OPERATORS =
+ Pt.COMPARISON_BINARY_OPERATORS =
+ Pt.COMMENT_KEYS =
+ Pt.BOOLEAN_UNARY_OPERATORS =
+ Pt.BOOLEAN_NUMBER_BINARY_OPERATORS =
+ Pt.BOOLEAN_BINARY_OPERATORS =
+ Pt.BLOCK_SCOPED_SYMBOL =
+ Pt.BINARY_OPERATORS =
+ Pt.ASSIGNMENT_OPERATORS =
+ void 0),
+ (Pt.STATEMENT_OR_BLOCK_KEYS = ['consequent', 'body', 'alternate']),
+ (Pt.FLATTENABLE_KEYS = ['body', 'expressions']),
+ (Pt.FOR_INIT_KEYS = ['left', 'init']),
+ (Pt.COMMENT_KEYS = [
+ 'leadingComments',
+ 'trailingComments',
+ 'innerComments',
+ ]);
+ let e = (Pt.LOGICAL_OPERATORS = ['||', '&&', '??']);
+ Pt.UPDATE_OPERATORS = ['++', '--'];
+ let t = (Pt.BOOLEAN_NUMBER_BINARY_OPERATORS = ['>', '<', '>=', '<=']),
+ n = (Pt.EQUALITY_BINARY_OPERATORS = ['==', '===', '!=', '!==']),
+ i = (Pt.COMPARISON_BINARY_OPERATORS = [...n, 'in', 'instanceof']),
+ r = (Pt.BOOLEAN_BINARY_OPERATORS = [...i, ...t]),
+ a = (Pt.NUMBER_BINARY_OPERATORS = [
+ '-',
+ '/',
+ '%',
+ '*',
+ '**',
+ '&',
+ '|',
+ '>>',
+ '>>>',
+ '<<',
+ '^',
+ ]);
+ (Pt.BINARY_OPERATORS = ['+', ...a, ...r, '|>']),
+ (Pt.ASSIGNMENT_OPERATORS = [
+ '=',
+ '+=',
+ ...a.map((d) => d + '='),
+ ...e.map((d) => d + '='),
+ ]);
+ let o = (Pt.BOOLEAN_UNARY_OPERATORS = ['delete', '!']),
+ s = (Pt.NUMBER_UNARY_OPERATORS = ['+', '-', '~']),
+ l = (Pt.STRING_UNARY_OPERATORS = ['typeof']);
+ return (
+ (Pt.UNARY_OPERATORS = ['void', 'throw', ...o, ...s, ...l]),
+ (Pt.INHERIT_KEYS = {
+ optional: ['typeAnnotation', 'typeParameters', 'returnType'],
+ force: ['start', 'loc', 'end'],
+ }),
+ (Pt.BLOCK_SCOPED_SYMBOL = Symbol.for('var used to be block scoped')),
+ (Pt.NOT_LOCAL_BINDING = Symbol.for(
+ 'should not be considered a local binding'
+ )),
+ Pt
+ );
+ }
+ var Ct = {},
+ R_;
+ function qi() {
+ if (R_) return Ct;
+ (R_ = 1),
+ Object.defineProperty(Ct, '__esModule', {value: !0}),
+ (Ct.VISITOR_KEYS =
+ Ct.NODE_PARENT_VALIDATIONS =
+ Ct.NODE_FIELDS =
+ Ct.FLIPPED_ALIAS_KEYS =
+ Ct.DEPRECATED_KEYS =
+ Ct.BUILDER_KEYS =
+ Ct.ALIAS_KEYS =
+ void 0),
+ (Ct.arrayOf = g),
+ (Ct.arrayOfType = S),
+ (Ct.assertEach = O),
+ (Ct.assertNodeOrValueType = w),
+ (Ct.assertNodeType = M),
+ (Ct.assertOneOf = P),
+ (Ct.assertOptionalChainStart = A),
+ (Ct.assertShape = U),
+ (Ct.assertValueType = I),
+ (Ct.chain = q),
+ (Ct.default = de),
+ (Ct.defineAliasedType = ve),
+ (Ct.validate = u),
+ (Ct.validateArrayOfType = _),
+ (Ct.validateOptional = y),
+ (Ct.validateOptionalType = m),
+ (Ct.validateType = p);
+ var e = Zu(),
+ t = lh();
+ let n = (Ct.VISITOR_KEYS = {}),
+ i = (Ct.ALIAS_KEYS = {}),
+ r = (Ct.FLIPPED_ALIAS_KEYS = {}),
+ a = (Ct.NODE_FIELDS = {}),
+ o = (Ct.BUILDER_KEYS = {}),
+ s = (Ct.DEPRECATED_KEYS = {}),
+ l = (Ct.NODE_PARENT_VALIDATIONS = {});
+ function d(oe) {
+ return Array.isArray(oe) ? 'array' : oe === null ? 'null' : typeof oe;
+ }
+ function u(oe) {
+ return {validate: oe};
+ }
+ function p(...oe) {
+ return u(M(...oe));
+ }
+ function y(oe) {
+ return {validate: oe, optional: !0};
+ }
+ function m(...oe) {
+ return {validate: M(...oe), optional: !0};
+ }
+ function g(oe) {
+ return q(I('array'), O(oe));
+ }
+ function S(...oe) {
+ return g(M(...oe));
+ }
+ function _(...oe) {
+ return u(S(...oe));
+ }
+ function O(oe) {
+ let be = process.env.BABEL_TYPES_8_BREAKING ? t.validateChild : () => {};
+ function $e(Ie, Pe, ke) {
+ if (Array.isArray(ke))
+ for (let je = 0; je < ke.length; je++) {
+ let Ae = `${Pe}[${je}]`,
+ Ye = ke[je];
+ oe(Ie, Ae, Ye), be(Ie, Ae, Ye);
+ }
+ }
+ return ($e.each = oe), $e;
+ }
+ function P(...oe) {
+ function be($e, Ie, Pe) {
+ if (!oe.includes(Pe))
+ throw new TypeError(
+ `Property ${Ie} expected value to be one of ${JSON.stringify(
+ oe
+ )} but got ${JSON.stringify(Pe)}`
+ );
+ }
+ return (be.oneOf = oe), be;
+ }
+ function M(...oe) {
+ function be($e, Ie, Pe) {
+ for (let ke of oe)
+ if ((0, e.default)(ke, Pe)) {
+ (0, t.validateChild)($e, Ie, Pe);
+ return;
+ }
+ throw new TypeError(
+ `Property ${Ie} of ${
+ $e.type
+ } expected node to be of a type ${JSON.stringify(
+ oe
+ )} but instead got ${JSON.stringify(Pe?.type)}`
+ );
+ }
+ return (be.oneOfNodeTypes = oe), be;
+ }
+ function w(...oe) {
+ function be($e, Ie, Pe) {
+ for (let ke of oe)
+ if (d(Pe) === ke || (0, e.default)(ke, Pe)) {
+ (0, t.validateChild)($e, Ie, Pe);
+ return;
+ }
+ throw new TypeError(
+ `Property ${Ie} of ${
+ $e.type
+ } expected node to be of a type ${JSON.stringify(
+ oe
+ )} but instead got ${JSON.stringify(Pe?.type)}`
+ );
+ }
+ return (be.oneOfNodeOrValueTypes = oe), be;
+ }
+ function I(oe) {
+ function be($e, Ie, Pe) {
+ if (!(d(Pe) === oe))
+ throw new TypeError(
+ `Property ${Ie} expected type of ${oe} but got ${d(Pe)}`
+ );
+ }
+ return (be.type = oe), be;
+ }
+ function U(oe) {
+ function be($e, Ie, Pe) {
+ let ke = [];
+ for (let je of Object.keys(oe))
+ try {
+ (0, t.validateField)($e, je, Pe[je], oe[je]);
+ } catch (Ae) {
+ if (Ae instanceof TypeError) {
+ ke.push(Ae.message);
+ continue;
+ }
+ throw Ae;
+ }
+ if (ke.length)
+ throw new TypeError(`Property ${Ie} of ${
+ $e.type
+ } expected to have the following:
+${ke.join(`
+`)}`);
+ }
+ return (be.shapeOf = oe), be;
+ }
+ function A() {
+ function oe(be) {
+ var $e;
+ let Ie = be;
+ for (; be; ) {
+ let {type: Pe} = Ie;
+ if (Pe === 'OptionalCallExpression') {
+ if (Ie.optional) return;
+ Ie = Ie.callee;
+ continue;
+ }
+ if (Pe === 'OptionalMemberExpression') {
+ if (Ie.optional) return;
+ Ie = Ie.object;
+ continue;
+ }
+ break;
+ }
+ throw new TypeError(
+ `Non-optional ${
+ be.type
+ } must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${
+ ($e = Ie) == null ? void 0 : $e.type
+ }`
+ );
+ }
+ return oe;
+ }
+ function q(...oe) {
+ function be(...$e) {
+ for (let Ie of oe) Ie(...$e);
+ }
+ if (
+ ((be.chainOf = oe),
+ oe.length >= 2 &&
+ 'type' in oe[0] &&
+ oe[0].type === 'array' &&
+ !('each' in oe[1]))
+ )
+ throw new Error(
+ 'An assertValueType("array") validator can only be followed by an assertEach(...) validator.'
+ );
+ return be;
+ }
+ let ae = new Set([
+ 'aliases',
+ 'builder',
+ 'deprecatedAlias',
+ 'fields',
+ 'inherits',
+ 'visitor',
+ 'validate',
+ ]),
+ le = new Set(['default', 'optional', 'deprecated', 'validate']),
+ G = {};
+ function ve(...oe) {
+ return (be, $e = {}) => {
+ let Ie = $e.aliases;
+ if (!Ie) {
+ var Pe, ke;
+ $e.inherits &&
+ (Ie = (Pe = G[$e.inherits].aliases) == null ? void 0 : Pe.slice()),
+ (ke = Ie) != null || (Ie = []),
+ ($e.aliases = Ie);
+ }
+ let je = oe.filter((Ae) => !Ie.includes(Ae));
+ Ie.unshift(...je), de(be, $e);
+ };
+ }
+ function de(oe, be = {}) {
+ let $e = (be.inherits && G[be.inherits]) || {},
+ Ie = be.fields;
+ if (!Ie && ((Ie = {}), $e.fields)) {
+ let Ae = Object.getOwnPropertyNames($e.fields);
+ for (let Ye of Ae) {
+ let bt = $e.fields[Ye],
+ st = bt.default;
+ if (Array.isArray(st) ? st.length > 0 : st && typeof st == 'object')
+ throw new Error(
+ 'field defaults can only be primitives or empty arrays currently'
+ );
+ Ie[Ye] = {
+ default: Array.isArray(st) ? [] : st,
+ optional: bt.optional,
+ deprecated: bt.deprecated,
+ validate: bt.validate,
+ };
+ }
+ }
+ let Pe = be.visitor || $e.visitor || [],
+ ke = be.aliases || $e.aliases || [],
+ je = be.builder || $e.builder || be.visitor || [];
+ for (let Ae of Object.keys(be))
+ if (!ae.has(Ae))
+ throw new Error(`Unknown type option "${Ae}" on ${oe}`);
+ be.deprecatedAlias && (s[be.deprecatedAlias] = oe);
+ for (let Ae of Pe.concat(je)) Ie[Ae] = Ie[Ae] || {};
+ for (let Ae of Object.keys(Ie)) {
+ let Ye = Ie[Ae];
+ Ye.default !== void 0 && !je.includes(Ae) && (Ye.optional = !0),
+ Ye.default === void 0
+ ? (Ye.default = null)
+ : !Ye.validate &&
+ Ye.default != null &&
+ (Ye.validate = I(d(Ye.default)));
+ for (let bt of Object.keys(Ye))
+ if (!le.has(bt))
+ throw new Error(`Unknown field key "${bt}" on ${oe}.${Ae}`);
+ }
+ (n[oe] = be.visitor = Pe),
+ (o[oe] = be.builder = je),
+ (a[oe] = be.fields = Ie),
+ (i[oe] = be.aliases = ke),
+ ke.forEach((Ae) => {
+ (r[Ae] = r[Ae] || []), r[Ae].push(oe);
+ }),
+ be.validate && (l[oe] = be.validate),
+ (G[oe] = be);
+ }
+ return Ct;
+ }
+ var L_;
+ function Zm() {
+ if (L_) return gn;
+ (L_ = 1),
+ Object.defineProperty(gn, '__esModule', {value: !0}),
+ (gn.patternLikeCommon =
+ gn.importAttributes =
+ gn.functionTypeAnnotationCommon =
+ gn.functionDeclarationCommon =
+ gn.functionCommon =
+ gn.classMethodOrPropertyCommon =
+ gn.classMethodOrDeclareMethodCommon =
+ void 0);
+ var e = Zu(),
+ t = qu(),
+ n = Um(),
+ i = LF(),
+ r = Ea(),
+ a = qi();
+ let o = (0, a.defineAliasedType)('Standardized');
+ o('ArrayExpression', {
+ fields: {
+ elements: {
+ validate: (0, a.arrayOf)(
+ (0, a.assertNodeOrValueType)('null', 'Expression', 'SpreadElement')
+ ),
+ default: process.env.BABEL_TYPES_8_BREAKING ? void 0 : [],
+ },
+ },
+ visitor: ['elements'],
+ aliases: ['Expression'],
+ }),
+ o('AssignmentExpression', {
+ fields: {
+ operator: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? Object.assign(
+ (function () {
+ let g = (0, a.assertOneOf)(...r.ASSIGNMENT_OPERATORS),
+ S = (0, a.assertOneOf)('=');
+ return function (_, O, P) {
+ ((0, e.default)('Pattern', _.left) ? S : g)(_, O, P);
+ };
+ })(),
+ {type: 'string'}
+ )
+ : (0, a.assertValueType)('string'),
+ },
+ left: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertNodeType)(
+ 'Identifier',
+ 'MemberExpression',
+ 'OptionalMemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression'
+ )
+ : (0, a.assertNodeType)('LVal', 'OptionalMemberExpression'),
+ },
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ },
+ builder: ['operator', 'left', 'right'],
+ visitor: ['left', 'right'],
+ aliases: ['Expression'],
+ }),
+ o('BinaryExpression', {
+ builder: ['operator', 'left', 'right'],
+ fields: {
+ operator: {validate: (0, a.assertOneOf)(...r.BINARY_OPERATORS)},
+ left: {
+ validate: (function () {
+ let g = (0, a.assertNodeType)('Expression'),
+ S = (0, a.assertNodeType)('Expression', 'PrivateName');
+ return Object.assign(
+ function (O, P, M) {
+ (O.operator === 'in' ? S : g)(O, P, M);
+ },
+ {oneOfNodeTypes: ['Expression', 'PrivateName']}
+ );
+ })(),
+ },
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ },
+ visitor: ['left', 'right'],
+ aliases: ['Binary', 'Expression'],
+ }),
+ o('InterpreterDirective', {
+ builder: ['value'],
+ fields: {value: {validate: (0, a.assertValueType)('string')}},
+ }),
+ o('Directive', {
+ visitor: ['value'],
+ fields: {value: {validate: (0, a.assertNodeType)('DirectiveLiteral')}},
+ }),
+ o('DirectiveLiteral', {
+ builder: ['value'],
+ fields: {value: {validate: (0, a.assertValueType)('string')}},
+ }),
+ o('BlockStatement', {
+ builder: ['body', 'directives'],
+ visitor: ['directives', 'body'],
+ fields: {
+ directives: {validate: (0, a.arrayOfType)('Directive'), default: []},
+ body: (0, a.validateArrayOfType)('Statement'),
+ },
+ aliases: ['Scopable', 'BlockParent', 'Block', 'Statement'],
+ }),
+ o('BreakStatement', {
+ visitor: ['label'],
+ fields: {
+ label: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ },
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ }),
+ o('CallExpression', {
+ visitor: ['callee', 'arguments', 'typeParameters', 'typeArguments'],
+ builder: ['callee', 'arguments'],
+ aliases: ['Expression'],
+ fields: Object.assign(
+ {
+ callee: {
+ validate: (0, a.assertNodeType)(
+ 'Expression',
+ 'Super',
+ 'V8IntrinsicIdentifier'
+ ),
+ },
+ arguments: (0, a.validateArrayOfType)(
+ 'Expression',
+ 'SpreadElement',
+ 'ArgumentPlaceholder'
+ ),
+ },
+ process.env.BABEL_TYPES_8_BREAKING
+ ? {}
+ : {
+ optional: {
+ validate: (0, a.assertValueType)('boolean'),
+ optional: !0,
+ },
+ },
+ {
+ typeArguments: {
+ validate: (0, a.assertNodeType)('TypeParameterInstantiation'),
+ optional: !0,
+ },
+ typeParameters: {
+ validate: (0, a.assertNodeType)('TSTypeParameterInstantiation'),
+ optional: !0,
+ },
+ }
+ ),
+ }),
+ o('CatchClause', {
+ visitor: ['param', 'body'],
+ fields: {
+ param: {
+ validate: (0, a.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern'
+ ),
+ optional: !0,
+ },
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ },
+ aliases: ['Scopable', 'BlockParent'],
+ }),
+ o('ConditionalExpression', {
+ visitor: ['test', 'consequent', 'alternate'],
+ fields: {
+ test: {validate: (0, a.assertNodeType)('Expression')},
+ consequent: {validate: (0, a.assertNodeType)('Expression')},
+ alternate: {validate: (0, a.assertNodeType)('Expression')},
+ },
+ aliases: ['Expression', 'Conditional'],
+ }),
+ o('ContinueStatement', {
+ visitor: ['label'],
+ fields: {
+ label: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ },
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ }),
+ o('DebuggerStatement', {aliases: ['Statement']}),
+ o('DoWhileStatement', {
+ builder: ['test', 'body'],
+ visitor: ['body', 'test'],
+ fields: {
+ test: {validate: (0, a.assertNodeType)('Expression')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ aliases: ['Statement', 'BlockParent', 'Loop', 'While', 'Scopable'],
+ }),
+ o('EmptyStatement', {aliases: ['Statement']}),
+ o('ExpressionStatement', {
+ visitor: ['expression'],
+ fields: {expression: {validate: (0, a.assertNodeType)('Expression')}},
+ aliases: ['Statement', 'ExpressionWrapper'],
+ }),
+ o('File', {
+ builder: ['program', 'comments', 'tokens'],
+ visitor: ['program'],
+ fields: {
+ program: {validate: (0, a.assertNodeType)('Program')},
+ comments: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertEach)(
+ (0, a.assertNodeType)('CommentBlock', 'CommentLine')
+ )
+ : Object.assign(() => {}, {
+ each: {oneOfNodeTypes: ['CommentBlock', 'CommentLine']},
+ }),
+ optional: !0,
+ },
+ tokens: {
+ validate: (0, a.assertEach)(Object.assign(() => {}, {type: 'any'})),
+ optional: !0,
+ },
+ },
+ }),
+ o('ForInStatement', {
+ visitor: ['left', 'right', 'body'],
+ aliases: [
+ 'Scopable',
+ 'Statement',
+ 'For',
+ 'BlockParent',
+ 'Loop',
+ 'ForXStatement',
+ ],
+ fields: {
+ left: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertNodeType)(
+ 'VariableDeclaration',
+ 'Identifier',
+ 'MemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression'
+ )
+ : (0, a.assertNodeType)('VariableDeclaration', 'LVal'),
+ },
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ }),
+ o('ForStatement', {
+ visitor: ['init', 'test', 'update', 'body'],
+ aliases: ['Scopable', 'Statement', 'For', 'BlockParent', 'Loop'],
+ fields: {
+ init: {
+ validate: (0, a.assertNodeType)(
+ 'VariableDeclaration',
+ 'Expression'
+ ),
+ optional: !0,
+ },
+ test: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ update: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ });
+ let s = () => ({
+ params: (0, a.validateArrayOfType)(
+ 'Identifier',
+ 'Pattern',
+ 'RestElement'
+ ),
+ generator: {default: !1},
+ async: {default: !1},
+ });
+ gn.functionCommon = s;
+ let l = () => ({
+ returnType: {
+ validate: (0, a.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ typeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ });
+ gn.functionTypeAnnotationCommon = l;
+ let d = () =>
+ Object.assign({}, s(), {
+ declare: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ id: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ });
+ (gn.functionDeclarationCommon = d),
+ o('FunctionDeclaration', {
+ builder: ['id', 'params', 'body', 'generator', 'async'],
+ visitor: ['id', 'typeParameters', 'params', 'returnType', 'body'],
+ fields: Object.assign({}, d(), l(), {
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ predicate: {
+ validate: (0, a.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate'
+ ),
+ optional: !0,
+ },
+ }),
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Statement',
+ 'Pureish',
+ 'Declaration',
+ ],
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (function () {
+ let g = (0, a.assertNodeType)('Identifier');
+ return function (S, _, O) {
+ (0, e.default)('ExportDefaultDeclaration', S) ||
+ g(O, 'id', O.id);
+ };
+ })()
+ : void 0,
+ }),
+ o('FunctionExpression', {
+ inherits: 'FunctionDeclaration',
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Expression',
+ 'Pureish',
+ ],
+ fields: Object.assign({}, s(), l(), {
+ id: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ predicate: {
+ validate: (0, a.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate'
+ ),
+ optional: !0,
+ },
+ }),
+ });
+ let u = () => ({
+ typeAnnotation: {
+ validate: (0, a.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ optional: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ });
+ (gn.patternLikeCommon = u),
+ o('Identifier', {
+ builder: ['name'],
+ visitor: ['typeAnnotation', 'decorators'],
+ aliases: ['Expression', 'PatternLike', 'LVal', 'TSEntityName'],
+ fields: Object.assign({}, u(), {
+ name: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('string'),
+ Object.assign(
+ function (g, S, _) {
+ if (!(0, t.default)(_, !1))
+ throw new TypeError(
+ `"${_}" is not a valid identifier name`
+ );
+ },
+ {type: 'string'}
+ )
+ )
+ : (0, a.assertValueType)('string'),
+ },
+ }),
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? function (g, S, _) {
+ let O = /\.(\w+)$/.exec(S);
+ if (!O) return;
+ let [, P] = O,
+ M = {computed: !1};
+ if (P === 'property') {
+ if (
+ (0, e.default)('MemberExpression', g, M) ||
+ (0, e.default)('OptionalMemberExpression', g, M)
+ )
+ return;
+ } else if (P === 'key') {
+ if (
+ (0, e.default)('Property', g, M) ||
+ (0, e.default)('Method', g, M)
+ )
+ return;
+ } else if (P === 'exported') {
+ if ((0, e.default)('ExportSpecifier', g)) return;
+ } else if (P === 'imported') {
+ if ((0, e.default)('ImportSpecifier', g, {imported: _})) return;
+ } else if (
+ P === 'meta' &&
+ (0, e.default)('MetaProperty', g, {meta: _})
+ )
+ return;
+ if (
+ ((0, n.isKeyword)(_.name) ||
+ (0, n.isReservedWord)(_.name, !1)) &&
+ _.name !== 'this'
+ )
+ throw new TypeError(`"${_.name}" is not a valid identifier`);
+ }
+ : void 0,
+ }),
+ o('IfStatement', {
+ visitor: ['test', 'consequent', 'alternate'],
+ aliases: ['Statement', 'Conditional'],
+ fields: {
+ test: {validate: (0, a.assertNodeType)('Expression')},
+ consequent: {validate: (0, a.assertNodeType)('Statement')},
+ alternate: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('Statement'),
+ },
+ },
+ }),
+ o('LabeledStatement', {
+ visitor: ['label', 'body'],
+ aliases: ['Statement'],
+ fields: {
+ label: {validate: (0, a.assertNodeType)('Identifier')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ }),
+ o('StringLiteral', {
+ builder: ['value'],
+ fields: {value: {validate: (0, a.assertValueType)('string')}},
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ o('NumericLiteral', {
+ builder: ['value'],
+ deprecatedAlias: 'NumberLiteral',
+ fields: {
+ value: {
+ validate: (0, a.chain)(
+ (0, a.assertValueType)('number'),
+ Object.assign(function (g, S, _) {}, {type: 'number'})
+ ),
+ },
+ },
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ o('NullLiteral', {
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ o('BooleanLiteral', {
+ builder: ['value'],
+ fields: {value: {validate: (0, a.assertValueType)('boolean')}},
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ o('RegExpLiteral', {
+ builder: ['pattern', 'flags'],
+ deprecatedAlias: 'RegexLiteral',
+ aliases: ['Expression', 'Pureish', 'Literal'],
+ fields: {
+ pattern: {validate: (0, a.assertValueType)('string')},
+ flags: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('string'),
+ Object.assign(
+ function (g, S, _) {
+ let O = /[^gimsuy]/.exec(_);
+ if (O)
+ throw new TypeError(
+ `"${O[0]}" is not a valid RegExp flag`
+ );
+ },
+ {type: 'string'}
+ )
+ )
+ : (0, a.assertValueType)('string'),
+ default: '',
+ },
+ },
+ }),
+ o('LogicalExpression', {
+ builder: ['operator', 'left', 'right'],
+ visitor: ['left', 'right'],
+ aliases: ['Binary', 'Expression'],
+ fields: {
+ operator: {validate: (0, a.assertOneOf)(...r.LOGICAL_OPERATORS)},
+ left: {validate: (0, a.assertNodeType)('Expression')},
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ },
+ }),
+ o('MemberExpression', {
+ builder: [
+ 'object',
+ 'property',
+ 'computed',
+ ...(process.env.BABEL_TYPES_8_BREAKING ? [] : ['optional']),
+ ],
+ visitor: ['object', 'property'],
+ aliases: ['Expression', 'LVal'],
+ fields: Object.assign(
+ {
+ object: {validate: (0, a.assertNodeType)('Expression', 'Super')},
+ property: {
+ validate: (function () {
+ let g = (0, a.assertNodeType)('Identifier', 'PrivateName'),
+ S = (0, a.assertNodeType)('Expression'),
+ _ = function (O, P, M) {
+ (O.computed ? S : g)(O, P, M);
+ };
+ return (
+ (_.oneOfNodeTypes = [
+ 'Expression',
+ 'Identifier',
+ 'PrivateName',
+ ]),
+ _
+ );
+ })(),
+ },
+ computed: {default: !1},
+ },
+ process.env.BABEL_TYPES_8_BREAKING
+ ? {}
+ : {
+ optional: {
+ validate: (0, a.assertValueType)('boolean'),
+ optional: !0,
+ },
+ }
+ ),
+ }),
+ o('NewExpression', {inherits: 'CallExpression'}),
+ o('Program', {
+ visitor: ['directives', 'body'],
+ builder: ['body', 'directives', 'sourceType', 'interpreter'],
+ fields: {
+ sourceType: {
+ validate: (0, a.assertOneOf)('script', 'module'),
+ default: 'script',
+ },
+ interpreter: {
+ validate: (0, a.assertNodeType)('InterpreterDirective'),
+ default: null,
+ optional: !0,
+ },
+ directives: {validate: (0, a.arrayOfType)('Directive'), default: []},
+ body: (0, a.validateArrayOfType)('Statement'),
+ },
+ aliases: ['Scopable', 'BlockParent', 'Block'],
+ }),
+ o('ObjectExpression', {
+ visitor: ['properties'],
+ aliases: ['Expression'],
+ fields: {
+ properties: (0, a.validateArrayOfType)(
+ 'ObjectMethod',
+ 'ObjectProperty',
+ 'SpreadElement'
+ ),
+ },
+ }),
+ o('ObjectMethod', {
+ builder: [
+ 'kind',
+ 'key',
+ 'params',
+ 'body',
+ 'computed',
+ 'generator',
+ 'async',
+ ],
+ visitor: [
+ 'decorators',
+ 'key',
+ 'typeParameters',
+ 'params',
+ 'returnType',
+ 'body',
+ ],
+ fields: Object.assign({}, s(), l(), {
+ kind: Object.assign(
+ {validate: (0, a.assertOneOf)('method', 'get', 'set')},
+ process.env.BABEL_TYPES_8_BREAKING ? {} : {default: 'method'}
+ ),
+ computed: {default: !1},
+ key: {
+ validate: (function () {
+ let g = (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral'
+ ),
+ S = (0, a.assertNodeType)('Expression'),
+ _ = function (O, P, M) {
+ (O.computed ? S : g)(O, P, M);
+ };
+ return (
+ (_.oneOfNodeTypes = [
+ 'Expression',
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ ]),
+ _
+ );
+ })(),
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ }),
+ aliases: [
+ 'UserWhitespacable',
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ 'ObjectMember',
+ ],
+ }),
+ o('ObjectProperty', {
+ builder: [
+ 'key',
+ 'value',
+ 'computed',
+ 'shorthand',
+ ...(process.env.BABEL_TYPES_8_BREAKING ? [] : ['decorators']),
+ ],
+ fields: {
+ computed: {default: !1},
+ key: {
+ validate: (function () {
+ let g = (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'DecimalLiteral',
+ 'PrivateName'
+ ),
+ S = (0, a.assertNodeType)('Expression');
+ return Object.assign(
+ function (O, P, M) {
+ (O.computed ? S : g)(O, P, M);
+ },
+ {
+ oneOfNodeTypes: [
+ 'Expression',
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'DecimalLiteral',
+ 'PrivateName',
+ ],
+ }
+ );
+ })(),
+ },
+ value: {validate: (0, a.assertNodeType)('Expression', 'PatternLike')},
+ shorthand: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('boolean'),
+ Object.assign(
+ function (g, S, _) {
+ if (_) {
+ if (g.computed)
+ throw new TypeError(
+ 'Property shorthand of ObjectProperty cannot be true if computed is true'
+ );
+ if (!(0, e.default)('Identifier', g.key))
+ throw new TypeError(
+ 'Property shorthand of ObjectProperty cannot be true if key is not an Identifier'
+ );
+ }
+ },
+ {type: 'boolean'}
+ )
+ )
+ : (0, a.assertValueType)('boolean'),
+ default: !1,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ },
+ visitor: ['key', 'value', 'decorators'],
+ aliases: ['UserWhitespacable', 'Property', 'ObjectMember'],
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (function () {
+ let g = (0, a.assertNodeType)(
+ 'Identifier',
+ 'Pattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSNonNullExpression',
+ 'TSTypeAssertion'
+ ),
+ S = (0, a.assertNodeType)('Expression');
+ return function (_, O, P) {
+ ((0, e.default)('ObjectPattern', _) ? g : S)(
+ P,
+ 'value',
+ P.value
+ );
+ };
+ })()
+ : void 0,
+ }),
+ o('RestElement', {
+ visitor: ['argument', 'typeAnnotation'],
+ builder: ['argument'],
+ aliases: ['LVal', 'PatternLike'],
+ deprecatedAlias: 'RestProperty',
+ fields: Object.assign({}, u(), {
+ argument: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'MemberExpression',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression'
+ )
+ : (0, a.assertNodeType)('LVal'),
+ },
+ }),
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? function (g, S) {
+ let _ = /(\w+)\[(\d+)\]/.exec(S);
+ if (!_) throw new Error('Internal Babel error: malformed key.');
+ let [, O, P] = _;
+ if (g[O].length > +P + 1)
+ throw new TypeError(`RestElement must be last element of ${O}`);
+ }
+ : void 0,
+ }),
+ o('ReturnStatement', {
+ visitor: ['argument'],
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ fields: {
+ argument: {
+ validate: (0, a.assertNodeType)('Expression'),
+ optional: !0,
+ },
+ },
+ }),
+ o('SequenceExpression', {
+ visitor: ['expressions'],
+ fields: {expressions: (0, a.validateArrayOfType)('Expression')},
+ aliases: ['Expression'],
+ }),
+ o('ParenthesizedExpression', {
+ visitor: ['expression'],
+ aliases: ['Expression', 'ExpressionWrapper'],
+ fields: {expression: {validate: (0, a.assertNodeType)('Expression')}},
+ }),
+ o('SwitchCase', {
+ visitor: ['test', 'consequent'],
+ fields: {
+ test: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ consequent: (0, a.validateArrayOfType)('Statement'),
+ },
+ }),
+ o('SwitchStatement', {
+ visitor: ['discriminant', 'cases'],
+ aliases: ['Statement', 'BlockParent', 'Scopable'],
+ fields: {
+ discriminant: {validate: (0, a.assertNodeType)('Expression')},
+ cases: (0, a.validateArrayOfType)('SwitchCase'),
+ },
+ }),
+ o('ThisExpression', {aliases: ['Expression']}),
+ o('ThrowStatement', {
+ visitor: ['argument'],
+ aliases: ['Statement', 'Terminatorless', 'CompletionStatement'],
+ fields: {argument: {validate: (0, a.assertNodeType)('Expression')}},
+ }),
+ o('TryStatement', {
+ visitor: ['block', 'handler', 'finalizer'],
+ aliases: ['Statement'],
+ fields: {
+ block: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertNodeType)('BlockStatement'),
+ Object.assign(
+ function (g) {
+ if (!g.handler && !g.finalizer)
+ throw new TypeError(
+ 'TryStatement expects either a handler or finalizer, or both'
+ );
+ },
+ {oneOfNodeTypes: ['BlockStatement']}
+ )
+ )
+ : (0, a.assertNodeType)('BlockStatement'),
+ },
+ handler: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('CatchClause'),
+ },
+ finalizer: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('BlockStatement'),
+ },
+ },
+ }),
+ o('UnaryExpression', {
+ builder: ['operator', 'argument', 'prefix'],
+ fields: {
+ prefix: {default: !0},
+ argument: {validate: (0, a.assertNodeType)('Expression')},
+ operator: {validate: (0, a.assertOneOf)(...r.UNARY_OPERATORS)},
+ },
+ visitor: ['argument'],
+ aliases: ['UnaryLike', 'Expression'],
+ }),
+ o('UpdateExpression', {
+ builder: ['operator', 'argument', 'prefix'],
+ fields: {
+ prefix: {default: !1},
+ argument: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertNodeType)('Identifier', 'MemberExpression')
+ : (0, a.assertNodeType)('Expression'),
+ },
+ operator: {validate: (0, a.assertOneOf)(...r.UPDATE_OPERATORS)},
+ },
+ visitor: ['argument'],
+ aliases: ['Expression'],
+ }),
+ o('VariableDeclaration', {
+ builder: ['kind', 'declarations'],
+ visitor: ['declarations'],
+ aliases: ['Statement', 'Declaration'],
+ fields: {
+ declare: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ kind: {
+ validate: (0, a.assertOneOf)(
+ 'var',
+ 'let',
+ 'const',
+ 'using',
+ 'await using'
+ ),
+ },
+ declarations: (0, a.validateArrayOfType)('VariableDeclarator'),
+ },
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (() => {
+ let g = (0, a.assertNodeType)('Identifier');
+ return function (S, _, O) {
+ if ((0, e.default)('ForXStatement', S, {left: O})) {
+ if (O.declarations.length !== 1)
+ throw new TypeError(
+ `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${S.type}`
+ );
+ } else
+ O.declarations.forEach((P) => {
+ P.init || g(P, 'id', P.id);
+ });
+ };
+ })()
+ : void 0,
+ }),
+ o('VariableDeclarator', {
+ visitor: ['id', 'init'],
+ fields: {
+ id: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.assertNodeType)(
+ 'Identifier',
+ 'ArrayPattern',
+ 'ObjectPattern'
+ )
+ : (0, a.assertNodeType)('LVal'),
+ },
+ definite: {optional: !0, validate: (0, a.assertValueType)('boolean')},
+ init: {optional: !0, validate: (0, a.assertNodeType)('Expression')},
+ },
+ }),
+ o('WhileStatement', {
+ visitor: ['test', 'body'],
+ aliases: ['Statement', 'BlockParent', 'Loop', 'While', 'Scopable'],
+ fields: {
+ test: {validate: (0, a.assertNodeType)('Expression')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ }),
+ o('WithStatement', {
+ visitor: ['object', 'body'],
+ aliases: ['Statement'],
+ fields: {
+ object: {validate: (0, a.assertNodeType)('Expression')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ },
+ }),
+ o('AssignmentPattern', {
+ visitor: ['left', 'right', 'decorators'],
+ builder: ['left', 'right'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, u(), {
+ left: {
+ validate: (0, a.assertNodeType)(
+ 'Identifier',
+ 'ObjectPattern',
+ 'ArrayPattern',
+ 'MemberExpression',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression'
+ ),
+ },
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ }),
+ }),
+ o('ArrayPattern', {
+ visitor: ['elements', 'typeAnnotation'],
+ builder: ['elements'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, u(), {
+ elements: {
+ validate: (0, a.chain)(
+ (0, a.assertValueType)('array'),
+ (0, a.assertEach)(
+ (0, a.assertNodeOrValueType)('null', 'PatternLike', 'LVal')
+ )
+ ),
+ },
+ }),
+ }),
+ o('ArrowFunctionExpression', {
+ builder: ['params', 'body', 'async'],
+ visitor: ['typeParameters', 'params', 'returnType', 'body'],
+ aliases: [
+ 'Scopable',
+ 'Function',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Expression',
+ 'Pureish',
+ ],
+ fields: Object.assign({}, s(), l(), {
+ expression: {validate: (0, a.assertValueType)('boolean')},
+ body: {
+ validate: (0, a.assertNodeType)('BlockStatement', 'Expression'),
+ },
+ predicate: {
+ validate: (0, a.assertNodeType)(
+ 'DeclaredPredicate',
+ 'InferredPredicate'
+ ),
+ optional: !0,
+ },
+ }),
+ }),
+ o('ClassBody', {
+ visitor: ['body'],
+ fields: {
+ body: (0, a.validateArrayOfType)(
+ 'ClassMethod',
+ 'ClassPrivateMethod',
+ 'ClassProperty',
+ 'ClassPrivateProperty',
+ 'ClassAccessorProperty',
+ 'TSDeclareMethod',
+ 'TSIndexSignature',
+ 'StaticBlock'
+ ),
+ },
+ }),
+ o('ClassExpression', {
+ builder: ['id', 'superClass', 'body', 'decorators'],
+ visitor: [
+ 'decorators',
+ 'id',
+ 'typeParameters',
+ 'superClass',
+ 'superTypeParameters',
+ 'mixins',
+ 'implements',
+ 'body',
+ ],
+ aliases: ['Scopable', 'Class', 'Expression'],
+ fields: {
+ id: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ typeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ body: {validate: (0, a.assertNodeType)('ClassBody')},
+ superClass: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('Expression'),
+ },
+ superTypeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation'
+ ),
+ optional: !0,
+ },
+ implements: {
+ validate: (0, a.arrayOfType)(
+ 'TSExpressionWithTypeArguments',
+ 'ClassImplements'
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ mixins: {
+ validate: (0, a.assertNodeType)('InterfaceExtends'),
+ optional: !0,
+ },
+ },
+ }),
+ o('ClassDeclaration', {
+ inherits: 'ClassExpression',
+ aliases: ['Scopable', 'Class', 'Statement', 'Declaration'],
+ fields: {
+ id: {validate: (0, a.assertNodeType)('Identifier'), optional: !0},
+ typeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterDeclaration',
+ 'TSTypeParameterDeclaration',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ body: {validate: (0, a.assertNodeType)('ClassBody')},
+ superClass: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('Expression'),
+ },
+ superTypeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation'
+ ),
+ optional: !0,
+ },
+ implements: {
+ validate: (0, a.arrayOfType)(
+ 'TSExpressionWithTypeArguments',
+ 'ClassImplements'
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ mixins: {
+ validate: (0, a.assertNodeType)('InterfaceExtends'),
+ optional: !0,
+ },
+ declare: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ abstract: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ },
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (function () {
+ let g = (0, a.assertNodeType)('Identifier');
+ return function (S, _, O) {
+ (0, e.default)('ExportDefaultDeclaration', S) ||
+ g(O, 'id', O.id);
+ };
+ })()
+ : void 0,
+ });
+ let p = (gn.importAttributes = {
+ attributes: {
+ optional: !0,
+ validate: (0, a.arrayOfType)('ImportAttribute'),
+ },
+ assertions: {
+ deprecated: !0,
+ optional: !0,
+ validate: (0, a.arrayOfType)('ImportAttribute'),
+ },
+ });
+ o('ExportAllDeclaration', {
+ builder: ['source'],
+ visitor: ['source', 'attributes', 'assertions'],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: Object.assign(
+ {
+ source: {validate: (0, a.assertNodeType)('StringLiteral')},
+ exportKind: (0, a.validateOptional)(
+ (0, a.assertOneOf)('type', 'value')
+ ),
+ },
+ p
+ ),
+ }),
+ o('ExportDefaultDeclaration', {
+ visitor: ['declaration'],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: {
+ declaration: (0, a.validateType)(
+ 'TSDeclareFunction',
+ 'FunctionDeclaration',
+ 'ClassDeclaration',
+ 'Expression'
+ ),
+ exportKind: (0, a.validateOptional)((0, a.assertOneOf)('value')),
+ },
+ }),
+ o('ExportNamedDeclaration', {
+ builder: ['declaration', 'specifiers', 'source'],
+ visitor: process.env
+ ? ['declaration', 'specifiers', 'source', 'attributes']
+ : ['declaration', 'specifiers', 'source', 'attributes', 'assertions'],
+ aliases: [
+ 'Statement',
+ 'Declaration',
+ 'ImportOrExportDeclaration',
+ 'ExportDeclaration',
+ ],
+ fields: Object.assign(
+ {
+ declaration: {
+ optional: !0,
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertNodeType)('Declaration'),
+ Object.assign(
+ function (g, S, _) {
+ if (_ && g.specifiers.length)
+ throw new TypeError(
+ 'Only declaration or specifiers is allowed on ExportNamedDeclaration'
+ );
+ if (_ && g.source)
+ throw new TypeError(
+ 'Cannot export a declaration from a source'
+ );
+ },
+ {oneOfNodeTypes: ['Declaration']}
+ )
+ )
+ : (0, a.assertNodeType)('Declaration'),
+ },
+ },
+ p,
+ {
+ specifiers: {
+ default: [],
+ validate: (0, a.arrayOf)(
+ (function () {
+ let g = (0, a.assertNodeType)(
+ 'ExportSpecifier',
+ 'ExportDefaultSpecifier',
+ 'ExportNamespaceSpecifier'
+ ),
+ S = (0, a.assertNodeType)('ExportSpecifier');
+ return process.env.BABEL_TYPES_8_BREAKING
+ ? Object.assign(
+ function (_, O, P) {
+ (_.source ? g : S)(_, O, P);
+ },
+ {
+ oneOfNodeTypes: [
+ 'ExportSpecifier',
+ 'ExportDefaultSpecifier',
+ 'ExportNamespaceSpecifier',
+ ],
+ }
+ )
+ : g;
+ })()
+ ),
+ },
+ source: {
+ validate: (0, a.assertNodeType)('StringLiteral'),
+ optional: !0,
+ },
+ exportKind: (0, a.validateOptional)(
+ (0, a.assertOneOf)('type', 'value')
+ ),
+ }
+ ),
+ }),
+ o('ExportSpecifier', {
+ visitor: ['local', 'exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {
+ local: {validate: (0, a.assertNodeType)('Identifier')},
+ exported: {
+ validate: (0, a.assertNodeType)('Identifier', 'StringLiteral'),
+ },
+ exportKind: {
+ validate: (0, a.assertOneOf)('type', 'value'),
+ optional: !0,
+ },
+ },
+ }),
+ o('ForOfStatement', {
+ visitor: ['left', 'right', 'body'],
+ builder: ['left', 'right', 'body', 'await'],
+ aliases: [
+ 'Scopable',
+ 'Statement',
+ 'For',
+ 'BlockParent',
+ 'Loop',
+ 'ForXStatement',
+ ],
+ fields: {
+ left: {
+ validate: (function () {
+ if (!process.env.BABEL_TYPES_8_BREAKING)
+ return (0, a.assertNodeType)('VariableDeclaration', 'LVal');
+ let g = (0, a.assertNodeType)('VariableDeclaration'),
+ S = (0, a.assertNodeType)(
+ 'Identifier',
+ 'MemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression'
+ );
+ return Object.assign(
+ function (_, O, P) {
+ (0, e.default)('VariableDeclaration', P)
+ ? g(_, O, P)
+ : S(_, O, P);
+ },
+ {
+ oneOfNodeTypes: [
+ 'VariableDeclaration',
+ 'Identifier',
+ 'MemberExpression',
+ 'ArrayPattern',
+ 'ObjectPattern',
+ 'TSAsExpression',
+ 'TSSatisfiesExpression',
+ 'TSTypeAssertion',
+ 'TSNonNullExpression',
+ ],
+ }
+ );
+ })(),
+ },
+ right: {validate: (0, a.assertNodeType)('Expression')},
+ body: {validate: (0, a.assertNodeType)('Statement')},
+ await: {default: !1},
+ },
+ }),
+ o('ImportDeclaration', {
+ builder: ['specifiers', 'source'],
+ visitor: ['specifiers', 'source', 'attributes', 'assertions'],
+ aliases: ['Statement', 'Declaration', 'ImportOrExportDeclaration'],
+ fields: Object.assign({}, p, {
+ module: {optional: !0, validate: (0, a.assertValueType)('boolean')},
+ phase: {
+ default: null,
+ validate: (0, a.assertOneOf)('source', 'defer'),
+ },
+ specifiers: (0, a.validateArrayOfType)(
+ 'ImportSpecifier',
+ 'ImportDefaultSpecifier',
+ 'ImportNamespaceSpecifier'
+ ),
+ source: {validate: (0, a.assertNodeType)('StringLiteral')},
+ importKind: {
+ validate: (0, a.assertOneOf)('type', 'typeof', 'value'),
+ optional: !0,
+ },
+ }),
+ }),
+ o('ImportDefaultSpecifier', {
+ visitor: ['local'],
+ aliases: ['ModuleSpecifier'],
+ fields: {local: {validate: (0, a.assertNodeType)('Identifier')}},
+ }),
+ o('ImportNamespaceSpecifier', {
+ visitor: ['local'],
+ aliases: ['ModuleSpecifier'],
+ fields: {local: {validate: (0, a.assertNodeType)('Identifier')}},
+ }),
+ o('ImportSpecifier', {
+ visitor: ['imported', 'local'],
+ builder: ['local', 'imported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {
+ local: {validate: (0, a.assertNodeType)('Identifier')},
+ imported: {
+ validate: (0, a.assertNodeType)('Identifier', 'StringLiteral'),
+ },
+ importKind: {
+ validate: (0, a.assertOneOf)('type', 'typeof', 'value'),
+ optional: !0,
+ },
+ },
+ }),
+ o('ImportExpression', {
+ visitor: ['source', 'options'],
+ aliases: ['Expression'],
+ fields: {
+ phase: {
+ default: null,
+ validate: (0, a.assertOneOf)('source', 'defer'),
+ },
+ source: {validate: (0, a.assertNodeType)('Expression')},
+ options: {
+ validate: (0, a.assertNodeType)('Expression'),
+ optional: !0,
+ },
+ },
+ }),
+ o('MetaProperty', {
+ visitor: ['meta', 'property'],
+ aliases: ['Expression'],
+ fields: {
+ meta: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertNodeType)('Identifier'),
+ Object.assign(
+ function (g, S, _) {
+ let O;
+ switch (_.name) {
+ case 'function':
+ O = 'sent';
+ break;
+ case 'new':
+ O = 'target';
+ break;
+ case 'import':
+ O = 'meta';
+ break;
+ }
+ if (!(0, e.default)('Identifier', g.property, {name: O}))
+ throw new TypeError('Unrecognised MetaProperty');
+ },
+ {oneOfNodeTypes: ['Identifier']}
+ )
+ )
+ : (0, a.assertNodeType)('Identifier'),
+ },
+ property: {validate: (0, a.assertNodeType)('Identifier')},
+ },
+ });
+ let y = () => ({
+ abstract: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ accessibility: {
+ validate: (0, a.assertOneOf)('public', 'private', 'protected'),
+ optional: !0,
+ },
+ static: {default: !1},
+ override: {default: !1},
+ computed: {default: !1},
+ optional: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ key: {
+ validate: (0, a.chain)(
+ (function () {
+ let g = (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral'
+ ),
+ S = (0, a.assertNodeType)('Expression');
+ return function (_, O, P) {
+ (_.computed ? S : g)(_, O, P);
+ };
+ })(),
+ (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'Expression'
+ )
+ ),
+ },
+ });
+ gn.classMethodOrPropertyCommon = y;
+ let m = () =>
+ Object.assign({}, s(), y(), {
+ params: (0, a.validateArrayOfType)(
+ 'Identifier',
+ 'Pattern',
+ 'RestElement',
+ 'TSParameterProperty'
+ ),
+ kind: {
+ validate: (0, a.assertOneOf)('get', 'set', 'method', 'constructor'),
+ default: 'method',
+ },
+ access: {
+ validate: (0, a.chain)(
+ (0, a.assertValueType)('string'),
+ (0, a.assertOneOf)('public', 'private', 'protected')
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ });
+ return (
+ (gn.classMethodOrDeclareMethodCommon = m),
+ o('ClassMethod', {
+ aliases: [
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ ],
+ builder: [
+ 'kind',
+ 'key',
+ 'params',
+ 'body',
+ 'computed',
+ 'static',
+ 'generator',
+ 'async',
+ ],
+ visitor: [
+ 'decorators',
+ 'key',
+ 'typeParameters',
+ 'params',
+ 'returnType',
+ 'body',
+ ],
+ fields: Object.assign({}, m(), l(), {
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ }),
+ }),
+ o('ObjectPattern', {
+ visitor: ['properties', 'typeAnnotation', 'decorators'],
+ builder: ['properties'],
+ aliases: ['Pattern', 'PatternLike', 'LVal'],
+ fields: Object.assign({}, u(), {
+ properties: (0, a.validateArrayOfType)(
+ 'RestElement',
+ 'ObjectProperty'
+ ),
+ }),
+ }),
+ o('SpreadElement', {
+ visitor: ['argument'],
+ aliases: ['UnaryLike'],
+ deprecatedAlias: 'SpreadProperty',
+ fields: {argument: {validate: (0, a.assertNodeType)('Expression')}},
+ }),
+ o('Super', {aliases: ['Expression']}),
+ o('TaggedTemplateExpression', {
+ visitor: ['tag', 'typeParameters', 'quasi'],
+ builder: ['tag', 'quasi'],
+ aliases: ['Expression'],
+ fields: {
+ tag: {validate: (0, a.assertNodeType)('Expression')},
+ quasi: {validate: (0, a.assertNodeType)('TemplateLiteral')},
+ typeParameters: {
+ validate: (0, a.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation'
+ ),
+ optional: !0,
+ },
+ },
+ }),
+ o('TemplateElement', {
+ builder: ['value', 'tail'],
+ fields: {
+ value: {
+ validate: (0, a.chain)(
+ (0, a.assertShape)({
+ raw: {validate: (0, a.assertValueType)('string')},
+ cooked: {
+ validate: (0, a.assertValueType)('string'),
+ optional: !0,
+ },
+ }),
+ function (S) {
+ let _ = S.value.raw,
+ O = !1,
+ P = () => {
+ throw new Error('Internal @babel/types error.');
+ },
+ {str: M, firstInvalidLoc: w} = (0, i.readStringContents)(
+ 'template',
+ _,
+ 0,
+ 0,
+ 0,
+ {
+ unterminated() {
+ O = !0;
+ },
+ strictNumericEscape: P,
+ invalidEscapeSequence: P,
+ numericSeparatorInEscapeSequence: P,
+ unexpectedNumericSeparator: P,
+ invalidDigit: P,
+ invalidCodePoint: P,
+ }
+ );
+ if (!O) throw new Error('Invalid raw');
+ S.value.cooked = w ? null : M;
+ }
+ ),
+ },
+ tail: {default: !1},
+ },
+ }),
+ o('TemplateLiteral', {
+ visitor: ['quasis', 'expressions'],
+ aliases: ['Expression', 'Literal'],
+ fields: {
+ quasis: (0, a.validateArrayOfType)('TemplateElement'),
+ expressions: {
+ validate: (0, a.chain)(
+ (0, a.assertValueType)('array'),
+ (0, a.assertEach)((0, a.assertNodeType)('Expression', 'TSType')),
+ function (g, S, _) {
+ if (g.quasis.length !== _.length + 1)
+ throw new TypeError(`Number of ${
+ g.type
+ } quasis should be exactly one more than the number of expressions.
+Expected ${_.length + 1} quasis but got ${g.quasis.length}`);
+ }
+ ),
+ },
+ },
+ }),
+ o('YieldExpression', {
+ builder: ['argument', 'delegate'],
+ visitor: ['argument'],
+ aliases: ['Expression', 'Terminatorless'],
+ fields: {
+ delegate: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('boolean'),
+ Object.assign(
+ function (g, S, _) {
+ if (_ && !g.argument)
+ throw new TypeError(
+ 'Property delegate of YieldExpression cannot be true if there is no argument'
+ );
+ },
+ {type: 'boolean'}
+ )
+ )
+ : (0, a.assertValueType)('boolean'),
+ default: !1,
+ },
+ argument: {
+ optional: !0,
+ validate: (0, a.assertNodeType)('Expression'),
+ },
+ },
+ }),
+ o('AwaitExpression', {
+ builder: ['argument'],
+ visitor: ['argument'],
+ aliases: ['Expression', 'Terminatorless'],
+ fields: {argument: {validate: (0, a.assertNodeType)('Expression')}},
+ }),
+ o('Import', {aliases: ['Expression']}),
+ o('BigIntLiteral', {
+ builder: ['value'],
+ fields: {value: {validate: (0, a.assertValueType)('string')}},
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ o('ExportNamespaceSpecifier', {
+ visitor: ['exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {exported: {validate: (0, a.assertNodeType)('Identifier')}},
+ }),
+ o('OptionalMemberExpression', {
+ builder: ['object', 'property', 'computed', 'optional'],
+ visitor: ['object', 'property'],
+ aliases: ['Expression'],
+ fields: {
+ object: {validate: (0, a.assertNodeType)('Expression')},
+ property: {
+ validate: (function () {
+ let g = (0, a.assertNodeType)('Identifier'),
+ S = (0, a.assertNodeType)('Expression');
+ return Object.assign(
+ function (O, P, M) {
+ (O.computed ? S : g)(O, P, M);
+ },
+ {oneOfNodeTypes: ['Expression', 'Identifier']}
+ );
+ })(),
+ },
+ computed: {default: !1},
+ optional: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('boolean'),
+ (0, a.assertOptionalChainStart)()
+ )
+ : (0, a.assertValueType)('boolean'),
+ },
+ },
+ }),
+ o('OptionalCallExpression', {
+ visitor: ['callee', 'arguments', 'typeParameters', 'typeArguments'],
+ builder: ['callee', 'arguments', 'optional'],
+ aliases: ['Expression'],
+ fields: {
+ callee: {validate: (0, a.assertNodeType)('Expression')},
+ arguments: (0, a.validateArrayOfType)(
+ 'Expression',
+ 'SpreadElement',
+ 'ArgumentPlaceholder'
+ ),
+ optional: {
+ validate: process.env.BABEL_TYPES_8_BREAKING
+ ? (0, a.chain)(
+ (0, a.assertValueType)('boolean'),
+ (0, a.assertOptionalChainStart)()
+ )
+ : (0, a.assertValueType)('boolean'),
+ },
+ typeArguments: {
+ validate: (0, a.assertNodeType)('TypeParameterInstantiation'),
+ optional: !0,
+ },
+ typeParameters: {
+ validate: (0, a.assertNodeType)('TSTypeParameterInstantiation'),
+ optional: !0,
+ },
+ },
+ }),
+ o('ClassProperty', {
+ visitor: ['decorators', 'key', 'typeAnnotation', 'value'],
+ builder: [
+ 'key',
+ 'value',
+ 'typeAnnotation',
+ 'decorators',
+ 'computed',
+ 'static',
+ ],
+ aliases: ['Property'],
+ fields: Object.assign({}, y(), {
+ value: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ definite: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ typeAnnotation: {
+ validate: (0, a.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ readonly: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ declare: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ variance: {validate: (0, a.assertNodeType)('Variance'), optional: !0},
+ }),
+ }),
+ o('ClassAccessorProperty', {
+ visitor: ['decorators', 'key', 'typeAnnotation', 'value'],
+ builder: [
+ 'key',
+ 'value',
+ 'typeAnnotation',
+ 'decorators',
+ 'computed',
+ 'static',
+ ],
+ aliases: ['Property', 'Accessor'],
+ fields: Object.assign({}, y(), {
+ key: {
+ validate: (0, a.chain)(
+ (function () {
+ let g = (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'PrivateName'
+ ),
+ S = (0, a.assertNodeType)('Expression');
+ return function (_, O, P) {
+ (_.computed ? S : g)(_, O, P);
+ };
+ })(),
+ (0, a.assertNodeType)(
+ 'Identifier',
+ 'StringLiteral',
+ 'NumericLiteral',
+ 'BigIntLiteral',
+ 'Expression',
+ 'PrivateName'
+ )
+ ),
+ },
+ value: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ definite: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ typeAnnotation: {
+ validate: (0, a.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ readonly: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ declare: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ variance: {validate: (0, a.assertNodeType)('Variance'), optional: !0},
+ }),
+ }),
+ o('ClassPrivateProperty', {
+ visitor: ['decorators', 'key', 'typeAnnotation', 'value'],
+ builder: ['key', 'value', 'decorators', 'static'],
+ aliases: ['Property', 'Private'],
+ fields: {
+ key: {validate: (0, a.assertNodeType)('PrivateName')},
+ value: {validate: (0, a.assertNodeType)('Expression'), optional: !0},
+ typeAnnotation: {
+ validate: (0, a.assertNodeType)(
+ 'TypeAnnotation',
+ 'TSTypeAnnotation',
+ 'Noop'
+ ),
+ optional: !0,
+ },
+ decorators: {validate: (0, a.arrayOfType)('Decorator'), optional: !0},
+ static: {validate: (0, a.assertValueType)('boolean'), default: !1},
+ readonly: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ definite: {validate: (0, a.assertValueType)('boolean'), optional: !0},
+ variance: {validate: (0, a.assertNodeType)('Variance'), optional: !0},
+ },
+ }),
+ o('ClassPrivateMethod', {
+ builder: ['kind', 'key', 'params', 'body', 'static'],
+ visitor: [
+ 'decorators',
+ 'key',
+ 'typeParameters',
+ 'params',
+ 'returnType',
+ 'body',
+ ],
+ aliases: [
+ 'Function',
+ 'Scopable',
+ 'BlockParent',
+ 'FunctionParent',
+ 'Method',
+ 'Private',
+ ],
+ fields: Object.assign({}, m(), l(), {
+ kind: {
+ validate: (0, a.assertOneOf)('get', 'set', 'method'),
+ default: 'method',
+ },
+ key: {validate: (0, a.assertNodeType)('PrivateName')},
+ body: {validate: (0, a.assertNodeType)('BlockStatement')},
+ }),
+ }),
+ o('PrivateName', {
+ visitor: ['id'],
+ aliases: ['Private'],
+ fields: {id: {validate: (0, a.assertNodeType)('Identifier')}},
+ }),
+ o('StaticBlock', {
+ visitor: ['body'],
+ fields: {body: (0, a.validateArrayOfType)('Statement')},
+ aliases: ['Scopable', 'BlockParent', 'FunctionParent'],
+ }),
+ gn
+ );
+ }
+ var F_ = {},
+ z_;
+ function FF() {
+ if (z_) return F_;
+ z_ = 1;
+ var e = Zm(),
+ t = qi();
+ let n = (0, t.defineAliasedType)('Flow'),
+ i = (r) => {
+ let a = r === 'DeclareClass';
+ n(r, {
+ builder: ['id', 'typeParameters', 'extends', 'body'],
+ visitor: [
+ 'id',
+ 'typeParameters',
+ 'extends',
+ ...(a ? ['mixins', 'implements'] : []),
+ 'body',
+ ],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: Object.assign(
+ {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ extends: (0, t.validateOptional)(
+ (0, t.arrayOfType)('InterfaceExtends')
+ ),
+ },
+ a
+ ? {
+ mixins: (0, t.validateOptional)(
+ (0, t.arrayOfType)('InterfaceExtends')
+ ),
+ implements: (0, t.validateOptional)(
+ (0, t.arrayOfType)('ClassImplements')
+ ),
+ }
+ : {},
+ {body: (0, t.validateType)('ObjectTypeAnnotation')}
+ ),
+ });
+ };
+ return (
+ n('AnyTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('ArrayTypeAnnotation', {
+ visitor: ['elementType'],
+ aliases: ['FlowType'],
+ fields: {elementType: (0, t.validateType)('FlowType')},
+ }),
+ n('BooleanTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('BooleanLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: {value: (0, t.validate)((0, t.assertValueType)('boolean'))},
+ }),
+ n('NullLiteralTypeAnnotation', {
+ aliases: ['FlowType', 'FlowBaseAnnotation'],
+ }),
+ n('ClassImplements', {
+ visitor: ['id', 'typeParameters'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterInstantiation'
+ ),
+ },
+ }),
+ i('DeclareClass'),
+ n('DeclareFunction', {
+ visitor: ['id'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ predicate: (0, t.validateOptionalType)('DeclaredPredicate'),
+ },
+ }),
+ i('DeclareInterface'),
+ n('DeclareModule', {
+ builder: ['id', 'body', 'kind'],
+ visitor: ['id', 'body'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier', 'StringLiteral'),
+ body: (0, t.validateType)('BlockStatement'),
+ kind: (0, t.validateOptional)((0, t.assertOneOf)('CommonJS', 'ES')),
+ },
+ }),
+ n('DeclareModuleExports', {
+ visitor: ['typeAnnotation'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {typeAnnotation: (0, t.validateType)('TypeAnnotation')},
+ }),
+ n('DeclareTypeAlias', {
+ visitor: ['id', 'typeParameters', 'right'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ right: (0, t.validateType)('FlowType'),
+ },
+ }),
+ n('DeclareOpaqueType', {
+ visitor: ['id', 'typeParameters', 'supertype'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ supertype: (0, t.validateOptionalType)('FlowType'),
+ impltype: (0, t.validateOptionalType)('FlowType'),
+ },
+ }),
+ n('DeclareVariable', {
+ visitor: ['id'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {id: (0, t.validateType)('Identifier')},
+ }),
+ n('DeclareExportDeclaration', {
+ visitor: ['declaration', 'specifiers', 'source', 'attributes'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: Object.assign(
+ {
+ declaration: (0, t.validateOptionalType)('Flow'),
+ specifiers: (0, t.validateOptional)(
+ (0, t.arrayOfType)('ExportSpecifier', 'ExportNamespaceSpecifier')
+ ),
+ source: (0, t.validateOptionalType)('StringLiteral'),
+ default: (0, t.validateOptional)((0, t.assertValueType)('boolean')),
+ },
+ e.importAttributes
+ ),
+ }),
+ n('DeclareExportAllDeclaration', {
+ visitor: ['source', 'attributes'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: Object.assign(
+ {
+ source: (0, t.validateType)('StringLiteral'),
+ exportKind: (0, t.validateOptional)(
+ (0, t.assertOneOf)('type', 'value')
+ ),
+ },
+ e.importAttributes
+ ),
+ }),
+ n('DeclaredPredicate', {
+ visitor: ['value'],
+ aliases: ['FlowPredicate'],
+ fields: {value: (0, t.validateType)('Flow')},
+ }),
+ n('ExistsTypeAnnotation', {aliases: ['FlowType']}),
+ n('FunctionTypeAnnotation', {
+ visitor: ['typeParameters', 'params', 'rest', 'returnType'],
+ aliases: ['FlowType'],
+ fields: {
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ params: (0, t.validateArrayOfType)('FunctionTypeParam'),
+ rest: (0, t.validateOptionalType)('FunctionTypeParam'),
+ this: (0, t.validateOptionalType)('FunctionTypeParam'),
+ returnType: (0, t.validateType)('FlowType'),
+ },
+ }),
+ n('FunctionTypeParam', {
+ visitor: ['name', 'typeAnnotation'],
+ fields: {
+ name: (0, t.validateOptionalType)('Identifier'),
+ typeAnnotation: (0, t.validateType)('FlowType'),
+ optional: (0, t.validateOptional)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('GenericTypeAnnotation', {
+ visitor: ['id', 'typeParameters'],
+ aliases: ['FlowType'],
+ fields: {
+ id: (0, t.validateType)('Identifier', 'QualifiedTypeIdentifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterInstantiation'
+ ),
+ },
+ }),
+ n('InferredPredicate', {aliases: ['FlowPredicate']}),
+ n('InterfaceExtends', {
+ visitor: ['id', 'typeParameters'],
+ fields: {
+ id: (0, t.validateType)('Identifier', 'QualifiedTypeIdentifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterInstantiation'
+ ),
+ },
+ }),
+ i('InterfaceDeclaration'),
+ n('InterfaceTypeAnnotation', {
+ visitor: ['extends', 'body'],
+ aliases: ['FlowType'],
+ fields: {
+ extends: (0, t.validateOptional)(
+ (0, t.arrayOfType)('InterfaceExtends')
+ ),
+ body: (0, t.validateType)('ObjectTypeAnnotation'),
+ },
+ }),
+ n('IntersectionTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: {types: (0, t.validate)((0, t.arrayOfType)('FlowType'))},
+ }),
+ n('MixedTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('EmptyTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('NullableTypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ aliases: ['FlowType'],
+ fields: {typeAnnotation: (0, t.validateType)('FlowType')},
+ }),
+ n('NumberLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: {value: (0, t.validate)((0, t.assertValueType)('number'))},
+ }),
+ n('NumberTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('ObjectTypeAnnotation', {
+ visitor: ['properties', 'indexers', 'callProperties', 'internalSlots'],
+ aliases: ['FlowType'],
+ builder: [
+ 'properties',
+ 'indexers',
+ 'callProperties',
+ 'internalSlots',
+ 'exact',
+ ],
+ fields: {
+ properties: (0, t.validate)(
+ (0, t.arrayOfType)('ObjectTypeProperty', 'ObjectTypeSpreadProperty')
+ ),
+ indexers: {
+ validate: (0, t.arrayOfType)('ObjectTypeIndexer'),
+ optional: !0,
+ default: [],
+ },
+ callProperties: {
+ validate: (0, t.arrayOfType)('ObjectTypeCallProperty'),
+ optional: !0,
+ default: [],
+ },
+ internalSlots: {
+ validate: (0, t.arrayOfType)('ObjectTypeInternalSlot'),
+ optional: !0,
+ default: [],
+ },
+ exact: {validate: (0, t.assertValueType)('boolean'), default: !1},
+ inexact: (0, t.validateOptional)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('ObjectTypeInternalSlot', {
+ visitor: ['id', 'value'],
+ builder: ['id', 'value', 'optional', 'static', 'method'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ value: (0, t.validateType)('FlowType'),
+ optional: (0, t.validate)((0, t.assertValueType)('boolean')),
+ static: (0, t.validate)((0, t.assertValueType)('boolean')),
+ method: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('ObjectTypeCallProperty', {
+ visitor: ['value'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ value: (0, t.validateType)('FlowType'),
+ static: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('ObjectTypeIndexer', {
+ visitor: ['variance', 'id', 'key', 'value'],
+ builder: ['id', 'key', 'value', 'variance'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ id: (0, t.validateOptionalType)('Identifier'),
+ key: (0, t.validateType)('FlowType'),
+ value: (0, t.validateType)('FlowType'),
+ static: (0, t.validate)((0, t.assertValueType)('boolean')),
+ variance: (0, t.validateOptionalType)('Variance'),
+ },
+ }),
+ n('ObjectTypeProperty', {
+ visitor: ['key', 'value', 'variance'],
+ aliases: ['UserWhitespacable'],
+ fields: {
+ key: (0, t.validateType)('Identifier', 'StringLiteral'),
+ value: (0, t.validateType)('FlowType'),
+ kind: (0, t.validate)((0, t.assertOneOf)('init', 'get', 'set')),
+ static: (0, t.validate)((0, t.assertValueType)('boolean')),
+ proto: (0, t.validate)((0, t.assertValueType)('boolean')),
+ optional: (0, t.validate)((0, t.assertValueType)('boolean')),
+ variance: (0, t.validateOptionalType)('Variance'),
+ method: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('ObjectTypeSpreadProperty', {
+ visitor: ['argument'],
+ aliases: ['UserWhitespacable'],
+ fields: {argument: (0, t.validateType)('FlowType')},
+ }),
+ n('OpaqueType', {
+ visitor: ['id', 'typeParameters', 'supertype', 'impltype'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ supertype: (0, t.validateOptionalType)('FlowType'),
+ impltype: (0, t.validateType)('FlowType'),
+ },
+ }),
+ n('QualifiedTypeIdentifier', {
+ visitor: ['qualification', 'id'],
+ builder: ['id', 'qualification'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ qualification: (0, t.validateType)(
+ 'Identifier',
+ 'QualifiedTypeIdentifier'
+ ),
+ },
+ }),
+ n('StringLiteralTypeAnnotation', {
+ builder: ['value'],
+ aliases: ['FlowType'],
+ fields: {value: (0, t.validate)((0, t.assertValueType)('string'))},
+ }),
+ n('StringTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('SymbolTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('ThisTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('TupleTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: {types: (0, t.validate)((0, t.arrayOfType)('FlowType'))},
+ }),
+ n('TypeofTypeAnnotation', {
+ visitor: ['argument'],
+ aliases: ['FlowType'],
+ fields: {argument: (0, t.validateType)('FlowType')},
+ }),
+ n('TypeAlias', {
+ visitor: ['id', 'typeParameters', 'right'],
+ aliases: ['FlowDeclaration', 'Statement', 'Declaration'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ typeParameters: (0, t.validateOptionalType)(
+ 'TypeParameterDeclaration'
+ ),
+ right: (0, t.validateType)('FlowType'),
+ },
+ }),
+ n('TypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ fields: {typeAnnotation: (0, t.validateType)('FlowType')},
+ }),
+ n('TypeCastExpression', {
+ visitor: ['expression', 'typeAnnotation'],
+ aliases: ['ExpressionWrapper', 'Expression'],
+ fields: {
+ expression: (0, t.validateType)('Expression'),
+ typeAnnotation: (0, t.validateType)('TypeAnnotation'),
+ },
+ }),
+ n('TypeParameter', {
+ visitor: ['bound', 'default', 'variance'],
+ fields: {
+ name: (0, t.validate)((0, t.assertValueType)('string')),
+ bound: (0, t.validateOptionalType)('TypeAnnotation'),
+ default: (0, t.validateOptionalType)('FlowType'),
+ variance: (0, t.validateOptionalType)('Variance'),
+ },
+ }),
+ n('TypeParameterDeclaration', {
+ visitor: ['params'],
+ fields: {params: (0, t.validate)((0, t.arrayOfType)('TypeParameter'))},
+ }),
+ n('TypeParameterInstantiation', {
+ visitor: ['params'],
+ fields: {params: (0, t.validate)((0, t.arrayOfType)('FlowType'))},
+ }),
+ n('UnionTypeAnnotation', {
+ visitor: ['types'],
+ aliases: ['FlowType'],
+ fields: {types: (0, t.validate)((0, t.arrayOfType)('FlowType'))},
+ }),
+ n('Variance', {
+ builder: ['kind'],
+ fields: {kind: (0, t.validate)((0, t.assertOneOf)('minus', 'plus'))},
+ }),
+ n('VoidTypeAnnotation', {aliases: ['FlowType', 'FlowBaseAnnotation']}),
+ n('EnumDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'body'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ body: (0, t.validateType)(
+ 'EnumBooleanBody',
+ 'EnumNumberBody',
+ 'EnumStringBody',
+ 'EnumSymbolBody'
+ ),
+ },
+ }),
+ n('EnumBooleanBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, t.validate)((0, t.assertValueType)('boolean')),
+ members: (0, t.validateArrayOfType)('EnumBooleanMember'),
+ hasUnknownMembers: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('EnumNumberBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, t.validate)((0, t.assertValueType)('boolean')),
+ members: (0, t.validateArrayOfType)('EnumNumberMember'),
+ hasUnknownMembers: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('EnumStringBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ explicitType: (0, t.validate)((0, t.assertValueType)('boolean')),
+ members: (0, t.validateArrayOfType)(
+ 'EnumStringMember',
+ 'EnumDefaultedMember'
+ ),
+ hasUnknownMembers: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('EnumSymbolBody', {
+ aliases: ['EnumBody'],
+ visitor: ['members'],
+ fields: {
+ members: (0, t.validateArrayOfType)('EnumDefaultedMember'),
+ hasUnknownMembers: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ n('EnumBooleanMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ init: (0, t.validateType)('BooleanLiteral'),
+ },
+ }),
+ n('EnumNumberMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id', 'init'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ init: (0, t.validateType)('NumericLiteral'),
+ },
+ }),
+ n('EnumStringMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id', 'init'],
+ fields: {
+ id: (0, t.validateType)('Identifier'),
+ init: (0, t.validateType)('StringLiteral'),
+ },
+ }),
+ n('EnumDefaultedMember', {
+ aliases: ['EnumMember'],
+ visitor: ['id'],
+ fields: {id: (0, t.validateType)('Identifier')},
+ }),
+ n('IndexedAccessType', {
+ visitor: ['objectType', 'indexType'],
+ aliases: ['FlowType'],
+ fields: {
+ objectType: (0, t.validateType)('FlowType'),
+ indexType: (0, t.validateType)('FlowType'),
+ },
+ }),
+ n('OptionalIndexedAccessType', {
+ visitor: ['objectType', 'indexType'],
+ aliases: ['FlowType'],
+ fields: {
+ objectType: (0, t.validateType)('FlowType'),
+ indexType: (0, t.validateType)('FlowType'),
+ optional: (0, t.validate)((0, t.assertValueType)('boolean')),
+ },
+ }),
+ F_
+ );
+ }
+ var B_ = {},
+ U_;
+ function zF() {
+ if (U_) return B_;
+ U_ = 1;
+ var e = qi();
+ let t = (0, e.defineAliasedType)('JSX');
+ return (
+ t('JSXAttribute', {
+ visitor: ['name', 'value'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, e.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXNamespacedName'
+ ),
+ },
+ value: {
+ optional: !0,
+ validate: (0, e.assertNodeType)(
+ 'JSXElement',
+ 'JSXFragment',
+ 'StringLiteral',
+ 'JSXExpressionContainer'
+ ),
+ },
+ },
+ }),
+ t('JSXClosingElement', {
+ visitor: ['name'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, e.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXMemberExpression',
+ 'JSXNamespacedName'
+ ),
+ },
+ },
+ }),
+ t('JSXElement', {
+ builder: [
+ 'openingElement',
+ 'closingElement',
+ 'children',
+ 'selfClosing',
+ ],
+ visitor: ['openingElement', 'children', 'closingElement'],
+ aliases: ['Immutable', 'Expression'],
+ fields: Object.assign(
+ {
+ openingElement: {
+ validate: (0, e.assertNodeType)('JSXOpeningElement'),
+ },
+ closingElement: {
+ optional: !0,
+ validate: (0, e.assertNodeType)('JSXClosingElement'),
+ },
+ children: (0, e.validateArrayOfType)(
+ 'JSXText',
+ 'JSXExpressionContainer',
+ 'JSXSpreadChild',
+ 'JSXElement',
+ 'JSXFragment'
+ ),
+ },
+ {
+ selfClosing: {
+ validate: (0, e.assertValueType)('boolean'),
+ optional: !0,
+ },
+ }
+ ),
+ }),
+ t('JSXEmptyExpression', {}),
+ t('JSXExpressionContainer', {
+ visitor: ['expression'],
+ aliases: ['Immutable'],
+ fields: {
+ expression: {
+ validate: (0, e.assertNodeType)('Expression', 'JSXEmptyExpression'),
+ },
+ },
+ }),
+ t('JSXSpreadChild', {
+ visitor: ['expression'],
+ aliases: ['Immutable'],
+ fields: {expression: {validate: (0, e.assertNodeType)('Expression')}},
+ }),
+ t('JSXIdentifier', {
+ builder: ['name'],
+ fields: {name: {validate: (0, e.assertValueType)('string')}},
+ }),
+ t('JSXMemberExpression', {
+ visitor: ['object', 'property'],
+ fields: {
+ object: {
+ validate: (0, e.assertNodeType)(
+ 'JSXMemberExpression',
+ 'JSXIdentifier'
+ ),
+ },
+ property: {validate: (0, e.assertNodeType)('JSXIdentifier')},
+ },
+ }),
+ t('JSXNamespacedName', {
+ visitor: ['namespace', 'name'],
+ fields: {
+ namespace: {validate: (0, e.assertNodeType)('JSXIdentifier')},
+ name: {validate: (0, e.assertNodeType)('JSXIdentifier')},
+ },
+ }),
+ t('JSXOpeningElement', {
+ builder: ['name', 'attributes', 'selfClosing'],
+ visitor: ['name', 'attributes'],
+ aliases: ['Immutable'],
+ fields: {
+ name: {
+ validate: (0, e.assertNodeType)(
+ 'JSXIdentifier',
+ 'JSXMemberExpression',
+ 'JSXNamespacedName'
+ ),
+ },
+ selfClosing: {default: !1},
+ attributes: (0, e.validateArrayOfType)(
+ 'JSXAttribute',
+ 'JSXSpreadAttribute'
+ ),
+ typeParameters: {
+ validate: (0, e.assertNodeType)(
+ 'TypeParameterInstantiation',
+ 'TSTypeParameterInstantiation'
+ ),
+ optional: !0,
+ },
+ },
+ }),
+ t('JSXSpreadAttribute', {
+ visitor: ['argument'],
+ fields: {argument: {validate: (0, e.assertNodeType)('Expression')}},
+ }),
+ t('JSXText', {
+ aliases: ['Immutable'],
+ builder: ['value'],
+ fields: {value: {validate: (0, e.assertValueType)('string')}},
+ }),
+ t('JSXFragment', {
+ builder: ['openingFragment', 'closingFragment', 'children'],
+ visitor: ['openingFragment', 'children', 'closingFragment'],
+ aliases: ['Immutable', 'Expression'],
+ fields: {
+ openingFragment: {
+ validate: (0, e.assertNodeType)('JSXOpeningFragment'),
+ },
+ closingFragment: {
+ validate: (0, e.assertNodeType)('JSXClosingFragment'),
+ },
+ children: (0, e.validateArrayOfType)(
+ 'JSXText',
+ 'JSXExpressionContainer',
+ 'JSXSpreadChild',
+ 'JSXElement',
+ 'JSXFragment'
+ ),
+ },
+ }),
+ t('JSXOpeningFragment', {aliases: ['Immutable']}),
+ t('JSXClosingFragment', {aliases: ['Immutable']}),
+ B_
+ );
+ }
+ var Z_ = {},
+ xi = {},
+ q_;
+ function $0() {
+ if (q_) return xi;
+ (q_ = 1),
+ Object.defineProperty(xi, '__esModule', {value: !0}),
+ (xi.PLACEHOLDERS_FLIPPED_ALIAS =
+ xi.PLACEHOLDERS_ALIAS =
+ xi.PLACEHOLDERS =
+ void 0);
+ var e = qi();
+ let t = (xi.PLACEHOLDERS = [
+ 'Identifier',
+ 'StringLiteral',
+ 'Expression',
+ 'Statement',
+ 'Declaration',
+ 'BlockStatement',
+ 'ClassBody',
+ 'Pattern',
+ ]),
+ n = (xi.PLACEHOLDERS_ALIAS = {
+ Declaration: ['Statement'],
+ Pattern: ['PatternLike', 'LVal'],
+ });
+ for (let r of t) {
+ let a = e.ALIAS_KEYS[r];
+ a != null && a.length && (n[r] = a);
+ }
+ let i = (xi.PLACEHOLDERS_FLIPPED_ALIAS = {});
+ return (
+ Object.keys(n).forEach((r) => {
+ n[r].forEach((a) => {
+ hasOwnProperty.call(i, a) || (i[a] = []), i[a].push(r);
+ });
+ }),
+ xi
+ );
+ }
+ var K_;
+ function BF() {
+ if (K_) return Z_;
+ K_ = 1;
+ var e = qi(),
+ t = $0(),
+ n = Zm();
+ let i = (0, e.defineAliasedType)('Miscellaneous');
+ return (
+ i('Noop', {visitor: []}),
+ i('Placeholder', {
+ visitor: [],
+ builder: ['expectedNode', 'name'],
+ fields: Object.assign(
+ {
+ name: {validate: (0, e.assertNodeType)('Identifier')},
+ expectedNode: {validate: (0, e.assertOneOf)(...t.PLACEHOLDERS)},
+ },
+ (0, n.patternLikeCommon)()
+ ),
+ }),
+ i('V8IntrinsicIdentifier', {
+ builder: ['name'],
+ fields: {name: {validate: (0, e.assertValueType)('string')}},
+ }),
+ Z_
+ );
+ }
+ var V_ = {},
+ J_;
+ function UF() {
+ if (J_) return V_;
+ J_ = 1;
+ var e = qi();
+ return (
+ (0, e.default)('ArgumentPlaceholder', {}),
+ (0, e.default)('BindExpression', {
+ visitor: ['object', 'callee'],
+ aliases: ['Expression'],
+ fields: process.env.BABEL_TYPES_8_BREAKING
+ ? {
+ object: {validate: (0, e.assertNodeType)('Expression')},
+ callee: {validate: (0, e.assertNodeType)('Expression')},
+ }
+ : {
+ object: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ['Expression'],
+ }),
+ },
+ callee: {
+ validate: Object.assign(() => {}, {
+ oneOfNodeTypes: ['Expression'],
+ }),
+ },
+ },
+ }),
+ (0, e.default)('ImportAttribute', {
+ visitor: ['key', 'value'],
+ fields: {
+ key: {validate: (0, e.assertNodeType)('Identifier', 'StringLiteral')},
+ value: {validate: (0, e.assertNodeType)('StringLiteral')},
+ },
+ }),
+ (0, e.default)('Decorator', {
+ visitor: ['expression'],
+ fields: {expression: {validate: (0, e.assertNodeType)('Expression')}},
+ }),
+ (0, e.default)('DoExpression', {
+ visitor: ['body'],
+ builder: ['body', 'async'],
+ aliases: ['Expression'],
+ fields: {
+ body: {validate: (0, e.assertNodeType)('BlockStatement')},
+ async: {validate: (0, e.assertValueType)('boolean'), default: !1},
+ },
+ }),
+ (0, e.default)('ExportDefaultSpecifier', {
+ visitor: ['exported'],
+ aliases: ['ModuleSpecifier'],
+ fields: {exported: {validate: (0, e.assertNodeType)('Identifier')}},
+ }),
+ (0, e.default)('RecordExpression', {
+ visitor: ['properties'],
+ aliases: ['Expression'],
+ fields: {
+ properties: (0, e.validateArrayOfType)(
+ 'ObjectProperty',
+ 'SpreadElement'
+ ),
+ },
+ }),
+ (0, e.default)('TupleExpression', {
+ fields: {
+ elements: {
+ validate: (0, e.arrayOfType)('Expression', 'SpreadElement'),
+ default: [],
+ },
+ },
+ visitor: ['elements'],
+ aliases: ['Expression'],
+ }),
+ (0, e.default)('DecimalLiteral', {
+ builder: ['value'],
+ fields: {value: {validate: (0, e.assertValueType)('string')}},
+ aliases: ['Expression', 'Pureish', 'Literal', 'Immutable'],
+ }),
+ (0, e.default)('ModuleExpression', {
+ visitor: ['body'],
+ fields: {body: {validate: (0, e.assertNodeType)('Program')}},
+ aliases: ['Expression'],
+ }),
+ (0, e.default)('TopicReference', {aliases: ['Expression']}),
+ (0, e.default)('PipelineTopicExpression', {
+ builder: ['expression'],
+ visitor: ['expression'],
+ fields: {expression: {validate: (0, e.assertNodeType)('Expression')}},
+ aliases: ['Expression'],
+ }),
+ (0, e.default)('PipelineBareFunction', {
+ builder: ['callee'],
+ visitor: ['callee'],
+ fields: {callee: {validate: (0, e.assertNodeType)('Expression')}},
+ aliases: ['Expression'],
+ }),
+ (0, e.default)('PipelinePrimaryTopicReference', {
+ aliases: ['Expression'],
+ }),
+ V_
+ );
+ }
+ var H_ = {},
+ W_;
+ function ZF() {
+ if (W_) return H_;
+ W_ = 1;
+ var e = qi(),
+ t = Zm(),
+ n = Zu();
+ let i = (0, e.defineAliasedType)('TypeScript'),
+ r = (0, e.assertValueType)('boolean'),
+ a = () => ({
+ returnType: {
+ validate: (0, e.assertNodeType)('TSTypeAnnotation', 'Noop'),
+ optional: !0,
+ },
+ typeParameters: {
+ validate: (0, e.assertNodeType)('TSTypeParameterDeclaration', 'Noop'),
+ optional: !0,
+ },
+ });
+ i('TSParameterProperty', {
+ aliases: ['LVal'],
+ visitor: ['parameter'],
+ fields: {
+ accessibility: {
+ validate: (0, e.assertOneOf)('public', 'private', 'protected'),
+ optional: !0,
+ },
+ readonly: {validate: (0, e.assertValueType)('boolean'), optional: !0},
+ parameter: {
+ validate: (0, e.assertNodeType)('Identifier', 'AssignmentPattern'),
+ },
+ override: {validate: (0, e.assertValueType)('boolean'), optional: !0},
+ decorators: {validate: (0, e.arrayOfType)('Decorator'), optional: !0},
+ },
+ }),
+ i('TSDeclareFunction', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'params', 'returnType'],
+ fields: Object.assign({}, (0, t.functionDeclarationCommon)(), a()),
+ }),
+ i('TSDeclareMethod', {
+ visitor: [
+ 'decorators',
+ 'key',
+ 'typeParameters',
+ 'params',
+ 'returnType',
+ ],
+ fields: Object.assign(
+ {},
+ (0, t.classMethodOrDeclareMethodCommon)(),
+ a()
+ ),
+ }),
+ i('TSQualifiedName', {
+ aliases: ['TSEntityName'],
+ visitor: ['left', 'right'],
+ fields: {
+ left: (0, e.validateType)('TSEntityName'),
+ right: (0, e.validateType)('Identifier'),
+ },
+ });
+ let o = () => ({
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterDeclaration'
+ ),
+ parameters: (0, e.validateArrayOfType)(
+ 'ArrayPattern',
+ 'Identifier',
+ 'ObjectPattern',
+ 'RestElement'
+ ),
+ typeAnnotation: (0, e.validateOptionalType)('TSTypeAnnotation'),
+ }),
+ s = {
+ aliases: ['TSTypeElement'],
+ visitor: ['typeParameters', 'parameters', 'typeAnnotation'],
+ fields: o(),
+ };
+ i('TSCallSignatureDeclaration', s), i('TSConstructSignatureDeclaration', s);
+ let l = () => ({
+ key: (0, e.validateType)('Expression'),
+ computed: {default: !1},
+ optional: (0, e.validateOptional)(r),
+ });
+ i('TSPropertySignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['key', 'typeAnnotation'],
+ fields: Object.assign({}, l(), {
+ readonly: (0, e.validateOptional)(r),
+ typeAnnotation: (0, e.validateOptionalType)('TSTypeAnnotation'),
+ kind: {validate: (0, e.assertOneOf)('get', 'set')},
+ }),
+ }),
+ i('TSMethodSignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['key', 'typeParameters', 'parameters', 'typeAnnotation'],
+ fields: Object.assign({}, o(), l(), {
+ kind: {validate: (0, e.assertOneOf)('method', 'get', 'set')},
+ }),
+ }),
+ i('TSIndexSignature', {
+ aliases: ['TSTypeElement'],
+ visitor: ['parameters', 'typeAnnotation'],
+ fields: {
+ readonly: (0, e.validateOptional)(r),
+ static: (0, e.validateOptional)(r),
+ parameters: (0, e.validateArrayOfType)('Identifier'),
+ typeAnnotation: (0, e.validateOptionalType)('TSTypeAnnotation'),
+ },
+ });
+ let d = [
+ 'TSAnyKeyword',
+ 'TSBooleanKeyword',
+ 'TSBigIntKeyword',
+ 'TSIntrinsicKeyword',
+ 'TSNeverKeyword',
+ 'TSNullKeyword',
+ 'TSNumberKeyword',
+ 'TSObjectKeyword',
+ 'TSStringKeyword',
+ 'TSSymbolKeyword',
+ 'TSUndefinedKeyword',
+ 'TSUnknownKeyword',
+ 'TSVoidKeyword',
+ ];
+ for (let g of d)
+ i(g, {aliases: ['TSType', 'TSBaseType'], visitor: [], fields: {}});
+ i('TSThisType', {
+ aliases: ['TSType', 'TSBaseType'],
+ visitor: [],
+ fields: {},
+ });
+ let u = {
+ aliases: ['TSType'],
+ visitor: ['typeParameters', 'parameters', 'typeAnnotation'],
+ };
+ i('TSFunctionType', Object.assign({}, u, {fields: o()})),
+ i(
+ 'TSConstructorType',
+ Object.assign({}, u, {
+ fields: Object.assign({}, o(), {
+ abstract: (0, e.validateOptional)(r),
+ }),
+ })
+ ),
+ i('TSTypeReference', {
+ aliases: ['TSType'],
+ visitor: ['typeName', 'typeParameters'],
+ fields: {
+ typeName: (0, e.validateType)('TSEntityName'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterInstantiation'
+ ),
+ },
+ }),
+ i('TSTypePredicate', {
+ aliases: ['TSType'],
+ visitor: ['parameterName', 'typeAnnotation'],
+ builder: ['parameterName', 'typeAnnotation', 'asserts'],
+ fields: {
+ parameterName: (0, e.validateType)('Identifier', 'TSThisType'),
+ typeAnnotation: (0, e.validateOptionalType)('TSTypeAnnotation'),
+ asserts: (0, e.validateOptional)(r),
+ },
+ }),
+ i('TSTypeQuery', {
+ aliases: ['TSType'],
+ visitor: ['exprName', 'typeParameters'],
+ fields: {
+ exprName: (0, e.validateType)('TSEntityName', 'TSImportType'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterInstantiation'
+ ),
+ },
+ }),
+ i('TSTypeLiteral', {
+ aliases: ['TSType'],
+ visitor: ['members'],
+ fields: {members: (0, e.validateArrayOfType)('TSTypeElement')},
+ }),
+ i('TSArrayType', {
+ aliases: ['TSType'],
+ visitor: ['elementType'],
+ fields: {elementType: (0, e.validateType)('TSType')},
+ }),
+ i('TSTupleType', {
+ aliases: ['TSType'],
+ visitor: ['elementTypes'],
+ fields: {
+ elementTypes: (0, e.validateArrayOfType)(
+ 'TSType',
+ 'TSNamedTupleMember'
+ ),
+ },
+ }),
+ i('TSOptionalType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: {typeAnnotation: (0, e.validateType)('TSType')},
+ }),
+ i('TSRestType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: {typeAnnotation: (0, e.validateType)('TSType')},
+ }),
+ i('TSNamedTupleMember', {
+ visitor: ['label', 'elementType'],
+ builder: ['label', 'elementType', 'optional'],
+ fields: {
+ label: (0, e.validateType)('Identifier'),
+ optional: {validate: r, default: !1},
+ elementType: (0, e.validateType)('TSType'),
+ },
+ });
+ let p = {
+ aliases: ['TSType'],
+ visitor: ['types'],
+ fields: {types: (0, e.validateArrayOfType)('TSType')},
+ };
+ i('TSUnionType', p),
+ i('TSIntersectionType', p),
+ i('TSConditionalType', {
+ aliases: ['TSType'],
+ visitor: ['checkType', 'extendsType', 'trueType', 'falseType'],
+ fields: {
+ checkType: (0, e.validateType)('TSType'),
+ extendsType: (0, e.validateType)('TSType'),
+ trueType: (0, e.validateType)('TSType'),
+ falseType: (0, e.validateType)('TSType'),
+ },
+ }),
+ i('TSInferType', {
+ aliases: ['TSType'],
+ visitor: ['typeParameter'],
+ fields: {typeParameter: (0, e.validateType)('TSTypeParameter')},
+ }),
+ i('TSParenthesizedType', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: {typeAnnotation: (0, e.validateType)('TSType')},
+ }),
+ i('TSTypeOperator', {
+ aliases: ['TSType'],
+ visitor: ['typeAnnotation'],
+ fields: {
+ operator: (0, e.validate)((0, e.assertValueType)('string')),
+ typeAnnotation: (0, e.validateType)('TSType'),
+ },
+ }),
+ i('TSIndexedAccessType', {
+ aliases: ['TSType'],
+ visitor: ['objectType', 'indexType'],
+ fields: {
+ objectType: (0, e.validateType)('TSType'),
+ indexType: (0, e.validateType)('TSType'),
+ },
+ }),
+ i('TSMappedType', {
+ aliases: ['TSType'],
+ visitor: ['typeParameter', 'nameType', 'typeAnnotation'],
+ builder: ['typeParameter', 'typeAnnotation', 'nameType'],
+ fields: Object.assign(
+ {},
+ {typeParameter: (0, e.validateType)('TSTypeParameter')},
+ {
+ readonly: (0, e.validateOptional)(
+ (0, e.assertOneOf)(!0, !1, '+', '-')
+ ),
+ optional: (0, e.validateOptional)(
+ (0, e.assertOneOf)(!0, !1, '+', '-')
+ ),
+ typeAnnotation: (0, e.validateOptionalType)('TSType'),
+ nameType: (0, e.validateOptionalType)('TSType'),
+ }
+ ),
+ }),
+ i('TSLiteralType', {
+ aliases: ['TSType', 'TSBaseType'],
+ visitor: ['literal'],
+ fields: {
+ literal: {
+ validate: (function () {
+ let g = (0, e.assertNodeType)('NumericLiteral', 'BigIntLiteral'),
+ S = (0, e.assertOneOf)('-'),
+ _ = (0, e.assertNodeType)(
+ 'NumericLiteral',
+ 'StringLiteral',
+ 'BooleanLiteral',
+ 'BigIntLiteral',
+ 'TemplateLiteral'
+ );
+ function O(P, M, w) {
+ (0, n.default)('UnaryExpression', w)
+ ? (S(w, 'operator', w.operator), g(w, 'argument', w.argument))
+ : _(P, M, w);
+ }
+ return (
+ (O.oneOfNodeTypes = [
+ 'NumericLiteral',
+ 'StringLiteral',
+ 'BooleanLiteral',
+ 'BigIntLiteral',
+ 'TemplateLiteral',
+ 'UnaryExpression',
+ ]),
+ O
+ );
+ })(),
+ },
+ },
+ });
+ let y = {
+ aliases: ['TSType'],
+ visitor: ['expression', 'typeParameters'],
+ fields: {
+ expression: (0, e.validateType)('TSEntityName'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterInstantiation'
+ ),
+ },
+ };
+ i('TSExpressionWithTypeArguments', y),
+ i('TSInterfaceDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'extends', 'body'],
+ fields: {
+ declare: (0, e.validateOptional)(r),
+ id: (0, e.validateType)('Identifier'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterDeclaration'
+ ),
+ extends: (0, e.validateOptional)(
+ (0, e.arrayOfType)('TSExpressionWithTypeArguments')
+ ),
+ body: (0, e.validateType)('TSInterfaceBody'),
+ },
+ }),
+ i('TSInterfaceBody', {
+ visitor: ['body'],
+ fields: {body: (0, e.validateArrayOfType)('TSTypeElement')},
+ }),
+ i('TSTypeAliasDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'typeParameters', 'typeAnnotation'],
+ fields: {
+ declare: (0, e.validateOptional)(r),
+ id: (0, e.validateType)('Identifier'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterDeclaration'
+ ),
+ typeAnnotation: (0, e.validateType)('TSType'),
+ },
+ }),
+ i('TSInstantiationExpression', {
+ aliases: ['Expression'],
+ visitor: ['expression', 'typeParameters'],
+ fields: {
+ expression: (0, e.validateType)('Expression'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterInstantiation'
+ ),
+ },
+ });
+ let m = {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['expression', 'typeAnnotation'],
+ fields: {
+ expression: (0, e.validateType)('Expression'),
+ typeAnnotation: (0, e.validateType)('TSType'),
+ },
+ };
+ return (
+ i('TSAsExpression', m),
+ i('TSSatisfiesExpression', m),
+ i('TSTypeAssertion', {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['typeAnnotation', 'expression'],
+ fields: {
+ typeAnnotation: (0, e.validateType)('TSType'),
+ expression: (0, e.validateType)('Expression'),
+ },
+ }),
+ i('TSEnumDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'members'],
+ fields: {
+ declare: (0, e.validateOptional)(r),
+ const: (0, e.validateOptional)(r),
+ id: (0, e.validateType)('Identifier'),
+ members: (0, e.validateArrayOfType)('TSEnumMember'),
+ initializer: (0, e.validateOptionalType)('Expression'),
+ },
+ }),
+ i('TSEnumMember', {
+ visitor: ['id', 'initializer'],
+ fields: {
+ id: (0, e.validateType)('Identifier', 'StringLiteral'),
+ initializer: (0, e.validateOptionalType)('Expression'),
+ },
+ }),
+ i('TSModuleDeclaration', {
+ aliases: ['Statement', 'Declaration'],
+ visitor: ['id', 'body'],
+ fields: Object.assign(
+ {
+ kind: {
+ validate: (0, e.assertOneOf)('global', 'module', 'namespace'),
+ },
+ declare: (0, e.validateOptional)(r),
+ },
+ {global: (0, e.validateOptional)(r)},
+ {
+ id: (0, e.validateType)('Identifier', 'StringLiteral'),
+ body: (0, e.validateType)('TSModuleBlock', 'TSModuleDeclaration'),
+ }
+ ),
+ }),
+ i('TSModuleBlock', {
+ aliases: ['Scopable', 'Block', 'BlockParent', 'FunctionParent'],
+ visitor: ['body'],
+ fields: {body: (0, e.validateArrayOfType)('Statement')},
+ }),
+ i('TSImportType', {
+ aliases: ['TSType'],
+ visitor: ['argument', 'qualifier', 'typeParameters'],
+ fields: {
+ argument: (0, e.validateType)('StringLiteral'),
+ qualifier: (0, e.validateOptionalType)('TSEntityName'),
+ typeParameters: (0, e.validateOptionalType)(
+ 'TSTypeParameterInstantiation'
+ ),
+ options: {
+ validate: (0, e.assertNodeType)('Expression'),
+ optional: !0,
+ },
+ },
+ }),
+ i('TSImportEqualsDeclaration', {
+ aliases: ['Statement'],
+ visitor: ['id', 'moduleReference'],
+ fields: {
+ isExport: (0, e.validate)(r),
+ id: (0, e.validateType)('Identifier'),
+ moduleReference: (0, e.validateType)(
+ 'TSEntityName',
+ 'TSExternalModuleReference'
+ ),
+ importKind: {
+ validate: (0, e.assertOneOf)('type', 'value'),
+ optional: !0,
+ },
+ },
+ }),
+ i('TSExternalModuleReference', {
+ visitor: ['expression'],
+ fields: {expression: (0, e.validateType)('StringLiteral')},
+ }),
+ i('TSNonNullExpression', {
+ aliases: ['Expression', 'LVal', 'PatternLike'],
+ visitor: ['expression'],
+ fields: {expression: (0, e.validateType)('Expression')},
+ }),
+ i('TSExportAssignment', {
+ aliases: ['Statement'],
+ visitor: ['expression'],
+ fields: {expression: (0, e.validateType)('Expression')},
+ }),
+ i('TSNamespaceExportDeclaration', {
+ aliases: ['Statement'],
+ visitor: ['id'],
+ fields: {id: (0, e.validateType)('Identifier')},
+ }),
+ i('TSTypeAnnotation', {
+ visitor: ['typeAnnotation'],
+ fields: {typeAnnotation: {validate: (0, e.assertNodeType)('TSType')}},
+ }),
+ i('TSTypeParameterInstantiation', {
+ visitor: ['params'],
+ fields: {params: (0, e.validateArrayOfType)('TSType')},
+ }),
+ i('TSTypeParameterDeclaration', {
+ visitor: ['params'],
+ fields: {params: (0, e.validateArrayOfType)('TSTypeParameter')},
+ }),
+ i('TSTypeParameter', {
+ builder: ['constraint', 'default', 'name'],
+ visitor: ['constraint', 'default'],
+ fields: {
+ name: {validate: (0, e.assertValueType)('string')},
+ in: {validate: (0, e.assertValueType)('boolean'), optional: !0},
+ out: {validate: (0, e.assertValueType)('boolean'), optional: !0},
+ const: {validate: (0, e.assertValueType)('boolean'), optional: !0},
+ constraint: {validate: (0, e.assertNodeType)('TSType'), optional: !0},
+ default: {validate: (0, e.assertNodeType)('TSType'), optional: !0},
+ },
+ }),
+ H_
+ );
+ }
+ var nu = {},
+ G_;
+ function qF() {
+ return (
+ G_ ||
+ ((G_ = 1),
+ Object.defineProperty(nu, '__esModule', {value: !0}),
+ (nu.DEPRECATED_ALIASES = void 0),
+ (nu.DEPRECATED_ALIASES = {
+ ModuleDeclaration: 'ImportOrExportDeclaration',
+ })),
+ nu
+ );
+ }
+ var X_;
+ function br() {
+ return (
+ X_ ||
+ ((X_ = 1),
+ (function (e) {
+ Object.defineProperty(e, '__esModule', {value: !0}),
+ Object.defineProperty(e, 'ALIAS_KEYS', {
+ enumerable: !0,
+ get: function () {
+ return t.ALIAS_KEYS;
+ },
+ }),
+ Object.defineProperty(e, 'BUILDER_KEYS', {
+ enumerable: !0,
+ get: function () {
+ return t.BUILDER_KEYS;
+ },
+ }),
+ Object.defineProperty(e, 'DEPRECATED_ALIASES', {
+ enumerable: !0,
+ get: function () {
+ return i.DEPRECATED_ALIASES;
+ },
+ }),
+ Object.defineProperty(e, 'DEPRECATED_KEYS', {
+ enumerable: !0,
+ get: function () {
+ return t.DEPRECATED_KEYS;
+ },
+ }),
+ Object.defineProperty(e, 'FLIPPED_ALIAS_KEYS', {
+ enumerable: !0,
+ get: function () {
+ return t.FLIPPED_ALIAS_KEYS;
+ },
+ }),
+ Object.defineProperty(e, 'NODE_FIELDS', {
+ enumerable: !0,
+ get: function () {
+ return t.NODE_FIELDS;
+ },
+ }),
+ Object.defineProperty(e, 'NODE_PARENT_VALIDATIONS', {
+ enumerable: !0,
+ get: function () {
+ return t.NODE_PARENT_VALIDATIONS;
+ },
+ }),
+ Object.defineProperty(e, 'PLACEHOLDERS', {
+ enumerable: !0,
+ get: function () {
+ return n.PLACEHOLDERS;
+ },
+ }),
+ Object.defineProperty(e, 'PLACEHOLDERS_ALIAS', {
+ enumerable: !0,
+ get: function () {
+ return n.PLACEHOLDERS_ALIAS;
+ },
+ }),
+ Object.defineProperty(e, 'PLACEHOLDERS_FLIPPED_ALIAS', {
+ enumerable: !0,
+ get: function () {
+ return n.PLACEHOLDERS_FLIPPED_ALIAS;
+ },
+ }),
+ (e.TYPES = void 0),
+ Object.defineProperty(e, 'VISITOR_KEYS', {
+ enumerable: !0,
+ get: function () {
+ return t.VISITOR_KEYS;
+ },
+ }),
+ Zm(),
+ FF(),
+ zF(),
+ BF(),
+ UF(),
+ ZF();
+ var t = qi(),
+ n = $0(),
+ i = qF();
+ Object.keys(i.DEPRECATED_ALIASES).forEach((r) => {
+ t.FLIPPED_ALIAS_KEYS[r] =
+ t.FLIPPED_ALIAS_KEYS[i.DEPRECATED_ALIASES[r]];
+ }),
+ (e.TYPES = [].concat(
+ Object.keys(t.VISITOR_KEYS),
+ Object.keys(t.FLIPPED_ALIAS_KEYS),
+ Object.keys(t.DEPRECATED_KEYS)
+ ));
+ })(Pg)),
+ Pg
+ );
+ }
+ var Y_;
+ function lh() {
+ if (Y_) return aa;
+ (Y_ = 1),
+ Object.defineProperty(aa, '__esModule', {value: !0}),
+ (aa.default = t),
+ (aa.validateChild = r),
+ (aa.validateField = i),
+ (aa.validateInternal = n);
+ var e = br();
+ function t(a, o, s) {
+ if (!a) return;
+ let l = e.NODE_FIELDS[a.type];
+ if (!l) return;
+ let d = l[o];
+ i(a, o, s, d), r(a, o, s);
+ }
+ function n(a, o, s, l, d) {
+ if (
+ a != null &&
+ a.validate &&
+ !(a.optional && l == null) &&
+ (a.validate(o, s, l), d)
+ ) {
+ var u;
+ let p = l.type;
+ if (p == null) return;
+ (u = e.NODE_PARENT_VALIDATIONS[p]) == null ||
+ u.call(e.NODE_PARENT_VALIDATIONS, o, s, l);
+ }
+ }
+ function i(a, o, s, l) {
+ l != null &&
+ l.validate &&
+ ((l.optional && s == null) || l.validate(a, o, s));
+ }
+ function r(a, o, s) {
+ var l;
+ let d = s?.type;
+ d != null &&
+ ((l = e.NODE_PARENT_VALIDATIONS[d]) == null ||
+ l.call(e.NODE_PARENT_VALIDATIONS, a, o, s));
+ }
+ return aa;
+ }
+ var Q_;
+ function Bn() {
+ if (Q_) return C;
+ (Q_ = 1),
+ Object.defineProperty(C, '__esModule', {value: !0}),
+ (C.anyTypeAnnotation = jo),
+ (C.argumentPlaceholder = ol),
+ (C.arrayExpression = a),
+ (C.arrayPattern = ee),
+ (C.arrayTypeAnnotation = Co),
+ (C.arrowFunctionExpression = ge),
+ (C.assignmentExpression = o),
+ (C.assignmentPattern = X),
+ (C.awaitExpression = bo),
+ (C.bigIntLiteral = So),
+ (C.binaryExpression = s),
+ (C.bindExpression = sl),
+ (C.blockStatement = p),
+ (C.booleanLiteral = $e),
+ (C.booleanLiteralTypeAnnotation = Ao),
+ (C.booleanTypeAnnotation = Do),
+ (C.breakStatement = y),
+ (C.callExpression = m),
+ (C.catchClause = g),
+ (C.classAccessorProperty = Po),
+ (C.classBody = fe),
+ (C.classDeclaration = me),
+ (C.classExpression = we),
+ (C.classImplements = No),
+ (C.classMethod = Ve),
+ (C.classPrivateMethod = wo),
+ (C.classPrivateProperty = xo),
+ (C.classProperty = Io),
+ (C.conditionalExpression = S),
+ (C.continueStatement = _),
+ (C.debuggerStatement = O),
+ (C.decimalLiteral = ml),
+ (C.declareClass = Ro),
+ (C.declareExportAllDeclaration = Vo),
+ (C.declareExportDeclaration = Ko),
+ (C.declareFunction = Lo),
+ (C.declareInterface = Fo),
+ (C.declareModule = zo),
+ (C.declareModuleExports = Bo),
+ (C.declareOpaqueType = Zo),
+ (C.declareTypeAlias = Uo),
+ (C.declareVariable = qo),
+ (C.declaredPredicate = Jo),
+ (C.decorator = cl),
+ (C.directive = d),
+ (C.directiveLiteral = u),
+ (C.doExpression = ul),
+ (C.doWhileStatement = P),
+ (C.emptyStatement = M),
+ (C.emptyTypeAnnotation = is),
+ (C.enumBooleanBody = Cs),
+ (C.enumBooleanMember = Ns),
+ (C.enumDeclaration = js),
+ (C.enumDefaultedMember = Fs),
+ (C.enumNumberBody = Ds),
+ (C.enumNumberMember = Rs),
+ (C.enumStringBody = As),
+ (C.enumStringMember = Ls),
+ (C.enumSymbolBody = Ms),
+ (C.existsTypeAnnotation = Ho),
+ (C.exportAllDeclaration = ze),
+ (C.exportDefaultDeclaration = Ce),
+ (C.exportDefaultSpecifier = dl),
+ (C.exportNamedDeclaration = lt),
+ (C.exportNamespaceSpecifier = _o),
+ (C.exportSpecifier = ne),
+ (C.expressionStatement = w),
+ (C.file = I),
+ (C.forInStatement = U),
+ (C.forOfStatement = he),
+ (C.forStatement = A),
+ (C.functionDeclaration = q),
+ (C.functionExpression = ae),
+ (C.functionTypeAnnotation = Wo),
+ (C.functionTypeParam = Go),
+ (C.genericTypeAnnotation = Xo),
+ (C.identifier = le),
+ (C.ifStatement = G),
+ (C.import = ko),
+ (C.importAttribute = ll),
+ (C.importDeclaration = Ke),
+ (C.importDefaultSpecifier = Ge),
+ (C.importExpression = It),
+ (C.importNamespaceSpecifier = Qe),
+ (C.importSpecifier = se),
+ (C.indexedAccessType = zs),
+ (C.inferredPredicate = Yo),
+ (C.interfaceDeclaration = es),
+ (C.interfaceExtends = Qo),
+ (C.interfaceTypeAnnotation = ts),
+ (C.interpreterDirective = l),
+ (C.intersectionTypeAnnotation = ns),
+ (C.jSXAttribute = C.jsxAttribute = Us),
+ (C.jSXClosingElement = C.jsxClosingElement = Zs),
+ (C.jSXClosingFragment = C.jsxClosingFragment = nl),
+ (C.jSXElement = C.jsxElement = qs),
+ (C.jSXEmptyExpression = C.jsxEmptyExpression = Ks),
+ (C.jSXExpressionContainer = C.jsxExpressionContainer = Vs),
+ (C.jSXFragment = C.jsxFragment = el),
+ (C.jSXIdentifier = C.jsxIdentifier = Hs),
+ (C.jSXMemberExpression = C.jsxMemberExpression = Ws),
+ (C.jSXNamespacedName = C.jsxNamespacedName = Gs),
+ (C.jSXOpeningElement = C.jsxOpeningElement = Xs),
+ (C.jSXOpeningFragment = C.jsxOpeningFragment = tl),
+ (C.jSXSpreadAttribute = C.jsxSpreadAttribute = Ys),
+ (C.jSXSpreadChild = C.jsxSpreadChild = Js),
+ (C.jSXText = C.jsxText = Qs),
+ (C.labeledStatement = ve),
+ (C.logicalExpression = Pe),
+ (C.memberExpression = ke),
+ (C.metaProperty = pt),
+ (C.mixedTypeAnnotation = rs),
+ (C.moduleExpression = yl),
+ (C.newExpression = je),
+ (C.noop = rl),
+ (C.nullLiteral = be),
+ (C.nullLiteralTypeAnnotation = Mo),
+ (C.nullableTypeAnnotation = as),
+ (C.numberLiteral = jc),
+ (C.numberLiteralTypeAnnotation = os),
+ (C.numberTypeAnnotation = ss),
+ (C.numericLiteral = oe),
+ (C.objectExpression = Ye),
+ (C.objectMethod = bt),
+ (C.objectPattern = et),
+ (C.objectProperty = st),
+ (C.objectTypeAnnotation = ls),
+ (C.objectTypeCallProperty = us),
+ (C.objectTypeIndexer = ds),
+ (C.objectTypeInternalSlot = cs),
+ (C.objectTypeProperty = fs),
+ (C.objectTypeSpreadProperty = ps),
+ (C.opaqueType = ms),
+ (C.optionalCallExpression = Eo),
+ (C.optionalIndexedAccessType = Bs),
+ (C.optionalMemberExpression = To),
+ (C.parenthesizedExpression = qt),
+ (C.pipelineBareFunction = hl),
+ (C.pipelinePrimaryTopicReference = bl),
+ (C.pipelineTopicExpression = vl),
+ (C.placeholder = il),
+ (C.privateName = Oo),
+ (C.program = Ae),
+ (C.qualifiedTypeIdentifier = ys),
+ (C.recordExpression = fl),
+ (C.regExpLiteral = Ie),
+ (C.regexLiteral = Cc),
+ (C.restElement = tt),
+ (C.restProperty = Dc),
+ (C.returnStatement = yt),
+ (C.sequenceExpression = dt),
+ (C.spreadElement = $t),
+ (C.spreadProperty = Ac),
+ (C.staticBlock = $o),
+ (C.stringLiteral = de),
+ (C.stringLiteralTypeAnnotation = gs),
+ (C.stringTypeAnnotation = vs),
+ (C.super = an),
+ (C.switchCase = J),
+ (C.switchStatement = Xe),
+ (C.symbolTypeAnnotation = hs),
+ (C.taggedTemplateExpression = Jt),
+ (C.templateElement = pn),
+ (C.templateLiteral = Sr),
+ (C.thisExpression = it),
+ (C.thisTypeAnnotation = bs),
+ (C.throwStatement = mt),
+ (C.topicReference = gl),
+ (C.tryStatement = Et),
+ (C.tSAnyKeyword = C.tsAnyKeyword = Ol),
+ (C.tSArrayType = C.tsArrayType = Wl),
+ (C.tSAsExpression = C.tsAsExpression = mc),
+ (C.tSBigIntKeyword = C.tsBigIntKeyword = jl),
+ (C.tSBooleanKeyword = C.tsBooleanKeyword = $l),
+ (C.tSCallSignatureDeclaration = C.tsCallSignatureDeclaration = El),
+ (C.tSConditionalType = C.tsConditionalType = nc),
+ (C.tSConstructSignatureDeclaration = C.tsConstructSignatureDeclaration =
+ Il),
+ (C.tSConstructorType = C.tsConstructorType = ql),
+ (C.tSDeclareFunction = C.tsDeclareFunction = Sl),
+ (C.tSDeclareMethod = C.tsDeclareMethod = _l),
+ (C.tSEnumDeclaration = C.tsEnumDeclaration = vc),
+ (C.tSEnumMember = C.tsEnumMember = hc),
+ (C.tSExportAssignment = C.tsExportAssignment = Ic),
+ (C.tSExpressionWithTypeArguments = C.tsExpressionWithTypeArguments = cc),
+ (C.tSExternalModuleReference = C.tsExternalModuleReference = Tc),
+ (C.tSFunctionType = C.tsFunctionType = Zl),
+ (C.tSImportEqualsDeclaration = C.tsImportEqualsDeclaration = _c),
+ (C.tSImportType = C.tsImportType = Sc),
+ (C.tSIndexSignature = C.tsIndexSignature = wl),
+ (C.tSIndexedAccessType = C.tsIndexedAccessType = oc),
+ (C.tSInferType = C.tsInferType = rc),
+ (C.tSInstantiationExpression = C.tsInstantiationExpression = pc),
+ (C.tSInterfaceBody = C.tsInterfaceBody = dc),
+ (C.tSInterfaceDeclaration = C.tsInterfaceDeclaration = uc),
+ (C.tSIntersectionType = C.tsIntersectionType = tc),
+ (C.tSIntrinsicKeyword = C.tsIntrinsicKeyword = Cl),
+ (C.tSLiteralType = C.tsLiteralType = lc),
+ (C.tSMappedType = C.tsMappedType = sc),
+ (C.tSMethodSignature = C.tsMethodSignature = xl),
+ (C.tSModuleBlock = C.tsModuleBlock = kc),
+ (C.tSModuleDeclaration = C.tsModuleDeclaration = bc),
+ (C.tSNamedTupleMember = C.tsNamedTupleMember = Ql),
+ (C.tSNamespaceExportDeclaration = C.tsNamespaceExportDeclaration = Pc),
+ (C.tSNeverKeyword = C.tsNeverKeyword = Dl),
+ (C.tSNonNullExpression = C.tsNonNullExpression = Ec),
+ (C.tSNullKeyword = C.tsNullKeyword = Al),
+ (C.tSNumberKeyword = C.tsNumberKeyword = Ml),
+ (C.tSObjectKeyword = C.tsObjectKeyword = Nl),
+ (C.tSOptionalType = C.tsOptionalType = Xl),
+ (C.tSParameterProperty = C.tsParameterProperty = kl),
+ (C.tSParenthesizedType = C.tsParenthesizedType = ic),
+ (C.tSPropertySignature = C.tsPropertySignature = Pl),
+ (C.tSQualifiedName = C.tsQualifiedName = Tl),
+ (C.tSRestType = C.tsRestType = Yl),
+ (C.tSSatisfiesExpression = C.tsSatisfiesExpression = yc),
+ (C.tSStringKeyword = C.tsStringKeyword = Rl),
+ (C.tSSymbolKeyword = C.tsSymbolKeyword = Ll),
+ (C.tSThisType = C.tsThisType = Ul),
+ (C.tSTupleType = C.tsTupleType = Gl),
+ (C.tSTypeAliasDeclaration = C.tsTypeAliasDeclaration = fc),
+ (C.tSTypeAnnotation = C.tsTypeAnnotation = xc),
+ (C.tSTypeAssertion = C.tsTypeAssertion = gc),
+ (C.tSTypeLiteral = C.tsTypeLiteral = Hl),
+ (C.tSTypeOperator = C.tsTypeOperator = ac),
+ (C.tSTypeParameter = C.tsTypeParameter = $c),
+ (C.tSTypeParameterDeclaration = C.tsTypeParameterDeclaration = Oc),
+ (C.tSTypeParameterInstantiation = C.tsTypeParameterInstantiation = wc),
+ (C.tSTypePredicate = C.tsTypePredicate = Vl),
+ (C.tSTypeQuery = C.tsTypeQuery = Jl),
+ (C.tSTypeReference = C.tsTypeReference = Kl),
+ (C.tSUndefinedKeyword = C.tsUndefinedKeyword = Fl),
+ (C.tSUnionType = C.tsUnionType = ec),
+ (C.tSUnknownKeyword = C.tsUnknownKeyword = zl),
+ (C.tSVoidKeyword = C.tsVoidKeyword = Bl),
+ (C.tupleExpression = pl),
+ (C.tupleTypeAnnotation = ks),
+ (C.typeAlias = _s),
+ (C.typeAnnotation = Ts),
+ (C.typeCastExpression = Es),
+ (C.typeParameter = Is),
+ (C.typeParameterDeclaration = Ps),
+ (C.typeParameterInstantiation = xs),
+ (C.typeofTypeAnnotation = Ss),
+ (C.unaryExpression = ft),
+ (C.unionTypeAnnotation = ws),
+ (C.updateExpression = De),
+ (C.v8IntrinsicIdentifier = al),
+ (C.variableDeclaration = Y),
+ (C.variableDeclarator = ce),
+ (C.variance = Os),
+ (C.voidTypeAnnotation = $s),
+ (C.whileStatement = Ze),
+ (C.withStatement = Ne),
+ (C.yieldExpression = ho);
+ var e = lh(),
+ t = Bm(),
+ n = qi();
+ let {validateInternal: i} = e,
+ {NODE_FIELDS: r} = n;
+ function a(v = []) {
+ let h = {type: 'ArrayExpression', elements: v},
+ k = r.ArrayExpression;
+ return i(k.elements, h, 'elements', v, 1), h;
+ }
+ function o(v, h, k) {
+ let E = {type: 'AssignmentExpression', operator: v, left: h, right: k},
+ L = r.AssignmentExpression;
+ return (
+ i(L.operator, E, 'operator', v),
+ i(L.left, E, 'left', h, 1),
+ i(L.right, E, 'right', k, 1),
+ E
+ );
+ }
+ function s(v, h, k) {
+ let E = {type: 'BinaryExpression', operator: v, left: h, right: k},
+ L = r.BinaryExpression;
+ return (
+ i(L.operator, E, 'operator', v),
+ i(L.left, E, 'left', h, 1),
+ i(L.right, E, 'right', k, 1),
+ E
+ );
+ }
+ function l(v) {
+ let h = {type: 'InterpreterDirective', value: v},
+ k = r.InterpreterDirective;
+ return i(k.value, h, 'value', v), h;
+ }
+ function d(v) {
+ let h = {type: 'Directive', value: v},
+ k = r.Directive;
+ return i(k.value, h, 'value', v, 1), h;
+ }
+ function u(v) {
+ let h = {type: 'DirectiveLiteral', value: v},
+ k = r.DirectiveLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function p(v, h = []) {
+ let k = {type: 'BlockStatement', body: v, directives: h},
+ E = r.BlockStatement;
+ return (
+ i(E.body, k, 'body', v, 1), i(E.directives, k, 'directives', h, 1), k
+ );
+ }
+ function y(v = null) {
+ let h = {type: 'BreakStatement', label: v},
+ k = r.BreakStatement;
+ return i(k.label, h, 'label', v, 1), h;
+ }
+ function m(v, h) {
+ let k = {type: 'CallExpression', callee: v, arguments: h},
+ E = r.CallExpression;
+ return (
+ i(E.callee, k, 'callee', v, 1), i(E.arguments, k, 'arguments', h, 1), k
+ );
+ }
+ function g(v = null, h) {
+ let k = {type: 'CatchClause', param: v, body: h},
+ E = r.CatchClause;
+ return i(E.param, k, 'param', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function S(v, h, k) {
+ let E = {
+ type: 'ConditionalExpression',
+ test: v,
+ consequent: h,
+ alternate: k,
+ },
+ L = r.ConditionalExpression;
+ return (
+ i(L.test, E, 'test', v, 1),
+ i(L.consequent, E, 'consequent', h, 1),
+ i(L.alternate, E, 'alternate', k, 1),
+ E
+ );
+ }
+ function _(v = null) {
+ let h = {type: 'ContinueStatement', label: v},
+ k = r.ContinueStatement;
+ return i(k.label, h, 'label', v, 1), h;
+ }
+ function O() {
+ return {type: 'DebuggerStatement'};
+ }
+ function P(v, h) {
+ let k = {type: 'DoWhileStatement', test: v, body: h},
+ E = r.DoWhileStatement;
+ return i(E.test, k, 'test', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function M() {
+ return {type: 'EmptyStatement'};
+ }
+ function w(v) {
+ let h = {type: 'ExpressionStatement', expression: v},
+ k = r.ExpressionStatement;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function I(v, h = null, k = null) {
+ let E = {type: 'File', program: v, comments: h, tokens: k},
+ L = r.File;
+ return (
+ i(L.program, E, 'program', v, 1),
+ i(L.comments, E, 'comments', h, 1),
+ i(L.tokens, E, 'tokens', k),
+ E
+ );
+ }
+ function U(v, h, k) {
+ let E = {type: 'ForInStatement', left: v, right: h, body: k},
+ L = r.ForInStatement;
+ return (
+ i(L.left, E, 'left', v, 1),
+ i(L.right, E, 'right', h, 1),
+ i(L.body, E, 'body', k, 1),
+ E
+ );
+ }
+ function A(v = null, h = null, k = null, E) {
+ let L = {type: 'ForStatement', init: v, test: h, update: k, body: E},
+ H = r.ForStatement;
+ return (
+ i(H.init, L, 'init', v, 1),
+ i(H.test, L, 'test', h, 1),
+ i(H.update, L, 'update', k, 1),
+ i(H.body, L, 'body', E, 1),
+ L
+ );
+ }
+ function q(v = null, h, k, E = !1, L = !1) {
+ let H = {
+ type: 'FunctionDeclaration',
+ id: v,
+ params: h,
+ body: k,
+ generator: E,
+ async: L,
+ },
+ He = r.FunctionDeclaration;
+ return (
+ i(He.id, H, 'id', v, 1),
+ i(He.params, H, 'params', h, 1),
+ i(He.body, H, 'body', k, 1),
+ i(He.generator, H, 'generator', E),
+ i(He.async, H, 'async', L),
+ H
+ );
+ }
+ function ae(v = null, h, k, E = !1, L = !1) {
+ let H = {
+ type: 'FunctionExpression',
+ id: v,
+ params: h,
+ body: k,
+ generator: E,
+ async: L,
+ },
+ He = r.FunctionExpression;
+ return (
+ i(He.id, H, 'id', v, 1),
+ i(He.params, H, 'params', h, 1),
+ i(He.body, H, 'body', k, 1),
+ i(He.generator, H, 'generator', E),
+ i(He.async, H, 'async', L),
+ H
+ );
+ }
+ function le(v) {
+ let h = {type: 'Identifier', name: v},
+ k = r.Identifier;
+ return i(k.name, h, 'name', v), h;
+ }
+ function G(v, h, k = null) {
+ let E = {type: 'IfStatement', test: v, consequent: h, alternate: k},
+ L = r.IfStatement;
+ return (
+ i(L.test, E, 'test', v, 1),
+ i(L.consequent, E, 'consequent', h, 1),
+ i(L.alternate, E, 'alternate', k, 1),
+ E
+ );
+ }
+ function ve(v, h) {
+ let k = {type: 'LabeledStatement', label: v, body: h},
+ E = r.LabeledStatement;
+ return i(E.label, k, 'label', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function de(v) {
+ let h = {type: 'StringLiteral', value: v},
+ k = r.StringLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function oe(v) {
+ let h = {type: 'NumericLiteral', value: v},
+ k = r.NumericLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function be() {
+ return {type: 'NullLiteral'};
+ }
+ function $e(v) {
+ let h = {type: 'BooleanLiteral', value: v},
+ k = r.BooleanLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function Ie(v, h = '') {
+ let k = {type: 'RegExpLiteral', pattern: v, flags: h},
+ E = r.RegExpLiteral;
+ return i(E.pattern, k, 'pattern', v), i(E.flags, k, 'flags', h), k;
+ }
+ function Pe(v, h, k) {
+ let E = {type: 'LogicalExpression', operator: v, left: h, right: k},
+ L = r.LogicalExpression;
+ return (
+ i(L.operator, E, 'operator', v),
+ i(L.left, E, 'left', h, 1),
+ i(L.right, E, 'right', k, 1),
+ E
+ );
+ }
+ function ke(v, h, k = !1, E = null) {
+ let L = {
+ type: 'MemberExpression',
+ object: v,
+ property: h,
+ computed: k,
+ optional: E,
+ },
+ H = r.MemberExpression;
+ return (
+ i(H.object, L, 'object', v, 1),
+ i(H.property, L, 'property', h, 1),
+ i(H.computed, L, 'computed', k),
+ i(H.optional, L, 'optional', E),
+ L
+ );
+ }
+ function je(v, h) {
+ let k = {type: 'NewExpression', callee: v, arguments: h},
+ E = r.NewExpression;
+ return (
+ i(E.callee, k, 'callee', v, 1), i(E.arguments, k, 'arguments', h, 1), k
+ );
+ }
+ function Ae(v, h = [], k = 'script', E = null) {
+ let L = {
+ type: 'Program',
+ body: v,
+ directives: h,
+ sourceType: k,
+ interpreter: E,
+ },
+ H = r.Program;
+ return (
+ i(H.body, L, 'body', v, 1),
+ i(H.directives, L, 'directives', h, 1),
+ i(H.sourceType, L, 'sourceType', k),
+ i(H.interpreter, L, 'interpreter', E, 1),
+ L
+ );
+ }
+ function Ye(v) {
+ let h = {type: 'ObjectExpression', properties: v},
+ k = r.ObjectExpression;
+ return i(k.properties, h, 'properties', v, 1), h;
+ }
+ function bt(v = 'method', h, k, E, L = !1, H = !1, He = !1) {
+ let Ft = {
+ type: 'ObjectMethod',
+ kind: v,
+ key: h,
+ params: k,
+ body: E,
+ computed: L,
+ generator: H,
+ async: He,
+ },
+ on = r.ObjectMethod;
+ return (
+ i(on.kind, Ft, 'kind', v),
+ i(on.key, Ft, 'key', h, 1),
+ i(on.params, Ft, 'params', k, 1),
+ i(on.body, Ft, 'body', E, 1),
+ i(on.computed, Ft, 'computed', L),
+ i(on.generator, Ft, 'generator', H),
+ i(on.async, Ft, 'async', He),
+ Ft
+ );
+ }
+ function st(v, h, k = !1, E = !1, L = null) {
+ let H = {
+ type: 'ObjectProperty',
+ key: v,
+ value: h,
+ computed: k,
+ shorthand: E,
+ decorators: L,
+ },
+ He = r.ObjectProperty;
+ return (
+ i(He.key, H, 'key', v, 1),
+ i(He.value, H, 'value', h, 1),
+ i(He.computed, H, 'computed', k),
+ i(He.shorthand, H, 'shorthand', E),
+ i(He.decorators, H, 'decorators', L, 1),
+ H
+ );
+ }
+ function tt(v) {
+ let h = {type: 'RestElement', argument: v},
+ k = r.RestElement;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function yt(v = null) {
+ let h = {type: 'ReturnStatement', argument: v},
+ k = r.ReturnStatement;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function dt(v) {
+ let h = {type: 'SequenceExpression', expressions: v},
+ k = r.SequenceExpression;
+ return i(k.expressions, h, 'expressions', v, 1), h;
+ }
+ function qt(v) {
+ let h = {type: 'ParenthesizedExpression', expression: v},
+ k = r.ParenthesizedExpression;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function J(v = null, h) {
+ let k = {type: 'SwitchCase', test: v, consequent: h},
+ E = r.SwitchCase;
+ return (
+ i(E.test, k, 'test', v, 1), i(E.consequent, k, 'consequent', h, 1), k
+ );
+ }
+ function Xe(v, h) {
+ let k = {type: 'SwitchStatement', discriminant: v, cases: h},
+ E = r.SwitchStatement;
+ return (
+ i(E.discriminant, k, 'discriminant', v, 1),
+ i(E.cases, k, 'cases', h, 1),
+ k
+ );
+ }
+ function it() {
+ return {type: 'ThisExpression'};
+ }
+ function mt(v) {
+ let h = {type: 'ThrowStatement', argument: v},
+ k = r.ThrowStatement;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function Et(v, h = null, k = null) {
+ let E = {type: 'TryStatement', block: v, handler: h, finalizer: k},
+ L = r.TryStatement;
+ return (
+ i(L.block, E, 'block', v, 1),
+ i(L.handler, E, 'handler', h, 1),
+ i(L.finalizer, E, 'finalizer', k, 1),
+ E
+ );
+ }
+ function ft(v, h, k = !0) {
+ let E = {type: 'UnaryExpression', operator: v, argument: h, prefix: k},
+ L = r.UnaryExpression;
+ return (
+ i(L.operator, E, 'operator', v),
+ i(L.argument, E, 'argument', h, 1),
+ i(L.prefix, E, 'prefix', k),
+ E
+ );
+ }
+ function De(v, h, k = !1) {
+ let E = {type: 'UpdateExpression', operator: v, argument: h, prefix: k},
+ L = r.UpdateExpression;
+ return (
+ i(L.operator, E, 'operator', v),
+ i(L.argument, E, 'argument', h, 1),
+ i(L.prefix, E, 'prefix', k),
+ E
+ );
+ }
+ function Y(v, h) {
+ let k = {type: 'VariableDeclaration', kind: v, declarations: h},
+ E = r.VariableDeclaration;
+ return (
+ i(E.kind, k, 'kind', v), i(E.declarations, k, 'declarations', h, 1), k
+ );
+ }
+ function ce(v, h = null) {
+ let k = {type: 'VariableDeclarator', id: v, init: h},
+ E = r.VariableDeclarator;
+ return i(E.id, k, 'id', v, 1), i(E.init, k, 'init', h, 1), k;
+ }
+ function Ze(v, h) {
+ let k = {type: 'WhileStatement', test: v, body: h},
+ E = r.WhileStatement;
+ return i(E.test, k, 'test', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function Ne(v, h) {
+ let k = {type: 'WithStatement', object: v, body: h},
+ E = r.WithStatement;
+ return i(E.object, k, 'object', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function X(v, h) {
+ let k = {type: 'AssignmentPattern', left: v, right: h},
+ E = r.AssignmentPattern;
+ return i(E.left, k, 'left', v, 1), i(E.right, k, 'right', h, 1), k;
+ }
+ function ee(v) {
+ let h = {type: 'ArrayPattern', elements: v},
+ k = r.ArrayPattern;
+ return i(k.elements, h, 'elements', v, 1), h;
+ }
+ function ge(v, h, k = !1) {
+ let E = {
+ type: 'ArrowFunctionExpression',
+ params: v,
+ body: h,
+ async: k,
+ expression: null,
+ },
+ L = r.ArrowFunctionExpression;
+ return (
+ i(L.params, E, 'params', v, 1),
+ i(L.body, E, 'body', h, 1),
+ i(L.async, E, 'async', k),
+ E
+ );
+ }
+ function fe(v) {
+ let h = {type: 'ClassBody', body: v},
+ k = r.ClassBody;
+ return i(k.body, h, 'body', v, 1), h;
+ }
+ function we(v = null, h = null, k, E = null) {
+ let L = {
+ type: 'ClassExpression',
+ id: v,
+ superClass: h,
+ body: k,
+ decorators: E,
+ },
+ H = r.ClassExpression;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.superClass, L, 'superClass', h, 1),
+ i(H.body, L, 'body', k, 1),
+ i(H.decorators, L, 'decorators', E, 1),
+ L
+ );
+ }
+ function me(v = null, h = null, k, E = null) {
+ let L = {
+ type: 'ClassDeclaration',
+ id: v,
+ superClass: h,
+ body: k,
+ decorators: E,
+ },
+ H = r.ClassDeclaration;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.superClass, L, 'superClass', h, 1),
+ i(H.body, L, 'body', k, 1),
+ i(H.decorators, L, 'decorators', E, 1),
+ L
+ );
+ }
+ function ze(v) {
+ let h = {type: 'ExportAllDeclaration', source: v},
+ k = r.ExportAllDeclaration;
+ return i(k.source, h, 'source', v, 1), h;
+ }
+ function Ce(v) {
+ let h = {type: 'ExportDefaultDeclaration', declaration: v},
+ k = r.ExportDefaultDeclaration;
+ return i(k.declaration, h, 'declaration', v, 1), h;
+ }
+ function lt(v = null, h = [], k = null) {
+ let E = {
+ type: 'ExportNamedDeclaration',
+ declaration: v,
+ specifiers: h,
+ source: k,
+ },
+ L = r.ExportNamedDeclaration;
+ return (
+ i(L.declaration, E, 'declaration', v, 1),
+ i(L.specifiers, E, 'specifiers', h, 1),
+ i(L.source, E, 'source', k, 1),
+ E
+ );
+ }
+ function ne(v, h) {
+ let k = {type: 'ExportSpecifier', local: v, exported: h},
+ E = r.ExportSpecifier;
+ return (
+ i(E.local, k, 'local', v, 1), i(E.exported, k, 'exported', h, 1), k
+ );
+ }
+ function he(v, h, k, E = !1) {
+ let L = {type: 'ForOfStatement', left: v, right: h, body: k, await: E},
+ H = r.ForOfStatement;
+ return (
+ i(H.left, L, 'left', v, 1),
+ i(H.right, L, 'right', h, 1),
+ i(H.body, L, 'body', k, 1),
+ i(H.await, L, 'await', E),
+ L
+ );
+ }
+ function Ke(v, h) {
+ let k = {type: 'ImportDeclaration', specifiers: v, source: h},
+ E = r.ImportDeclaration;
+ return (
+ i(E.specifiers, k, 'specifiers', v, 1),
+ i(E.source, k, 'source', h, 1),
+ k
+ );
+ }
+ function Ge(v) {
+ let h = {type: 'ImportDefaultSpecifier', local: v},
+ k = r.ImportDefaultSpecifier;
+ return i(k.local, h, 'local', v, 1), h;
+ }
+ function Qe(v) {
+ let h = {type: 'ImportNamespaceSpecifier', local: v},
+ k = r.ImportNamespaceSpecifier;
+ return i(k.local, h, 'local', v, 1), h;
+ }
+ function se(v, h) {
+ let k = {type: 'ImportSpecifier', local: v, imported: h},
+ E = r.ImportSpecifier;
+ return (
+ i(E.local, k, 'local', v, 1), i(E.imported, k, 'imported', h, 1), k
+ );
+ }
+ function It(v, h = null) {
+ let k = {type: 'ImportExpression', source: v, options: h},
+ E = r.ImportExpression;
+ return (
+ i(E.source, k, 'source', v, 1), i(E.options, k, 'options', h, 1), k
+ );
+ }
+ function pt(v, h) {
+ let k = {type: 'MetaProperty', meta: v, property: h},
+ E = r.MetaProperty;
+ return i(E.meta, k, 'meta', v, 1), i(E.property, k, 'property', h, 1), k;
+ }
+ function Ve(v = 'method', h, k, E, L = !1, H = !1, He = !1, Ft = !1) {
+ let on = {
+ type: 'ClassMethod',
+ kind: v,
+ key: h,
+ params: k,
+ body: E,
+ computed: L,
+ static: H,
+ generator: He,
+ async: Ft,
+ },
+ er = r.ClassMethod;
+ return (
+ i(er.kind, on, 'kind', v),
+ i(er.key, on, 'key', h, 1),
+ i(er.params, on, 'params', k, 1),
+ i(er.body, on, 'body', E, 1),
+ i(er.computed, on, 'computed', L),
+ i(er.static, on, 'static', H),
+ i(er.generator, on, 'generator', He),
+ i(er.async, on, 'async', Ft),
+ on
+ );
+ }
+ function et(v) {
+ let h = {type: 'ObjectPattern', properties: v},
+ k = r.ObjectPattern;
+ return i(k.properties, h, 'properties', v, 1), h;
+ }
+ function $t(v) {
+ let h = {type: 'SpreadElement', argument: v},
+ k = r.SpreadElement;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function an() {
+ return {type: 'Super'};
+ }
+ function Jt(v, h) {
+ let k = {type: 'TaggedTemplateExpression', tag: v, quasi: h},
+ E = r.TaggedTemplateExpression;
+ return i(E.tag, k, 'tag', v, 1), i(E.quasi, k, 'quasi', h, 1), k;
+ }
+ function pn(v, h = !1) {
+ let k = {type: 'TemplateElement', value: v, tail: h},
+ E = r.TemplateElement;
+ return i(E.value, k, 'value', v), i(E.tail, k, 'tail', h), k;
+ }
+ function Sr(v, h) {
+ let k = {type: 'TemplateLiteral', quasis: v, expressions: h},
+ E = r.TemplateLiteral;
+ return (
+ i(E.quasis, k, 'quasis', v, 1),
+ i(E.expressions, k, 'expressions', h, 1),
+ k
+ );
+ }
+ function ho(v = null, h = !1) {
+ let k = {type: 'YieldExpression', argument: v, delegate: h},
+ E = r.YieldExpression;
+ return (
+ i(E.argument, k, 'argument', v, 1), i(E.delegate, k, 'delegate', h), k
+ );
+ }
+ function bo(v) {
+ let h = {type: 'AwaitExpression', argument: v},
+ k = r.AwaitExpression;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function ko() {
+ return {type: 'Import'};
+ }
+ function So(v) {
+ let h = {type: 'BigIntLiteral', value: v},
+ k = r.BigIntLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function _o(v) {
+ let h = {type: 'ExportNamespaceSpecifier', exported: v},
+ k = r.ExportNamespaceSpecifier;
+ return i(k.exported, h, 'exported', v, 1), h;
+ }
+ function To(v, h, k = !1, E) {
+ let L = {
+ type: 'OptionalMemberExpression',
+ object: v,
+ property: h,
+ computed: k,
+ optional: E,
+ },
+ H = r.OptionalMemberExpression;
+ return (
+ i(H.object, L, 'object', v, 1),
+ i(H.property, L, 'property', h, 1),
+ i(H.computed, L, 'computed', k),
+ i(H.optional, L, 'optional', E),
+ L
+ );
+ }
+ function Eo(v, h, k) {
+ let E = {
+ type: 'OptionalCallExpression',
+ callee: v,
+ arguments: h,
+ optional: k,
+ },
+ L = r.OptionalCallExpression;
+ return (
+ i(L.callee, E, 'callee', v, 1),
+ i(L.arguments, E, 'arguments', h, 1),
+ i(L.optional, E, 'optional', k),
+ E
+ );
+ }
+ function Io(v, h = null, k = null, E = null, L = !1, H = !1) {
+ let He = {
+ type: 'ClassProperty',
+ key: v,
+ value: h,
+ typeAnnotation: k,
+ decorators: E,
+ computed: L,
+ static: H,
+ },
+ Ft = r.ClassProperty;
+ return (
+ i(Ft.key, He, 'key', v, 1),
+ i(Ft.value, He, 'value', h, 1),
+ i(Ft.typeAnnotation, He, 'typeAnnotation', k, 1),
+ i(Ft.decorators, He, 'decorators', E, 1),
+ i(Ft.computed, He, 'computed', L),
+ i(Ft.static, He, 'static', H),
+ He
+ );
+ }
+ function Po(v, h = null, k = null, E = null, L = !1, H = !1) {
+ let He = {
+ type: 'ClassAccessorProperty',
+ key: v,
+ value: h,
+ typeAnnotation: k,
+ decorators: E,
+ computed: L,
+ static: H,
+ },
+ Ft = r.ClassAccessorProperty;
+ return (
+ i(Ft.key, He, 'key', v, 1),
+ i(Ft.value, He, 'value', h, 1),
+ i(Ft.typeAnnotation, He, 'typeAnnotation', k, 1),
+ i(Ft.decorators, He, 'decorators', E, 1),
+ i(Ft.computed, He, 'computed', L),
+ i(Ft.static, He, 'static', H),
+ He
+ );
+ }
+ function xo(v, h = null, k = null, E = !1) {
+ let L = {
+ type: 'ClassPrivateProperty',
+ key: v,
+ value: h,
+ decorators: k,
+ static: E,
+ },
+ H = r.ClassPrivateProperty;
+ return (
+ i(H.key, L, 'key', v, 1),
+ i(H.value, L, 'value', h, 1),
+ i(H.decorators, L, 'decorators', k, 1),
+ i(H.static, L, 'static', E),
+ L
+ );
+ }
+ function wo(v = 'method', h, k, E, L = !1) {
+ let H = {
+ type: 'ClassPrivateMethod',
+ kind: v,
+ key: h,
+ params: k,
+ body: E,
+ static: L,
+ },
+ He = r.ClassPrivateMethod;
+ return (
+ i(He.kind, H, 'kind', v),
+ i(He.key, H, 'key', h, 1),
+ i(He.params, H, 'params', k, 1),
+ i(He.body, H, 'body', E, 1),
+ i(He.static, H, 'static', L),
+ H
+ );
+ }
+ function Oo(v) {
+ let h = {type: 'PrivateName', id: v},
+ k = r.PrivateName;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function $o(v) {
+ let h = {type: 'StaticBlock', body: v},
+ k = r.StaticBlock;
+ return i(k.body, h, 'body', v, 1), h;
+ }
+ function jo() {
+ return {type: 'AnyTypeAnnotation'};
+ }
+ function Co(v) {
+ let h = {type: 'ArrayTypeAnnotation', elementType: v},
+ k = r.ArrayTypeAnnotation;
+ return i(k.elementType, h, 'elementType', v, 1), h;
+ }
+ function Do() {
+ return {type: 'BooleanTypeAnnotation'};
+ }
+ function Ao(v) {
+ let h = {type: 'BooleanLiteralTypeAnnotation', value: v},
+ k = r.BooleanLiteralTypeAnnotation;
+ return i(k.value, h, 'value', v), h;
+ }
+ function Mo() {
+ return {type: 'NullLiteralTypeAnnotation'};
+ }
+ function No(v, h = null) {
+ let k = {type: 'ClassImplements', id: v, typeParameters: h},
+ E = r.ClassImplements;
+ return (
+ i(E.id, k, 'id', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function Ro(v, h = null, k = null, E) {
+ let L = {
+ type: 'DeclareClass',
+ id: v,
+ typeParameters: h,
+ extends: k,
+ body: E,
+ },
+ H = r.DeclareClass;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.extends, L, 'extends', k, 1),
+ i(H.body, L, 'body', E, 1),
+ L
+ );
+ }
+ function Lo(v) {
+ let h = {type: 'DeclareFunction', id: v},
+ k = r.DeclareFunction;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function Fo(v, h = null, k = null, E) {
+ let L = {
+ type: 'DeclareInterface',
+ id: v,
+ typeParameters: h,
+ extends: k,
+ body: E,
+ },
+ H = r.DeclareInterface;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.extends, L, 'extends', k, 1),
+ i(H.body, L, 'body', E, 1),
+ L
+ );
+ }
+ function zo(v, h, k = null) {
+ let E = {type: 'DeclareModule', id: v, body: h, kind: k},
+ L = r.DeclareModule;
+ return (
+ i(L.id, E, 'id', v, 1),
+ i(L.body, E, 'body', h, 1),
+ i(L.kind, E, 'kind', k),
+ E
+ );
+ }
+ function Bo(v) {
+ let h = {type: 'DeclareModuleExports', typeAnnotation: v},
+ k = r.DeclareModuleExports;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function Uo(v, h = null, k) {
+ let E = {type: 'DeclareTypeAlias', id: v, typeParameters: h, right: k},
+ L = r.DeclareTypeAlias;
+ return (
+ i(L.id, E, 'id', v, 1),
+ i(L.typeParameters, E, 'typeParameters', h, 1),
+ i(L.right, E, 'right', k, 1),
+ E
+ );
+ }
+ function Zo(v, h = null, k = null) {
+ let E = {
+ type: 'DeclareOpaqueType',
+ id: v,
+ typeParameters: h,
+ supertype: k,
+ },
+ L = r.DeclareOpaqueType;
+ return (
+ i(L.id, E, 'id', v, 1),
+ i(L.typeParameters, E, 'typeParameters', h, 1),
+ i(L.supertype, E, 'supertype', k, 1),
+ E
+ );
+ }
+ function qo(v) {
+ let h = {type: 'DeclareVariable', id: v},
+ k = r.DeclareVariable;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function Ko(v = null, h = null, k = null, E = null) {
+ let L = {
+ type: 'DeclareExportDeclaration',
+ declaration: v,
+ specifiers: h,
+ source: k,
+ attributes: E,
+ },
+ H = r.DeclareExportDeclaration;
+ return (
+ i(H.declaration, L, 'declaration', v, 1),
+ i(H.specifiers, L, 'specifiers', h, 1),
+ i(H.source, L, 'source', k, 1),
+ i(H.attributes, L, 'attributes', E, 1),
+ L
+ );
+ }
+ function Vo(v, h = null) {
+ let k = {type: 'DeclareExportAllDeclaration', source: v, attributes: h},
+ E = r.DeclareExportAllDeclaration;
+ return (
+ i(E.source, k, 'source', v, 1),
+ i(E.attributes, k, 'attributes', h, 1),
+ k
+ );
+ }
+ function Jo(v) {
+ let h = {type: 'DeclaredPredicate', value: v},
+ k = r.DeclaredPredicate;
+ return i(k.value, h, 'value', v, 1), h;
+ }
+ function Ho() {
+ return {type: 'ExistsTypeAnnotation'};
+ }
+ function Wo(v = null, h, k = null, E) {
+ let L = {
+ type: 'FunctionTypeAnnotation',
+ typeParameters: v,
+ params: h,
+ rest: k,
+ returnType: E,
+ },
+ H = r.FunctionTypeAnnotation;
+ return (
+ i(H.typeParameters, L, 'typeParameters', v, 1),
+ i(H.params, L, 'params', h, 1),
+ i(H.rest, L, 'rest', k, 1),
+ i(H.returnType, L, 'returnType', E, 1),
+ L
+ );
+ }
+ function Go(v = null, h) {
+ let k = {type: 'FunctionTypeParam', name: v, typeAnnotation: h},
+ E = r.FunctionTypeParam;
+ return (
+ i(E.name, k, 'name', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function Xo(v, h = null) {
+ let k = {type: 'GenericTypeAnnotation', id: v, typeParameters: h},
+ E = r.GenericTypeAnnotation;
+ return (
+ i(E.id, k, 'id', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function Yo() {
+ return {type: 'InferredPredicate'};
+ }
+ function Qo(v, h = null) {
+ let k = {type: 'InterfaceExtends', id: v, typeParameters: h},
+ E = r.InterfaceExtends;
+ return (
+ i(E.id, k, 'id', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function es(v, h = null, k = null, E) {
+ let L = {
+ type: 'InterfaceDeclaration',
+ id: v,
+ typeParameters: h,
+ extends: k,
+ body: E,
+ },
+ H = r.InterfaceDeclaration;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.extends, L, 'extends', k, 1),
+ i(H.body, L, 'body', E, 1),
+ L
+ );
+ }
+ function ts(v = null, h) {
+ let k = {type: 'InterfaceTypeAnnotation', extends: v, body: h},
+ E = r.InterfaceTypeAnnotation;
+ return i(E.extends, k, 'extends', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function ns(v) {
+ let h = {type: 'IntersectionTypeAnnotation', types: v},
+ k = r.IntersectionTypeAnnotation;
+ return i(k.types, h, 'types', v, 1), h;
+ }
+ function rs() {
+ return {type: 'MixedTypeAnnotation'};
+ }
+ function is() {
+ return {type: 'EmptyTypeAnnotation'};
+ }
+ function as(v) {
+ let h = {type: 'NullableTypeAnnotation', typeAnnotation: v},
+ k = r.NullableTypeAnnotation;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function os(v) {
+ let h = {type: 'NumberLiteralTypeAnnotation', value: v},
+ k = r.NumberLiteralTypeAnnotation;
+ return i(k.value, h, 'value', v), h;
+ }
+ function ss() {
+ return {type: 'NumberTypeAnnotation'};
+ }
+ function ls(v, h = [], k = [], E = [], L = !1) {
+ let H = {
+ type: 'ObjectTypeAnnotation',
+ properties: v,
+ indexers: h,
+ callProperties: k,
+ internalSlots: E,
+ exact: L,
+ },
+ He = r.ObjectTypeAnnotation;
+ return (
+ i(He.properties, H, 'properties', v, 1),
+ i(He.indexers, H, 'indexers', h, 1),
+ i(He.callProperties, H, 'callProperties', k, 1),
+ i(He.internalSlots, H, 'internalSlots', E, 1),
+ i(He.exact, H, 'exact', L),
+ H
+ );
+ }
+ function cs(v, h, k, E, L) {
+ let H = {
+ type: 'ObjectTypeInternalSlot',
+ id: v,
+ value: h,
+ optional: k,
+ static: E,
+ method: L,
+ },
+ He = r.ObjectTypeInternalSlot;
+ return (
+ i(He.id, H, 'id', v, 1),
+ i(He.value, H, 'value', h, 1),
+ i(He.optional, H, 'optional', k),
+ i(He.static, H, 'static', E),
+ i(He.method, H, 'method', L),
+ H
+ );
+ }
+ function us(v) {
+ let h = {type: 'ObjectTypeCallProperty', value: v, static: null},
+ k = r.ObjectTypeCallProperty;
+ return i(k.value, h, 'value', v, 1), h;
+ }
+ function ds(v = null, h, k, E = null) {
+ let L = {
+ type: 'ObjectTypeIndexer',
+ id: v,
+ key: h,
+ value: k,
+ variance: E,
+ static: null,
+ },
+ H = r.ObjectTypeIndexer;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.key, L, 'key', h, 1),
+ i(H.value, L, 'value', k, 1),
+ i(H.variance, L, 'variance', E, 1),
+ L
+ );
+ }
+ function fs(v, h, k = null) {
+ let E = {
+ type: 'ObjectTypeProperty',
+ key: v,
+ value: h,
+ variance: k,
+ kind: null,
+ method: null,
+ optional: null,
+ proto: null,
+ static: null,
+ },
+ L = r.ObjectTypeProperty;
+ return (
+ i(L.key, E, 'key', v, 1),
+ i(L.value, E, 'value', h, 1),
+ i(L.variance, E, 'variance', k, 1),
+ E
+ );
+ }
+ function ps(v) {
+ let h = {type: 'ObjectTypeSpreadProperty', argument: v},
+ k = r.ObjectTypeSpreadProperty;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function ms(v, h = null, k = null, E) {
+ let L = {
+ type: 'OpaqueType',
+ id: v,
+ typeParameters: h,
+ supertype: k,
+ impltype: E,
+ },
+ H = r.OpaqueType;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.supertype, L, 'supertype', k, 1),
+ i(H.impltype, L, 'impltype', E, 1),
+ L
+ );
+ }
+ function ys(v, h) {
+ let k = {type: 'QualifiedTypeIdentifier', id: v, qualification: h},
+ E = r.QualifiedTypeIdentifier;
+ return (
+ i(E.id, k, 'id', v, 1), i(E.qualification, k, 'qualification', h, 1), k
+ );
+ }
+ function gs(v) {
+ let h = {type: 'StringLiteralTypeAnnotation', value: v},
+ k = r.StringLiteralTypeAnnotation;
+ return i(k.value, h, 'value', v), h;
+ }
+ function vs() {
+ return {type: 'StringTypeAnnotation'};
+ }
+ function hs() {
+ return {type: 'SymbolTypeAnnotation'};
+ }
+ function bs() {
+ return {type: 'ThisTypeAnnotation'};
+ }
+ function ks(v) {
+ let h = {type: 'TupleTypeAnnotation', types: v},
+ k = r.TupleTypeAnnotation;
+ return i(k.types, h, 'types', v, 1), h;
+ }
+ function Ss(v) {
+ let h = {type: 'TypeofTypeAnnotation', argument: v},
+ k = r.TypeofTypeAnnotation;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function _s(v, h = null, k) {
+ let E = {type: 'TypeAlias', id: v, typeParameters: h, right: k},
+ L = r.TypeAlias;
+ return (
+ i(L.id, E, 'id', v, 1),
+ i(L.typeParameters, E, 'typeParameters', h, 1),
+ i(L.right, E, 'right', k, 1),
+ E
+ );
+ }
+ function Ts(v) {
+ let h = {type: 'TypeAnnotation', typeAnnotation: v},
+ k = r.TypeAnnotation;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function Es(v, h) {
+ let k = {type: 'TypeCastExpression', expression: v, typeAnnotation: h},
+ E = r.TypeCastExpression;
+ return (
+ i(E.expression, k, 'expression', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function Is(v = null, h = null, k = null) {
+ let E = {
+ type: 'TypeParameter',
+ bound: v,
+ default: h,
+ variance: k,
+ name: null,
+ },
+ L = r.TypeParameter;
+ return (
+ i(L.bound, E, 'bound', v, 1),
+ i(L.default, E, 'default', h, 1),
+ i(L.variance, E, 'variance', k, 1),
+ E
+ );
+ }
+ function Ps(v) {
+ let h = {type: 'TypeParameterDeclaration', params: v},
+ k = r.TypeParameterDeclaration;
+ return i(k.params, h, 'params', v, 1), h;
+ }
+ function xs(v) {
+ let h = {type: 'TypeParameterInstantiation', params: v},
+ k = r.TypeParameterInstantiation;
+ return i(k.params, h, 'params', v, 1), h;
+ }
+ function ws(v) {
+ let h = {type: 'UnionTypeAnnotation', types: v},
+ k = r.UnionTypeAnnotation;
+ return i(k.types, h, 'types', v, 1), h;
+ }
+ function Os(v) {
+ let h = {type: 'Variance', kind: v},
+ k = r.Variance;
+ return i(k.kind, h, 'kind', v), h;
+ }
+ function $s() {
+ return {type: 'VoidTypeAnnotation'};
+ }
+ function js(v, h) {
+ let k = {type: 'EnumDeclaration', id: v, body: h},
+ E = r.EnumDeclaration;
+ return i(E.id, k, 'id', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function Cs(v) {
+ let h = {
+ type: 'EnumBooleanBody',
+ members: v,
+ explicitType: null,
+ hasUnknownMembers: null,
+ },
+ k = r.EnumBooleanBody;
+ return i(k.members, h, 'members', v, 1), h;
+ }
+ function Ds(v) {
+ let h = {
+ type: 'EnumNumberBody',
+ members: v,
+ explicitType: null,
+ hasUnknownMembers: null,
+ },
+ k = r.EnumNumberBody;
+ return i(k.members, h, 'members', v, 1), h;
+ }
+ function As(v) {
+ let h = {
+ type: 'EnumStringBody',
+ members: v,
+ explicitType: null,
+ hasUnknownMembers: null,
+ },
+ k = r.EnumStringBody;
+ return i(k.members, h, 'members', v, 1), h;
+ }
+ function Ms(v) {
+ let h = {type: 'EnumSymbolBody', members: v, hasUnknownMembers: null},
+ k = r.EnumSymbolBody;
+ return i(k.members, h, 'members', v, 1), h;
+ }
+ function Ns(v) {
+ let h = {type: 'EnumBooleanMember', id: v, init: null},
+ k = r.EnumBooleanMember;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function Rs(v, h) {
+ let k = {type: 'EnumNumberMember', id: v, init: h},
+ E = r.EnumNumberMember;
+ return i(E.id, k, 'id', v, 1), i(E.init, k, 'init', h, 1), k;
+ }
+ function Ls(v, h) {
+ let k = {type: 'EnumStringMember', id: v, init: h},
+ E = r.EnumStringMember;
+ return i(E.id, k, 'id', v, 1), i(E.init, k, 'init', h, 1), k;
+ }
+ function Fs(v) {
+ let h = {type: 'EnumDefaultedMember', id: v},
+ k = r.EnumDefaultedMember;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function zs(v, h) {
+ let k = {type: 'IndexedAccessType', objectType: v, indexType: h},
+ E = r.IndexedAccessType;
+ return (
+ i(E.objectType, k, 'objectType', v, 1),
+ i(E.indexType, k, 'indexType', h, 1),
+ k
+ );
+ }
+ function Bs(v, h) {
+ let k = {
+ type: 'OptionalIndexedAccessType',
+ objectType: v,
+ indexType: h,
+ optional: null,
+ },
+ E = r.OptionalIndexedAccessType;
+ return (
+ i(E.objectType, k, 'objectType', v, 1),
+ i(E.indexType, k, 'indexType', h, 1),
+ k
+ );
+ }
+ function Us(v, h = null) {
+ let k = {type: 'JSXAttribute', name: v, value: h},
+ E = r.JSXAttribute;
+ return i(E.name, k, 'name', v, 1), i(E.value, k, 'value', h, 1), k;
+ }
+ function Zs(v) {
+ let h = {type: 'JSXClosingElement', name: v},
+ k = r.JSXClosingElement;
+ return i(k.name, h, 'name', v, 1), h;
+ }
+ function qs(v, h = null, k, E = null) {
+ let L = {
+ type: 'JSXElement',
+ openingElement: v,
+ closingElement: h,
+ children: k,
+ selfClosing: E,
+ },
+ H = r.JSXElement;
+ return (
+ i(H.openingElement, L, 'openingElement', v, 1),
+ i(H.closingElement, L, 'closingElement', h, 1),
+ i(H.children, L, 'children', k, 1),
+ i(H.selfClosing, L, 'selfClosing', E),
+ L
+ );
+ }
+ function Ks() {
+ return {type: 'JSXEmptyExpression'};
+ }
+ function Vs(v) {
+ let h = {type: 'JSXExpressionContainer', expression: v},
+ k = r.JSXExpressionContainer;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function Js(v) {
+ let h = {type: 'JSXSpreadChild', expression: v},
+ k = r.JSXSpreadChild;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function Hs(v) {
+ let h = {type: 'JSXIdentifier', name: v},
+ k = r.JSXIdentifier;
+ return i(k.name, h, 'name', v), h;
+ }
+ function Ws(v, h) {
+ let k = {type: 'JSXMemberExpression', object: v, property: h},
+ E = r.JSXMemberExpression;
+ return (
+ i(E.object, k, 'object', v, 1), i(E.property, k, 'property', h, 1), k
+ );
+ }
+ function Gs(v, h) {
+ let k = {type: 'JSXNamespacedName', namespace: v, name: h},
+ E = r.JSXNamespacedName;
+ return (
+ i(E.namespace, k, 'namespace', v, 1), i(E.name, k, 'name', h, 1), k
+ );
+ }
+ function Xs(v, h, k = !1) {
+ let E = {
+ type: 'JSXOpeningElement',
+ name: v,
+ attributes: h,
+ selfClosing: k,
+ },
+ L = r.JSXOpeningElement;
+ return (
+ i(L.name, E, 'name', v, 1),
+ i(L.attributes, E, 'attributes', h, 1),
+ i(L.selfClosing, E, 'selfClosing', k),
+ E
+ );
+ }
+ function Ys(v) {
+ let h = {type: 'JSXSpreadAttribute', argument: v},
+ k = r.JSXSpreadAttribute;
+ return i(k.argument, h, 'argument', v, 1), h;
+ }
+ function Qs(v) {
+ let h = {type: 'JSXText', value: v},
+ k = r.JSXText;
+ return i(k.value, h, 'value', v), h;
+ }
+ function el(v, h, k) {
+ let E = {
+ type: 'JSXFragment',
+ openingFragment: v,
+ closingFragment: h,
+ children: k,
+ },
+ L = r.JSXFragment;
+ return (
+ i(L.openingFragment, E, 'openingFragment', v, 1),
+ i(L.closingFragment, E, 'closingFragment', h, 1),
+ i(L.children, E, 'children', k, 1),
+ E
+ );
+ }
+ function tl() {
+ return {type: 'JSXOpeningFragment'};
+ }
+ function nl() {
+ return {type: 'JSXClosingFragment'};
+ }
+ function rl() {
+ return {type: 'Noop'};
+ }
+ function il(v, h) {
+ let k = {type: 'Placeholder', expectedNode: v, name: h},
+ E = r.Placeholder;
+ return (
+ i(E.expectedNode, k, 'expectedNode', v), i(E.name, k, 'name', h, 1), k
+ );
+ }
+ function al(v) {
+ let h = {type: 'V8IntrinsicIdentifier', name: v},
+ k = r.V8IntrinsicIdentifier;
+ return i(k.name, h, 'name', v), h;
+ }
+ function ol() {
+ return {type: 'ArgumentPlaceholder'};
+ }
+ function sl(v, h) {
+ let k = {type: 'BindExpression', object: v, callee: h},
+ E = r.BindExpression;
+ return i(E.object, k, 'object', v, 1), i(E.callee, k, 'callee', h, 1), k;
+ }
+ function ll(v, h) {
+ let k = {type: 'ImportAttribute', key: v, value: h},
+ E = r.ImportAttribute;
+ return i(E.key, k, 'key', v, 1), i(E.value, k, 'value', h, 1), k;
+ }
+ function cl(v) {
+ let h = {type: 'Decorator', expression: v},
+ k = r.Decorator;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function ul(v, h = !1) {
+ let k = {type: 'DoExpression', body: v, async: h},
+ E = r.DoExpression;
+ return i(E.body, k, 'body', v, 1), i(E.async, k, 'async', h), k;
+ }
+ function dl(v) {
+ let h = {type: 'ExportDefaultSpecifier', exported: v},
+ k = r.ExportDefaultSpecifier;
+ return i(k.exported, h, 'exported', v, 1), h;
+ }
+ function fl(v) {
+ let h = {type: 'RecordExpression', properties: v},
+ k = r.RecordExpression;
+ return i(k.properties, h, 'properties', v, 1), h;
+ }
+ function pl(v = []) {
+ let h = {type: 'TupleExpression', elements: v},
+ k = r.TupleExpression;
+ return i(k.elements, h, 'elements', v, 1), h;
+ }
+ function ml(v) {
+ let h = {type: 'DecimalLiteral', value: v},
+ k = r.DecimalLiteral;
+ return i(k.value, h, 'value', v), h;
+ }
+ function yl(v) {
+ let h = {type: 'ModuleExpression', body: v},
+ k = r.ModuleExpression;
+ return i(k.body, h, 'body', v, 1), h;
+ }
+ function gl() {
+ return {type: 'TopicReference'};
+ }
+ function vl(v) {
+ let h = {type: 'PipelineTopicExpression', expression: v},
+ k = r.PipelineTopicExpression;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function hl(v) {
+ let h = {type: 'PipelineBareFunction', callee: v},
+ k = r.PipelineBareFunction;
+ return i(k.callee, h, 'callee', v, 1), h;
+ }
+ function bl() {
+ return {type: 'PipelinePrimaryTopicReference'};
+ }
+ function kl(v) {
+ let h = {type: 'TSParameterProperty', parameter: v},
+ k = r.TSParameterProperty;
+ return i(k.parameter, h, 'parameter', v, 1), h;
+ }
+ function Sl(v = null, h = null, k, E = null) {
+ let L = {
+ type: 'TSDeclareFunction',
+ id: v,
+ typeParameters: h,
+ params: k,
+ returnType: E,
+ },
+ H = r.TSDeclareFunction;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.params, L, 'params', k, 1),
+ i(H.returnType, L, 'returnType', E, 1),
+ L
+ );
+ }
+ function _l(v = null, h, k = null, E, L = null) {
+ let H = {
+ type: 'TSDeclareMethod',
+ decorators: v,
+ key: h,
+ typeParameters: k,
+ params: E,
+ returnType: L,
+ },
+ He = r.TSDeclareMethod;
+ return (
+ i(He.decorators, H, 'decorators', v, 1),
+ i(He.key, H, 'key', h, 1),
+ i(He.typeParameters, H, 'typeParameters', k, 1),
+ i(He.params, H, 'params', E, 1),
+ i(He.returnType, H, 'returnType', L, 1),
+ H
+ );
+ }
+ function Tl(v, h) {
+ let k = {type: 'TSQualifiedName', left: v, right: h},
+ E = r.TSQualifiedName;
+ return i(E.left, k, 'left', v, 1), i(E.right, k, 'right', h, 1), k;
+ }
+ function El(v = null, h, k = null) {
+ let E = {
+ type: 'TSCallSignatureDeclaration',
+ typeParameters: v,
+ parameters: h,
+ typeAnnotation: k,
+ },
+ L = r.TSCallSignatureDeclaration;
+ return (
+ i(L.typeParameters, E, 'typeParameters', v, 1),
+ i(L.parameters, E, 'parameters', h, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', k, 1),
+ E
+ );
+ }
+ function Il(v = null, h, k = null) {
+ let E = {
+ type: 'TSConstructSignatureDeclaration',
+ typeParameters: v,
+ parameters: h,
+ typeAnnotation: k,
+ },
+ L = r.TSConstructSignatureDeclaration;
+ return (
+ i(L.typeParameters, E, 'typeParameters', v, 1),
+ i(L.parameters, E, 'parameters', h, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', k, 1),
+ E
+ );
+ }
+ function Pl(v, h = null) {
+ let k = {
+ type: 'TSPropertySignature',
+ key: v,
+ typeAnnotation: h,
+ kind: null,
+ },
+ E = r.TSPropertySignature;
+ return (
+ i(E.key, k, 'key', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function xl(v, h = null, k, E = null) {
+ let L = {
+ type: 'TSMethodSignature',
+ key: v,
+ typeParameters: h,
+ parameters: k,
+ typeAnnotation: E,
+ kind: null,
+ },
+ H = r.TSMethodSignature;
+ return (
+ i(H.key, L, 'key', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.parameters, L, 'parameters', k, 1),
+ i(H.typeAnnotation, L, 'typeAnnotation', E, 1),
+ L
+ );
+ }
+ function wl(v, h = null) {
+ let k = {type: 'TSIndexSignature', parameters: v, typeAnnotation: h},
+ E = r.TSIndexSignature;
+ return (
+ i(E.parameters, k, 'parameters', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function Ol() {
+ return {type: 'TSAnyKeyword'};
+ }
+ function $l() {
+ return {type: 'TSBooleanKeyword'};
+ }
+ function jl() {
+ return {type: 'TSBigIntKeyword'};
+ }
+ function Cl() {
+ return {type: 'TSIntrinsicKeyword'};
+ }
+ function Dl() {
+ return {type: 'TSNeverKeyword'};
+ }
+ function Al() {
+ return {type: 'TSNullKeyword'};
+ }
+ function Ml() {
+ return {type: 'TSNumberKeyword'};
+ }
+ function Nl() {
+ return {type: 'TSObjectKeyword'};
+ }
+ function Rl() {
+ return {type: 'TSStringKeyword'};
+ }
+ function Ll() {
+ return {type: 'TSSymbolKeyword'};
+ }
+ function Fl() {
+ return {type: 'TSUndefinedKeyword'};
+ }
+ function zl() {
+ return {type: 'TSUnknownKeyword'};
+ }
+ function Bl() {
+ return {type: 'TSVoidKeyword'};
+ }
+ function Ul() {
+ return {type: 'TSThisType'};
+ }
+ function Zl(v = null, h, k = null) {
+ let E = {
+ type: 'TSFunctionType',
+ typeParameters: v,
+ parameters: h,
+ typeAnnotation: k,
+ },
+ L = r.TSFunctionType;
+ return (
+ i(L.typeParameters, E, 'typeParameters', v, 1),
+ i(L.parameters, E, 'parameters', h, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', k, 1),
+ E
+ );
+ }
+ function ql(v = null, h, k = null) {
+ let E = {
+ type: 'TSConstructorType',
+ typeParameters: v,
+ parameters: h,
+ typeAnnotation: k,
+ },
+ L = r.TSConstructorType;
+ return (
+ i(L.typeParameters, E, 'typeParameters', v, 1),
+ i(L.parameters, E, 'parameters', h, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', k, 1),
+ E
+ );
+ }
+ function Kl(v, h = null) {
+ let k = {type: 'TSTypeReference', typeName: v, typeParameters: h},
+ E = r.TSTypeReference;
+ return (
+ i(E.typeName, k, 'typeName', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function Vl(v, h = null, k = null) {
+ let E = {
+ type: 'TSTypePredicate',
+ parameterName: v,
+ typeAnnotation: h,
+ asserts: k,
+ },
+ L = r.TSTypePredicate;
+ return (
+ i(L.parameterName, E, 'parameterName', v, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', h, 1),
+ i(L.asserts, E, 'asserts', k),
+ E
+ );
+ }
+ function Jl(v, h = null) {
+ let k = {type: 'TSTypeQuery', exprName: v, typeParameters: h},
+ E = r.TSTypeQuery;
+ return (
+ i(E.exprName, k, 'exprName', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function Hl(v) {
+ let h = {type: 'TSTypeLiteral', members: v},
+ k = r.TSTypeLiteral;
+ return i(k.members, h, 'members', v, 1), h;
+ }
+ function Wl(v) {
+ let h = {type: 'TSArrayType', elementType: v},
+ k = r.TSArrayType;
+ return i(k.elementType, h, 'elementType', v, 1), h;
+ }
+ function Gl(v) {
+ let h = {type: 'TSTupleType', elementTypes: v},
+ k = r.TSTupleType;
+ return i(k.elementTypes, h, 'elementTypes', v, 1), h;
+ }
+ function Xl(v) {
+ let h = {type: 'TSOptionalType', typeAnnotation: v},
+ k = r.TSOptionalType;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function Yl(v) {
+ let h = {type: 'TSRestType', typeAnnotation: v},
+ k = r.TSRestType;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function Ql(v, h, k = !1) {
+ let E = {
+ type: 'TSNamedTupleMember',
+ label: v,
+ elementType: h,
+ optional: k,
+ },
+ L = r.TSNamedTupleMember;
+ return (
+ i(L.label, E, 'label', v, 1),
+ i(L.elementType, E, 'elementType', h, 1),
+ i(L.optional, E, 'optional', k),
+ E
+ );
+ }
+ function ec(v) {
+ let h = {type: 'TSUnionType', types: v},
+ k = r.TSUnionType;
+ return i(k.types, h, 'types', v, 1), h;
+ }
+ function tc(v) {
+ let h = {type: 'TSIntersectionType', types: v},
+ k = r.TSIntersectionType;
+ return i(k.types, h, 'types', v, 1), h;
+ }
+ function nc(v, h, k, E) {
+ let L = {
+ type: 'TSConditionalType',
+ checkType: v,
+ extendsType: h,
+ trueType: k,
+ falseType: E,
+ },
+ H = r.TSConditionalType;
+ return (
+ i(H.checkType, L, 'checkType', v, 1),
+ i(H.extendsType, L, 'extendsType', h, 1),
+ i(H.trueType, L, 'trueType', k, 1),
+ i(H.falseType, L, 'falseType', E, 1),
+ L
+ );
+ }
+ function rc(v) {
+ let h = {type: 'TSInferType', typeParameter: v},
+ k = r.TSInferType;
+ return i(k.typeParameter, h, 'typeParameter', v, 1), h;
+ }
+ function ic(v) {
+ let h = {type: 'TSParenthesizedType', typeAnnotation: v},
+ k = r.TSParenthesizedType;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function ac(v) {
+ let h = {type: 'TSTypeOperator', typeAnnotation: v, operator: null},
+ k = r.TSTypeOperator;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function oc(v, h) {
+ let k = {type: 'TSIndexedAccessType', objectType: v, indexType: h},
+ E = r.TSIndexedAccessType;
+ return (
+ i(E.objectType, k, 'objectType', v, 1),
+ i(E.indexType, k, 'indexType', h, 1),
+ k
+ );
+ }
+ function sc(v, h = null, k = null) {
+ let E = {
+ type: 'TSMappedType',
+ typeParameter: v,
+ typeAnnotation: h,
+ nameType: k,
+ },
+ L = r.TSMappedType;
+ return (
+ i(L.typeParameter, E, 'typeParameter', v, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', h, 1),
+ i(L.nameType, E, 'nameType', k, 1),
+ E
+ );
+ }
+ function lc(v) {
+ let h = {type: 'TSLiteralType', literal: v},
+ k = r.TSLiteralType;
+ return i(k.literal, h, 'literal', v, 1), h;
+ }
+ function cc(v, h = null) {
+ let k = {
+ type: 'TSExpressionWithTypeArguments',
+ expression: v,
+ typeParameters: h,
+ },
+ E = r.TSExpressionWithTypeArguments;
+ return (
+ i(E.expression, k, 'expression', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function uc(v, h = null, k = null, E) {
+ let L = {
+ type: 'TSInterfaceDeclaration',
+ id: v,
+ typeParameters: h,
+ extends: k,
+ body: E,
+ },
+ H = r.TSInterfaceDeclaration;
+ return (
+ i(H.id, L, 'id', v, 1),
+ i(H.typeParameters, L, 'typeParameters', h, 1),
+ i(H.extends, L, 'extends', k, 1),
+ i(H.body, L, 'body', E, 1),
+ L
+ );
+ }
+ function dc(v) {
+ let h = {type: 'TSInterfaceBody', body: v},
+ k = r.TSInterfaceBody;
+ return i(k.body, h, 'body', v, 1), h;
+ }
+ function fc(v, h = null, k) {
+ let E = {
+ type: 'TSTypeAliasDeclaration',
+ id: v,
+ typeParameters: h,
+ typeAnnotation: k,
+ },
+ L = r.TSTypeAliasDeclaration;
+ return (
+ i(L.id, E, 'id', v, 1),
+ i(L.typeParameters, E, 'typeParameters', h, 1),
+ i(L.typeAnnotation, E, 'typeAnnotation', k, 1),
+ E
+ );
+ }
+ function pc(v, h = null) {
+ let k = {
+ type: 'TSInstantiationExpression',
+ expression: v,
+ typeParameters: h,
+ },
+ E = r.TSInstantiationExpression;
+ return (
+ i(E.expression, k, 'expression', v, 1),
+ i(E.typeParameters, k, 'typeParameters', h, 1),
+ k
+ );
+ }
+ function mc(v, h) {
+ let k = {type: 'TSAsExpression', expression: v, typeAnnotation: h},
+ E = r.TSAsExpression;
+ return (
+ i(E.expression, k, 'expression', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function yc(v, h) {
+ let k = {type: 'TSSatisfiesExpression', expression: v, typeAnnotation: h},
+ E = r.TSSatisfiesExpression;
+ return (
+ i(E.expression, k, 'expression', v, 1),
+ i(E.typeAnnotation, k, 'typeAnnotation', h, 1),
+ k
+ );
+ }
+ function gc(v, h) {
+ let k = {type: 'TSTypeAssertion', typeAnnotation: v, expression: h},
+ E = r.TSTypeAssertion;
+ return (
+ i(E.typeAnnotation, k, 'typeAnnotation', v, 1),
+ i(E.expression, k, 'expression', h, 1),
+ k
+ );
+ }
+ function vc(v, h) {
+ let k = {type: 'TSEnumDeclaration', id: v, members: h},
+ E = r.TSEnumDeclaration;
+ return i(E.id, k, 'id', v, 1), i(E.members, k, 'members', h, 1), k;
+ }
+ function hc(v, h = null) {
+ let k = {type: 'TSEnumMember', id: v, initializer: h},
+ E = r.TSEnumMember;
+ return (
+ i(E.id, k, 'id', v, 1), i(E.initializer, k, 'initializer', h, 1), k
+ );
+ }
+ function bc(v, h) {
+ let k = {type: 'TSModuleDeclaration', id: v, body: h, kind: null},
+ E = r.TSModuleDeclaration;
+ return i(E.id, k, 'id', v, 1), i(E.body, k, 'body', h, 1), k;
+ }
+ function kc(v) {
+ let h = {type: 'TSModuleBlock', body: v},
+ k = r.TSModuleBlock;
+ return i(k.body, h, 'body', v, 1), h;
+ }
+ function Sc(v, h = null, k = null) {
+ let E = {
+ type: 'TSImportType',
+ argument: v,
+ qualifier: h,
+ typeParameters: k,
+ },
+ L = r.TSImportType;
+ return (
+ i(L.argument, E, 'argument', v, 1),
+ i(L.qualifier, E, 'qualifier', h, 1),
+ i(L.typeParameters, E, 'typeParameters', k, 1),
+ E
+ );
+ }
+ function _c(v, h) {
+ let k = {
+ type: 'TSImportEqualsDeclaration',
+ id: v,
+ moduleReference: h,
+ isExport: null,
+ },
+ E = r.TSImportEqualsDeclaration;
+ return (
+ i(E.id, k, 'id', v, 1),
+ i(E.moduleReference, k, 'moduleReference', h, 1),
+ k
+ );
+ }
+ function Tc(v) {
+ let h = {type: 'TSExternalModuleReference', expression: v},
+ k = r.TSExternalModuleReference;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function Ec(v) {
+ let h = {type: 'TSNonNullExpression', expression: v},
+ k = r.TSNonNullExpression;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function Ic(v) {
+ let h = {type: 'TSExportAssignment', expression: v},
+ k = r.TSExportAssignment;
+ return i(k.expression, h, 'expression', v, 1), h;
+ }
+ function Pc(v) {
+ let h = {type: 'TSNamespaceExportDeclaration', id: v},
+ k = r.TSNamespaceExportDeclaration;
+ return i(k.id, h, 'id', v, 1), h;
+ }
+ function xc(v) {
+ let h = {type: 'TSTypeAnnotation', typeAnnotation: v},
+ k = r.TSTypeAnnotation;
+ return i(k.typeAnnotation, h, 'typeAnnotation', v, 1), h;
+ }
+ function wc(v) {
+ let h = {type: 'TSTypeParameterInstantiation', params: v},
+ k = r.TSTypeParameterInstantiation;
+ return i(k.params, h, 'params', v, 1), h;
+ }
+ function Oc(v) {
+ let h = {type: 'TSTypeParameterDeclaration', params: v},
+ k = r.TSTypeParameterDeclaration;
+ return i(k.params, h, 'params', v, 1), h;
+ }
+ function $c(v = null, h = null, k) {
+ let E = {type: 'TSTypeParameter', constraint: v, default: h, name: k},
+ L = r.TSTypeParameter;
+ return (
+ i(L.constraint, E, 'constraint', v, 1),
+ i(L.default, E, 'default', h, 1),
+ i(L.name, E, 'name', k),
+ E
+ );
+ }
+ function jc(v) {
+ return (
+ (0, t.default)('NumberLiteral', 'NumericLiteral', 'The node type '),
+ oe(v)
+ );
+ }
+ function Cc(v, h = '') {
+ return (
+ (0, t.default)('RegexLiteral', 'RegExpLiteral', 'The node type '),
+ Ie(v, h)
+ );
+ }
+ function Dc(v) {
+ return (
+ (0, t.default)('RestProperty', 'RestElement', 'The node type '), tt(v)
+ );
+ }
+ function Ac(v) {
+ return (
+ (0, t.default)('SpreadProperty', 'SpreadElement', 'The node type '),
+ $t(v)
+ );
+ }
+ return C;
+ }
+ var eT;
+ function KF() {
+ if (eT) return $f;
+ (eT = 1),
+ Object.defineProperty($f, '__esModule', {value: !0}),
+ ($f.default = n);
+ var e = Bn(),
+ t = uh();
+ function n(i, r) {
+ let a = i.value.split(/\r\n|\n|\r/),
+ o = 0;
+ for (let l = 0; l < a.length; l++) /[^ \t]/.exec(a[l]) && (o = l);
+ let s = '';
+ for (let l = 0; l < a.length; l++) {
+ let d = a[l],
+ u = l === 0,
+ p = l === a.length - 1,
+ y = l === o,
+ m = d.replace(/\t/g, ' ');
+ u || (m = m.replace(/^ +/, '')),
+ p || (m = m.replace(/ +$/, '')),
+ m && (y || (m += ' '), (s += m));
+ }
+ s && r.push((0, t.inherits)((0, e.stringLiteral)(s), i));
+ }
+ return $f;
+ }
+ var tT;
+ function VF() {
+ if (tT) return Of;
+ (tT = 1),
+ Object.defineProperty(Of, '__esModule', {value: !0}),
+ (Of.default = n);
+ var e = ln(),
+ t = KF();
+ function n(i) {
+ let r = [];
+ for (let a = 0; a < i.children.length; a++) {
+ let o = i.children[a];
+ if ((0, e.isJSXText)(o)) {
+ (0, t.default)(o, r);
+ continue;
+ }
+ (0, e.isJSXExpressionContainer)(o) && (o = o.expression),
+ !(0, e.isJSXEmptyExpression)(o) && r.push(o);
+ }
+ return r;
+ }
+ return Of;
+ }
+ var Mf = {},
+ Nf = {},
+ nT;
+ function j0() {
+ if (nT) return Nf;
+ (nT = 1),
+ Object.defineProperty(Nf, '__esModule', {value: !0}),
+ (Nf.default = t);
+ var e = br();
+ function t(n) {
+ return !!(n && e.VISITOR_KEYS[n.type]);
+ }
+ return Nf;
+ }
+ var rT;
+ function JF() {
+ if (rT) return Mf;
+ (rT = 1),
+ Object.defineProperty(Mf, '__esModule', {value: !0}),
+ (Mf.default = t);
+ var e = j0();
+ function t(n) {
+ if (!(0, e.default)(n)) {
+ var i;
+ let r = (i = n?.type) != null ? i : JSON.stringify(n);
+ throw new TypeError(`Not a valid node of type "${r}"`);
+ }
+ }
+ return Mf;
+ }
+ var R = {},
+ iT;
+ function HF() {
+ if (iT) return R;
+ (iT = 1),
+ Object.defineProperty(R, '__esModule', {value: !0}),
+ (R.assertAccessor = vy),
+ (R.assertAnyTypeAnnotation = Oo),
+ (R.assertArgumentPlaceholder = il),
+ (R.assertArrayExpression = i),
+ (R.assertArrayPattern = Ne),
+ (R.assertArrayTypeAnnotation = $o),
+ (R.assertArrowFunctionExpression = X),
+ (R.assertAssignmentExpression = r),
+ (R.assertAssignmentPattern = Ze),
+ (R.assertAwaitExpression = Sr),
+ (R.assertBigIntLiteral = bo),
+ (R.assertBinary = jc),
+ (R.assertBinaryExpression = a),
+ (R.assertBindExpression = al),
+ (R.assertBlock = Ac),
+ (R.assertBlockParent = Dc),
+ (R.assertBlockStatement = d),
+ (R.assertBooleanLiteral = oe),
+ (R.assertBooleanLiteralTypeAnnotation = Co),
+ (R.assertBooleanTypeAnnotation = jo),
+ (R.assertBreakStatement = u),
+ (R.assertCallExpression = p),
+ (R.assertCatchClause = y),
+ (R.assertClass = Gu),
+ (R.assertClassAccessorProperty = Eo),
+ (R.assertClassBody = ee),
+ (R.assertClassDeclaration = fe),
+ (R.assertClassExpression = ge),
+ (R.assertClassImplements = Ao),
+ (R.assertClassMethod = It),
+ (R.assertClassPrivateMethod = Po),
+ (R.assertClassPrivateProperty = Io),
+ (R.assertClassProperty = To),
+ (R.assertCompletionStatement = k),
+ (R.assertConditional = E),
+ (R.assertConditionalExpression = m),
+ (R.assertContinueStatement = g),
+ (R.assertDebuggerStatement = S),
+ (R.assertDecimalLiteral = fl),
+ (R.assertDeclaration = ny),
+ (R.assertDeclareClass = Mo),
+ (R.assertDeclareExportAllDeclaration = qo),
+ (R.assertDeclareExportDeclaration = Zo),
+ (R.assertDeclareFunction = No),
+ (R.assertDeclareInterface = Ro),
+ (R.assertDeclareModule = Lo),
+ (R.assertDeclareModuleExports = Fo),
+ (R.assertDeclareOpaqueType = Bo),
+ (R.assertDeclareTypeAlias = zo),
+ (R.assertDeclareVariable = Uo),
+ (R.assertDeclaredPredicate = Ko),
+ (R.assertDecorator = sl),
+ (R.assertDirective = s),
+ (R.assertDirectiveLiteral = l),
+ (R.assertDoExpression = ll),
+ (R.assertDoWhileStatement = _),
+ (R.assertEmptyStatement = O),
+ (R.assertEmptyTypeAnnotation = ns),
+ (R.assertEnumBody = Ey),
+ (R.assertEnumBooleanBody = $s),
+ (R.assertEnumBooleanMember = As),
+ (R.assertEnumDeclaration = Os),
+ (R.assertEnumDefaultedMember = Rs),
+ (R.assertEnumMember = Iy),
+ (R.assertEnumNumberBody = js),
+ (R.assertEnumNumberMember = Ms),
+ (R.assertEnumStringBody = Cs),
+ (R.assertEnumStringMember = Ns),
+ (R.assertEnumSymbolBody = Ds),
+ (R.assertExistsTypeAnnotation = Vo),
+ (R.assertExportAllDeclaration = we),
+ (R.assertExportDeclaration = yy),
+ (R.assertExportDefaultDeclaration = me),
+ (R.assertExportDefaultSpecifier = cl),
+ (R.assertExportNamedDeclaration = ze),
+ (R.assertExportNamespaceSpecifier = ko),
+ (R.assertExportSpecifier = Ce),
+ (R.assertExpression = $c),
+ (R.assertExpressionStatement = P),
+ (R.assertExpressionWrapper = He),
+ (R.assertFile = M),
+ (R.assertFlow = by),
+ (R.assertFlowBaseAnnotation = Sy),
+ (R.assertFlowDeclaration = _y),
+ (R.assertFlowPredicate = Ty),
+ (R.assertFlowType = ky),
+ (R.assertFor = Ft),
+ (R.assertForInStatement = w),
+ (R.assertForOfStatement = lt),
+ (R.assertForStatement = I),
+ (R.assertForXStatement = on),
+ (R.assertFunction = er),
+ (R.assertFunctionDeclaration = U),
+ (R.assertFunctionExpression = A),
+ (R.assertFunctionParent = ey),
+ (R.assertFunctionTypeAnnotation = Jo),
+ (R.assertFunctionTypeParam = Ho),
+ (R.assertGenericTypeAnnotation = Wo),
+ (R.assertIdentifier = q),
+ (R.assertIfStatement = ae),
+ (R.assertImmutable = sy),
+ (R.assertImport = ho),
+ (R.assertImportAttribute = ol),
+ (R.assertImportDeclaration = ne),
+ (R.assertImportDefaultSpecifier = he),
+ (R.assertImportExpression = Qe),
+ (R.assertImportNamespaceSpecifier = Ke),
+ (R.assertImportOrExportDeclaration = my),
+ (R.assertImportSpecifier = Ge),
+ (R.assertIndexedAccessType = Ls),
+ (R.assertInferredPredicate = Go),
+ (R.assertInterfaceDeclaration = Yo),
+ (R.assertInterfaceExtends = Xo),
+ (R.assertInterfaceTypeAnnotation = Qo),
+ (R.assertInterpreterDirective = o),
+ (R.assertIntersectionTypeAnnotation = es),
+ (R.assertJSX = Py),
+ (R.assertJSXAttribute = zs),
+ (R.assertJSXClosingElement = Bs),
+ (R.assertJSXClosingFragment = el),
+ (R.assertJSXElement = Us),
+ (R.assertJSXEmptyExpression = Zs),
+ (R.assertJSXExpressionContainer = qs),
+ (R.assertJSXFragment = Ys),
+ (R.assertJSXIdentifier = Vs),
+ (R.assertJSXMemberExpression = Js),
+ (R.assertJSXNamespacedName = Hs),
+ (R.assertJSXOpeningElement = Ws),
+ (R.assertJSXOpeningFragment = Qs),
+ (R.assertJSXSpreadAttribute = Gs),
+ (R.assertJSXSpreadChild = Ks),
+ (R.assertJSXText = Xs),
+ (R.assertLVal = iy),
+ (R.assertLabeledStatement = le),
+ (R.assertLiteral = oy),
+ (R.assertLogicalExpression = $e),
+ (R.assertLoop = L),
+ (R.assertMemberExpression = Ie),
+ (R.assertMetaProperty = se),
+ (R.assertMethod = cy),
+ (R.assertMiscellaneous = xy),
+ (R.assertMixedTypeAnnotation = ts),
+ (R.assertModuleDeclaration = f),
+ (R.assertModuleExpression = pl),
+ (R.assertModuleSpecifier = gy),
+ (R.assertNewExpression = Pe),
+ (R.assertNoop = tl),
+ (R.assertNullLiteral = de),
+ (R.assertNullLiteralTypeAnnotation = Do),
+ (R.assertNullableTypeAnnotation = rs),
+ (R.assertNumberLiteral = Cy),
+ (R.assertNumberLiteralTypeAnnotation = is),
+ (R.assertNumberTypeAnnotation = as),
+ (R.assertNumericLiteral = ve),
+ (R.assertObjectExpression = je),
+ (R.assertObjectMember = uy),
+ (R.assertObjectMethod = Ae),
+ (R.assertObjectPattern = pt),
+ (R.assertObjectProperty = Ye),
+ (R.assertObjectTypeAnnotation = os),
+ (R.assertObjectTypeCallProperty = ls),
+ (R.assertObjectTypeIndexer = cs),
+ (R.assertObjectTypeInternalSlot = ss),
+ (R.assertObjectTypeProperty = us),
+ (R.assertObjectTypeSpreadProperty = ds),
+ (R.assertOpaqueType = fs),
+ (R.assertOptionalCallExpression = _o),
+ (R.assertOptionalIndexedAccessType = Fs),
+ (R.assertOptionalMemberExpression = So),
+ (R.assertParenthesizedExpression = yt),
+ (R.assertPattern = py),
+ (R.assertPatternLike = ry),
+ (R.assertPipelineBareFunction = gl),
+ (R.assertPipelinePrimaryTopicReference = vl),
+ (R.assertPipelineTopicExpression = yl),
+ (R.assertPlaceholder = nl),
+ (R.assertPrivate = hy),
+ (R.assertPrivateName = xo),
+ (R.assertProgram = ke),
+ (R.assertProperty = dy),
+ (R.assertPureish = ty),
+ (R.assertQualifiedTypeIdentifier = ps),
+ (R.assertRecordExpression = ul),
+ (R.assertRegExpLiteral = be),
+ (R.assertRegexLiteral = Dy),
+ (R.assertRestElement = bt),
+ (R.assertRestProperty = Ay),
+ (R.assertReturnStatement = st),
+ (R.assertScopable = Cc),
+ (R.assertSequenceExpression = tt),
+ (R.assertSpreadElement = Ve),
+ (R.assertSpreadProperty = My),
+ (R.assertStandardized = Oc),
+ (R.assertStatement = v),
+ (R.assertStaticBlock = wo),
+ (R.assertStringLiteral = G),
+ (R.assertStringLiteralTypeAnnotation = ms),
+ (R.assertStringTypeAnnotation = ys),
+ (R.assertSuper = et),
+ (R.assertSwitchCase = dt),
+ (R.assertSwitchStatement = qt),
+ (R.assertSymbolTypeAnnotation = gs),
+ (R.assertTSAnyKeyword = xl),
+ (R.assertTSArrayType = Jl),
+ (R.assertTSAsExpression = fc),
+ (R.assertTSBaseType = jy),
+ (R.assertTSBigIntKeyword = Ol),
+ (R.assertTSBooleanKeyword = wl),
+ (R.assertTSCallSignatureDeclaration = _l),
+ (R.assertTSConditionalType = ec),
+ (R.assertTSConstructSignatureDeclaration = Tl),
+ (R.assertTSConstructorType = Ul),
+ (R.assertTSDeclareFunction = bl),
+ (R.assertTSDeclareMethod = kl),
+ (R.assertTSEntityName = ay),
+ (R.assertTSEnumDeclaration = yc),
+ (R.assertTSEnumMember = gc),
+ (R.assertTSExportAssignment = Tc),
+ (R.assertTSExpressionWithTypeArguments = sc),
+ (R.assertTSExternalModuleReference = Sc),
+ (R.assertTSFunctionType = Bl),
+ (R.assertTSImportEqualsDeclaration = kc),
+ (R.assertTSImportType = bc),
+ (R.assertTSIndexSignature = Pl),
+ (R.assertTSIndexedAccessType = ic),
+ (R.assertTSInferType = tc),
+ (R.assertTSInstantiationExpression = dc),
+ (R.assertTSInterfaceBody = cc),
+ (R.assertTSInterfaceDeclaration = lc),
+ (R.assertTSIntersectionType = Ql),
+ (R.assertTSIntrinsicKeyword = $l),
+ (R.assertTSLiteralType = oc),
+ (R.assertTSMappedType = ac),
+ (R.assertTSMethodSignature = Il),
+ (R.assertTSModuleBlock = hc),
+ (R.assertTSModuleDeclaration = vc),
+ (R.assertTSNamedTupleMember = Xl),
+ (R.assertTSNamespaceExportDeclaration = Ec),
+ (R.assertTSNeverKeyword = jl),
+ (R.assertTSNonNullExpression = _c),
+ (R.assertTSNullKeyword = Cl),
+ (R.assertTSNumberKeyword = Dl),
+ (R.assertTSObjectKeyword = Al),
+ (R.assertTSOptionalType = Wl),
+ (R.assertTSParameterProperty = hl),
+ (R.assertTSParenthesizedType = nc),
+ (R.assertTSPropertySignature = El),
+ (R.assertTSQualifiedName = Sl),
+ (R.assertTSRestType = Gl),
+ (R.assertTSSatisfiesExpression = pc),
+ (R.assertTSStringKeyword = Ml),
+ (R.assertTSSymbolKeyword = Nl),
+ (R.assertTSThisType = zl),
+ (R.assertTSTupleType = Hl),
+ (R.assertTSType = $y),
+ (R.assertTSTypeAliasDeclaration = uc),
+ (R.assertTSTypeAnnotation = Ic),
+ (R.assertTSTypeAssertion = mc),
+ (R.assertTSTypeElement = Oy),
+ (R.assertTSTypeLiteral = Vl),
+ (R.assertTSTypeOperator = rc),
+ (R.assertTSTypeParameter = wc),
+ (R.assertTSTypeParameterDeclaration = xc),
+ (R.assertTSTypeParameterInstantiation = Pc),
+ (R.assertTSTypePredicate = ql),
+ (R.assertTSTypeQuery = Kl),
+ (R.assertTSTypeReference = Zl),
+ (R.assertTSUndefinedKeyword = Rl),
+ (R.assertTSUnionType = Yl),
+ (R.assertTSUnknownKeyword = Ll),
+ (R.assertTSVoidKeyword = Fl),
+ (R.assertTaggedTemplateExpression = $t),
+ (R.assertTemplateElement = an),
+ (R.assertTemplateLiteral = Jt),
+ (R.assertTerminatorless = h),
+ (R.assertThisExpression = J),
+ (R.assertThisTypeAnnotation = vs),
+ (R.assertThrowStatement = Xe),
+ (R.assertTopicReference = ml),
+ (R.assertTryStatement = it),
+ (R.assertTupleExpression = dl),
+ (R.assertTupleTypeAnnotation = hs),
+ (R.assertTypeAlias = ks),
+ (R.assertTypeAnnotation = Ss),
+ (R.assertTypeCastExpression = _s),
+ (R.assertTypeParameter = Ts),
+ (R.assertTypeParameterDeclaration = Es),
+ (R.assertTypeParameterInstantiation = Is),
+ (R.assertTypeScript = wy),
+ (R.assertTypeofTypeAnnotation = bs),
+ (R.assertUnaryExpression = mt),
+ (R.assertUnaryLike = fy),
+ (R.assertUnionTypeAnnotation = Ps),
+ (R.assertUpdateExpression = Et),
+ (R.assertUserWhitespacable = ly),
+ (R.assertV8IntrinsicIdentifier = rl),
+ (R.assertVariableDeclaration = ft),
+ (R.assertVariableDeclarator = De),
+ (R.assertVariance = xs),
+ (R.assertVoidTypeAnnotation = ws),
+ (R.assertWhile = H),
+ (R.assertWhileStatement = Y),
+ (R.assertWithStatement = ce),
+ (R.assertYieldExpression = pn);
+ var e = Zu(),
+ t = Bm();
+ function n(c, b, Kh) {
+ if (!(0, e.default)(c, b, Kh))
+ throw new Error(
+ `Expected type "${c}" with option ${JSON.stringify(
+ Kh
+ )}, but instead got "${b.type}".`
+ );
+ }
+ function i(c, b) {
+ n('ArrayExpression', c, b);
+ }
+ function r(c, b) {
+ n('AssignmentExpression', c, b);
+ }
+ function a(c, b) {
+ n('BinaryExpression', c, b);
+ }
+ function o(c, b) {
+ n('InterpreterDirective', c, b);
+ }
+ function s(c, b) {
+ n('Directive', c, b);
+ }
+ function l(c, b) {
+ n('DirectiveLiteral', c, b);
+ }
+ function d(c, b) {
+ n('BlockStatement', c, b);
+ }
+ function u(c, b) {
+ n('BreakStatement', c, b);
+ }
+ function p(c, b) {
+ n('CallExpression', c, b);
+ }
+ function y(c, b) {
+ n('CatchClause', c, b);
+ }
+ function m(c, b) {
+ n('ConditionalExpression', c, b);
+ }
+ function g(c, b) {
+ n('ContinueStatement', c, b);
+ }
+ function S(c, b) {
+ n('DebuggerStatement', c, b);
+ }
+ function _(c, b) {
+ n('DoWhileStatement', c, b);
+ }
+ function O(c, b) {
+ n('EmptyStatement', c, b);
+ }
+ function P(c, b) {
+ n('ExpressionStatement', c, b);
+ }
+ function M(c, b) {
+ n('File', c, b);
+ }
+ function w(c, b) {
+ n('ForInStatement', c, b);
+ }
+ function I(c, b) {
+ n('ForStatement', c, b);
+ }
+ function U(c, b) {
+ n('FunctionDeclaration', c, b);
+ }
+ function A(c, b) {
+ n('FunctionExpression', c, b);
+ }
+ function q(c, b) {
+ n('Identifier', c, b);
+ }
+ function ae(c, b) {
+ n('IfStatement', c, b);
+ }
+ function le(c, b) {
+ n('LabeledStatement', c, b);
+ }
+ function G(c, b) {
+ n('StringLiteral', c, b);
+ }
+ function ve(c, b) {
+ n('NumericLiteral', c, b);
+ }
+ function de(c, b) {
+ n('NullLiteral', c, b);
+ }
+ function oe(c, b) {
+ n('BooleanLiteral', c, b);
+ }
+ function be(c, b) {
+ n('RegExpLiteral', c, b);
+ }
+ function $e(c, b) {
+ n('LogicalExpression', c, b);
+ }
+ function Ie(c, b) {
+ n('MemberExpression', c, b);
+ }
+ function Pe(c, b) {
+ n('NewExpression', c, b);
+ }
+ function ke(c, b) {
+ n('Program', c, b);
+ }
+ function je(c, b) {
+ n('ObjectExpression', c, b);
+ }
+ function Ae(c, b) {
+ n('ObjectMethod', c, b);
+ }
+ function Ye(c, b) {
+ n('ObjectProperty', c, b);
+ }
+ function bt(c, b) {
+ n('RestElement', c, b);
+ }
+ function st(c, b) {
+ n('ReturnStatement', c, b);
+ }
+ function tt(c, b) {
+ n('SequenceExpression', c, b);
+ }
+ function yt(c, b) {
+ n('ParenthesizedExpression', c, b);
+ }
+ function dt(c, b) {
+ n('SwitchCase', c, b);
+ }
+ function qt(c, b) {
+ n('SwitchStatement', c, b);
+ }
+ function J(c, b) {
+ n('ThisExpression', c, b);
+ }
+ function Xe(c, b) {
+ n('ThrowStatement', c, b);
+ }
+ function it(c, b) {
+ n('TryStatement', c, b);
+ }
+ function mt(c, b) {
+ n('UnaryExpression', c, b);
+ }
+ function Et(c, b) {
+ n('UpdateExpression', c, b);
+ }
+ function ft(c, b) {
+ n('VariableDeclaration', c, b);
+ }
+ function De(c, b) {
+ n('VariableDeclarator', c, b);
+ }
+ function Y(c, b) {
+ n('WhileStatement', c, b);
+ }
+ function ce(c, b) {
+ n('WithStatement', c, b);
+ }
+ function Ze(c, b) {
+ n('AssignmentPattern', c, b);
+ }
+ function Ne(c, b) {
+ n('ArrayPattern', c, b);
+ }
+ function X(c, b) {
+ n('ArrowFunctionExpression', c, b);
+ }
+ function ee(c, b) {
+ n('ClassBody', c, b);
+ }
+ function ge(c, b) {
+ n('ClassExpression', c, b);
+ }
+ function fe(c, b) {
+ n('ClassDeclaration', c, b);
+ }
+ function we(c, b) {
+ n('ExportAllDeclaration', c, b);
+ }
+ function me(c, b) {
+ n('ExportDefaultDeclaration', c, b);
+ }
+ function ze(c, b) {
+ n('ExportNamedDeclaration', c, b);
+ }
+ function Ce(c, b) {
+ n('ExportSpecifier', c, b);
+ }
+ function lt(c, b) {
+ n('ForOfStatement', c, b);
+ }
+ function ne(c, b) {
+ n('ImportDeclaration', c, b);
+ }
+ function he(c, b) {
+ n('ImportDefaultSpecifier', c, b);
+ }
+ function Ke(c, b) {
+ n('ImportNamespaceSpecifier', c, b);
+ }
+ function Ge(c, b) {
+ n('ImportSpecifier', c, b);
+ }
+ function Qe(c, b) {
+ n('ImportExpression', c, b);
+ }
+ function se(c, b) {
+ n('MetaProperty', c, b);
+ }
+ function It(c, b) {
+ n('ClassMethod', c, b);
+ }
+ function pt(c, b) {
+ n('ObjectPattern', c, b);
+ }
+ function Ve(c, b) {
+ n('SpreadElement', c, b);
+ }
+ function et(c, b) {
+ n('Super', c, b);
+ }
+ function $t(c, b) {
+ n('TaggedTemplateExpression', c, b);
+ }
+ function an(c, b) {
+ n('TemplateElement', c, b);
+ }
+ function Jt(c, b) {
+ n('TemplateLiteral', c, b);
+ }
+ function pn(c, b) {
+ n('YieldExpression', c, b);
+ }
+ function Sr(c, b) {
+ n('AwaitExpression', c, b);
+ }
+ function ho(c, b) {
+ n('Import', c, b);
+ }
+ function bo(c, b) {
+ n('BigIntLiteral', c, b);
+ }
+ function ko(c, b) {
+ n('ExportNamespaceSpecifier', c, b);
+ }
+ function So(c, b) {
+ n('OptionalMemberExpression', c, b);
+ }
+ function _o(c, b) {
+ n('OptionalCallExpression', c, b);
+ }
+ function To(c, b) {
+ n('ClassProperty', c, b);
+ }
+ function Eo(c, b) {
+ n('ClassAccessorProperty', c, b);
+ }
+ function Io(c, b) {
+ n('ClassPrivateProperty', c, b);
+ }
+ function Po(c, b) {
+ n('ClassPrivateMethod', c, b);
+ }
+ function xo(c, b) {
+ n('PrivateName', c, b);
+ }
+ function wo(c, b) {
+ n('StaticBlock', c, b);
+ }
+ function Oo(c, b) {
+ n('AnyTypeAnnotation', c, b);
+ }
+ function $o(c, b) {
+ n('ArrayTypeAnnotation', c, b);
+ }
+ function jo(c, b) {
+ n('BooleanTypeAnnotation', c, b);
+ }
+ function Co(c, b) {
+ n('BooleanLiteralTypeAnnotation', c, b);
+ }
+ function Do(c, b) {
+ n('NullLiteralTypeAnnotation', c, b);
+ }
+ function Ao(c, b) {
+ n('ClassImplements', c, b);
+ }
+ function Mo(c, b) {
+ n('DeclareClass', c, b);
+ }
+ function No(c, b) {
+ n('DeclareFunction', c, b);
+ }
+ function Ro(c, b) {
+ n('DeclareInterface', c, b);
+ }
+ function Lo(c, b) {
+ n('DeclareModule', c, b);
+ }
+ function Fo(c, b) {
+ n('DeclareModuleExports', c, b);
+ }
+ function zo(c, b) {
+ n('DeclareTypeAlias', c, b);
+ }
+ function Bo(c, b) {
+ n('DeclareOpaqueType', c, b);
+ }
+ function Uo(c, b) {
+ n('DeclareVariable', c, b);
+ }
+ function Zo(c, b) {
+ n('DeclareExportDeclaration', c, b);
+ }
+ function qo(c, b) {
+ n('DeclareExportAllDeclaration', c, b);
+ }
+ function Ko(c, b) {
+ n('DeclaredPredicate', c, b);
+ }
+ function Vo(c, b) {
+ n('ExistsTypeAnnotation', c, b);
+ }
+ function Jo(c, b) {
+ n('FunctionTypeAnnotation', c, b);
+ }
+ function Ho(c, b) {
+ n('FunctionTypeParam', c, b);
+ }
+ function Wo(c, b) {
+ n('GenericTypeAnnotation', c, b);
+ }
+ function Go(c, b) {
+ n('InferredPredicate', c, b);
+ }
+ function Xo(c, b) {
+ n('InterfaceExtends', c, b);
+ }
+ function Yo(c, b) {
+ n('InterfaceDeclaration', c, b);
+ }
+ function Qo(c, b) {
+ n('InterfaceTypeAnnotation', c, b);
+ }
+ function es(c, b) {
+ n('IntersectionTypeAnnotation', c, b);
+ }
+ function ts(c, b) {
+ n('MixedTypeAnnotation', c, b);
+ }
+ function ns(c, b) {
+ n('EmptyTypeAnnotation', c, b);
+ }
+ function rs(c, b) {
+ n('NullableTypeAnnotation', c, b);
+ }
+ function is(c, b) {
+ n('NumberLiteralTypeAnnotation', c, b);
+ }
+ function as(c, b) {
+ n('NumberTypeAnnotation', c, b);
+ }
+ function os(c, b) {
+ n('ObjectTypeAnnotation', c, b);
+ }
+ function ss(c, b) {
+ n('ObjectTypeInternalSlot', c, b);
+ }
+ function ls(c, b) {
+ n('ObjectTypeCallProperty', c, b);
+ }
+ function cs(c, b) {
+ n('ObjectTypeIndexer', c, b);
+ }
+ function us(c, b) {
+ n('ObjectTypeProperty', c, b);
+ }
+ function ds(c, b) {
+ n('ObjectTypeSpreadProperty', c, b);
+ }
+ function fs(c, b) {
+ n('OpaqueType', c, b);
+ }
+ function ps(c, b) {
+ n('QualifiedTypeIdentifier', c, b);
+ }
+ function ms(c, b) {
+ n('StringLiteralTypeAnnotation', c, b);
+ }
+ function ys(c, b) {
+ n('StringTypeAnnotation', c, b);
+ }
+ function gs(c, b) {
+ n('SymbolTypeAnnotation', c, b);
+ }
+ function vs(c, b) {
+ n('ThisTypeAnnotation', c, b);
+ }
+ function hs(c, b) {
+ n('TupleTypeAnnotation', c, b);
+ }
+ function bs(c, b) {
+ n('TypeofTypeAnnotation', c, b);
+ }
+ function ks(c, b) {
+ n('TypeAlias', c, b);
+ }
+ function Ss(c, b) {
+ n('TypeAnnotation', c, b);
+ }
+ function _s(c, b) {
+ n('TypeCastExpression', c, b);
+ }
+ function Ts(c, b) {
+ n('TypeParameter', c, b);
+ }
+ function Es(c, b) {
+ n('TypeParameterDeclaration', c, b);
+ }
+ function Is(c, b) {
+ n('TypeParameterInstantiation', c, b);
+ }
+ function Ps(c, b) {
+ n('UnionTypeAnnotation', c, b);
+ }
+ function xs(c, b) {
+ n('Variance', c, b);
+ }
+ function ws(c, b) {
+ n('VoidTypeAnnotation', c, b);
+ }
+ function Os(c, b) {
+ n('EnumDeclaration', c, b);
+ }
+ function $s(c, b) {
+ n('EnumBooleanBody', c, b);
+ }
+ function js(c, b) {
+ n('EnumNumberBody', c, b);
+ }
+ function Cs(c, b) {
+ n('EnumStringBody', c, b);
+ }
+ function Ds(c, b) {
+ n('EnumSymbolBody', c, b);
+ }
+ function As(c, b) {
+ n('EnumBooleanMember', c, b);
+ }
+ function Ms(c, b) {
+ n('EnumNumberMember', c, b);
+ }
+ function Ns(c, b) {
+ n('EnumStringMember', c, b);
+ }
+ function Rs(c, b) {
+ n('EnumDefaultedMember', c, b);
+ }
+ function Ls(c, b) {
+ n('IndexedAccessType', c, b);
+ }
+ function Fs(c, b) {
+ n('OptionalIndexedAccessType', c, b);
+ }
+ function zs(c, b) {
+ n('JSXAttribute', c, b);
+ }
+ function Bs(c, b) {
+ n('JSXClosingElement', c, b);
+ }
+ function Us(c, b) {
+ n('JSXElement', c, b);
+ }
+ function Zs(c, b) {
+ n('JSXEmptyExpression', c, b);
+ }
+ function qs(c, b) {
+ n('JSXExpressionContainer', c, b);
+ }
+ function Ks(c, b) {
+ n('JSXSpreadChild', c, b);
+ }
+ function Vs(c, b) {
+ n('JSXIdentifier', c, b);
+ }
+ function Js(c, b) {
+ n('JSXMemberExpression', c, b);
+ }
+ function Hs(c, b) {
+ n('JSXNamespacedName', c, b);
+ }
+ function Ws(c, b) {
+ n('JSXOpeningElement', c, b);
+ }
+ function Gs(c, b) {
+ n('JSXSpreadAttribute', c, b);
+ }
+ function Xs(c, b) {
+ n('JSXText', c, b);
+ }
+ function Ys(c, b) {
+ n('JSXFragment', c, b);
+ }
+ function Qs(c, b) {
+ n('JSXOpeningFragment', c, b);
+ }
+ function el(c, b) {
+ n('JSXClosingFragment', c, b);
+ }
+ function tl(c, b) {
+ n('Noop', c, b);
+ }
+ function nl(c, b) {
+ n('Placeholder', c, b);
+ }
+ function rl(c, b) {
+ n('V8IntrinsicIdentifier', c, b);
+ }
+ function il(c, b) {
+ n('ArgumentPlaceholder', c, b);
+ }
+ function al(c, b) {
+ n('BindExpression', c, b);
+ }
+ function ol(c, b) {
+ n('ImportAttribute', c, b);
+ }
+ function sl(c, b) {
+ n('Decorator', c, b);
+ }
+ function ll(c, b) {
+ n('DoExpression', c, b);
+ }
+ function cl(c, b) {
+ n('ExportDefaultSpecifier', c, b);
+ }
+ function ul(c, b) {
+ n('RecordExpression', c, b);
+ }
+ function dl(c, b) {
+ n('TupleExpression', c, b);
+ }
+ function fl(c, b) {
+ n('DecimalLiteral', c, b);
+ }
+ function pl(c, b) {
+ n('ModuleExpression', c, b);
+ }
+ function ml(c, b) {
+ n('TopicReference', c, b);
+ }
+ function yl(c, b) {
+ n('PipelineTopicExpression', c, b);
+ }
+ function gl(c, b) {
+ n('PipelineBareFunction', c, b);
+ }
+ function vl(c, b) {
+ n('PipelinePrimaryTopicReference', c, b);
+ }
+ function hl(c, b) {
+ n('TSParameterProperty', c, b);
+ }
+ function bl(c, b) {
+ n('TSDeclareFunction', c, b);
+ }
+ function kl(c, b) {
+ n('TSDeclareMethod', c, b);
+ }
+ function Sl(c, b) {
+ n('TSQualifiedName', c, b);
+ }
+ function _l(c, b) {
+ n('TSCallSignatureDeclaration', c, b);
+ }
+ function Tl(c, b) {
+ n('TSConstructSignatureDeclaration', c, b);
+ }
+ function El(c, b) {
+ n('TSPropertySignature', c, b);
+ }
+ function Il(c, b) {
+ n('TSMethodSignature', c, b);
+ }
+ function Pl(c, b) {
+ n('TSIndexSignature', c, b);
+ }
+ function xl(c, b) {
+ n('TSAnyKeyword', c, b);
+ }
+ function wl(c, b) {
+ n('TSBooleanKeyword', c, b);
+ }
+ function Ol(c, b) {
+ n('TSBigIntKeyword', c, b);
+ }
+ function $l(c, b) {
+ n('TSIntrinsicKeyword', c, b);
+ }
+ function jl(c, b) {
+ n('TSNeverKeyword', c, b);
+ }
+ function Cl(c, b) {
+ n('TSNullKeyword', c, b);
+ }
+ function Dl(c, b) {
+ n('TSNumberKeyword', c, b);
+ }
+ function Al(c, b) {
+ n('TSObjectKeyword', c, b);
+ }
+ function Ml(c, b) {
+ n('TSStringKeyword', c, b);
+ }
+ function Nl(c, b) {
+ n('TSSymbolKeyword', c, b);
+ }
+ function Rl(c, b) {
+ n('TSUndefinedKeyword', c, b);
+ }
+ function Ll(c, b) {
+ n('TSUnknownKeyword', c, b);
+ }
+ function Fl(c, b) {
+ n('TSVoidKeyword', c, b);
+ }
+ function zl(c, b) {
+ n('TSThisType', c, b);
+ }
+ function Bl(c, b) {
+ n('TSFunctionType', c, b);
+ }
+ function Ul(c, b) {
+ n('TSConstructorType', c, b);
+ }
+ function Zl(c, b) {
+ n('TSTypeReference', c, b);
+ }
+ function ql(c, b) {
+ n('TSTypePredicate', c, b);
+ }
+ function Kl(c, b) {
+ n('TSTypeQuery', c, b);
+ }
+ function Vl(c, b) {
+ n('TSTypeLiteral', c, b);
+ }
+ function Jl(c, b) {
+ n('TSArrayType', c, b);
+ }
+ function Hl(c, b) {
+ n('TSTupleType', c, b);
+ }
+ function Wl(c, b) {
+ n('TSOptionalType', c, b);
+ }
+ function Gl(c, b) {
+ n('TSRestType', c, b);
+ }
+ function Xl(c, b) {
+ n('TSNamedTupleMember', c, b);
+ }
+ function Yl(c, b) {
+ n('TSUnionType', c, b);
+ }
+ function Ql(c, b) {
+ n('TSIntersectionType', c, b);
+ }
+ function ec(c, b) {
+ n('TSConditionalType', c, b);
+ }
+ function tc(c, b) {
+ n('TSInferType', c, b);
+ }
+ function nc(c, b) {
+ n('TSParenthesizedType', c, b);
+ }
+ function rc(c, b) {
+ n('TSTypeOperator', c, b);
+ }
+ function ic(c, b) {
+ n('TSIndexedAccessType', c, b);
+ }
+ function ac(c, b) {
+ n('TSMappedType', c, b);
+ }
+ function oc(c, b) {
+ n('TSLiteralType', c, b);
+ }
+ function sc(c, b) {
+ n('TSExpressionWithTypeArguments', c, b);
+ }
+ function lc(c, b) {
+ n('TSInterfaceDeclaration', c, b);
+ }
+ function cc(c, b) {
+ n('TSInterfaceBody', c, b);
+ }
+ function uc(c, b) {
+ n('TSTypeAliasDeclaration', c, b);
+ }
+ function dc(c, b) {
+ n('TSInstantiationExpression', c, b);
+ }
+ function fc(c, b) {
+ n('TSAsExpression', c, b);
+ }
+ function pc(c, b) {
+ n('TSSatisfiesExpression', c, b);
+ }
+ function mc(c, b) {
+ n('TSTypeAssertion', c, b);
+ }
+ function yc(c, b) {
+ n('TSEnumDeclaration', c, b);
+ }
+ function gc(c, b) {
+ n('TSEnumMember', c, b);
+ }
+ function vc(c, b) {
+ n('TSModuleDeclaration', c, b);
+ }
+ function hc(c, b) {
+ n('TSModuleBlock', c, b);
+ }
+ function bc(c, b) {
+ n('TSImportType', c, b);
+ }
+ function kc(c, b) {
+ n('TSImportEqualsDeclaration', c, b);
+ }
+ function Sc(c, b) {
+ n('TSExternalModuleReference', c, b);
+ }
+ function _c(c, b) {
+ n('TSNonNullExpression', c, b);
+ }
+ function Tc(c, b) {
+ n('TSExportAssignment', c, b);
+ }
+ function Ec(c, b) {
+ n('TSNamespaceExportDeclaration', c, b);
+ }
+ function Ic(c, b) {
+ n('TSTypeAnnotation', c, b);
+ }
+ function Pc(c, b) {
+ n('TSTypeParameterInstantiation', c, b);
+ }
+ function xc(c, b) {
+ n('TSTypeParameterDeclaration', c, b);
+ }
+ function wc(c, b) {
+ n('TSTypeParameter', c, b);
+ }
+ function Oc(c, b) {
+ n('Standardized', c, b);
+ }
+ function $c(c, b) {
+ n('Expression', c, b);
+ }
+ function jc(c, b) {
+ n('Binary', c, b);
+ }
+ function Cc(c, b) {
+ n('Scopable', c, b);
+ }
+ function Dc(c, b) {
+ n('BlockParent', c, b);
+ }
+ function Ac(c, b) {
+ n('Block', c, b);
+ }
+ function v(c, b) {
+ n('Statement', c, b);
+ }
+ function h(c, b) {
+ n('Terminatorless', c, b);
+ }
+ function k(c, b) {
+ n('CompletionStatement', c, b);
+ }
+ function E(c, b) {
+ n('Conditional', c, b);
+ }
+ function L(c, b) {
+ n('Loop', c, b);
+ }
+ function H(c, b) {
+ n('While', c, b);
+ }
+ function He(c, b) {
+ n('ExpressionWrapper', c, b);
+ }
+ function Ft(c, b) {
+ n('For', c, b);
+ }
+ function on(c, b) {
+ n('ForXStatement', c, b);
+ }
+ function er(c, b) {
+ n('Function', c, b);
+ }
+ function ey(c, b) {
+ n('FunctionParent', c, b);
+ }
+ function ty(c, b) {
+ n('Pureish', c, b);
+ }
+ function ny(c, b) {
+ n('Declaration', c, b);
+ }
+ function ry(c, b) {
+ n('PatternLike', c, b);
+ }
+ function iy(c, b) {
+ n('LVal', c, b);
+ }
+ function ay(c, b) {
+ n('TSEntityName', c, b);
+ }
+ function oy(c, b) {
+ n('Literal', c, b);
+ }
+ function sy(c, b) {
+ n('Immutable', c, b);
+ }
+ function ly(c, b) {
+ n('UserWhitespacable', c, b);
+ }
+ function cy(c, b) {
+ n('Method', c, b);
+ }
+ function uy(c, b) {
+ n('ObjectMember', c, b);
+ }
+ function dy(c, b) {
+ n('Property', c, b);
+ }
+ function fy(c, b) {
+ n('UnaryLike', c, b);
+ }
+ function py(c, b) {
+ n('Pattern', c, b);
+ }
+ function Gu(c, b) {
+ n('Class', c, b);
+ }
+ function my(c, b) {
+ n('ImportOrExportDeclaration', c, b);
+ }
+ function yy(c, b) {
+ n('ExportDeclaration', c, b);
+ }
+ function gy(c, b) {
+ n('ModuleSpecifier', c, b);
+ }
+ function vy(c, b) {
+ n('Accessor', c, b);
+ }
+ function hy(c, b) {
+ n('Private', c, b);
+ }
+ function by(c, b) {
+ n('Flow', c, b);
+ }
+ function ky(c, b) {
+ n('FlowType', c, b);
+ }
+ function Sy(c, b) {
+ n('FlowBaseAnnotation', c, b);
+ }
+ function _y(c, b) {
+ n('FlowDeclaration', c, b);
+ }
+ function Ty(c, b) {
+ n('FlowPredicate', c, b);
+ }
+ function Ey(c, b) {
+ n('EnumBody', c, b);
+ }
+ function Iy(c, b) {
+ n('EnumMember', c, b);
+ }
+ function Py(c, b) {
+ n('JSX', c, b);
+ }
+ function xy(c, b) {
+ n('Miscellaneous', c, b);
+ }
+ function wy(c, b) {
+ n('TypeScript', c, b);
+ }
+ function Oy(c, b) {
+ n('TSTypeElement', c, b);
+ }
+ function $y(c, b) {
+ n('TSType', c, b);
+ }
+ function jy(c, b) {
+ n('TSBaseType', c, b);
+ }
+ function Cy(c, b) {
+ (0, t.default)('assertNumberLiteral', 'assertNumericLiteral'),
+ n('NumberLiteral', c, b);
+ }
+ function Dy(c, b) {
+ (0, t.default)('assertRegexLiteral', 'assertRegExpLiteral'),
+ n('RegexLiteral', c, b);
+ }
+ function Ay(c, b) {
+ (0, t.default)('assertRestProperty', 'assertRestElement'),
+ n('RestProperty', c, b);
+ }
+ function My(c, b) {
+ (0, t.default)('assertSpreadProperty', 'assertSpreadElement'),
+ n('SpreadProperty', c, b);
+ }
+ function f(c, b) {
+ (0, t.default)(
+ 'assertModuleDeclaration',
+ 'assertImportOrExportDeclaration'
+ ),
+ n('ModuleDeclaration', c, b);
+ }
+ return R;
+ }
+ var ru = {},
+ aT;
+ function WF() {
+ if (aT) return ru;
+ (aT = 1),
+ Object.defineProperty(ru, '__esModule', {value: !0}),
+ (ru.default = void 0);
+ var e = Bn();
+ ru.default = t;
+ function t(n) {
+ switch (n) {
+ case 'string':
+ return (0, e.stringTypeAnnotation)();
+ case 'number':
+ return (0, e.numberTypeAnnotation)();
+ case 'undefined':
+ return (0, e.voidTypeAnnotation)();
+ case 'boolean':
+ return (0, e.booleanTypeAnnotation)();
+ case 'function':
+ return (0, e.genericTypeAnnotation)((0, e.identifier)('Function'));
+ case 'object':
+ return (0, e.genericTypeAnnotation)((0, e.identifier)('Object'));
+ case 'symbol':
+ return (0, e.genericTypeAnnotation)((0, e.identifier)('Symbol'));
+ case 'bigint':
+ return (0, e.anyTypeAnnotation)();
+ }
+ throw new Error('Invalid typeof value: ' + n);
+ }
+ return ru;
+ }
+ var Rf = {},
+ Lf = {},
+ oT;
+ function C0() {
+ if (oT) return Lf;
+ (oT = 1),
+ Object.defineProperty(Lf, '__esModule', {value: !0}),
+ (Lf.default = n);
+ var e = ln();
+ function t(i) {
+ return (0, e.isIdentifier)(i)
+ ? i.name
+ : `${i.id.name}.${t(i.qualification)}`;
+ }
+ function n(i) {
+ let r = Array.from(i),
+ a = new Map(),
+ o = new Map(),
+ s = new Set(),
+ l = [];
+ for (let d = 0; d < r.length; d++) {
+ let u = r[d];
+ if (u && !l.includes(u)) {
+ if ((0, e.isAnyTypeAnnotation)(u)) return [u];
+ if ((0, e.isFlowBaseAnnotation)(u)) {
+ o.set(u.type, u);
+ continue;
+ }
+ if ((0, e.isUnionTypeAnnotation)(u)) {
+ s.has(u.types) || (r.push(...u.types), s.add(u.types));
+ continue;
+ }
+ if ((0, e.isGenericTypeAnnotation)(u)) {
+ let p = t(u.id);
+ if (a.has(p)) {
+ let y = a.get(p);
+ y.typeParameters
+ ? u.typeParameters &&
+ (y.typeParameters.params.push(...u.typeParameters.params),
+ (y.typeParameters.params = n(y.typeParameters.params)))
+ : (y = u.typeParameters);
+ } else a.set(p, u);
+ continue;
+ }
+ l.push(u);
+ }
+ }
+ for (let [, d] of o) l.push(d);
+ for (let [, d] of a) l.push(d);
+ return l;
+ }
+ return Lf;
+ }
+ var sT;
+ function GF() {
+ if (sT) return Rf;
+ (sT = 1),
+ Object.defineProperty(Rf, '__esModule', {value: !0}),
+ (Rf.default = n);
+ var e = Bn(),
+ t = C0();
+ function n(i) {
+ let r = (0, t.default)(i);
+ return r.length === 1 ? r[0] : (0, e.unionTypeAnnotation)(r);
+ }
+ return Rf;
+ }
+ var Ff = {},
+ zf = {},
+ lT;
+ function XF() {
+ if (lT) return zf;
+ (lT = 1),
+ Object.defineProperty(zf, '__esModule', {value: !0}),
+ (zf.default = n);
+ var e = ln();
+ function t(i) {
+ return (0, e.isIdentifier)(i) ? i.name : `${i.right.name}.${t(i.left)}`;
+ }
+ function n(i) {
+ let r = Array.from(i),
+ a = new Map(),
+ o = new Map(),
+ s = new Set(),
+ l = [];
+ for (let d = 0; d < r.length; d++) {
+ let u = r[d];
+ if (u && !l.includes(u)) {
+ if ((0, e.isTSAnyKeyword)(u)) return [u];
+ if ((0, e.isTSBaseType)(u)) {
+ o.set(u.type, u);
+ continue;
+ }
+ if ((0, e.isTSUnionType)(u)) {
+ s.has(u.types) || (r.push(...u.types), s.add(u.types));
+ continue;
+ }
+ if ((0, e.isTSTypeReference)(u) && u.typeParameters) {
+ let p = t(u.typeName);
+ if (a.has(p)) {
+ let y = a.get(p);
+ y.typeParameters
+ ? u.typeParameters &&
+ (y.typeParameters.params.push(...u.typeParameters.params),
+ (y.typeParameters.params = n(y.typeParameters.params)))
+ : (y = u.typeParameters);
+ } else a.set(p, u);
+ continue;
+ }
+ l.push(u);
+ }
+ }
+ for (let [, d] of o) l.push(d);
+ for (let [, d] of a) l.push(d);
+ return l;
+ }
+ return zf;
+ }
+ var cT;
+ function YF() {
+ if (cT) return Ff;
+ (cT = 1),
+ Object.defineProperty(Ff, '__esModule', {value: !0}),
+ (Ff.default = i);
+ var e = Bn(),
+ t = XF(),
+ n = ln();
+ function i(r) {
+ let a = r.map((s) =>
+ (0, n.isTSTypeAnnotation)(s) ? s.typeAnnotation : s
+ ),
+ o = (0, t.default)(a);
+ return o.length === 1 ? o[0] : (0, e.tsUnionType)(o);
+ }
+ return Ff;
+ }
+ var wg = {},
+ uT;
+ function QF() {
+ return (
+ uT ||
+ ((uT = 1),
+ (function (e) {
+ Object.defineProperty(e, '__esModule', {value: !0}),
+ Object.defineProperty(e, 'AnyTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.anyTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ArgumentPlaceholder', {
+ enumerable: !0,
+ get: function () {
+ return t.argumentPlaceholder;
+ },
+ }),
+ Object.defineProperty(e, 'ArrayExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.arrayExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ArrayPattern', {
+ enumerable: !0,
+ get: function () {
+ return t.arrayPattern;
+ },
+ }),
+ Object.defineProperty(e, 'ArrayTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.arrayTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ArrowFunctionExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.arrowFunctionExpression;
+ },
+ }),
+ Object.defineProperty(e, 'AssignmentExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.assignmentExpression;
+ },
+ }),
+ Object.defineProperty(e, 'AssignmentPattern', {
+ enumerable: !0,
+ get: function () {
+ return t.assignmentPattern;
+ },
+ }),
+ Object.defineProperty(e, 'AwaitExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.awaitExpression;
+ },
+ }),
+ Object.defineProperty(e, 'BigIntLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.bigIntLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'BinaryExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.binaryExpression;
+ },
+ }),
+ Object.defineProperty(e, 'BindExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.bindExpression;
+ },
+ }),
+ Object.defineProperty(e, 'BlockStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.blockStatement;
+ },
+ }),
+ Object.defineProperty(e, 'BooleanLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.booleanLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'BooleanLiteralTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.booleanLiteralTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'BooleanTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.booleanTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'BreakStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.breakStatement;
+ },
+ }),
+ Object.defineProperty(e, 'CallExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.callExpression;
+ },
+ }),
+ Object.defineProperty(e, 'CatchClause', {
+ enumerable: !0,
+ get: function () {
+ return t.catchClause;
+ },
+ }),
+ Object.defineProperty(e, 'ClassAccessorProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.classAccessorProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ClassBody', {
+ enumerable: !0,
+ get: function () {
+ return t.classBody;
+ },
+ }),
+ Object.defineProperty(e, 'ClassDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.classDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'ClassExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.classExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ClassImplements', {
+ enumerable: !0,
+ get: function () {
+ return t.classImplements;
+ },
+ }),
+ Object.defineProperty(e, 'ClassMethod', {
+ enumerable: !0,
+ get: function () {
+ return t.classMethod;
+ },
+ }),
+ Object.defineProperty(e, 'ClassPrivateMethod', {
+ enumerable: !0,
+ get: function () {
+ return t.classPrivateMethod;
+ },
+ }),
+ Object.defineProperty(e, 'ClassPrivateProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.classPrivateProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ClassProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.classProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ConditionalExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.conditionalExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ContinueStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.continueStatement;
+ },
+ }),
+ Object.defineProperty(e, 'DebuggerStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.debuggerStatement;
+ },
+ }),
+ Object.defineProperty(e, 'DecimalLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.decimalLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareClass', {
+ enumerable: !0,
+ get: function () {
+ return t.declareClass;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareExportAllDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.declareExportAllDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareExportDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.declareExportDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareFunction', {
+ enumerable: !0,
+ get: function () {
+ return t.declareFunction;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareInterface', {
+ enumerable: !0,
+ get: function () {
+ return t.declareInterface;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareModule', {
+ enumerable: !0,
+ get: function () {
+ return t.declareModule;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareModuleExports', {
+ enumerable: !0,
+ get: function () {
+ return t.declareModuleExports;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareOpaqueType', {
+ enumerable: !0,
+ get: function () {
+ return t.declareOpaqueType;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareTypeAlias', {
+ enumerable: !0,
+ get: function () {
+ return t.declareTypeAlias;
+ },
+ }),
+ Object.defineProperty(e, 'DeclareVariable', {
+ enumerable: !0,
+ get: function () {
+ return t.declareVariable;
+ },
+ }),
+ Object.defineProperty(e, 'DeclaredPredicate', {
+ enumerable: !0,
+ get: function () {
+ return t.declaredPredicate;
+ },
+ }),
+ Object.defineProperty(e, 'Decorator', {
+ enumerable: !0,
+ get: function () {
+ return t.decorator;
+ },
+ }),
+ Object.defineProperty(e, 'Directive', {
+ enumerable: !0,
+ get: function () {
+ return t.directive;
+ },
+ }),
+ Object.defineProperty(e, 'DirectiveLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.directiveLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'DoExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.doExpression;
+ },
+ }),
+ Object.defineProperty(e, 'DoWhileStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.doWhileStatement;
+ },
+ }),
+ Object.defineProperty(e, 'EmptyStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.emptyStatement;
+ },
+ }),
+ Object.defineProperty(e, 'EmptyTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.emptyTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'EnumBooleanBody', {
+ enumerable: !0,
+ get: function () {
+ return t.enumBooleanBody;
+ },
+ }),
+ Object.defineProperty(e, 'EnumBooleanMember', {
+ enumerable: !0,
+ get: function () {
+ return t.enumBooleanMember;
+ },
+ }),
+ Object.defineProperty(e, 'EnumDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.enumDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'EnumDefaultedMember', {
+ enumerable: !0,
+ get: function () {
+ return t.enumDefaultedMember;
+ },
+ }),
+ Object.defineProperty(e, 'EnumNumberBody', {
+ enumerable: !0,
+ get: function () {
+ return t.enumNumberBody;
+ },
+ }),
+ Object.defineProperty(e, 'EnumNumberMember', {
+ enumerable: !0,
+ get: function () {
+ return t.enumNumberMember;
+ },
+ }),
+ Object.defineProperty(e, 'EnumStringBody', {
+ enumerable: !0,
+ get: function () {
+ return t.enumStringBody;
+ },
+ }),
+ Object.defineProperty(e, 'EnumStringMember', {
+ enumerable: !0,
+ get: function () {
+ return t.enumStringMember;
+ },
+ }),
+ Object.defineProperty(e, 'EnumSymbolBody', {
+ enumerable: !0,
+ get: function () {
+ return t.enumSymbolBody;
+ },
+ }),
+ Object.defineProperty(e, 'ExistsTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.existsTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ExportAllDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.exportAllDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'ExportDefaultDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.exportDefaultDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'ExportDefaultSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.exportDefaultSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'ExportNamedDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.exportNamedDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'ExportNamespaceSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.exportNamespaceSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'ExportSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.exportSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'ExpressionStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.expressionStatement;
+ },
+ }),
+ Object.defineProperty(e, 'File', {
+ enumerable: !0,
+ get: function () {
+ return t.file;
+ },
+ }),
+ Object.defineProperty(e, 'ForInStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.forInStatement;
+ },
+ }),
+ Object.defineProperty(e, 'ForOfStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.forOfStatement;
+ },
+ }),
+ Object.defineProperty(e, 'ForStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.forStatement;
+ },
+ }),
+ Object.defineProperty(e, 'FunctionDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.functionDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'FunctionExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.functionExpression;
+ },
+ }),
+ Object.defineProperty(e, 'FunctionTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.functionTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'FunctionTypeParam', {
+ enumerable: !0,
+ get: function () {
+ return t.functionTypeParam;
+ },
+ }),
+ Object.defineProperty(e, 'GenericTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.genericTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'Identifier', {
+ enumerable: !0,
+ get: function () {
+ return t.identifier;
+ },
+ }),
+ Object.defineProperty(e, 'IfStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.ifStatement;
+ },
+ }),
+ Object.defineProperty(e, 'Import', {
+ enumerable: !0,
+ get: function () {
+ return t.import;
+ },
+ }),
+ Object.defineProperty(e, 'ImportAttribute', {
+ enumerable: !0,
+ get: function () {
+ return t.importAttribute;
+ },
+ }),
+ Object.defineProperty(e, 'ImportDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.importDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'ImportDefaultSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.importDefaultSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'ImportExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.importExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ImportNamespaceSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.importNamespaceSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'ImportSpecifier', {
+ enumerable: !0,
+ get: function () {
+ return t.importSpecifier;
+ },
+ }),
+ Object.defineProperty(e, 'IndexedAccessType', {
+ enumerable: !0,
+ get: function () {
+ return t.indexedAccessType;
+ },
+ }),
+ Object.defineProperty(e, 'InferredPredicate', {
+ enumerable: !0,
+ get: function () {
+ return t.inferredPredicate;
+ },
+ }),
+ Object.defineProperty(e, 'InterfaceDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.interfaceDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'InterfaceExtends', {
+ enumerable: !0,
+ get: function () {
+ return t.interfaceExtends;
+ },
+ }),
+ Object.defineProperty(e, 'InterfaceTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.interfaceTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'InterpreterDirective', {
+ enumerable: !0,
+ get: function () {
+ return t.interpreterDirective;
+ },
+ }),
+ Object.defineProperty(e, 'IntersectionTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.intersectionTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'JSXAttribute', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxAttribute;
+ },
+ }),
+ Object.defineProperty(e, 'JSXClosingElement', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxClosingElement;
+ },
+ }),
+ Object.defineProperty(e, 'JSXClosingFragment', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxClosingFragment;
+ },
+ }),
+ Object.defineProperty(e, 'JSXElement', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxElement;
+ },
+ }),
+ Object.defineProperty(e, 'JSXEmptyExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxEmptyExpression;
+ },
+ }),
+ Object.defineProperty(e, 'JSXExpressionContainer', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxExpressionContainer;
+ },
+ }),
+ Object.defineProperty(e, 'JSXFragment', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxFragment;
+ },
+ }),
+ Object.defineProperty(e, 'JSXIdentifier', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxIdentifier;
+ },
+ }),
+ Object.defineProperty(e, 'JSXMemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxMemberExpression;
+ },
+ }),
+ Object.defineProperty(e, 'JSXNamespacedName', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxNamespacedName;
+ },
+ }),
+ Object.defineProperty(e, 'JSXOpeningElement', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxOpeningElement;
+ },
+ }),
+ Object.defineProperty(e, 'JSXOpeningFragment', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxOpeningFragment;
+ },
+ }),
+ Object.defineProperty(e, 'JSXSpreadAttribute', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxSpreadAttribute;
+ },
+ }),
+ Object.defineProperty(e, 'JSXSpreadChild', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxSpreadChild;
+ },
+ }),
+ Object.defineProperty(e, 'JSXText', {
+ enumerable: !0,
+ get: function () {
+ return t.jsxText;
+ },
+ }),
+ Object.defineProperty(e, 'LabeledStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.labeledStatement;
+ },
+ }),
+ Object.defineProperty(e, 'LogicalExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.logicalExpression;
+ },
+ }),
+ Object.defineProperty(e, 'MemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.memberExpression;
+ },
+ }),
+ Object.defineProperty(e, 'MetaProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.metaProperty;
+ },
+ }),
+ Object.defineProperty(e, 'MixedTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.mixedTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ModuleExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.moduleExpression;
+ },
+ }),
+ Object.defineProperty(e, 'NewExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.newExpression;
+ },
+ }),
+ Object.defineProperty(e, 'Noop', {
+ enumerable: !0,
+ get: function () {
+ return t.noop;
+ },
+ }),
+ Object.defineProperty(e, 'NullLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.nullLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'NullLiteralTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.nullLiteralTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'NullableTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.nullableTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'NumberLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.numberLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'NumberLiteralTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.numberLiteralTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'NumberTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.numberTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'NumericLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.numericLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.objectExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectMethod', {
+ enumerable: !0,
+ get: function () {
+ return t.objectMethod;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectPattern', {
+ enumerable: !0,
+ get: function () {
+ return t.objectPattern;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.objectProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeCallProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeCallProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeIndexer', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeIndexer;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeInternalSlot', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeInternalSlot;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ObjectTypeSpreadProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.objectTypeSpreadProperty;
+ },
+ }),
+ Object.defineProperty(e, 'OpaqueType', {
+ enumerable: !0,
+ get: function () {
+ return t.opaqueType;
+ },
+ }),
+ Object.defineProperty(e, 'OptionalCallExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.optionalCallExpression;
+ },
+ }),
+ Object.defineProperty(e, 'OptionalIndexedAccessType', {
+ enumerable: !0,
+ get: function () {
+ return t.optionalIndexedAccessType;
+ },
+ }),
+ Object.defineProperty(e, 'OptionalMemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.optionalMemberExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ParenthesizedExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.parenthesizedExpression;
+ },
+ }),
+ Object.defineProperty(e, 'PipelineBareFunction', {
+ enumerable: !0,
+ get: function () {
+ return t.pipelineBareFunction;
+ },
+ }),
+ Object.defineProperty(e, 'PipelinePrimaryTopicReference', {
+ enumerable: !0,
+ get: function () {
+ return t.pipelinePrimaryTopicReference;
+ },
+ }),
+ Object.defineProperty(e, 'PipelineTopicExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.pipelineTopicExpression;
+ },
+ }),
+ Object.defineProperty(e, 'Placeholder', {
+ enumerable: !0,
+ get: function () {
+ return t.placeholder;
+ },
+ }),
+ Object.defineProperty(e, 'PrivateName', {
+ enumerable: !0,
+ get: function () {
+ return t.privateName;
+ },
+ }),
+ Object.defineProperty(e, 'Program', {
+ enumerable: !0,
+ get: function () {
+ return t.program;
+ },
+ }),
+ Object.defineProperty(e, 'QualifiedTypeIdentifier', {
+ enumerable: !0,
+ get: function () {
+ return t.qualifiedTypeIdentifier;
+ },
+ }),
+ Object.defineProperty(e, 'RecordExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.recordExpression;
+ },
+ }),
+ Object.defineProperty(e, 'RegExpLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.regExpLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'RegexLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.regexLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'RestElement', {
+ enumerable: !0,
+ get: function () {
+ return t.restElement;
+ },
+ }),
+ Object.defineProperty(e, 'RestProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.restProperty;
+ },
+ }),
+ Object.defineProperty(e, 'ReturnStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.returnStatement;
+ },
+ }),
+ Object.defineProperty(e, 'SequenceExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.sequenceExpression;
+ },
+ }),
+ Object.defineProperty(e, 'SpreadElement', {
+ enumerable: !0,
+ get: function () {
+ return t.spreadElement;
+ },
+ }),
+ Object.defineProperty(e, 'SpreadProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.spreadProperty;
+ },
+ }),
+ Object.defineProperty(e, 'StaticBlock', {
+ enumerable: !0,
+ get: function () {
+ return t.staticBlock;
+ },
+ }),
+ Object.defineProperty(e, 'StringLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.stringLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'StringLiteralTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.stringLiteralTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'StringTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.stringTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'Super', {
+ enumerable: !0,
+ get: function () {
+ return t.super;
+ },
+ }),
+ Object.defineProperty(e, 'SwitchCase', {
+ enumerable: !0,
+ get: function () {
+ return t.switchCase;
+ },
+ }),
+ Object.defineProperty(e, 'SwitchStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.switchStatement;
+ },
+ }),
+ Object.defineProperty(e, 'SymbolTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.symbolTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'TSAnyKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsAnyKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSArrayType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsArrayType;
+ },
+ }),
+ Object.defineProperty(e, 'TSAsExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.tsAsExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TSBigIntKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsBigIntKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSBooleanKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsBooleanKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSCallSignatureDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsCallSignatureDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSConditionalType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsConditionalType;
+ },
+ }),
+ Object.defineProperty(e, 'TSConstructSignatureDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsConstructSignatureDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSConstructorType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsConstructorType;
+ },
+ }),
+ Object.defineProperty(e, 'TSDeclareFunction', {
+ enumerable: !0,
+ get: function () {
+ return t.tsDeclareFunction;
+ },
+ }),
+ Object.defineProperty(e, 'TSDeclareMethod', {
+ enumerable: !0,
+ get: function () {
+ return t.tsDeclareMethod;
+ },
+ }),
+ Object.defineProperty(e, 'TSEnumDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsEnumDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSEnumMember', {
+ enumerable: !0,
+ get: function () {
+ return t.tsEnumMember;
+ },
+ }),
+ Object.defineProperty(e, 'TSExportAssignment', {
+ enumerable: !0,
+ get: function () {
+ return t.tsExportAssignment;
+ },
+ }),
+ Object.defineProperty(e, 'TSExpressionWithTypeArguments', {
+ enumerable: !0,
+ get: function () {
+ return t.tsExpressionWithTypeArguments;
+ },
+ }),
+ Object.defineProperty(e, 'TSExternalModuleReference', {
+ enumerable: !0,
+ get: function () {
+ return t.tsExternalModuleReference;
+ },
+ }),
+ Object.defineProperty(e, 'TSFunctionType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsFunctionType;
+ },
+ }),
+ Object.defineProperty(e, 'TSImportEqualsDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsImportEqualsDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSImportType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsImportType;
+ },
+ }),
+ Object.defineProperty(e, 'TSIndexSignature', {
+ enumerable: !0,
+ get: function () {
+ return t.tsIndexSignature;
+ },
+ }),
+ Object.defineProperty(e, 'TSIndexedAccessType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsIndexedAccessType;
+ },
+ }),
+ Object.defineProperty(e, 'TSInferType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsInferType;
+ },
+ }),
+ Object.defineProperty(e, 'TSInstantiationExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.tsInstantiationExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TSInterfaceBody', {
+ enumerable: !0,
+ get: function () {
+ return t.tsInterfaceBody;
+ },
+ }),
+ Object.defineProperty(e, 'TSInterfaceDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsInterfaceDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSIntersectionType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsIntersectionType;
+ },
+ }),
+ Object.defineProperty(e, 'TSIntrinsicKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsIntrinsicKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSLiteralType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsLiteralType;
+ },
+ }),
+ Object.defineProperty(e, 'TSMappedType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsMappedType;
+ },
+ }),
+ Object.defineProperty(e, 'TSMethodSignature', {
+ enumerable: !0,
+ get: function () {
+ return t.tsMethodSignature;
+ },
+ }),
+ Object.defineProperty(e, 'TSModuleBlock', {
+ enumerable: !0,
+ get: function () {
+ return t.tsModuleBlock;
+ },
+ }),
+ Object.defineProperty(e, 'TSModuleDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsModuleDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSNamedTupleMember', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNamedTupleMember;
+ },
+ }),
+ Object.defineProperty(e, 'TSNamespaceExportDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNamespaceExportDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSNeverKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNeverKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSNonNullExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNonNullExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TSNullKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNullKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSNumberKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsNumberKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSObjectKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsObjectKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSOptionalType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsOptionalType;
+ },
+ }),
+ Object.defineProperty(e, 'TSParameterProperty', {
+ enumerable: !0,
+ get: function () {
+ return t.tsParameterProperty;
+ },
+ }),
+ Object.defineProperty(e, 'TSParenthesizedType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsParenthesizedType;
+ },
+ }),
+ Object.defineProperty(e, 'TSPropertySignature', {
+ enumerable: !0,
+ get: function () {
+ return t.tsPropertySignature;
+ },
+ }),
+ Object.defineProperty(e, 'TSQualifiedName', {
+ enumerable: !0,
+ get: function () {
+ return t.tsQualifiedName;
+ },
+ }),
+ Object.defineProperty(e, 'TSRestType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsRestType;
+ },
+ }),
+ Object.defineProperty(e, 'TSSatisfiesExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.tsSatisfiesExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TSStringKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsStringKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSSymbolKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsSymbolKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSThisType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsThisType;
+ },
+ }),
+ Object.defineProperty(e, 'TSTupleType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTupleType;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeAliasDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeAliasDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeAssertion', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeAssertion;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeOperator', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeOperator;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeParameter', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeParameter;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeParameterDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeParameterDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeParameterInstantiation', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeParameterInstantiation;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypePredicate', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypePredicate;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeQuery', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeQuery;
+ },
+ }),
+ Object.defineProperty(e, 'TSTypeReference', {
+ enumerable: !0,
+ get: function () {
+ return t.tsTypeReference;
+ },
+ }),
+ Object.defineProperty(e, 'TSUndefinedKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsUndefinedKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSUnionType', {
+ enumerable: !0,
+ get: function () {
+ return t.tsUnionType;
+ },
+ }),
+ Object.defineProperty(e, 'TSUnknownKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsUnknownKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TSVoidKeyword', {
+ enumerable: !0,
+ get: function () {
+ return t.tsVoidKeyword;
+ },
+ }),
+ Object.defineProperty(e, 'TaggedTemplateExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.taggedTemplateExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TemplateElement', {
+ enumerable: !0,
+ get: function () {
+ return t.templateElement;
+ },
+ }),
+ Object.defineProperty(e, 'TemplateLiteral', {
+ enumerable: !0,
+ get: function () {
+ return t.templateLiteral;
+ },
+ }),
+ Object.defineProperty(e, 'ThisExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.thisExpression;
+ },
+ }),
+ Object.defineProperty(e, 'ThisTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.thisTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'ThrowStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.throwStatement;
+ },
+ }),
+ Object.defineProperty(e, 'TopicReference', {
+ enumerable: !0,
+ get: function () {
+ return t.topicReference;
+ },
+ }),
+ Object.defineProperty(e, 'TryStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.tryStatement;
+ },
+ }),
+ Object.defineProperty(e, 'TupleExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.tupleExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TupleTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.tupleTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'TypeAlias', {
+ enumerable: !0,
+ get: function () {
+ return t.typeAlias;
+ },
+ }),
+ Object.defineProperty(e, 'TypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.typeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'TypeCastExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.typeCastExpression;
+ },
+ }),
+ Object.defineProperty(e, 'TypeParameter', {
+ enumerable: !0,
+ get: function () {
+ return t.typeParameter;
+ },
+ }),
+ Object.defineProperty(e, 'TypeParameterDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.typeParameterDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'TypeParameterInstantiation', {
+ enumerable: !0,
+ get: function () {
+ return t.typeParameterInstantiation;
+ },
+ }),
+ Object.defineProperty(e, 'TypeofTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.typeofTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'UnaryExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.unaryExpression;
+ },
+ }),
+ Object.defineProperty(e, 'UnionTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.unionTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'UpdateExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.updateExpression;
+ },
+ }),
+ Object.defineProperty(e, 'V8IntrinsicIdentifier', {
+ enumerable: !0,
+ get: function () {
+ return t.v8IntrinsicIdentifier;
+ },
+ }),
+ Object.defineProperty(e, 'VariableDeclaration', {
+ enumerable: !0,
+ get: function () {
+ return t.variableDeclaration;
+ },
+ }),
+ Object.defineProperty(e, 'VariableDeclarator', {
+ enumerable: !0,
+ get: function () {
+ return t.variableDeclarator;
+ },
+ }),
+ Object.defineProperty(e, 'Variance', {
+ enumerable: !0,
+ get: function () {
+ return t.variance;
+ },
+ }),
+ Object.defineProperty(e, 'VoidTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return t.voidTypeAnnotation;
+ },
+ }),
+ Object.defineProperty(e, 'WhileStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.whileStatement;
+ },
+ }),
+ Object.defineProperty(e, 'WithStatement', {
+ enumerable: !0,
+ get: function () {
+ return t.withStatement;
+ },
+ }),
+ Object.defineProperty(e, 'YieldExpression', {
+ enumerable: !0,
+ get: function () {
+ return t.yieldExpression;
+ },
+ });
+ var t = Bn();
+ })(wg)),
+ wg
+ );
+ }
+ var Bf = {},
+ dT;
+ function D0() {
+ if (dT) return Bf;
+ (dT = 1),
+ Object.defineProperty(Bf, '__esModule', {value: !0}),
+ (Bf.buildUndefinedNode = t);
+ var e = Bn();
+ function t() {
+ return (0, e.unaryExpression)('void', (0, e.numericLiteral)(0), !0);
+ }
+ return Bf;
+ }
+ var Uf = {},
+ fT;
+ function Ia() {
+ if (fT) return Uf;
+ (fT = 1),
+ Object.defineProperty(Uf, '__esModule', {value: !0}),
+ (Uf.default = a);
+ var e = br(),
+ t = ln();
+ let {hasOwn: n} = {
+ hasOwn: Function.call.bind(Object.prototype.hasOwnProperty),
+ };
+ function i(l, d, u, p) {
+ return l && typeof l.type == 'string' ? o(l, d, u, p) : l;
+ }
+ function r(l, d, u, p) {
+ return Array.isArray(l) ? l.map((y) => i(y, d, u, p)) : i(l, d, u, p);
+ }
+ function a(l, d = !0, u = !1) {
+ return o(l, d, u, new Map());
+ }
+ function o(l, d = !0, u = !1, p) {
+ if (!l) return l;
+ let {type: y} = l,
+ m = {type: l.type};
+ if ((0, t.isIdentifier)(l))
+ (m.name = l.name),
+ n(l, 'optional') &&
+ typeof l.optional == 'boolean' &&
+ (m.optional = l.optional),
+ n(l, 'typeAnnotation') &&
+ (m.typeAnnotation = d
+ ? r(l.typeAnnotation, !0, u, p)
+ : l.typeAnnotation),
+ n(l, 'decorators') &&
+ (m.decorators = d ? r(l.decorators, !0, u, p) : l.decorators);
+ else if (n(e.NODE_FIELDS, y))
+ for (let g of Object.keys(e.NODE_FIELDS[y]))
+ n(l, g) &&
+ (d
+ ? (m[g] =
+ (0, t.isFile)(l) && g === 'comments'
+ ? s(l.comments, d, u, p)
+ : r(l[g], !0, u, p))
+ : (m[g] = l[g]));
+ else throw new Error(`Unknown node type: "${y}"`);
+ return (
+ n(l, 'loc') && (u ? (m.loc = null) : (m.loc = l.loc)),
+ n(l, 'leadingComments') &&
+ (m.leadingComments = s(l.leadingComments, d, u, p)),
+ n(l, 'innerComments') &&
+ (m.innerComments = s(l.innerComments, d, u, p)),
+ n(l, 'trailingComments') &&
+ (m.trailingComments = s(l.trailingComments, d, u, p)),
+ n(l, 'extra') && (m.extra = Object.assign({}, l.extra)),
+ m
+ );
+ }
+ function s(l, d, u, p) {
+ return !l || !d
+ ? l
+ : l.map((y) => {
+ let m = p.get(y);
+ if (m) return m;
+ let {type: g, value: S, loc: _} = y,
+ O = {type: g, value: S, loc: _};
+ return u && (O.loc = null), p.set(y, O), O;
+ });
+ }
+ return Uf;
+ }
+ var Zf = {},
+ pT;
+ function ez() {
+ if (pT) return Zf;
+ (pT = 1),
+ Object.defineProperty(Zf, '__esModule', {value: !0}),
+ (Zf.default = t);
+ var e = Ia();
+ function t(n) {
+ return (0, e.default)(n, !1);
+ }
+ return Zf;
+ }
+ var qf = {},
+ mT;
+ function tz() {
+ if (mT) return qf;
+ (mT = 1),
+ Object.defineProperty(qf, '__esModule', {value: !0}),
+ (qf.default = t);
+ var e = Ia();
+ function t(n) {
+ return (0, e.default)(n);
+ }
+ return qf;
+ }
+ var Kf = {},
+ yT;
+ function nz() {
+ if (yT) return Kf;
+ (yT = 1),
+ Object.defineProperty(Kf, '__esModule', {value: !0}),
+ (Kf.default = t);
+ var e = Ia();
+ function t(n) {
+ return (0, e.default)(n, !0, !0);
+ }
+ return Kf;
+ }
+ var Vf = {},
+ gT;
+ function rz() {
+ if (gT) return Vf;
+ (gT = 1),
+ Object.defineProperty(Vf, '__esModule', {value: !0}),
+ (Vf.default = t);
+ var e = Ia();
+ function t(n) {
+ return (0, e.default)(n, !1, !0);
+ }
+ return Vf;
+ }
+ var Jf = {},
+ Hf = {},
+ vT;
+ function A0() {
+ if (vT) return Hf;
+ (vT = 1),
+ Object.defineProperty(Hf, '__esModule', {value: !0}),
+ (Hf.default = e);
+ function e(t, n, i) {
+ if (!i || !t) return t;
+ let r = `${n}Comments`;
+ return (
+ t[r]
+ ? n === 'leading'
+ ? (t[r] = i.concat(t[r]))
+ : t[r].push(...i)
+ : (t[r] = i),
+ t
+ );
+ }
+ return Hf;
+ }
+ var hT;
+ function iz() {
+ if (hT) return Jf;
+ (hT = 1),
+ Object.defineProperty(Jf, '__esModule', {value: !0}),
+ (Jf.default = t);
+ var e = A0();
+ function t(n, i, r, a) {
+ return (0, e.default)(n, i, [
+ {type: a ? 'CommentLine' : 'CommentBlock', value: r},
+ ]);
+ }
+ return Jf;
+ }
+ var Wf = {},
+ Gf = {},
+ bT;
+ function ch() {
+ if (bT) return Gf;
+ (bT = 1),
+ Object.defineProperty(Gf, '__esModule', {value: !0}),
+ (Gf.default = e);
+ function e(t, n, i) {
+ n &&
+ i &&
+ (n[t] = Array.from(new Set([].concat(n[t], i[t]).filter(Boolean))));
+ }
+ return Gf;
+ }
+ var kT;
+ function M0() {
+ if (kT) return Wf;
+ (kT = 1),
+ Object.defineProperty(Wf, '__esModule', {value: !0}),
+ (Wf.default = t);
+ var e = ch();
+ function t(n, i) {
+ (0, e.default)('innerComments', n, i);
+ }
+ return Wf;
+ }
+ var Xf = {},
+ ST;
+ function N0() {
+ if (ST) return Xf;
+ (ST = 1),
+ Object.defineProperty(Xf, '__esModule', {value: !0}),
+ (Xf.default = t);
+ var e = ch();
+ function t(n, i) {
+ (0, e.default)('leadingComments', n, i);
+ }
+ return Xf;
+ }
+ var Yf = {},
+ Qf = {},
+ _T;
+ function R0() {
+ if (_T) return Qf;
+ (_T = 1),
+ Object.defineProperty(Qf, '__esModule', {value: !0}),
+ (Qf.default = t);
+ var e = ch();
+ function t(n, i) {
+ (0, e.default)('trailingComments', n, i);
+ }
+ return Qf;
+ }
+ var TT;
+ function L0() {
+ if (TT) return Yf;
+ (TT = 1),
+ Object.defineProperty(Yf, '__esModule', {value: !0}),
+ (Yf.default = i);
+ var e = R0(),
+ t = N0(),
+ n = M0();
+ function i(r, a) {
+ return (
+ (0, e.default)(r, a), (0, t.default)(r, a), (0, n.default)(r, a), r
+ );
+ }
+ return Yf;
+ }
+ var ep = {},
+ ET;
+ function az() {
+ if (ET) return ep;
+ (ET = 1),
+ Object.defineProperty(ep, '__esModule', {value: !0}),
+ (ep.default = t);
+ var e = Ea();
+ function t(n) {
+ return (
+ e.COMMENT_KEYS.forEach((i) => {
+ n[i] = null;
+ }),
+ n
+ );
+ }
+ return ep;
+ }
+ var pe = {},
+ IT;
+ function oz() {
+ if (IT) return pe;
+ (IT = 1),
+ Object.defineProperty(pe, '__esModule', {value: !0}),
+ (pe.WHILE_TYPES =
+ pe.USERWHITESPACABLE_TYPES =
+ pe.UNARYLIKE_TYPES =
+ pe.TYPESCRIPT_TYPES =
+ pe.TSTYPE_TYPES =
+ pe.TSTYPEELEMENT_TYPES =
+ pe.TSENTITYNAME_TYPES =
+ pe.TSBASETYPE_TYPES =
+ pe.TERMINATORLESS_TYPES =
+ pe.STATEMENT_TYPES =
+ pe.STANDARDIZED_TYPES =
+ pe.SCOPABLE_TYPES =
+ pe.PUREISH_TYPES =
+ pe.PROPERTY_TYPES =
+ pe.PRIVATE_TYPES =
+ pe.PATTERN_TYPES =
+ pe.PATTERNLIKE_TYPES =
+ pe.OBJECTMEMBER_TYPES =
+ pe.MODULESPECIFIER_TYPES =
+ pe.MODULEDECLARATION_TYPES =
+ pe.MISCELLANEOUS_TYPES =
+ pe.METHOD_TYPES =
+ pe.LVAL_TYPES =
+ pe.LOOP_TYPES =
+ pe.LITERAL_TYPES =
+ pe.JSX_TYPES =
+ pe.IMPORTOREXPORTDECLARATION_TYPES =
+ pe.IMMUTABLE_TYPES =
+ pe.FUNCTION_TYPES =
+ pe.FUNCTIONPARENT_TYPES =
+ pe.FOR_TYPES =
+ pe.FORXSTATEMENT_TYPES =
+ pe.FLOW_TYPES =
+ pe.FLOWTYPE_TYPES =
+ pe.FLOWPREDICATE_TYPES =
+ pe.FLOWDECLARATION_TYPES =
+ pe.FLOWBASEANNOTATION_TYPES =
+ pe.EXPRESSION_TYPES =
+ pe.EXPRESSIONWRAPPER_TYPES =
+ pe.EXPORTDECLARATION_TYPES =
+ pe.ENUMMEMBER_TYPES =
+ pe.ENUMBODY_TYPES =
+ pe.DECLARATION_TYPES =
+ pe.CONDITIONAL_TYPES =
+ pe.COMPLETIONSTATEMENT_TYPES =
+ pe.CLASS_TYPES =
+ pe.BLOCK_TYPES =
+ pe.BLOCKPARENT_TYPES =
+ pe.BINARY_TYPES =
+ pe.ACCESSOR_TYPES =
+ void 0);
+ var e = br();
+ (pe.STANDARDIZED_TYPES = e.FLIPPED_ALIAS_KEYS.Standardized),
+ (pe.EXPRESSION_TYPES = e.FLIPPED_ALIAS_KEYS.Expression),
+ (pe.BINARY_TYPES = e.FLIPPED_ALIAS_KEYS.Binary),
+ (pe.SCOPABLE_TYPES = e.FLIPPED_ALIAS_KEYS.Scopable),
+ (pe.BLOCKPARENT_TYPES = e.FLIPPED_ALIAS_KEYS.BlockParent),
+ (pe.BLOCK_TYPES = e.FLIPPED_ALIAS_KEYS.Block),
+ (pe.STATEMENT_TYPES = e.FLIPPED_ALIAS_KEYS.Statement),
+ (pe.TERMINATORLESS_TYPES = e.FLIPPED_ALIAS_KEYS.Terminatorless),
+ (pe.COMPLETIONSTATEMENT_TYPES = e.FLIPPED_ALIAS_KEYS.CompletionStatement),
+ (pe.CONDITIONAL_TYPES = e.FLIPPED_ALIAS_KEYS.Conditional),
+ (pe.LOOP_TYPES = e.FLIPPED_ALIAS_KEYS.Loop),
+ (pe.WHILE_TYPES = e.FLIPPED_ALIAS_KEYS.While),
+ (pe.EXPRESSIONWRAPPER_TYPES = e.FLIPPED_ALIAS_KEYS.ExpressionWrapper),
+ (pe.FOR_TYPES = e.FLIPPED_ALIAS_KEYS.For),
+ (pe.FORXSTATEMENT_TYPES = e.FLIPPED_ALIAS_KEYS.ForXStatement),
+ (pe.FUNCTION_TYPES = e.FLIPPED_ALIAS_KEYS.Function),
+ (pe.FUNCTIONPARENT_TYPES = e.FLIPPED_ALIAS_KEYS.FunctionParent),
+ (pe.PUREISH_TYPES = e.FLIPPED_ALIAS_KEYS.Pureish),
+ (pe.DECLARATION_TYPES = e.FLIPPED_ALIAS_KEYS.Declaration),
+ (pe.PATTERNLIKE_TYPES = e.FLIPPED_ALIAS_KEYS.PatternLike),
+ (pe.LVAL_TYPES = e.FLIPPED_ALIAS_KEYS.LVal),
+ (pe.TSENTITYNAME_TYPES = e.FLIPPED_ALIAS_KEYS.TSEntityName),
+ (pe.LITERAL_TYPES = e.FLIPPED_ALIAS_KEYS.Literal),
+ (pe.IMMUTABLE_TYPES = e.FLIPPED_ALIAS_KEYS.Immutable),
+ (pe.USERWHITESPACABLE_TYPES = e.FLIPPED_ALIAS_KEYS.UserWhitespacable),
+ (pe.METHOD_TYPES = e.FLIPPED_ALIAS_KEYS.Method),
+ (pe.OBJECTMEMBER_TYPES = e.FLIPPED_ALIAS_KEYS.ObjectMember),
+ (pe.PROPERTY_TYPES = e.FLIPPED_ALIAS_KEYS.Property),
+ (pe.UNARYLIKE_TYPES = e.FLIPPED_ALIAS_KEYS.UnaryLike),
+ (pe.PATTERN_TYPES = e.FLIPPED_ALIAS_KEYS.Pattern),
+ (pe.CLASS_TYPES = e.FLIPPED_ALIAS_KEYS.Class);
+ let t = (pe.IMPORTOREXPORTDECLARATION_TYPES =
+ e.FLIPPED_ALIAS_KEYS.ImportOrExportDeclaration);
+ return (
+ (pe.EXPORTDECLARATION_TYPES = e.FLIPPED_ALIAS_KEYS.ExportDeclaration),
+ (pe.MODULESPECIFIER_TYPES = e.FLIPPED_ALIAS_KEYS.ModuleSpecifier),
+ (pe.ACCESSOR_TYPES = e.FLIPPED_ALIAS_KEYS.Accessor),
+ (pe.PRIVATE_TYPES = e.FLIPPED_ALIAS_KEYS.Private),
+ (pe.FLOW_TYPES = e.FLIPPED_ALIAS_KEYS.Flow),
+ (pe.FLOWTYPE_TYPES = e.FLIPPED_ALIAS_KEYS.FlowType),
+ (pe.FLOWBASEANNOTATION_TYPES = e.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation),
+ (pe.FLOWDECLARATION_TYPES = e.FLIPPED_ALIAS_KEYS.FlowDeclaration),
+ (pe.FLOWPREDICATE_TYPES = e.FLIPPED_ALIAS_KEYS.FlowPredicate),
+ (pe.ENUMBODY_TYPES = e.FLIPPED_ALIAS_KEYS.EnumBody),
+ (pe.ENUMMEMBER_TYPES = e.FLIPPED_ALIAS_KEYS.EnumMember),
+ (pe.JSX_TYPES = e.FLIPPED_ALIAS_KEYS.JSX),
+ (pe.MISCELLANEOUS_TYPES = e.FLIPPED_ALIAS_KEYS.Miscellaneous),
+ (pe.TYPESCRIPT_TYPES = e.FLIPPED_ALIAS_KEYS.TypeScript),
+ (pe.TSTYPEELEMENT_TYPES = e.FLIPPED_ALIAS_KEYS.TSTypeElement),
+ (pe.TSTYPE_TYPES = e.FLIPPED_ALIAS_KEYS.TSType),
+ (pe.TSBASETYPE_TYPES = e.FLIPPED_ALIAS_KEYS.TSBaseType),
+ (pe.MODULEDECLARATION_TYPES = t),
+ pe
+ );
+ }
+ var tp = {},
+ np = {},
+ PT;
+ function F0() {
+ if (PT) return np;
+ (PT = 1),
+ Object.defineProperty(np, '__esModule', {value: !0}),
+ (np.default = n);
+ var e = ln(),
+ t = Bn();
+ function n(i, r) {
+ if ((0, e.isBlockStatement)(i)) return i;
+ let a = [];
+ return (
+ (0, e.isEmptyStatement)(i)
+ ? (a = [])
+ : ((0, e.isStatement)(i) ||
+ ((0, e.isFunction)(r)
+ ? (i = (0, t.returnStatement)(i))
+ : (i = (0, t.expressionStatement)(i))),
+ (a = [i])),
+ (0, t.blockStatement)(a)
+ );
+ }
+ return np;
+ }
+ var xT;
+ function sz() {
+ if (xT) return tp;
+ (xT = 1),
+ Object.defineProperty(tp, '__esModule', {value: !0}),
+ (tp.default = t);
+ var e = F0();
+ function t(n, i = 'body') {
+ let r = (0, e.default)(n[i], n);
+ return (n[i] = r), r;
+ }
+ return tp;
+ }
+ var rp = {},
+ ip = {},
+ wT;
+ function z0() {
+ if (wT) return ip;
+ (wT = 1),
+ Object.defineProperty(ip, '__esModule', {value: !0}),
+ (ip.default = n);
+ var e = qu(),
+ t = Um();
+ function n(i) {
+ i = i + '';
+ let r = '';
+ for (let a of i) r += (0, t.isIdentifierChar)(a.codePointAt(0)) ? a : '-';
+ return (
+ (r = r.replace(/^[-0-9]+/, '')),
+ (r = r.replace(/[-\s]+(.)?/g, function (a, o) {
+ return o ? o.toUpperCase() : '';
+ })),
+ (0, e.default)(r) || (r = `_${r}`),
+ r || '_'
+ );
+ }
+ return ip;
+ }
+ var OT;
+ function lz() {
+ if (OT) return rp;
+ (OT = 1),
+ Object.defineProperty(rp, '__esModule', {value: !0}),
+ (rp.default = t);
+ var e = z0();
+ function t(n) {
+ return (
+ (n = (0, e.default)(n)),
+ (n === 'eval' || n === 'arguments') && (n = '_' + n),
+ n
+ );
+ }
+ return rp;
+ }
+ var ap = {},
+ $T;
+ function cz() {
+ if ($T) return ap;
+ ($T = 1),
+ Object.defineProperty(ap, '__esModule', {value: !0}),
+ (ap.default = n);
+ var e = ln(),
+ t = Bn();
+ function n(i, r = i.key || i.property) {
+ return (
+ !i.computed &&
+ (0, e.isIdentifier)(r) &&
+ (r = (0, t.stringLiteral)(r.name)),
+ r
+ );
+ }
+ return ap;
+ }
+ var iu = {},
+ jT;
+ function uz() {
+ if (jT) return iu;
+ (jT = 1),
+ Object.defineProperty(iu, '__esModule', {value: !0}),
+ (iu.default = void 0);
+ var e = ln();
+ iu.default = t;
+ function t(n) {
+ if (
+ ((0, e.isExpressionStatement)(n) && (n = n.expression),
+ (0, e.isExpression)(n))
+ )
+ return n;
+ if (
+ ((0, e.isClass)(n)
+ ? (n.type = 'ClassExpression')
+ : (0, e.isFunction)(n) && (n.type = 'FunctionExpression'),
+ !(0, e.isExpression)(n))
+ )
+ throw new Error(`cannot turn ${n.type} to an expression`);
+ return n;
+ }
+ return iu;
+ }
+ var op = {},
+ sp = {},
+ lp = {},
+ CT;
+ function B0() {
+ if (CT) return lp;
+ (CT = 1),
+ Object.defineProperty(lp, '__esModule', {value: !0}),
+ (lp.default = t);
+ var e = br();
+ function t(n, i, r) {
+ if (!n) return;
+ let a = e.VISITOR_KEYS[n.type];
+ if (a) {
+ (r = r || {}), i(n, r);
+ for (let o of a) {
+ let s = n[o];
+ if (Array.isArray(s)) for (let l of s) t(l, i, r);
+ else t(s, i, r);
+ }
+ }
+ }
+ return lp;
+ }
+ var cp = {},
+ DT;
+ function U0() {
+ if (DT) return cp;
+ (DT = 1),
+ Object.defineProperty(cp, '__esModule', {value: !0}),
+ (cp.default = i);
+ var e = Ea();
+ let t = ['tokens', 'start', 'end', 'loc', 'raw', 'rawValue'],
+ n = [...e.COMMENT_KEYS, 'comments', ...t];
+ function i(r, a = {}) {
+ let o = a.preserveComments ? t : n;
+ for (let l of o) r[l] != null && (r[l] = void 0);
+ for (let l of Object.keys(r))
+ l[0] === '_' && r[l] != null && (r[l] = void 0);
+ let s = Object.getOwnPropertySymbols(r);
+ for (let l of s) r[l] = null;
+ }
+ return cp;
+ }
+ var AT;
+ function Z0() {
+ if (AT) return sp;
+ (AT = 1),
+ Object.defineProperty(sp, '__esModule', {value: !0}),
+ (sp.default = n);
+ var e = B0(),
+ t = U0();
+ function n(i, r) {
+ return (0, e.default)(i, t.default, r), i;
+ }
+ return sp;
+ }
+ var MT;
+ function dz() {
+ if (MT) return op;
+ (MT = 1),
+ Object.defineProperty(op, '__esModule', {value: !0}),
+ (op.default = i);
+ var e = ln(),
+ t = Ia(),
+ n = Z0();
+ function i(r, a = r.key) {
+ let o;
+ return r.kind === 'method'
+ ? i.increment() + ''
+ : ((0, e.isIdentifier)(a)
+ ? (o = a.name)
+ : (0, e.isStringLiteral)(a)
+ ? (o = JSON.stringify(a.value))
+ : (o = JSON.stringify((0, n.default)((0, t.default)(a)))),
+ r.computed && (o = `[${o}]`),
+ r.static && (o = `static:${o}`),
+ o);
+ }
+ return (
+ (i.uid = 0),
+ (i.increment = function () {
+ return i.uid >= Number.MAX_SAFE_INTEGER ? (i.uid = 0) : i.uid++;
+ }),
+ op
+ );
+ }
+ var au = {},
+ NT;
+ function fz() {
+ if (NT) return au;
+ (NT = 1),
+ Object.defineProperty(au, '__esModule', {value: !0}),
+ (au.default = void 0);
+ var e = ln(),
+ t = Bn();
+ au.default = n;
+ function n(i, r) {
+ if ((0, e.isStatement)(i)) return i;
+ let a = !1,
+ o;
+ if ((0, e.isClass)(i)) (a = !0), (o = 'ClassDeclaration');
+ else if ((0, e.isFunction)(i)) (a = !0), (o = 'FunctionDeclaration');
+ else if ((0, e.isAssignmentExpression)(i))
+ return (0, t.expressionStatement)(i);
+ if ((a && !i.id && (o = !1), !o)) {
+ if (r) return !1;
+ throw new Error(`cannot turn ${i.type} to a statement`);
+ }
+ return (i.type = o), i;
+ }
+ return au;
+ }
+ var ou = {},
+ RT;
+ function pz() {
+ if (RT) return ou;
+ (RT = 1),
+ Object.defineProperty(ou, '__esModule', {value: !0}),
+ (ou.default = void 0);
+ var e = qu(),
+ t = Bn();
+ ou.default = a;
+ let n = Function.call.bind(Object.prototype.toString);
+ function i(o) {
+ return n(o) === '[object RegExp]';
+ }
+ function r(o) {
+ if (
+ typeof o != 'object' ||
+ o === null ||
+ Object.prototype.toString.call(o) !== '[object Object]'
+ )
+ return !1;
+ let s = Object.getPrototypeOf(o);
+ return s === null || Object.getPrototypeOf(s) === null;
+ }
+ function a(o) {
+ if (o === void 0) return (0, t.identifier)('undefined');
+ if (o === !0 || o === !1) return (0, t.booleanLiteral)(o);
+ if (o === null) return (0, t.nullLiteral)();
+ if (typeof o == 'string') return (0, t.stringLiteral)(o);
+ if (typeof o == 'number') {
+ let s;
+ if (Number.isFinite(o)) s = (0, t.numericLiteral)(Math.abs(o));
+ else {
+ let l;
+ Number.isNaN(o)
+ ? (l = (0, t.numericLiteral)(0))
+ : (l = (0, t.numericLiteral)(1)),
+ (s = (0, t.binaryExpression)('/', l, (0, t.numericLiteral)(0)));
+ }
+ return (
+ (o < 0 || Object.is(o, -0)) && (s = (0, t.unaryExpression)('-', s)), s
+ );
+ }
+ if (i(o)) {
+ let s = o.source,
+ l = /\/([a-z]*)$/.exec(o.toString())[1];
+ return (0, t.regExpLiteral)(s, l);
+ }
+ if (Array.isArray(o)) return (0, t.arrayExpression)(o.map(a));
+ if (r(o)) {
+ let s = [];
+ for (let l of Object.keys(o)) {
+ let d;
+ (0, e.default)(l)
+ ? (d = (0, t.identifier)(l))
+ : (d = (0, t.stringLiteral)(l)),
+ s.push((0, t.objectProperty)(d, a(o[l])));
+ }
+ return (0, t.objectExpression)(s);
+ }
+ throw new Error("don't know how to turn this value into a node");
+ }
+ return ou;
+ }
+ var up = {},
+ LT;
+ function mz() {
+ if (LT) return up;
+ (LT = 1),
+ Object.defineProperty(up, '__esModule', {value: !0}),
+ (up.default = t);
+ var e = Bn();
+ function t(n, i, r = !1) {
+ return (
+ (n.object = (0, e.memberExpression)(n.object, n.property, n.computed)),
+ (n.property = i),
+ (n.computed = !!r),
+ n
+ );
+ }
+ return up;
+ }
+ var dp = {},
+ FT;
+ function yz() {
+ if (FT) return dp;
+ (FT = 1),
+ Object.defineProperty(dp, '__esModule', {value: !0}),
+ (dp.default = n);
+ var e = Ea(),
+ t = L0();
+ function n(i, r) {
+ if (!i || !r) return i;
+ for (let a of e.INHERIT_KEYS.optional) i[a] == null && (i[a] = r[a]);
+ for (let a of Object.keys(r))
+ a[0] === '_' && a !== '__clone' && (i[a] = r[a]);
+ for (let a of e.INHERIT_KEYS.force) i[a] = r[a];
+ return (0, t.default)(i, r), i;
+ }
+ return dp;
+ }
+ var fp = {},
+ zT;
+ function gz() {
+ if (zT) return fp;
+ (zT = 1),
+ Object.defineProperty(fp, '__esModule', {value: !0}),
+ (fp.default = n);
+ var e = Bn(),
+ t = uh();
+ function n(i, r) {
+ if ((0, t.isSuper)(i.object))
+ throw new Error(
+ 'Cannot prepend node to super property access (`super.foo`).'
+ );
+ return (i.object = (0, e.memberExpression)(r, i.object)), i;
+ }
+ return fp;
+ }
+ var pp = {},
+ BT;
+ function vz() {
+ if (BT) return pp;
+ (BT = 1),
+ Object.defineProperty(pp, '__esModule', {value: !0}),
+ (pp.default = e);
+ function e(t) {
+ let n = [].concat(t),
+ i = Object.create(null);
+ for (; n.length; ) {
+ let r = n.pop();
+ if (r)
+ switch (r.type) {
+ case 'ArrayPattern':
+ n.push(...r.elements);
+ break;
+ case 'AssignmentExpression':
+ case 'AssignmentPattern':
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ n.push(r.left);
+ break;
+ case 'ObjectPattern':
+ n.push(...r.properties);
+ break;
+ case 'ObjectProperty':
+ n.push(r.value);
+ break;
+ case 'RestElement':
+ case 'UpdateExpression':
+ n.push(r.argument);
+ break;
+ case 'UnaryExpression':
+ r.operator === 'delete' && n.push(r.argument);
+ break;
+ case 'Identifier':
+ i[r.name] = r;
+ break;
+ }
+ }
+ return i;
+ }
+ return pp;
+ }
+ var mp = {},
+ UT;
+ function qm() {
+ if (UT) return mp;
+ (UT = 1),
+ Object.defineProperty(mp, '__esModule', {value: !0}),
+ (mp.default = t);
+ var e = ln();
+ function t(i, r, a, o) {
+ let s = [].concat(i),
+ l = Object.create(null);
+ for (; s.length; ) {
+ let d = s.shift();
+ if (
+ !d ||
+ (o &&
+ ((0, e.isAssignmentExpression)(d) ||
+ (0, e.isUnaryExpression)(d) ||
+ (0, e.isUpdateExpression)(d)))
+ )
+ continue;
+ if ((0, e.isIdentifier)(d)) {
+ r ? (l[d.name] = l[d.name] || []).push(d) : (l[d.name] = d);
+ continue;
+ }
+ if (
+ (0, e.isExportDeclaration)(d) &&
+ !(0, e.isExportAllDeclaration)(d)
+ ) {
+ (0, e.isDeclaration)(d.declaration) && s.push(d.declaration);
+ continue;
+ }
+ if (a) {
+ if ((0, e.isFunctionDeclaration)(d)) {
+ s.push(d.id);
+ continue;
+ }
+ if ((0, e.isFunctionExpression)(d)) continue;
+ }
+ let u = t.keys[d.type];
+ if (u)
+ for (let p = 0; p < u.length; p++) {
+ let y = u[p],
+ m = d[y];
+ m && (Array.isArray(m) ? s.push(...m) : s.push(m));
+ }
+ }
+ return l;
+ }
+ let n = {
+ DeclareClass: ['id'],
+ DeclareFunction: ['id'],
+ DeclareModule: ['id'],
+ DeclareVariable: ['id'],
+ DeclareInterface: ['id'],
+ DeclareTypeAlias: ['id'],
+ DeclareOpaqueType: ['id'],
+ InterfaceDeclaration: ['id'],
+ TypeAlias: ['id'],
+ OpaqueType: ['id'],
+ CatchClause: ['param'],
+ LabeledStatement: ['label'],
+ UnaryExpression: ['argument'],
+ AssignmentExpression: ['left'],
+ ImportSpecifier: ['local'],
+ ImportNamespaceSpecifier: ['local'],
+ ImportDefaultSpecifier: ['local'],
+ ImportDeclaration: ['specifiers'],
+ ExportSpecifier: ['exported'],
+ ExportNamespaceSpecifier: ['exported'],
+ ExportDefaultSpecifier: ['exported'],
+ FunctionDeclaration: ['id', 'params'],
+ FunctionExpression: ['id', 'params'],
+ ArrowFunctionExpression: ['params'],
+ ObjectMethod: ['params'],
+ ClassMethod: ['params'],
+ ClassPrivateMethod: ['params'],
+ ForInStatement: ['left'],
+ ForOfStatement: ['left'],
+ ClassDeclaration: ['id'],
+ ClassExpression: ['id'],
+ RestElement: ['argument'],
+ UpdateExpression: ['argument'],
+ ObjectProperty: ['value'],
+ AssignmentPattern: ['left'],
+ ArrayPattern: ['elements'],
+ ObjectPattern: ['properties'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: ['id'],
+ };
+ return (t.keys = n), mp;
+ }
+ var su = {},
+ ZT;
+ function hz() {
+ if (ZT) return su;
+ (ZT = 1),
+ Object.defineProperty(su, '__esModule', {value: !0}),
+ (su.default = void 0);
+ var e = qm();
+ su.default = t;
+ function t(n, i) {
+ return (0, e.default)(n, i, !0);
+ }
+ return su;
+ }
+ var yp = {},
+ qT;
+ function bz() {
+ if (qT) return yp;
+ (qT = 1),
+ Object.defineProperty(yp, '__esModule', {value: !0}),
+ (yp.default = i);
+ var e = ln();
+ function t(r) {
+ return (0, e.isNullLiteral)(r)
+ ? 'null'
+ : (0, e.isRegExpLiteral)(r)
+ ? `/${r.pattern}/${r.flags}`
+ : (0, e.isTemplateLiteral)(r)
+ ? r.quasis.map((a) => a.value.raw).join('')
+ : r.value !== void 0
+ ? String(r.value)
+ : null;
+ }
+ function n(r) {
+ if (!r.computed || (0, e.isLiteral)(r.key)) return r.key;
+ }
+ function i(r, a) {
+ if ('id' in r && r.id) return {name: r.id.name, originalNode: r.id};
+ let o = '',
+ s;
+ if (
+ ((0, e.isObjectProperty)(a, {value: r})
+ ? (s = n(a))
+ : (0, e.isObjectMethod)(r) || (0, e.isClassMethod)(r)
+ ? ((s = n(r)),
+ r.kind === 'get' ? (o = 'get ') : r.kind === 'set' && (o = 'set '))
+ : (0, e.isVariableDeclarator)(a, {init: r})
+ ? (s = a.id)
+ : (0, e.isAssignmentExpression)(a, {operator: '=', right: r}) &&
+ (s = a.left),
+ !s)
+ )
+ return null;
+ let l = (0, e.isLiteral)(s)
+ ? t(s)
+ : (0, e.isIdentifier)(s)
+ ? s.name
+ : (0, e.isPrivateName)(s)
+ ? s.id.name
+ : null;
+ return l == null ? null : {name: o + l, originalNode: s};
+ }
+ return yp;
+ }
+ var gp = {},
+ KT;
+ function kz() {
+ if (KT) return gp;
+ (KT = 1),
+ Object.defineProperty(gp, '__esModule', {value: !0}),
+ (gp.default = t);
+ var e = br();
+ function t(i, r, a) {
+ typeof r == 'function' && (r = {enter: r});
+ let {enter: o, exit: s} = r;
+ n(i, o, s, a, []);
+ }
+ function n(i, r, a, o, s) {
+ let l = e.VISITOR_KEYS[i.type];
+ if (l) {
+ r && r(i, s, o);
+ for (let d of l) {
+ let u = i[d];
+ if (Array.isArray(u))
+ for (let p = 0; p < u.length; p++) {
+ let y = u[p];
+ y &&
+ (s.push({node: i, key: d, index: p}),
+ n(y, r, a, o, s),
+ s.pop());
+ }
+ else u && (s.push({node: i, key: d}), n(u, r, a, o, s), s.pop());
+ }
+ a && a(i, s, o);
+ }
+ }
+ return gp;
+ }
+ var vp = {},
+ VT;
+ function Sz() {
+ if (VT) return vp;
+ (VT = 1),
+ Object.defineProperty(vp, '__esModule', {value: !0}),
+ (vp.default = t);
+ var e = qm();
+ function t(n, i, r) {
+ if (
+ r &&
+ n.type === 'Identifier' &&
+ i.type === 'ObjectProperty' &&
+ r.type === 'ObjectExpression'
+ )
+ return !1;
+ let a = e.default.keys[i.type];
+ if (a)
+ for (let o = 0; o < a.length; o++) {
+ let s = a[o],
+ l = i[s];
+ if (Array.isArray(l)) {
+ if (l.includes(n)) return !0;
+ } else if (l === n) return !0;
+ }
+ return !1;
+ }
+ return vp;
+ }
+ var hp = {},
+ bp = {},
+ JT;
+ function q0() {
+ if (JT) return bp;
+ (JT = 1),
+ Object.defineProperty(bp, '__esModule', {value: !0}),
+ (bp.default = n);
+ var e = ln(),
+ t = Ea();
+ function n(i) {
+ return (
+ (0, e.isVariableDeclaration)(i) &&
+ (i.kind !== 'var' || i[t.BLOCK_SCOPED_SYMBOL])
+ );
+ }
+ return bp;
+ }
+ var HT;
+ function _z() {
+ if (HT) return hp;
+ (HT = 1),
+ Object.defineProperty(hp, '__esModule', {value: !0}),
+ (hp.default = n);
+ var e = ln(),
+ t = q0();
+ function n(i) {
+ return (
+ (0, e.isFunctionDeclaration)(i) ||
+ (0, e.isClassDeclaration)(i) ||
+ (0, t.default)(i)
+ );
+ }
+ return hp;
+ }
+ var kp = {},
+ WT;
+ function Tz() {
+ if (WT) return kp;
+ (WT = 1),
+ Object.defineProperty(kp, '__esModule', {value: !0}),
+ (kp.default = n);
+ var e = sh(),
+ t = ln();
+ function n(i) {
+ return (0, e.default)(i.type, 'Immutable')
+ ? !0
+ : (0, t.isIdentifier)(i)
+ ? i.name === 'undefined'
+ : !1;
+ }
+ return kp;
+ }
+ var Sp = {},
+ GT;
+ function Ez() {
+ if (GT) return Sp;
+ (GT = 1),
+ Object.defineProperty(Sp, '__esModule', {value: !0}),
+ (Sp.default = t);
+ var e = br();
+ function t(n, i) {
+ if (
+ typeof n != 'object' ||
+ typeof i != 'object' ||
+ n == null ||
+ i == null
+ )
+ return n === i;
+ if (n.type !== i.type) return !1;
+ let r = Object.keys(e.NODE_FIELDS[n.type] || n.type),
+ a = e.VISITOR_KEYS[n.type];
+ for (let o of r) {
+ let s = n[o],
+ l = i[o];
+ if (typeof s != typeof l) return !1;
+ if (!(s == null && l == null)) {
+ if (s == null || l == null) return !1;
+ if (Array.isArray(s)) {
+ if (!Array.isArray(l) || s.length !== l.length) return !1;
+ for (let d = 0; d < s.length; d++) if (!t(s[d], l[d])) return !1;
+ continue;
+ }
+ if (typeof s == 'object' && !(a != null && a.includes(o))) {
+ for (let d of Object.keys(s)) if (s[d] !== l[d]) return !1;
+ continue;
+ }
+ if (!t(s, l)) return !1;
+ }
+ }
+ return !0;
+ }
+ return Sp;
+ }
+ var _p = {},
+ XT;
+ function Iz() {
+ if (XT) return _p;
+ (XT = 1),
+ Object.defineProperty(_p, '__esModule', {value: !0}),
+ (_p.default = e);
+ function e(t, n, i) {
+ switch (n.type) {
+ case 'MemberExpression':
+ case 'OptionalMemberExpression':
+ return n.property === t ? !!n.computed : n.object === t;
+ case 'JSXMemberExpression':
+ return n.object === t;
+ case 'VariableDeclarator':
+ return n.init === t;
+ case 'ArrowFunctionExpression':
+ return n.body === t;
+ case 'PrivateName':
+ return !1;
+ case 'ClassMethod':
+ case 'ClassPrivateMethod':
+ case 'ObjectMethod':
+ return n.key === t ? !!n.computed : !1;
+ case 'ObjectProperty':
+ return n.key === t ? !!n.computed : !i || i.type !== 'ObjectPattern';
+ case 'ClassProperty':
+ case 'ClassAccessorProperty':
+ return n.key === t ? !!n.computed : !0;
+ case 'ClassPrivateProperty':
+ return n.key !== t;
+ case 'ClassDeclaration':
+ case 'ClassExpression':
+ return n.superClass === t;
+ case 'AssignmentExpression':
+ return n.right === t;
+ case 'AssignmentPattern':
+ return n.right === t;
+ case 'LabeledStatement':
+ return !1;
+ case 'CatchClause':
+ return !1;
+ case 'RestElement':
+ return !1;
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ return !1;
+ case 'FunctionDeclaration':
+ case 'FunctionExpression':
+ return !1;
+ case 'ExportNamespaceSpecifier':
+ case 'ExportDefaultSpecifier':
+ return !1;
+ case 'ExportSpecifier':
+ return i != null && i.source ? !1 : n.local === t;
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'ImportSpecifier':
+ return !1;
+ case 'ImportAttribute':
+ return !1;
+ case 'JSXAttribute':
+ return !1;
+ case 'ObjectPattern':
+ case 'ArrayPattern':
+ return !1;
+ case 'MetaProperty':
+ return !1;
+ case 'ObjectTypeProperty':
+ return n.key !== t;
+ case 'TSEnumMember':
+ return n.id !== t;
+ case 'TSPropertySignature':
+ return n.key === t ? !!n.computed : !0;
+ }
+ return !0;
+ }
+ return _p;
+ }
+ var Tp = {},
+ YT;
+ function Pz() {
+ if (YT) return Tp;
+ (YT = 1),
+ Object.defineProperty(Tp, '__esModule', {value: !0}),
+ (Tp.default = t);
+ var e = ln();
+ function t(n, i) {
+ return (0, e.isBlockStatement)(n) &&
+ ((0, e.isFunction)(i) || (0, e.isCatchClause)(i))
+ ? !1
+ : (0, e.isPattern)(n) &&
+ ((0, e.isFunction)(i) || (0, e.isCatchClause)(i))
+ ? !0
+ : (0, e.isScopable)(n);
+ }
+ return Tp;
+ }
+ var Ep = {},
+ QT;
+ function xz() {
+ if (QT) return Ep;
+ (QT = 1),
+ Object.defineProperty(Ep, '__esModule', {value: !0}),
+ (Ep.default = t);
+ var e = ln();
+ function t(n) {
+ return (
+ (0, e.isImportDefaultSpecifier)(n) ||
+ (0, e.isIdentifier)(n.imported || n.exported, {name: 'default'})
+ );
+ }
+ return Ep;
+ }
+ var Ip = {},
+ eE;
+ function wz() {
+ if (eE) return Ip;
+ (eE = 1),
+ Object.defineProperty(Ip, '__esModule', {value: !0}),
+ (Ip.default = n);
+ var e = qu();
+ let t = new Set([
+ 'abstract',
+ 'boolean',
+ 'byte',
+ 'char',
+ 'double',
+ 'enum',
+ 'final',
+ 'float',
+ 'goto',
+ 'implements',
+ 'int',
+ 'interface',
+ 'long',
+ 'native',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ 'short',
+ 'static',
+ 'synchronized',
+ 'throws',
+ 'transient',
+ 'volatile',
+ ]);
+ function n(i) {
+ return (0, e.default)(i) && !t.has(i);
+ }
+ return Ip;
+ }
+ var Pp = {},
+ tE;
+ function Oz() {
+ if (tE) return Pp;
+ (tE = 1),
+ Object.defineProperty(Pp, '__esModule', {value: !0}),
+ (Pp.default = n);
+ var e = ln(),
+ t = Ea();
+ function n(i) {
+ return (
+ (0, e.isVariableDeclaration)(i, {kind: 'var'}) &&
+ !i[t.BLOCK_SCOPED_SYMBOL]
+ );
+ }
+ return Pp;
+ }
+ var xp = {},
+ wp = {},
+ nE;
+ function $z() {
+ if (nE) return wp;
+ (nE = 1),
+ Object.defineProperty(wp, '__esModule', {value: !0}),
+ (wp.default = a);
+ var e = qm(),
+ t = ln(),
+ n = Bn(),
+ i = D0(),
+ r = Ia();
+ function a(o, s) {
+ let l = [],
+ d = !0;
+ for (let u of o)
+ if (((0, t.isEmptyStatement)(u) || (d = !1), (0, t.isExpression)(u)))
+ l.push(u);
+ else if ((0, t.isExpressionStatement)(u)) l.push(u.expression);
+ else if ((0, t.isVariableDeclaration)(u)) {
+ if (u.kind !== 'var') return;
+ for (let p of u.declarations) {
+ let y = (0, e.default)(p);
+ for (let m of Object.keys(y))
+ s.push({kind: u.kind, id: (0, r.default)(y[m])});
+ p.init && l.push((0, n.assignmentExpression)('=', p.id, p.init));
+ }
+ d = !0;
+ } else if ((0, t.isIfStatement)(u)) {
+ let p = u.consequent
+ ? a([u.consequent], s)
+ : (0, i.buildUndefinedNode)(),
+ y = u.alternate ? a([u.alternate], s) : (0, i.buildUndefinedNode)();
+ if (!p || !y) return;
+ l.push((0, n.conditionalExpression)(u.test, p, y));
+ } else if ((0, t.isBlockStatement)(u)) {
+ let p = a(u.body, s);
+ if (!p) return;
+ l.push(p);
+ } else if ((0, t.isEmptyStatement)(u)) o.indexOf(u) === 0 && (d = !0);
+ else return;
+ return (
+ d && l.push((0, i.buildUndefinedNode)()),
+ l.length === 1 ? l[0] : (0, n.sequenceExpression)(l)
+ );
+ }
+ return wp;
+ }
+ var rE;
+ function jz() {
+ if (rE) return xp;
+ (rE = 1),
+ Object.defineProperty(xp, '__esModule', {value: !0}),
+ (xp.default = t);
+ var e = $z();
+ function t(n, i) {
+ if (!(n != null && n.length)) return;
+ let r = [],
+ a = (0, e.default)(n, r);
+ if (a) {
+ for (let o of r) i.push(o);
+ return a;
+ }
+ }
+ return xp;
+ }
+ var iE;
+ function uh() {
+ return (
+ iE ||
+ ((iE = 1),
+ (function (e) {
+ Object.defineProperty(e, '__esModule', {value: !0});
+ var t = {
+ react: !0,
+ assertNode: !0,
+ createTypeAnnotationBasedOnTypeof: !0,
+ createUnionTypeAnnotation: !0,
+ createFlowUnionType: !0,
+ createTSUnionType: !0,
+ cloneNode: !0,
+ clone: !0,
+ cloneDeep: !0,
+ cloneDeepWithoutLoc: !0,
+ cloneWithoutLoc: !0,
+ addComment: !0,
+ addComments: !0,
+ inheritInnerComments: !0,
+ inheritLeadingComments: !0,
+ inheritsComments: !0,
+ inheritTrailingComments: !0,
+ removeComments: !0,
+ ensureBlock: !0,
+ toBindingIdentifierName: !0,
+ toBlock: !0,
+ toComputedKey: !0,
+ toExpression: !0,
+ toIdentifier: !0,
+ toKeyAlias: !0,
+ toStatement: !0,
+ valueToNode: !0,
+ appendToMemberExpression: !0,
+ inherits: !0,
+ prependToMemberExpression: !0,
+ removeProperties: !0,
+ removePropertiesDeep: !0,
+ removeTypeDuplicates: !0,
+ getAssignmentIdentifiers: !0,
+ getBindingIdentifiers: !0,
+ getOuterBindingIdentifiers: !0,
+ getFunctionName: !0,
+ traverse: !0,
+ traverseFast: !0,
+ shallowEqual: !0,
+ is: !0,
+ isBinding: !0,
+ isBlockScoped: !0,
+ isImmutable: !0,
+ isLet: !0,
+ isNode: !0,
+ isNodesEquivalent: !0,
+ isPlaceholderType: !0,
+ isReferenced: !0,
+ isScope: !0,
+ isSpecifierDefault: !0,
+ isType: !0,
+ isValidES3Identifier: !0,
+ isValidIdentifier: !0,
+ isVar: !0,
+ matchesPattern: !0,
+ validate: !0,
+ buildMatchMemberExpression: !0,
+ __internal__deprecationWarning: !0,
+ };
+ Object.defineProperty(e, '__internal__deprecationWarning', {
+ enumerable: !0,
+ get: function () {
+ return Qe.default;
+ },
+ }),
+ Object.defineProperty(e, 'addComment', {
+ enumerable: !0,
+ get: function () {
+ return P.default;
+ },
+ }),
+ Object.defineProperty(e, 'addComments', {
+ enumerable: !0,
+ get: function () {
+ return M.default;
+ },
+ }),
+ Object.defineProperty(e, 'appendToMemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return Ae.default;
+ },
+ }),
+ Object.defineProperty(e, 'assertNode', {
+ enumerable: !0,
+ get: function () {
+ return a.default;
+ },
+ }),
+ Object.defineProperty(e, 'buildMatchMemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return Ke.default;
+ },
+ }),
+ Object.defineProperty(e, 'clone', {
+ enumerable: !0,
+ get: function () {
+ return g.default;
+ },
+ }),
+ Object.defineProperty(e, 'cloneDeep', {
+ enumerable: !0,
+ get: function () {
+ return S.default;
+ },
+ }),
+ Object.defineProperty(e, 'cloneDeepWithoutLoc', {
+ enumerable: !0,
+ get: function () {
+ return _.default;
+ },
+ }),
+ Object.defineProperty(e, 'cloneNode', {
+ enumerable: !0,
+ get: function () {
+ return m.default;
+ },
+ }),
+ Object.defineProperty(e, 'cloneWithoutLoc', {
+ enumerable: !0,
+ get: function () {
+ return O.default;
+ },
+ }),
+ Object.defineProperty(e, 'createFlowUnionType', {
+ enumerable: !0,
+ get: function () {
+ return l.default;
+ },
+ }),
+ Object.defineProperty(e, 'createTSUnionType', {
+ enumerable: !0,
+ get: function () {
+ return d.default;
+ },
+ }),
+ Object.defineProperty(e, 'createTypeAnnotationBasedOnTypeof', {
+ enumerable: !0,
+ get: function () {
+ return s.default;
+ },
+ }),
+ Object.defineProperty(e, 'createUnionTypeAnnotation', {
+ enumerable: !0,
+ get: function () {
+ return l.default;
+ },
+ }),
+ Object.defineProperty(e, 'ensureBlock', {
+ enumerable: !0,
+ get: function () {
+ return G.default;
+ },
+ }),
+ Object.defineProperty(e, 'getAssignmentIdentifiers', {
+ enumerable: !0,
+ get: function () {
+ return dt.default;
+ },
+ }),
+ Object.defineProperty(e, 'getBindingIdentifiers', {
+ enumerable: !0,
+ get: function () {
+ return qt.default;
+ },
+ }),
+ Object.defineProperty(e, 'getFunctionName', {
+ enumerable: !0,
+ get: function () {
+ return Xe.default;
+ },
+ }),
+ Object.defineProperty(e, 'getOuterBindingIdentifiers', {
+ enumerable: !0,
+ get: function () {
+ return J.default;
+ },
+ }),
+ Object.defineProperty(e, 'inheritInnerComments', {
+ enumerable: !0,
+ get: function () {
+ return w.default;
+ },
+ }),
+ Object.defineProperty(e, 'inheritLeadingComments', {
+ enumerable: !0,
+ get: function () {
+ return I.default;
+ },
+ }),
+ Object.defineProperty(e, 'inheritTrailingComments', {
+ enumerable: !0,
+ get: function () {
+ return A.default;
+ },
+ }),
+ Object.defineProperty(e, 'inherits', {
+ enumerable: !0,
+ get: function () {
+ return Ye.default;
+ },
+ }),
+ Object.defineProperty(e, 'inheritsComments', {
+ enumerable: !0,
+ get: function () {
+ return U.default;
+ },
+ }),
+ Object.defineProperty(e, 'is', {
+ enumerable: !0,
+ get: function () {
+ return ft.default;
+ },
+ }),
+ Object.defineProperty(e, 'isBinding', {
+ enumerable: !0,
+ get: function () {
+ return De.default;
+ },
+ }),
+ Object.defineProperty(e, 'isBlockScoped', {
+ enumerable: !0,
+ get: function () {
+ return Y.default;
+ },
+ }),
+ Object.defineProperty(e, 'isImmutable', {
+ enumerable: !0,
+ get: function () {
+ return ce.default;
+ },
+ }),
+ Object.defineProperty(e, 'isLet', {
+ enumerable: !0,
+ get: function () {
+ return Ze.default;
+ },
+ }),
+ Object.defineProperty(e, 'isNode', {
+ enumerable: !0,
+ get: function () {
+ return Ne.default;
+ },
+ }),
+ Object.defineProperty(e, 'isNodesEquivalent', {
+ enumerable: !0,
+ get: function () {
+ return X.default;
+ },
+ }),
+ Object.defineProperty(e, 'isPlaceholderType', {
+ enumerable: !0,
+ get: function () {
+ return ee.default;
+ },
+ }),
+ Object.defineProperty(e, 'isReferenced', {
+ enumerable: !0,
+ get: function () {
+ return ge.default;
+ },
+ }),
+ Object.defineProperty(e, 'isScope', {
+ enumerable: !0,
+ get: function () {
+ return fe.default;
+ },
+ }),
+ Object.defineProperty(e, 'isSpecifierDefault', {
+ enumerable: !0,
+ get: function () {
+ return we.default;
+ },
+ }),
+ Object.defineProperty(e, 'isType', {
+ enumerable: !0,
+ get: function () {
+ return me.default;
+ },
+ }),
+ Object.defineProperty(e, 'isValidES3Identifier', {
+ enumerable: !0,
+ get: function () {
+ return ze.default;
+ },
+ }),
+ Object.defineProperty(e, 'isValidIdentifier', {
+ enumerable: !0,
+ get: function () {
+ return Ce.default;
+ },
+ }),
+ Object.defineProperty(e, 'isVar', {
+ enumerable: !0,
+ get: function () {
+ return lt.default;
+ },
+ }),
+ Object.defineProperty(e, 'matchesPattern', {
+ enumerable: !0,
+ get: function () {
+ return ne.default;
+ },
+ }),
+ Object.defineProperty(e, 'prependToMemberExpression', {
+ enumerable: !0,
+ get: function () {
+ return bt.default;
+ },
+ }),
+ (e.react = void 0),
+ Object.defineProperty(e, 'removeComments', {
+ enumerable: !0,
+ get: function () {
+ return q.default;
+ },
+ }),
+ Object.defineProperty(e, 'removeProperties', {
+ enumerable: !0,
+ get: function () {
+ return st.default;
+ },
+ }),
+ Object.defineProperty(e, 'removePropertiesDeep', {
+ enumerable: !0,
+ get: function () {
+ return tt.default;
+ },
+ }),
+ Object.defineProperty(e, 'removeTypeDuplicates', {
+ enumerable: !0,
+ get: function () {
+ return yt.default;
+ },
+ }),
+ Object.defineProperty(e, 'shallowEqual', {
+ enumerable: !0,
+ get: function () {
+ return Et.default;
+ },
+ }),
+ Object.defineProperty(e, 'toBindingIdentifierName', {
+ enumerable: !0,
+ get: function () {
+ return ve.default;
+ },
+ }),
+ Object.defineProperty(e, 'toBlock', {
+ enumerable: !0,
+ get: function () {
+ return de.default;
+ },
+ }),
+ Object.defineProperty(e, 'toComputedKey', {
+ enumerable: !0,
+ get: function () {
+ return oe.default;
+ },
+ }),
+ Object.defineProperty(e, 'toExpression', {
+ enumerable: !0,
+ get: function () {
+ return be.default;
+ },
+ }),
+ Object.defineProperty(e, 'toIdentifier', {
+ enumerable: !0,
+ get: function () {
+ return $e.default;
+ },
+ }),
+ Object.defineProperty(e, 'toKeyAlias', {
+ enumerable: !0,
+ get: function () {
+ return Ie.default;
+ },
+ }),
+ Object.defineProperty(e, 'toStatement', {
+ enumerable: !0,
+ get: function () {
+ return Pe.default;
+ },
+ }),
+ Object.defineProperty(e, 'traverse', {
+ enumerable: !0,
+ get: function () {
+ return it.default;
+ },
+ }),
+ Object.defineProperty(e, 'traverseFast', {
+ enumerable: !0,
+ get: function () {
+ return mt.default;
+ },
+ }),
+ Object.defineProperty(e, 'validate', {
+ enumerable: !0,
+ get: function () {
+ return he.default;
+ },
+ }),
+ Object.defineProperty(e, 'valueToNode', {
+ enumerable: !0,
+ get: function () {
+ return ke.default;
+ },
+ });
+ var n = AF(),
+ i = MF(),
+ r = VF(),
+ a = JF(),
+ o = HF();
+ Object.keys(o).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === o[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return o[se];
+ },
+ });
+ });
+ var s = WF(),
+ l = GF(),
+ d = YF(),
+ u = Bn();
+ Object.keys(u).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === u[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return u[se];
+ },
+ });
+ });
+ var p = QF();
+ Object.keys(p).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === p[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return p[se];
+ },
+ });
+ });
+ var y = D0();
+ Object.keys(y).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === y[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return y[se];
+ },
+ });
+ });
+ var m = Ia(),
+ g = ez(),
+ S = tz(),
+ _ = nz(),
+ O = rz(),
+ P = iz(),
+ M = A0(),
+ w = M0(),
+ I = N0(),
+ U = L0(),
+ A = R0(),
+ q = az(),
+ ae = oz();
+ Object.keys(ae).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === ae[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return ae[se];
+ },
+ });
+ });
+ var le = Ea();
+ Object.keys(le).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === le[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return le[se];
+ },
+ });
+ });
+ var G = sz(),
+ ve = lz(),
+ de = F0(),
+ oe = cz(),
+ be = uz(),
+ $e = z0(),
+ Ie = dz(),
+ Pe = fz(),
+ ke = pz(),
+ je = br();
+ Object.keys(je).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === je[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return je[se];
+ },
+ });
+ });
+ var Ae = mz(),
+ Ye = yz(),
+ bt = gz(),
+ st = U0(),
+ tt = Z0(),
+ yt = C0(),
+ dt = vz(),
+ qt = qm(),
+ J = hz(),
+ Xe = bz(),
+ it = kz();
+ Object.keys(it).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === it[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return it[se];
+ },
+ });
+ });
+ var mt = B0(),
+ Et = oh(),
+ ft = Zu(),
+ De = Sz(),
+ Y = _z(),
+ ce = Tz(),
+ Ze = q0(),
+ Ne = j0(),
+ X = Ez(),
+ ee = O0(),
+ ge = Iz(),
+ fe = Pz(),
+ we = xz(),
+ me = sh(),
+ ze = wz(),
+ Ce = qu(),
+ lt = Oz(),
+ ne = x0(),
+ he = lh(),
+ Ke = w0(),
+ Ge = ln();
+ Object.keys(Ge).forEach(function (se) {
+ se === 'default' ||
+ se === '__esModule' ||
+ Object.prototype.hasOwnProperty.call(t, se) ||
+ (se in e && e[se] === Ge[se]) ||
+ Object.defineProperty(e, se, {
+ enumerable: !0,
+ get: function () {
+ return Ge[se];
+ },
+ });
+ });
+ var Qe = Bm();
+ (e.react = {
+ isReactComponent: n.default,
+ isCompatTag: i.default,
+ buildChildren: r.default,
+ }),
+ (e.toSequenceExpression = jz().default),
+ process.env.BABEL_TYPES_8_BREAKING &&
+ console.warn(
+ 'BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!'
+ );
+ })(Ig)),
+ Ig
+ );
+ }
+ var $ = uh(),
+ Ba = {},
+ Pu = {},
+ Cz = {
+ get exports() {
+ return Pu;
+ },
+ set exports(e) {
+ Pu = e;
+ },
+ },
+ aE;
+ function Dz() {
+ if (aE) return Pu;
+ aE = 1;
+ let e = process || {},
+ t = e.argv || [],
+ n = e.env || {},
+ i =
+ !(n.NO_COLOR || t.includes('--no-color')) &&
+ (!!n.FORCE_COLOR ||
+ t.includes('--color') ||
+ e.platform === 'win32' ||
+ ((e.stdout || {}).isTTY && n.TERM !== 'dumb') ||
+ !!n.CI),
+ r =
+ (s, l, d = s) =>
+ (u) => {
+ let p = '' + u,
+ y = p.indexOf(l, s.length);
+ return ~y ? s + a(p, l, d, y) + l : s + p + l;
+ },
+ a = (s, l, d, u) => {
+ let p = '',
+ y = 0;
+ do
+ (p += s.substring(y, u) + d),
+ (y = u + l.length),
+ (u = s.indexOf(l, y));
+ while (~u);
+ return p + s.substring(y);
+ },
+ o = (s = i) => {
+ let l = s ? r : () => String;
+ return {
+ isColorSupported: s,
+ reset: l('\x1B[0m', '\x1B[0m'),
+ bold: l('\x1B[1m', '\x1B[22m', '\x1B[22m\x1B[1m'),
+ dim: l('\x1B[2m', '\x1B[22m', '\x1B[22m\x1B[2m'),
+ italic: l('\x1B[3m', '\x1B[23m'),
+ underline: l('\x1B[4m', '\x1B[24m'),
+ inverse: l('\x1B[7m', '\x1B[27m'),
+ hidden: l('\x1B[8m', '\x1B[28m'),
+ strikethrough: l('\x1B[9m', '\x1B[29m'),
+ black: l('\x1B[30m', '\x1B[39m'),
+ red: l('\x1B[31m', '\x1B[39m'),
+ green: l('\x1B[32m', '\x1B[39m'),
+ yellow: l('\x1B[33m', '\x1B[39m'),
+ blue: l('\x1B[34m', '\x1B[39m'),
+ magenta: l('\x1B[35m', '\x1B[39m'),
+ cyan: l('\x1B[36m', '\x1B[39m'),
+ white: l('\x1B[37m', '\x1B[39m'),
+ gray: l('\x1B[90m', '\x1B[39m'),
+ bgBlack: l('\x1B[40m', '\x1B[49m'),
+ bgRed: l('\x1B[41m', '\x1B[49m'),
+ bgGreen: l('\x1B[42m', '\x1B[49m'),
+ bgYellow: l('\x1B[43m', '\x1B[49m'),
+ bgBlue: l('\x1B[44m', '\x1B[49m'),
+ bgMagenta: l('\x1B[45m', '\x1B[49m'),
+ bgCyan: l('\x1B[46m', '\x1B[49m'),
+ bgWhite: l('\x1B[47m', '\x1B[49m'),
+ blackBright: l('\x1B[90m', '\x1B[39m'),
+ redBright: l('\x1B[91m', '\x1B[39m'),
+ greenBright: l('\x1B[92m', '\x1B[39m'),
+ yellowBright: l('\x1B[93m', '\x1B[39m'),
+ blueBright: l('\x1B[94m', '\x1B[39m'),
+ magentaBright: l('\x1B[95m', '\x1B[39m'),
+ cyanBright: l('\x1B[96m', '\x1B[39m'),
+ whiteBright: l('\x1B[97m', '\x1B[39m'),
+ bgBlackBright: l('\x1B[100m', '\x1B[49m'),
+ bgRedBright: l('\x1B[101m', '\x1B[49m'),
+ bgGreenBright: l('\x1B[102m', '\x1B[49m'),
+ bgYellowBright: l('\x1B[103m', '\x1B[49m'),
+ bgBlueBright: l('\x1B[104m', '\x1B[49m'),
+ bgMagentaBright: l('\x1B[105m', '\x1B[49m'),
+ bgCyanBright: l('\x1B[106m', '\x1B[49m'),
+ bgWhiteBright: l('\x1B[107m', '\x1B[49m'),
+ };
+ };
+ return (Cz.exports = o()), (Pu.createColors = o), Pu;
+ }
+ var lu = {},
+ oE;
+ function Az() {
+ return (
+ oE ||
+ ((oE = 1),
+ Object.defineProperty(lu, '__esModule', {value: !0}),
+ (lu.default =
+ /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g),
+ (lu.matchToToken = function (e) {
+ var t = {type: 'invalid', value: e[0], closed: void 0};
+ return (
+ e[1]
+ ? ((t.type = 'string'), (t.closed = !!(e[3] || e[4])))
+ : e[5]
+ ? (t.type = 'comment')
+ : e[6]
+ ? ((t.type = 'comment'), (t.closed = !!e[7]))
+ : e[8]
+ ? (t.type = 'regex')
+ : e[9]
+ ? (t.type = 'number')
+ : e[10]
+ ? (t.type = 'name')
+ : e[11]
+ ? (t.type = 'punctuator')
+ : e[12] && (t.type = 'whitespace'),
+ t
+ );
+ })),
+ lu
+ );
+ }
+ var sE;
+ function Mz() {
+ if (sE) return Ba;
+ (sE = 1), Object.defineProperty(Ba, '__esModule', {value: !0});
+ var e = Dz(),
+ t = Az(),
+ n = Um();
+ function i() {
+ return typeof process == 'object' &&
+ (process.env.FORCE_COLOR === '0' || process.env.FORCE_COLOR === 'false')
+ ? !1
+ : e.isColorSupported;
+ }
+ let r = (M, w) => (I) => M(w(I));
+ function a(M) {
+ return {
+ keyword: M.cyan,
+ capitalized: M.yellow,
+ jsxIdentifier: M.yellow,
+ punctuator: M.yellow,
+ number: M.magenta,
+ string: M.green,
+ regex: M.magenta,
+ comment: M.gray,
+ invalid: r(r(M.white, M.bgRed), M.bold),
+ gutter: M.gray,
+ marker: r(M.red, M.bold),
+ message: r(M.red, M.bold),
+ reset: M.reset,
+ };
+ }
+ let o = a(e.createColors(!0)),
+ s = a(e.createColors(!1));
+ function l(M) {
+ return M ? o : s;
+ }
+ let d = new Set(['as', 'async', 'from', 'get', 'of', 'set']),
+ u = /\r\n|[\n\r\u2028\u2029]/,
+ p = /^[()[\]{}]$/,
+ y;
+ {
+ let M = /^[a-z][\w-]*$/i,
+ w = function (I, U, A) {
+ if (I.type === 'name') {
+ if (
+ n.isKeyword(I.value) ||
+ n.isStrictReservedWord(I.value, !0) ||
+ d.has(I.value)
+ )
+ return 'keyword';
+ if (
+ M.test(I.value) &&
+ (A[U - 1] === '<' || A.slice(U - 2, U) === '')
+ )
+ return 'jsxIdentifier';
+ if (I.value[0] !== I.value[0].toLowerCase()) return 'capitalized';
+ }
+ return I.type === 'punctuator' && p.test(I.value)
+ ? 'bracket'
+ : I.type === 'invalid' && (I.value === '@' || I.value === '#')
+ ? 'punctuator'
+ : I.type;
+ };
+ y = function* (I) {
+ let U;
+ for (; (U = t.default.exec(I)); ) {
+ let A = t.matchToToken(U);
+ yield {type: w(A, U.index, I), value: A.value};
+ }
+ };
+ }
+ function m(M) {
+ if (M === '') return '';
+ let w = l(!0),
+ I = '';
+ for (let {type: U, value: A} of y(M))
+ U in w
+ ? (I += A.split(u).map((q) => w[U](q)).join(`
+`))
+ : (I += A);
+ return I;
+ }
+ let g = !1,
+ S = /\r\n|[\n\r\u2028\u2029]/;
+ function _(M, w, I) {
+ let U = Object.assign({column: 0, line: -1}, M.start),
+ A = Object.assign({}, U, M.end),
+ {linesAbove: q = 2, linesBelow: ae = 3} = I || {},
+ le = U.line,
+ G = U.column,
+ ve = A.line,
+ de = A.column,
+ oe = Math.max(le - (q + 1), 0),
+ be = Math.min(w.length, ve + ae);
+ le === -1 && (oe = 0), ve === -1 && (be = w.length);
+ let $e = ve - le,
+ Ie = {};
+ if ($e)
+ for (let Pe = 0; Pe <= $e; Pe++) {
+ let ke = Pe + le;
+ if (!G) Ie[ke] = !0;
+ else if (Pe === 0) {
+ let je = w[ke - 1].length;
+ Ie[ke] = [G, je - G + 1];
+ } else if (Pe === $e) Ie[ke] = [0, de];
+ else {
+ let je = w[ke - Pe].length;
+ Ie[ke] = [0, je];
+ }
+ }
+ else
+ G === de
+ ? G
+ ? (Ie[le] = [G, 0])
+ : (Ie[le] = !0)
+ : (Ie[le] = [G, de - G]);
+ return {start: oe, end: be, markerLines: Ie};
+ }
+ function O(M, w, I = {}) {
+ let U = I.forceColor || (i() && I.highlightCode),
+ A = l(U),
+ q = M.split(S),
+ {start: ae, end: le, markerLines: G} = _(w, q, I),
+ ve = w.start && typeof w.start.column == 'number',
+ de = String(le).length,
+ be = (U ? m(M) : M)
+ .split(S, le)
+ .slice(ae, le)
+ .map(($e, Ie) => {
+ let Pe = ae + 1 + Ie,
+ je = ` ${` ${Pe}`.slice(-de)} |`,
+ Ae = G[Pe],
+ Ye = !G[Pe + 1];
+ if (Ae) {
+ let bt = '';
+ if (Array.isArray(Ae)) {
+ let st = $e
+ .slice(0, Math.max(Ae[0] - 1, 0))
+ .replace(/[^\t]/g, ' '),
+ tt = Ae[1] || 1;
+ (bt = [
+ `
+ `,
+ A.gutter(je.replace(/\d/g, ' ')),
+ ' ',
+ st,
+ A.marker('^').repeat(tt),
+ ].join('')),
+ Ye && I.message && (bt += ' ' + A.message(I.message));
+ }
+ return [
+ A.marker('>'),
+ A.gutter(je),
+ $e.length > 0 ? ` ${$e}` : '',
+ bt,
+ ].join('');
+ } else return ` ${A.gutter(je)}${$e.length > 0 ? ` ${$e}` : ''}`;
+ }).join(`
+`);
+ return (
+ I.message &&
+ !ve &&
+ (be = `${' '.repeat(de + 1)}${I.message}
+${be}`),
+ U ? A.reset(be) : be
+ );
+ }
+ function P(M, w, I, U = {}) {
+ if (!g) {
+ g = !0;
+ let q =
+ 'Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.';
+ if (process.emitWarning) process.emitWarning(q, 'DeprecationWarning');
+ else {
+ let ae = new Error(q);
+ (ae.name = 'DeprecationWarning'), console.warn(new Error(q));
+ }
+ }
+ return (I = Math.max(I, 0)), O(M, {start: {column: I, line: w}}, U);
+ }
+ return (Ba.codeFrameColumns = O), (Ba.default = P), (Ba.highlight = m), Ba;
+ }
+ var Nz = Mz();
+ function j(e, t, n, i) {
+ if (n === 'a' && !i)
+ throw new TypeError('Private accessor was defined without a getter');
+ if (typeof t == 'function' ? e !== t || !i : !t.has(e))
+ throw new TypeError(
+ 'Cannot read private member from an object whose class did not declare it'
+ );
+ return n === 'm' ? i : n === 'a' ? i.call(e) : i ? i.value : t.get(e);
+ }
+ function at(e, t, n, i, r) {
+ if (i === 'm') throw new TypeError('Private method is not writable');
+ if (i === 'a' && !r)
+ throw new TypeError('Private accessor was defined without a setter');
+ if (typeof t == 'function' ? e !== t || !r : !t.has(e))
+ throw new TypeError(
+ 'Cannot write private member to an object whose class did not declare it'
+ );
+ return i === 'a' ? r.call(e, n) : r ? (r.value = n) : t.set(e, n), n;
+ }
+ var In, sr;
+ function zn(e) {
+ return new ev(e);
+ }
+ var ev = class e {
+ constructor(t) {
+ In.set(this, void 0), at(this, In, t, 'f');
+ }
+ map(t) {
+ return new e(t(j(this, In, 'f')));
+ }
+ mapErr(t) {
+ return this;
+ }
+ mapOr(t, n) {
+ return n(j(this, In, 'f'));
+ }
+ mapOrElse(t, n) {
+ return n(j(this, In, 'f'));
+ }
+ andThen(t) {
+ return t(j(this, In, 'f'));
+ }
+ and(t) {
+ return t;
+ }
+ or(t) {
+ return this;
+ }
+ orElse(t) {
+ return this;
+ }
+ isOk() {
+ return !0;
+ }
+ isErr() {
+ return !1;
+ }
+ expect(t) {
+ return j(this, In, 'f');
+ }
+ expectErr(t) {
+ throw new Error(`${t}: ${j(this, In, 'f')}`);
+ }
+ unwrap() {
+ return j(this, In, 'f');
+ }
+ unwrapOr(t) {
+ return j(this, In, 'f');
+ }
+ unwrapOrElse(t) {
+ return j(this, In, 'f');
+ }
+ unwrapErr() {
+ throw j(this, In, 'f') instanceof Error
+ ? j(this, In, 'f')
+ : new Error(`Can't unwrap \`Ok\` to \`Err\`: ${j(this, In, 'f')}`);
+ }
+ };
+ In = new WeakMap();
+ function gr(e) {
+ return new tv(e);
+ }
+ var tv = class e {
+ constructor(t) {
+ sr.set(this, void 0), at(this, sr, t, 'f');
+ }
+ map(t) {
+ return this;
+ }
+ mapErr(t) {
+ return new e(t(j(this, sr, 'f')));
+ }
+ mapOr(t, n) {
+ return t;
+ }
+ mapOrElse(t, n) {
+ return t();
+ }
+ andThen(t) {
+ return this;
+ }
+ and(t) {
+ return this;
+ }
+ or(t) {
+ return t;
+ }
+ orElse(t) {
+ return t(j(this, sr, 'f'));
+ }
+ isOk() {
+ return !1;
+ }
+ isErr() {
+ return !0;
+ }
+ expect(t) {
+ throw new Error(`${t}: ${j(this, sr, 'f')}`);
+ }
+ expectErr(t) {
+ return j(this, sr, 'f');
+ }
+ unwrap() {
+ throw j(this, sr, 'f') instanceof Error
+ ? j(this, sr, 'f')
+ : new Error(`Can't unwrap \`Err\` to \`Ok\`: ${j(this, sr, 'f')}`);
+ }
+ unwrapOr(t) {
+ return t;
+ }
+ unwrapOrElse(t) {
+ return t(j(this, sr, 'f'));
+ }
+ unwrapErr() {
+ return j(this, sr, 'f');
+ }
+ };
+ sr = new WeakMap();
+ function Me(e, t) {
+ throw new Error(t);
+ }
+ function ra(e, t) {
+ let n = 0;
+ for (let i = 0; i < e.length; i++) {
+ let r = e[i];
+ t(r, i) === !0 && (e[n++] = r);
+ }
+ e.length = n;
+ }
+ function Rz(e, t) {
+ for (let n of e) t(n) || e.delete(n);
+ }
+ function dr(e, t, n) {
+ if (e.has(t)) return e.get(t);
+ {
+ let i = n();
+ return e.set(t, i), i;
+ }
+ }
+ function Xn(e, t, n) {
+ return e.has(t) ? e.get(t) : (e.set(t, n), n);
+ }
+ function Lz(e, t) {
+ if (e.size !== t.size) return !1;
+ for (let n of e) if (!t.has(n)) return !1;
+ return !0;
+ }
+ function Fz(e, t) {
+ let n = new Set(e);
+ for (let i of t) n.add(i);
+ return n;
+ }
+ function zz(e) {
+ if (e.length === 0 || e.some((i) => i.size === 0)) return new Set();
+ if (e.length === 1) return new Set(e[0]);
+ let t = new Set(),
+ n = e[0];
+ e: for (let i of n) {
+ for (let r = 1; r < e.length; r++) if (!e[r].has(i)) continue e;
+ t.add(i);
+ }
+ return t;
+ }
+ function Bz(e, t) {
+ for (let n of t) if (!e.has(n)) return !1;
+ return !0;
+ }
+ function Cu(e, t) {
+ for (let n of e) if (t(n)) return !0;
+ return !1;
+ }
+ function Uz(e, t) {
+ let n = new Set();
+ for (let i of e) t(i) && n.add(i);
+ return n;
+ }
+ function Wi(e) {
+ return e.node != null;
+ }
+ function K0(e, t) {
+ return Object.prototype.hasOwnProperty.call(e, t);
+ }
+ var lE = 2,
+ cE = 3,
+ Zz = 10,
+ uE = 5,
+ wt;
+ (function (e) {
+ (e.Error = 'Error'),
+ (e.Warning = 'Warning'),
+ (e.Hint = 'Hint'),
+ (e.Off = 'Off');
+ })(wt || (wt = {}));
+ var _i;
+ (function (e) {
+ (e[(e.InsertBefore = 0)] = 'InsertBefore'),
+ (e[(e.InsertAfter = 1)] = 'InsertAfter'),
+ (e[(e.Remove = 2)] = 'Remove'),
+ (e[(e.Replace = 3)] = 'Replace');
+ })(_i || (_i = {}));
+ var Tt = class e {
+ constructor(t) {
+ this.options = t;
+ }
+ static create(t) {
+ return new e(Object.assign(Object.assign({}, t), {details: []}));
+ }
+ get reason() {
+ return this.options.reason;
+ }
+ get description() {
+ return this.options.description;
+ }
+ get severity() {
+ return dh(this.category).severity;
+ }
+ get suggestions() {
+ return this.options.suggestions;
+ }
+ get category() {
+ return this.options.category;
+ }
+ withDetails(...t) {
+ return this.options.details.push(...t), this;
+ }
+ primaryLocation() {
+ let t = this.options.details.filter((n) => n.kind === 'error')[0];
+ return t != null && t.kind === 'error' ? t.loc : null;
+ }
+ printErrorMessage(t, n) {
+ var i, r;
+ let a = [bm(this.category, this.reason)];
+ this.description != null &&
+ a.push(
+ `
+
+`,
+ `${this.description}.`
+ );
+ for (let o of this.options.details)
+ switch (o.kind) {
+ case 'error': {
+ let s = o.loc;
+ if (s == null || typeof s == 'symbol') continue;
+ let l;
+ try {
+ l = V0(t, s, (i = o.message) !== null && i !== void 0 ? i : '');
+ } catch {
+ l = (r = o.message) !== null && r !== void 0 ? r : '';
+ }
+ if (
+ (a.push(`
+
+`),
+ s.filename != null)
+ ) {
+ let d = s.start.line,
+ u = n.eslint ? s.start.column + 1 : s.start.column;
+ a.push(`${s.filename}:${d}:${u}
+`);
+ }
+ a.push(l);
+ break;
+ }
+ case 'hint': {
+ a.push(`
+
+`),
+ a.push(o.message);
+ break;
+ }
+ default:
+ Me(o, `Unexpected detail kind ${o.kind}`);
+ }
+ return a.join('');
+ }
+ toString() {
+ let t = [bm(this.category, this.reason)];
+ this.description != null && t.push(`. ${this.description}.`);
+ let n = this.primaryLocation();
+ return (
+ n != null &&
+ typeof n != 'symbol' &&
+ t.push(` (${n.start.line}:${n.start.column})`),
+ t.join('')
+ );
+ }
+ },
+ Nn = class {
+ constructor(t) {
+ this.options = t;
+ }
+ get reason() {
+ return this.options.reason;
+ }
+ get description() {
+ return this.options.description;
+ }
+ get severity() {
+ return dh(this.category).severity;
+ }
+ get loc() {
+ return this.options.loc;
+ }
+ get suggestions() {
+ return this.options.suggestions;
+ }
+ get category() {
+ return this.options.category;
+ }
+ primaryLocation() {
+ return this.loc;
+ }
+ printErrorMessage(t, n) {
+ let i = [bm(this.category, this.reason)];
+ this.description != null &&
+ i.push(`
+
+${this.description}.`);
+ let r = this.loc;
+ if (r != null && typeof r != 'symbol') {
+ let a;
+ try {
+ a = V0(t, r, this.reason);
+ } catch {
+ a = '';
+ }
+ if (
+ (i.push(`
+
+`),
+ r.filename != null)
+ ) {
+ let o = r.start.line,
+ s = n.eslint ? r.start.column + 1 : r.start.column;
+ i.push(`${r.filename}:${o}:${s}
+`);
+ }
+ i.push(a),
+ i.push(`
+
+`);
+ }
+ return i.join('');
+ }
+ toString() {
+ let t = [bm(this.category, this.reason)];
+ this.description != null && t.push(`. ${this.description}.`);
+ let n = this.loc;
+ return (
+ n != null &&
+ typeof n != 'symbol' &&
+ t.push(` (${n.start.line}:${n.start.column})`),
+ t.join('')
+ );
+ }
+ },
+ D = class e extends Error {
+ static invariant(t, n) {
+ if (!t) {
+ let i = new e();
+ throw (
+ (i.pushDiagnostic(
+ Tt.create({
+ reason: n.reason,
+ description: n.description,
+ category: K.Invariant,
+ }).withDetails(...n.details)
+ ),
+ i)
+ );
+ }
+ }
+ static throwDiagnostic(t) {
+ let n = new e();
+ throw (n.pushDiagnostic(new Tt(t)), n);
+ }
+ static throwTodo(t) {
+ let n = new e();
+ throw (
+ (n.pushErrorDetail(
+ new Nn(Object.assign(Object.assign({}, t), {category: K.Todo}))
+ ),
+ n)
+ );
+ }
+ static throwInvalidJS(t) {
+ let n = new e();
+ throw (
+ (n.pushErrorDetail(
+ new Nn(Object.assign(Object.assign({}, t), {category: K.Syntax}))
+ ),
+ n)
+ );
+ }
+ static throwInvalidReact(t) {
+ let n = new e();
+ throw (n.pushErrorDetail(new Nn(t)), n);
+ }
+ static throwInvalidConfig(t) {
+ let n = new e();
+ throw (
+ (n.pushErrorDetail(
+ new Nn(Object.assign(Object.assign({}, t), {category: K.Config}))
+ ),
+ n)
+ );
+ }
+ static throw(t) {
+ let n = new e();
+ throw (n.pushErrorDetail(new Nn(t)), n);
+ }
+ constructor(...t) {
+ super(...t),
+ (this.details = []),
+ (this.disabledDetails = []),
+ (this.printedMessage = null),
+ (this.name = 'ReactCompilerError'),
+ (this.details = []),
+ (this.disabledDetails = []);
+ }
+ get message() {
+ var t;
+ return (t = this.printedMessage) !== null && t !== void 0
+ ? t
+ : this.toString();
+ }
+ set message(t) {}
+ toString() {
+ return this.printedMessage
+ ? this.printedMessage
+ : Array.isArray(this.details)
+ ? this.details.map((t) => t.toString()).join(`
+
+`)
+ : this.name;
+ }
+ withPrintedMessage(t, n) {
+ return (this.printedMessage = this.printErrorMessage(t, n)), this;
+ }
+ printErrorMessage(t, n) {
+ return n.eslint && this.details.length === 1
+ ? this.details[0].printErrorMessage(t, n)
+ : `Found ${this.details.length} error${
+ this.details.length === 1 ? '' : 's'
+ }:
+
+` +
+ this.details.map((i) => i.printErrorMessage(t, n).trim()).join(`
+
+`);
+ }
+ merge(t) {
+ this.details.push(...t.details),
+ this.disabledDetails.push(...t.disabledDetails);
+ }
+ pushDiagnostic(t) {
+ t.severity === wt.Off
+ ? this.disabledDetails.push(t)
+ : this.details.push(t);
+ }
+ push(t) {
+ var n;
+ let i = new Nn({
+ category: t.category,
+ reason: t.reason,
+ description: (n = t.description) !== null && n !== void 0 ? n : null,
+ suggestions: t.suggestions,
+ loc: typeof t.loc == 'symbol' ? null : t.loc,
+ });
+ return this.pushErrorDetail(i);
+ }
+ pushErrorDetail(t) {
+ return (
+ t.severity === wt.Off
+ ? this.disabledDetails.push(t)
+ : this.details.push(t),
+ t
+ );
+ }
+ hasAnyErrors() {
+ return this.details.length > 0;
+ }
+ asResult() {
+ return this.hasAnyErrors() ? gr(this) : zn(void 0);
+ }
+ hasErrors() {
+ for (let t of this.details) if (t.severity === wt.Error) return !0;
+ return !1;
+ }
+ hasWarning() {
+ let t = !1;
+ for (let n of this.details) {
+ if (n.severity === wt.Error) return !1;
+ n.severity === wt.Warning && (t = !0);
+ }
+ return t;
+ }
+ hasHints() {
+ let t = !1;
+ for (let n of this.details) {
+ if (n.severity === wt.Error || n.severity === wt.Warning) return !1;
+ n.severity === wt.Hint && (t = !0);
+ }
+ return t;
+ }
+ };
+ function V0(e, t, n) {
+ let i = Nz.codeFrameColumns(
+ e,
+ {
+ start: {line: t.start.line, column: t.start.column + 1},
+ end: {line: t.end.line, column: t.end.column + 1},
+ },
+ {message: n, linesAbove: lE, linesBelow: cE}
+ ),
+ r = i.split(/\r?\n/);
+ if (t.end.line - t.start.line < Zz) return i;
+ let a = r[0].indexOf('|');
+ return [
+ ...r.slice(0, lE + uE),
+ ' '.repeat(a) + '\u2026',
+ ...r.slice(-(cE + uE)),
+ ].join(`
+`);
+ }
+ function bm(e, t) {
+ let n;
+ switch (e) {
+ case K.AutomaticEffectDependencies:
+ case K.CapitalizedCalls:
+ case K.Config:
+ case K.EffectDerivationsOfState:
+ case K.EffectSetState:
+ case K.ErrorBoundaries:
+ case K.Factories:
+ case K.FBT:
+ case K.Fire:
+ case K.Gating:
+ case K.Globals:
+ case K.Hooks:
+ case K.Immutability:
+ case K.Purity:
+ case K.Refs:
+ case K.RenderSetState:
+ case K.StaticComponents:
+ case K.Suppression:
+ case K.Syntax:
+ case K.UseMemo:
+ case K.VoidUseMemo: {
+ n = 'Error';
+ break;
+ }
+ case K.EffectDependencies:
+ case K.IncompatibleLibrary:
+ case K.PreserveManualMemo:
+ case K.UnsupportedSyntax: {
+ n = 'Compilation Skipped';
+ break;
+ }
+ case K.Invariant: {
+ n = 'Invariant';
+ break;
+ }
+ case K.Todo: {
+ n = 'Todo';
+ break;
+ }
+ default:
+ Me(e, `Unhandled category '${e}'`);
+ }
+ return `${n}: ${t}`;
+ }
+ var K;
+ (function (e) {
+ (e.Hooks = 'Hooks'),
+ (e.CapitalizedCalls = 'CapitalizedCalls'),
+ (e.StaticComponents = 'StaticComponents'),
+ (e.UseMemo = 'UseMemo'),
+ (e.VoidUseMemo = 'VoidUseMemo'),
+ (e.Factories = 'Factories'),
+ (e.PreserveManualMemo = 'PreserveManualMemo'),
+ (e.IncompatibleLibrary = 'IncompatibleLibrary'),
+ (e.Immutability = 'Immutability'),
+ (e.Globals = 'Globals'),
+ (e.Refs = 'Refs'),
+ (e.EffectDependencies = 'EffectDependencies'),
+ (e.EffectSetState = 'EffectSetState'),
+ (e.EffectDerivationsOfState = 'EffectDerivationsOfState'),
+ (e.ErrorBoundaries = 'ErrorBoundaries'),
+ (e.Purity = 'Purity'),
+ (e.RenderSetState = 'RenderSetState'),
+ (e.Invariant = 'Invariant'),
+ (e.Todo = 'Todo'),
+ (e.Syntax = 'Syntax'),
+ (e.UnsupportedSyntax = 'UnsupportedSyntax'),
+ (e.Config = 'Config'),
+ (e.Gating = 'Gating'),
+ (e.Suppression = 'Suppression'),
+ (e.AutomaticEffectDependencies = 'AutomaticEffectDependencies'),
+ (e.Fire = 'Fire'),
+ (e.FBT = 'FBT');
+ })(K || (K = {}));
+ var Dt;
+ (function (e) {
+ (e.Recommended = 'recommended'),
+ (e.RecommendedLatest = 'recommended-latest'),
+ (e.Off = 'off');
+ })(Dt || (Dt = {}));
+ var dE = /^[a-z]+(-[a-z]+)*$/;
+ function dh(e) {
+ let t = qz(e);
+ return (
+ so(
+ dE.test(t.name),
+ `Invalid rule name, got '${
+ t.name
+ }' but rules must match ${dE.toString()}`
+ ),
+ t
+ );
+ }
+ function qz(e) {
+ switch (e) {
+ case K.AutomaticEffectDependencies:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'automatic-effect-dependencies',
+ description:
+ 'Verifies that automatic effect dependencies are compiled if opted-in',
+ preset: Dt.Off,
+ };
+ case K.CapitalizedCalls:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'capitalized-calls',
+ description:
+ 'Validates against calling capitalized functions/methods instead of using JSX',
+ preset: Dt.Off,
+ };
+ case K.Config:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'config',
+ description: 'Validates the compiler configuration options',
+ preset: Dt.Recommended,
+ };
+ case K.EffectDependencies:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'memoized-effect-dependencies',
+ description: 'Validates that effect dependencies are memoized',
+ preset: Dt.Off,
+ };
+ case K.EffectDerivationsOfState:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'no-deriving-state-in-effects',
+ description:
+ 'Validates against deriving values from state in an effect',
+ preset: Dt.Off,
+ };
+ case K.EffectSetState:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'set-state-in-effect',
+ description:
+ 'Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance',
+ preset: Dt.Recommended,
+ };
+ case K.ErrorBoundaries:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'error-boundaries',
+ description:
+ 'Validates usage of error boundaries instead of try/catch for errors in child components',
+ preset: Dt.Recommended,
+ };
+ case K.Factories:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'component-hook-factories',
+ description:
+ 'Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level',
+ preset: Dt.Recommended,
+ };
+ case K.FBT:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'fbt',
+ description: 'Validates usage of fbt',
+ preset: Dt.Off,
+ };
+ case K.Fire:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'fire',
+ description: 'Validates usage of `fire`',
+ preset: Dt.Off,
+ };
+ case K.Gating:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'gating',
+ description:
+ 'Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)',
+ preset: Dt.Recommended,
+ };
+ case K.Globals:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'globals',
+ description:
+ 'Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)',
+ preset: Dt.Recommended,
+ };
+ case K.Hooks:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'hooks',
+ description: 'Validates the rules of hooks',
+ preset: Dt.Off,
+ };
+ case K.Immutability:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'immutability',
+ description:
+ 'Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)',
+ preset: Dt.Recommended,
+ };
+ case K.Invariant:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'invariant',
+ description: 'Internal invariants',
+ preset: Dt.Off,
+ };
+ case K.PreserveManualMemo:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'preserve-manual-memoization',
+ description:
+ 'Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)',
+ preset: Dt.Recommended,
+ };
+ case K.Purity:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'purity',
+ description:
+ 'Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions',
+ preset: Dt.Recommended,
+ };
+ case K.Refs:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'refs',
+ description:
+ 'Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)',
+ preset: Dt.Recommended,
+ };
+ case K.RenderSetState:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'set-state-in-render',
+ description:
+ 'Validates against setting state during render, which can trigger additional renders and potential infinite render loops',
+ preset: Dt.Recommended,
+ };
+ case K.StaticComponents:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'static-components',
+ description:
+ 'Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering',
+ preset: Dt.Recommended,
+ };
+ case K.Suppression:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'rule-suppression',
+ description: 'Validates against suppression of other rules',
+ preset: Dt.Off,
+ };
+ case K.Syntax:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'syntax',
+ description: 'Validates against invalid syntax',
+ preset: Dt.Off,
+ };
+ case K.Todo:
+ return {
+ category: e,
+ severity: wt.Hint,
+ name: 'todo',
+ description: 'Unimplemented features',
+ preset: Dt.Off,
+ };
+ case K.UnsupportedSyntax:
+ return {
+ category: e,
+ severity: wt.Warning,
+ name: 'unsupported-syntax',
+ description:
+ 'Validates against syntax that we do not plan to support in React Compiler',
+ preset: Dt.Recommended,
+ };
+ case K.UseMemo:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'use-memo',
+ description:
+ 'Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
+ preset: Dt.Recommended,
+ };
+ case K.VoidUseMemo:
+ return {
+ category: e,
+ severity: wt.Error,
+ name: 'void-use-memo',
+ description:
+ 'Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
+ preset: Dt.RecommendedLatest,
+ };
+ case K.IncompatibleLibrary:
+ return {
+ category: e,
+ severity: wt.Warning,
+ name: 'incompatible-library',
+ description:
+ 'Validates against usage of libraries which are incompatible with memoization (manual or automatic)',
+ preset: Dt.Recommended,
+ };
+ default:
+ Me(e, `Unsupported category ${e}`);
+ }
+ }
+ var fh = Object.keys(K).map((e) => dh(e));
+ function Kz(e, t, n, i) {
+ var r, a;
+ let o = e.node.id,
+ s = e.node.params,
+ l = e.node.params;
+ D.invariant(o != null && t.id != null, {
+ reason:
+ 'Expected function declarations that are referenced elsewhere to have a named identifier',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (r = e.node.loc) !== null && r !== void 0 ? r : null,
+ message: null,
+ },
+ ],
+ }),
+ D.invariant(s.length === l.length, {
+ reason:
+ 'Expected React Compiler optimized function declarations to have the same number of parameters as source',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (a = e.node.loc) !== null && a !== void 0 ? a : null,
+ message: null,
+ },
+ ],
+ });
+ let d = $.identifier(n.newUid(`${i}_result`)),
+ u = $.identifier(n.newUid(`${o.name}_unoptimized`)),
+ p = $.identifier(n.newUid(`${o.name}_optimized`));
+ (t.id.name = p.name), e.get('id').replaceInline(u);
+ let y = [],
+ m = [];
+ for (let g = 0; g < s.length; g++) {
+ let S = `arg${g}`;
+ s[g].type === 'RestElement'
+ ? (y.push($.restElement($.identifier(S))),
+ m.push(() => $.spreadElement($.identifier(S))))
+ : (y.push($.identifier(S)), m.push(() => $.identifier(S)));
+ }
+ e.insertAfter(
+ $.functionDeclaration(
+ o,
+ y,
+ $.blockStatement([
+ $.ifStatement(
+ d,
+ $.returnStatement(
+ $.callExpression(
+ t.id,
+ m.map((g) => g())
+ )
+ ),
+ $.returnStatement(
+ $.callExpression(
+ u,
+ m.map((g) => g())
+ )
+ )
+ ),
+ ])
+ )
+ ),
+ e.insertBefore(
+ $.variableDeclaration('const', [
+ $.variableDeclarator(d, $.callExpression($.identifier(i), [])),
+ ])
+ ),
+ e.insertBefore(t);
+ }
+ function Vz(e, t, n, i, r) {
+ var a;
+ let o = n.addImportSpecifier(i).name;
+ if (r && e.isFunctionDeclaration())
+ D.invariant(t.type === 'FunctionDeclaration', {
+ reason: 'Expected compiled node type to match input type',
+ description: `Got ${t.type} but expected FunctionDeclaration`,
+ details: [
+ {
+ kind: 'error',
+ loc: (a = e.node.loc) !== null && a !== void 0 ? a : null,
+ message: null,
+ },
+ ],
+ }),
+ Kz(e, t, n, o);
+ else {
+ let s = $.conditionalExpression(
+ $.callExpression($.identifier(o), []),
+ fE(t),
+ fE(e.node)
+ );
+ e.parentPath.node.type !== 'ExportDefaultDeclaration' &&
+ e.node.type === 'FunctionDeclaration' &&
+ e.node.id != null
+ ? e.replaceWith(
+ $.variableDeclaration('const', [$.variableDeclarator(e.node.id, s)])
+ )
+ : e.parentPath.node.type === 'ExportDefaultDeclaration' &&
+ e.node.type !== 'ArrowFunctionExpression' &&
+ e.node.id != null
+ ? (e.insertAfter(
+ $.exportDefaultDeclaration($.identifier(e.node.id.name))
+ ),
+ e.parentPath.replaceWith(
+ $.variableDeclaration('const', [
+ $.variableDeclarator($.identifier(e.node.id.name), s),
+ ])
+ ))
+ : e.replaceWith(s);
+ }
+ }
+ function fE(e) {
+ var t, n;
+ return e.type === 'ArrowFunctionExpression' ||
+ e.type === 'FunctionExpression'
+ ? e
+ : {
+ type: 'FunctionExpression',
+ async: e.async,
+ generator: e.generator,
+ loc: (t = e.loc) !== null && t !== void 0 ? t : null,
+ id: (n = e.id) !== null && n !== void 0 ? n : null,
+ params: e.params,
+ body: e.body,
+ };
+ }
+ function Jz(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected instruction id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ var Hz = 0;
+ function Gn() {
+ return {kind: 'Type', id: Jz(Hz++)};
+ }
+ function xu(e, t) {
+ return e.kind !== t.kind
+ ? !1
+ : Wz(e, t) ||
+ tB(e, t) ||
+ eB(e, t) ||
+ Yz(e, t) ||
+ Qz(e, t) ||
+ nB(e, t) ||
+ Xz(e, t) ||
+ Gz(e, t);
+ }
+ function Wz(e, t) {
+ return e.kind === 'Type' && t.kind === 'Type' ? e.id === t.id : !1;
+ }
+ function ph(e, t, n) {
+ return e.kind === n && t.kind === n;
+ }
+ function Gz(e, t) {
+ return ph(e, t, 'ObjectMethod');
+ }
+ function Xz(e, t) {
+ return e.kind === 'Property' &&
+ t.kind === 'Property' &&
+ xu(e.objectType, t.objectType)
+ ? e.propertyName === t.propertyName && e.objectName === t.objectName
+ : !1;
+ }
+ function Yz(e, t) {
+ return ph(e, t, 'Primitive');
+ }
+ function Qz(e, t) {
+ return ph(e, t, 'Poly');
+ }
+ function eB(e, t) {
+ return e.kind === 'Object' && t.kind == 'Object'
+ ? e.shapeId === t.shapeId
+ : !1;
+ }
+ function tB(e, t) {
+ return e.kind !== 'Function' || t.kind !== 'Function'
+ ? !1
+ : xu(e.return, t.return);
+ }
+ function nB(e, t) {
+ if (e.kind === 'Phi' && t.kind === 'Phi') {
+ if (e.operands.length !== t.operands.length) return !1;
+ let n = new Set(e.operands);
+ for (let i = 0; i < t.operands.length; i++)
+ if (!n.has(t.operands[i])) return !1;
+ }
+ return !1;
+ }
+ var rB = new Set([
+ 'break',
+ 'case',
+ 'catch',
+ 'class',
+ 'const',
+ 'continue',
+ 'debugger',
+ 'default',
+ 'delete',
+ 'do',
+ 'else',
+ 'enum',
+ 'export',
+ 'extends',
+ 'false',
+ 'finally',
+ 'for',
+ 'function',
+ 'if',
+ 'import',
+ 'in',
+ 'instanceof',
+ 'new',
+ 'null',
+ 'return',
+ 'super',
+ 'switch',
+ 'this',
+ 'throw',
+ 'true',
+ 'try',
+ 'typeof',
+ 'var',
+ 'void',
+ 'while',
+ 'with',
+ ]),
+ iB = new Set([
+ 'let',
+ 'static',
+ 'implements',
+ 'interface',
+ 'package',
+ 'private',
+ 'protected',
+ 'public',
+ ]),
+ aB = new Set(['eval', 'arguments']);
+ function oB(e) {
+ return rB.has(e) || iB.has(e) || aB.has(e);
+ }
+ var F = Symbol();
+ function J0(e) {
+ return e === 'block' || e === 'catch';
+ }
+ function sB(e) {
+ return !J0(e);
+ }
+ var St;
+ (function (e) {
+ (e.Break = 'Break'), (e.Continue = 'Continue'), (e.Try = 'Try');
+ })(St || (St = {}));
+ var Q;
+ (function (e) {
+ (e.Const = 'Const'),
+ (e.Let = 'Let'),
+ (e.Reassign = 'Reassign'),
+ (e.Catch = 'Catch'),
+ (e.HoistedConst = 'HoistedConst'),
+ (e.HoistedLet = 'HoistedLet'),
+ (e.HoistedFunction = 'HoistedFunction'),
+ (e.Function = 'Function');
+ })(Q || (Q = {}));
+ function H0(e) {
+ switch (e) {
+ case Q.HoistedLet:
+ return Q.Let;
+ case Q.HoistedConst:
+ return Q.Const;
+ case Q.HoistedFunction:
+ return Q.Function;
+ case Q.Let:
+ case Q.Const:
+ case Q.Function:
+ case Q.Reassign:
+ case Q.Catch:
+ return null;
+ default:
+ Me(e, 'Unexpected lvalue kind');
+ }
+ }
+ function Du(e, t) {
+ return {
+ id: e,
+ name: null,
+ declarationId: gh(e),
+ mutableRange: {start: V(0), end: V(0)},
+ scope: null,
+ type: Gn(),
+ loc: t,
+ };
+ }
+ function Og(e, t) {
+ return Object.assign(Object.assign({}, t), {
+ mutableRange: {start: V(0), end: V(0)},
+ id: e,
+ });
+ }
+ function W0(e) {
+ if (oB(e)) {
+ let t = new D();
+ return (
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.Syntax,
+ reason: 'Expected a non-reserved identifier name',
+ description: `\`${e}\` is a reserved word in JavaScript and cannot be used as an identifier name`,
+ suggestions: null,
+ }).withDetails({kind: 'error', loc: F, message: 'reserved word'})
+ ),
+ gr(t)
+ );
+ } else
+ $.isValidIdentifier(e) ||
+ new D().pushDiagnostic(
+ Tt.create({
+ category: K.Syntax,
+ reason: 'Expected a valid identifier name',
+ description: `\`${e}\` is not a valid JavaScript identifier`,
+ suggestions: null,
+ }).withDetails({kind: 'error', loc: F, message: 'reserved word'})
+ );
+ return zn({kind: 'named', value: e});
+ }
+ function uo(e) {
+ return W0(e).unwrap();
+ }
+ function $n(e) {
+ D.invariant(e.name === null, {
+ reason: 'Expected a temporary (unnamed) identifier',
+ description: `Identifier already has a name, \`${e.name}\``,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ }),
+ (e.name = {kind: 'promoted', value: `#t${e.declarationId}`});
+ }
+ function pE(e) {
+ return e.startsWith('#t');
+ }
+ function G0(e) {
+ D.invariant(e.name === null, {
+ reason: 'Expected a temporary (unnamed) identifier',
+ description: `Identifier already has a name, \`${e.name}\``,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ }),
+ (e.name = {kind: 'promoted', value: `#T${e.declarationId}`});
+ }
+ function mE(e) {
+ return e.startsWith('#T');
+ }
+ var qe;
+ (function (e) {
+ (e.Global = 'global'),
+ (e.JsxCaptured = 'jsx-captured'),
+ (e.HookCaptured = 'hook-captured'),
+ (e.HookReturn = 'hook-return'),
+ (e.Effect = 'effect'),
+ (e.KnownReturnSignature = 'known-return-signature'),
+ (e.Context = 'context'),
+ (e.State = 'state'),
+ (e.ReducerState = 'reducer-state'),
+ (e.ReactiveFunctionArgument = 'reactive-function-argument'),
+ (e.Other = 'other');
+ })(qe || (qe = {}));
+ var z;
+ (function (e) {
+ (e.MaybeFrozen = 'maybefrozen'),
+ (e.Frozen = 'frozen'),
+ (e.Primitive = 'primitive'),
+ (e.Global = 'global'),
+ (e.Mutable = 'mutable'),
+ (e.Context = 'context');
+ })(z || (z = {}));
+ var mh = W.z.enum([
+ z.MaybeFrozen,
+ z.Frozen,
+ z.Primitive,
+ z.Global,
+ z.Mutable,
+ z.Context,
+ ]),
+ X0 = W.z.enum([
+ qe.Context,
+ qe.Effect,
+ qe.Global,
+ qe.HookCaptured,
+ qe.HookReturn,
+ qe.JsxCaptured,
+ qe.KnownReturnSignature,
+ qe.Other,
+ qe.ReactiveFunctionArgument,
+ qe.ReducerState,
+ qe.State,
+ ]),
+ x;
+ (function (e) {
+ (e.Unknown = ''),
+ (e.Freeze = 'freeze'),
+ (e.Read = 'read'),
+ (e.Capture = 'capture'),
+ (e.ConditionallyMutateIterator = 'mutate-iterator?'),
+ (e.ConditionallyMutate = 'mutate?'),
+ (e.Mutate = 'mutate'),
+ (e.Store = 'store');
+ })(x || (x = {}));
+ var wu = W.z.enum([
+ x.Read,
+ x.Mutate,
+ x.ConditionallyMutate,
+ x.ConditionallyMutateIterator,
+ x.Capture,
+ x.Store,
+ x.Freeze,
+ ]);
+ function Op(e, t) {
+ switch (e) {
+ case x.Capture:
+ case x.Store:
+ case x.ConditionallyMutate:
+ case x.ConditionallyMutateIterator:
+ case x.Mutate:
+ return !0;
+ case x.Unknown:
+ D.invariant(!1, {
+ reason: 'Unexpected unknown effect',
+ description: null,
+ details: [{kind: 'error', loc: t, message: null}],
+ suggestions: null,
+ });
+ case x.Read:
+ case x.Freeze:
+ return !1;
+ default:
+ Me(e, `Unexpected effect \`${e}\``);
+ }
+ }
+ function Y0(e, t) {
+ return (
+ e.length === t.length &&
+ e.every(
+ (n, i) => n.property === t[i].property && n.optional === t[i].optional
+ )
+ );
+ }
+ function Km(e, t) {
+ let n = t.identifier.scope;
+ return n !== null && lB(n, e) ? n : null;
+ }
+ function lB(e, t) {
+ return t >= e.range.start && t < e.range.end;
+ }
+ function Zi(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected block id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ function Q0(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected block id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ function yh(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected identifier id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ function gh(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected declaration id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ function V(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected instruction id to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ function cB(e) {
+ return e.type.kind == 'ObjectMethod';
+ }
+ function km(e) {
+ return e.type.kind === 'Primitive';
+ }
+ function eI(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInArray';
+ }
+ function tI(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInMap';
+ }
+ function nI(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInSet';
+ }
+ function uB(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInProps';
+ }
+ function fo(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInRefValue';
+ }
+ function Yn(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInUseRefId';
+ }
+ function vh(e) {
+ return e.type.kind === 'Object' && e.type.shapeId === 'BuiltInUseState';
+ }
+ function nv(e) {
+ return e.kind === 'Object' && e.shapeId === 'BuiltInJsx';
+ }
+ function hh(e) {
+ return Yn(e) || fo(e);
+ }
+ function dB(e) {
+ return (
+ e.kind === 'Object' &&
+ (e.shapeId === 'BuiltInUseRefId' ||
+ e.shapeId == 'ReanimatedSharedValueId')
+ );
+ }
+ function vr(e) {
+ return e.type.kind === 'Function' && e.type.shapeId === 'BuiltInSetState';
+ }
+ function fB(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInStartTransition'
+ );
+ }
+ function pB(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInSetActionState'
+ );
+ }
+ function mB(e) {
+ return e.type.kind === 'Function' && e.type.shapeId === 'BuiltInUseReducer';
+ }
+ function yB(e) {
+ return e.type.kind === 'Function' && e.type.shapeId === 'BuiltInDispatch';
+ }
+ function gB(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInFireFunction'
+ );
+ }
+ function vB(e) {
+ return (
+ e.type.kind === 'Function' &&
+ e.type.shapeId === 'BuiltInEffectEventFunction'
+ );
+ }
+ function Sm(e) {
+ return vr(e) || pB(e) || yB(e) || Yn(e) || fB(e);
+ }
+ function hB(e) {
+ let t = e.type;
+ return t.kind !== 'Object'
+ ? !1
+ : vh(e) ||
+ t.shapeId === 'BuiltInUseActionState' ||
+ mB(e) ||
+ t.shapeId === 'BuiltInUseTransition';
+ }
+ function bB(e, {value: t}) {
+ if (t.kind === 'CallExpression' || t.kind === 'MethodCall') {
+ let n = t.kind === 'CallExpression' ? t.callee : t.property;
+ switch (Qn(e, n.identifier)) {
+ case 'useState':
+ case 'useReducer':
+ case 'useActionState':
+ case 'useRef':
+ case 'useTransition':
+ return !0;
+ }
+ }
+ return !1;
+ }
+ function Ku(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInUseEffectHook'
+ );
+ }
+ function rI(e) {
+ return (
+ e.type.kind === 'Function' &&
+ e.type.shapeId === 'BuiltInUseLayoutEffectHook'
+ );
+ }
+ function iI(e) {
+ return (
+ e.type.kind === 'Function' &&
+ e.type.shapeId === 'BuiltInUseInsertionEffectHook'
+ );
+ }
+ function yE(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInUseContextHook'
+ );
+ }
+ function Qn(e, t) {
+ return Au(e, t.type);
+ }
+ function rv(e) {
+ return (
+ e.type.kind === 'Function' && e.type.shapeId === 'BuiltInUseOperator'
+ );
+ }
+ function Au(e, t) {
+ var n;
+ if (t.kind === 'Function') {
+ let i = e.getFunctionSignature(t);
+ return (n = i?.hookKind) !== null && n !== void 0 ? n : null;
+ }
+ return null;
+ }
+ function Mu(e) {
+ let t = [];
+ return (
+ t.push('scope'),
+ t.push(`@${e.id}`),
+ t.push(`[${e.range.start}:${e.range.end}]`),
+ t.push(
+ `dependencies=[${Array.from(e.dependencies)
+ .map((n) => kB(n))
+ .join(', ')}]`
+ ),
+ t.push(
+ `declarations=[${Array.from(e.declarations)
+ .map(([, n]) =>
+ un(Object.assign(Object.assign({}, n.identifier), {scope: n.scope}))
+ )
+ .join(', ')}]`
+ ),
+ t.push(
+ `reassignments=[${Array.from(e.reassignments).map((n) => un(n))}]`
+ ),
+ e.earlyReturnValue !== null &&
+ t.push(
+ `earlyReturn={id: ${un(e.earlyReturnValue.value)}, label: ${
+ e.earlyReturnValue.label
+ }}}`
+ ),
+ t.join(' ')
+ );
+ }
+ function kB(e) {
+ return `${un(e.identifier) + Vu(e.identifier.type)}${e.path
+ .map((n) => `${n.optional ? '?.' : '.'}${n.property}`)
+ .join('')}`;
+ }
+ function SB(e) {
+ let t = [],
+ n = '';
+ return (
+ e.id !== null ? (n += e.id) : (n += '<>'),
+ e.nameHint != null && (n += ` ${e.nameHint}`),
+ e.params.length !== 0
+ ? (n +=
+ '(' +
+ e.params
+ .map((i) =>
+ i.kind === 'Identifier' ? _e(i) : `...${_e(i.place)}`
+ )
+ .join(', ') +
+ ')')
+ : (n += '()'),
+ (n += `: ${_e(e.returns)}`),
+ t.push(n),
+ t.push(...e.directives),
+ t.push(_B(e.body)),
+ t.join(`
+`)
+ );
+ }
+ function _B(e, t = null) {
+ var n;
+ let i = [],
+ r = ' '.repeat((n = t?.indent) !== null && n !== void 0 ? n : 0),
+ a = (o, s = ' ') => {
+ i.push(`${s}${o}`);
+ };
+ for (let [o, s] of e.blocks) {
+ if ((i.push(`bb${o} (${s.kind}):`), s.preds.size > 0)) {
+ let d = ['predecessor blocks:'];
+ for (let u of s.preds) d.push(`bb${u}`);
+ a(d.join(' '));
+ }
+ for (let d of s.phis) a(TB(d));
+ for (let d of s.instructions) a(Vm(d));
+ let l = aI(s.terminal);
+ Array.isArray(l) ? l.forEach((d) => a(d)) : a(l);
+ }
+ return i.map((o) => r + o).join(`
+`);
+ }
+ function Vm(e) {
+ let t = `[${e.id}]`,
+ n = ki(e.value);
+ return (
+ e.effects != null &&
+ (n += `
+ ${e.effects.map(Si).join(`
+ `)}`),
+ e.lvalue !== null ? `${t} ${_e(e.lvalue)} = ${n}` : `${t} ${n}`
+ );
+ }
+ function TB(e) {
+ let t = [];
+ t.push(_e(e.place)),
+ t.push(sI(e.place.identifier)),
+ t.push(Vu(e.place.identifier.type)),
+ t.push(': phi(');
+ let n = [];
+ for (let [i, r] of e.operands) n.push(`bb${i}: ${_e(r)}`);
+ return t.push(n.join(', ')), t.push(')'), t.join('');
+ }
+ function aI(e) {
+ let t;
+ switch (e.kind) {
+ case 'if': {
+ t = `[${e.id}] If (${_e(e.test)}) then:bb${e.consequent} else:bb${
+ e.alternate
+ }${e.fallthrough ? ` fallthrough=bb${e.fallthrough}` : ''}`;
+ break;
+ }
+ case 'branch': {
+ t = `[${e.id}] Branch (${_e(e.test)}) then:bb${e.consequent} else:bb${
+ e.alternate
+ } fallthrough:bb${e.fallthrough}`;
+ break;
+ }
+ case 'logical': {
+ t = `[${e.id}] Logical ${e.operator} test:bb${e.test} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'ternary': {
+ t = `[${e.id}] Ternary test:bb${e.test} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'optional': {
+ t = `[${e.id}] Optional (optional=${e.optional}) test:bb${e.test} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'throw': {
+ t = `[${e.id}] Throw ${_e(e.value)}`;
+ break;
+ }
+ case 'return': {
+ (t = `[${e.id}] Return ${e.returnVariant}${
+ e.value != null ? ' ' + _e(e.value) : ''
+ }`),
+ e.effects != null &&
+ (t += `
+ ${e.effects.map(Si).join(`
+ `)}`);
+ break;
+ }
+ case 'goto': {
+ t = `[${e.id}] Goto${e.variant === St.Continue ? '(Continue)' : ''} bb${
+ e.block
+ }`;
+ break;
+ }
+ case 'switch': {
+ let n = [];
+ n.push(`[${e.id}] Switch (${_e(e.test)})`),
+ e.cases.forEach((i) => {
+ i.test !== null
+ ? n.push(` Case ${_e(i.test)}: bb${i.block}`)
+ : n.push(` Default: bb${i.block}`);
+ }),
+ e.fallthrough && n.push(` Fallthrough: bb${e.fallthrough}`),
+ (t = n);
+ break;
+ }
+ case 'do-while': {
+ t = `[${e.id}] DoWhile loop=${`bb${e.loop}`} test=bb${
+ e.test
+ } fallthrough=${`bb${e.fallthrough}`}`;
+ break;
+ }
+ case 'while': {
+ t = `[${e.id}] While test=bb${e.test} loop=${
+ e.loop !== null ? `bb${e.loop}` : ''
+ } fallthrough=${e.fallthrough ? `bb${e.fallthrough}` : ''}`;
+ break;
+ }
+ case 'for': {
+ t = `[${e.id}] For init=bb${e.init} test=bb${e.test} loop=bb${e.loop} update=bb${e.update} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'for-of': {
+ t = `[${e.id}] ForOf init=bb${e.init} test=bb${e.test} loop=bb${e.loop} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'for-in': {
+ t = `[${e.id}] ForIn init=bb${e.init} loop=bb${e.loop} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'label': {
+ t = `[${e.id}] Label block=bb${e.block} fallthrough=${
+ e.fallthrough ? `bb${e.fallthrough}` : ''
+ }`;
+ break;
+ }
+ case 'sequence': {
+ t = `[${e.id}] Sequence block=bb${e.block} fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'unreachable': {
+ t = `[${e.id}] Unreachable`;
+ break;
+ }
+ case 'unsupported': {
+ t = `[${e.id}] Unsupported`;
+ break;
+ }
+ case 'maybe-throw': {
+ (t = `[${e.id}] MaybeThrow continuation=bb${e.continuation} handler=bb${e.handler}`),
+ e.effects != null &&
+ (t += `
+ ${e.effects.map(Si).join(`
+ `)}`);
+ break;
+ }
+ case 'scope': {
+ t = `[${e.id}] Scope ${Mu(e.scope)} block=bb${e.block} fallthrough=bb${
+ e.fallthrough
+ }`;
+ break;
+ }
+ case 'pruned-scope': {
+ t = `[${e.id}] Scope ${Mu(e.scope)} block=bb${
+ e.block
+ } fallthrough=bb${e.fallthrough}`;
+ break;
+ }
+ case 'try': {
+ t = `[${e.id}] Try block=bb${e.block} handler=bb${e.handler}${
+ e.handlerBinding !== null
+ ? ` handlerBinding=(${_e(e.handlerBinding)})`
+ : ''
+ } fallthrough=${e.fallthrough != null ? `bb${e.fallthrough}` : ''}`;
+ break;
+ }
+ default:
+ Me(e, `Unexpected terminal kind \`${e}\``);
+ }
+ return t;
+ }
+ function EB() {
+ return '';
+ }
+ function oI(e) {
+ switch (e.kind) {
+ case 'identifier':
+ return e.name;
+ case 'string':
+ return `"${e.name}"`;
+ case 'computed':
+ return `[${_e(e.name)}]`;
+ case 'number':
+ return String(e.name);
+ }
+ }
+ function ki(e) {
+ var t, n, i, r, a;
+ let o = '';
+ switch (e.kind) {
+ case 'ArrayExpression': {
+ o = `Array [${e.elements
+ .map((s) =>
+ s.kind === 'Identifier'
+ ? _e(s)
+ : s.kind === 'Hole'
+ ? EB()
+ : `...${_e(s.place)}`
+ )
+ .join(', ')}]`;
+ break;
+ }
+ case 'ObjectExpression': {
+ let s = [];
+ if (e.properties !== null)
+ for (let l of e.properties)
+ l.kind === 'ObjectProperty'
+ ? s.push(`${oI(l.key)}: ${_e(l.place)}`)
+ : s.push(`...${_e(l.place)}`);
+ o = `Object { ${s.join(', ')} }`;
+ break;
+ }
+ case 'UnaryExpression': {
+ o = `Unary ${_e(e.value)}`;
+ break;
+ }
+ case 'BinaryExpression': {
+ o = `Binary ${_e(e.left)} ${e.operator} ${_e(e.right)}`;
+ break;
+ }
+ case 'NewExpression': {
+ o = `New ${_e(e.callee)}(${e.args.map((s) => ha(s)).join(', ')})`;
+ break;
+ }
+ case 'CallExpression': {
+ o = `Call ${_e(e.callee)}(${e.args.map((s) => ha(s)).join(', ')})`;
+ break;
+ }
+ case 'MethodCall': {
+ o = `MethodCall ${_e(e.receiver)}.${_e(e.property)}(${e.args
+ .map((s) => ha(s))
+ .join(', ')})`;
+ break;
+ }
+ case 'JSXText': {
+ o = `JSXText ${JSON.stringify(e.value)}`;
+ break;
+ }
+ case 'Primitive': {
+ e.value === void 0
+ ? (o = '')
+ : (o = JSON.stringify(e.value));
+ break;
+ }
+ case 'TypeCastExpression': {
+ o = `TypeCast ${_e(e.value)}: ${Vu(e.type)}`;
+ break;
+ }
+ case 'JsxExpression': {
+ let s = [];
+ for (let u of e.props)
+ u.kind === 'JsxAttribute'
+ ? s.push(
+ `${u.name}={${u.place !== null ? _e(u.place) : ''}}`
+ )
+ : s.push(`...${_e(u.argument)}`);
+ let l = e.tag.kind === 'Identifier' ? _e(e.tag) : e.tag.name,
+ d = s.length !== 0 ? ' ' + s.join(' ') : '';
+ if (e.children !== null) {
+ let u = e.children.map((p) => `{${_e(p)}}`);
+ o = `JSX <${l}${d}${d.length > 0 ? ' ' : ''}>${u.join('')}${l}>`;
+ } else o = `JSX <${l}${d}${d.length > 0 ? ' ' : ''}/>`;
+ break;
+ }
+ case 'JsxFragment': {
+ o = `JsxFragment [${e.children.map((s) => _e(s)).join(', ')}]`;
+ break;
+ }
+ case 'UnsupportedNode': {
+ o = `UnsupportedNode ${e.node.type}`;
+ break;
+ }
+ case 'LoadLocal': {
+ o = `LoadLocal ${_e(e.place)}`;
+ break;
+ }
+ case 'DeclareLocal': {
+ o = `DeclareLocal ${e.lvalue.kind} ${_e(e.lvalue.place)}`;
+ break;
+ }
+ case 'DeclareContext': {
+ o = `DeclareContext ${e.lvalue.kind} ${_e(e.lvalue.place)}`;
+ break;
+ }
+ case 'StoreLocal': {
+ o = `StoreLocal ${e.lvalue.kind} ${_e(e.lvalue.place)} = ${_e(
+ e.value
+ )}`;
+ break;
+ }
+ case 'LoadContext': {
+ o = `LoadContext ${_e(e.place)}`;
+ break;
+ }
+ case 'StoreContext': {
+ o = `StoreContext ${e.lvalue.kind} ${_e(e.lvalue.place)} = ${_e(
+ e.value
+ )}`;
+ break;
+ }
+ case 'Destructure': {
+ o = `Destructure ${e.lvalue.kind} ${ha(e.lvalue.pattern)} = ${_e(
+ e.value
+ )}`;
+ break;
+ }
+ case 'PropertyLoad': {
+ o = `PropertyLoad ${_e(e.object)}.${e.property}`;
+ break;
+ }
+ case 'PropertyStore': {
+ o = `PropertyStore ${_e(e.object)}.${e.property} = ${_e(e.value)}`;
+ break;
+ }
+ case 'PropertyDelete': {
+ o = `PropertyDelete ${_e(e.object)}.${e.property}`;
+ break;
+ }
+ case 'ComputedLoad': {
+ o = `ComputedLoad ${_e(e.object)}[${_e(e.property)}]`;
+ break;
+ }
+ case 'ComputedStore': {
+ o = `ComputedStore ${_e(e.object)}[${_e(e.property)}] = ${_e(e.value)}`;
+ break;
+ }
+ case 'ComputedDelete': {
+ o = `ComputedDelete ${_e(e.object)}[${_e(e.property)}]`;
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ let s = e.kind === 'FunctionExpression' ? 'Function' : 'ObjectMethod',
+ l = $B(e, ''),
+ d = SB(e.loweredFunc.func)
+ .split(
+ `
+`
+ )
+ .map((y) => ` ${y}`).join(`
+`),
+ u = e.loweredFunc.func.context.map((y) => _e(y)).join(','),
+ p =
+ (i =
+ (n =
+ (t = e.loweredFunc.func.aliasingEffects) === null ||
+ t === void 0
+ ? void 0
+ : t.map(Si)) === null || n === void 0
+ ? void 0
+ : n.join(', ')) !== null && i !== void 0
+ ? i
+ : '';
+ o = `${s} ${l} @context[${u}] @aliasingEffects=[${p}]
+${d}`;
+ break;
+ }
+ case 'TaggedTemplateExpression': {
+ o = `${_e(e.tag)}\`${e.value.raw}\``;
+ break;
+ }
+ case 'LogicalExpression': {
+ o = `Logical ${ki(e.left)} ${e.operator} ${ki(e.right)}`;
+ break;
+ }
+ case 'SequenceExpression': {
+ o = [
+ 'Sequence',
+ ...e.instructions.map((s) => ` ${Vm(s)}`),
+ ` ${ki(e.value)}`,
+ ].join(`
+`);
+ break;
+ }
+ case 'ConditionalExpression': {
+ o = `Ternary ${ki(e.test)} ? ${ki(e.consequent)} : ${ki(e.alternate)}`;
+ break;
+ }
+ case 'TemplateLiteral': {
+ (o = '`'),
+ D.invariant(e.subexprs.length === e.quasis.length - 1, {
+ reason: 'Bad assumption about quasi length.',
+ description: null,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ suggestions: null,
+ });
+ for (let s = 0; s < e.subexprs.length; s++)
+ (o += e.quasis[s].raw), (o += `\${${_e(e.subexprs[s])}}`);
+ o += e.quasis.at(-1).raw + '`';
+ break;
+ }
+ case 'LoadGlobal': {
+ switch (e.binding.kind) {
+ case 'Global': {
+ o = `LoadGlobal(global) ${e.binding.name}`;
+ break;
+ }
+ case 'ModuleLocal': {
+ o = `LoadGlobal(module) ${e.binding.name}`;
+ break;
+ }
+ case 'ImportDefault': {
+ o = `LoadGlobal import ${e.binding.name} from '${e.binding.module}'`;
+ break;
+ }
+ case 'ImportNamespace': {
+ o = `LoadGlobal import * as ${e.binding.name} from '${e.binding.module}'`;
+ break;
+ }
+ case 'ImportSpecifier': {
+ e.binding.imported !== e.binding.name
+ ? (o = `LoadGlobal import { ${e.binding.imported} as ${e.binding.name} } from '${e.binding.module}'`)
+ : (o = `LoadGlobal import { ${e.binding.name} } from '${e.binding.module}'`);
+ break;
+ }
+ default:
+ Me(e.binding, `Unexpected binding kind \`${e.binding.kind}\``);
+ }
+ break;
+ }
+ case 'StoreGlobal': {
+ o = `StoreGlobal ${e.name} = ${_e(e.value)}`;
+ break;
+ }
+ case 'OptionalExpression': {
+ o = `OptionalExpression ${ki(e.value)}`;
+ break;
+ }
+ case 'RegExpLiteral': {
+ o = `RegExp /${e.pattern}/${e.flags}`;
+ break;
+ }
+ case 'MetaProperty': {
+ o = `MetaProperty ${e.meta}.${e.property}`;
+ break;
+ }
+ case 'Await': {
+ o = `Await ${_e(e.value)}`;
+ break;
+ }
+ case 'GetIterator': {
+ o = `GetIterator collection=${_e(e.collection)}`;
+ break;
+ }
+ case 'IteratorNext': {
+ o = `IteratorNext iterator=${_e(e.iterator)} collection=${_e(
+ e.collection
+ )}`;
+ break;
+ }
+ case 'NextPropertyOf': {
+ o = `NextPropertyOf ${_e(e.value)}`;
+ break;
+ }
+ case 'Debugger': {
+ o = 'Debugger';
+ break;
+ }
+ case 'PostfixUpdate': {
+ o = `PostfixUpdate ${_e(e.lvalue)} = ${_e(e.value)} ${e.operation}`;
+ break;
+ }
+ case 'PrefixUpdate': {
+ o = `PrefixUpdate ${_e(e.lvalue)} = ${e.operation} ${_e(e.value)}`;
+ break;
+ }
+ case 'StartMemoize': {
+ o = `StartMemoize deps=${
+ (a =
+ (r = e.deps) === null || r === void 0
+ ? void 0
+ : r.map((s) => lI(s, !1))) !== null && a !== void 0
+ ? a
+ : '(none)'
+ }`;
+ break;
+ }
+ case 'FinishMemoize': {
+ o = `FinishMemoize decl=${_e(e.decl)}${e.pruned ? ' pruned' : ''}`;
+ break;
+ }
+ default:
+ Me(e, `Unexpected instruction kind '${e.kind}'`);
+ }
+ return o;
+ }
+ function IB(e) {
+ return e.end > e.start + 1;
+ }
+ function sI(e) {
+ var t, n;
+ let i =
+ (n = (t = e.scope) === null || t === void 0 ? void 0 : t.range) !==
+ null && n !== void 0
+ ? n
+ : e.mutableRange;
+ return IB(i) ? `[${i.start}:${i.end}]` : '';
+ }
+ function ha(e) {
+ switch (e.kind) {
+ case 'ArrayPattern':
+ return (
+ '[ ' +
+ e.items
+ .map((t) => (t.kind === 'Hole' ? '' : ha(t)))
+ .join(', ') +
+ ' ]'
+ );
+ case 'ObjectPattern':
+ return (
+ '{ ' +
+ e.properties
+ .map((t) => {
+ switch (t.kind) {
+ case 'ObjectProperty':
+ return `${oI(t.key)}: ${ha(t.place)}`;
+ case 'Spread':
+ return ha(t);
+ default:
+ Me(t, 'Unexpected object property kind');
+ }
+ })
+ .join(', ') +
+ ' }'
+ );
+ case 'Spread':
+ return `...${_e(e.place)}`;
+ case 'Identifier':
+ return _e(e);
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ }
+ function _e(e) {
+ return [
+ e.effect,
+ ' ',
+ un(e.identifier),
+ sI(e.identifier),
+ Vu(e.identifier.type),
+ e.reactive ? '{reactive}' : null,
+ ]
+ .filter((n) => n != null)
+ .join('');
+ }
+ function un(e) {
+ return `${PB(e.name)}$${e.id}${xB(e.scope)}`;
+ }
+ function PB(e) {
+ return e === null ? '' : e.value;
+ }
+ function xB(e) {
+ return `${e !== null ? `_@${e.id}` : ''}`;
+ }
+ function lI(e, t) {
+ var n;
+ let i;
+ return (
+ e.root.kind === 'Global'
+ ? (i = e.root.identifierName)
+ : (D.invariant(
+ ((n = e.root.value.identifier.name) === null || n === void 0
+ ? void 0
+ : n.kind) === 'named',
+ {
+ reason:
+ 'DepsValidation: expected named local variable in depslist',
+ description: null,
+ suggestions: null,
+ details: [{kind: 'error', loc: e.root.value.loc, message: null}],
+ }
+ ),
+ (i = t
+ ? e.root.value.identifier.name.value
+ : un(e.root.value.identifier))),
+ `${i}${e.path
+ .map((r) => `${r.optional ? '?.' : '.'}${r.property}`)
+ .join('')}`
+ );
+ }
+ function Vu(e) {
+ if (e.kind === 'Type') return '';
+ if (e.kind === 'Object' && e.shapeId != null)
+ return `:T${e.kind}<${e.shapeId}>`;
+ if (e.kind === 'Function' && e.shapeId != null) {
+ let t = Vu(e.return);
+ return `:T${e.kind}<${e.shapeId}>()${t !== '' ? `: ${t}` : ''}`;
+ } else return `:T${e.kind}`;
+ }
+ function wB(e) {
+ return typeof e == 'symbol'
+ ? 'generated'
+ : `${e.start.line}:${e.start.column}:${e.end.line}:${e.end.column}`;
+ }
+ function OB(e) {
+ return typeof e == 'symbol' ? 'generated' : `${e.start.line}:${e.end.line}`;
+ }
+ function $B(e, t) {
+ var n;
+ switch (e.kind) {
+ case 'FunctionExpression':
+ return (n = e.name) !== null && n !== void 0 ? n : t;
+ case 'ObjectMethod':
+ return t;
+ }
+ }
+ function Si(e) {
+ var t;
+ switch (e.kind) {
+ case 'Assign':
+ return `Assign ${Kt(e.into)} = ${Kt(e.from)}`;
+ case 'Alias':
+ return `Alias ${Kt(e.into)} <- ${Kt(e.from)}`;
+ case 'MaybeAlias':
+ return `MaybeAlias ${Kt(e.into)} <- ${Kt(e.from)}`;
+ case 'Capture':
+ return `Capture ${Kt(e.into)} <- ${Kt(e.from)}`;
+ case 'ImmutableCapture':
+ return `ImmutableCapture ${Kt(e.into)} <- ${Kt(e.from)}`;
+ case 'Create':
+ return `Create ${Kt(e.into)} = ${e.value}`;
+ case 'CreateFrom':
+ return `Create ${Kt(e.into)} = kindOf(${Kt(e.from)})`;
+ case 'CreateFunction':
+ return `Function ${Kt(e.into)} = Function captures=[${e.captures
+ .map(Kt)
+ .join(', ')}]`;
+ case 'Apply': {
+ let n =
+ e.receiver.identifier.id === e.function.identifier.id
+ ? Kt(e.receiver)
+ : `${Kt(e.receiver)}.${Kt(e.function)}`,
+ i = e.args
+ .map((a) =>
+ a.kind === 'Identifier'
+ ? Kt(a)
+ : a.kind === 'Hole'
+ ? ' '
+ : `...${Kt(a.place)}`
+ )
+ .join(', '),
+ r = '';
+ return (
+ e.signature != null &&
+ (e.signature.aliasing != null
+ ? (r = jB(e.signature.aliasing))
+ : (r = JSON.stringify(e.signature, null, 2))),
+ `Apply ${Kt(e.into)} = ${n}(${i})${
+ r != ''
+ ? `
+ `
+ : ''
+ }${r}`
+ );
+ }
+ case 'Freeze':
+ return `Freeze ${Kt(e.value)} ${e.reason}`;
+ case 'Mutate':
+ case 'MutateConditionally':
+ case 'MutateTransitive':
+ case 'MutateTransitiveConditionally':
+ return `${e.kind} ${Kt(e.value)}${
+ e.kind === 'Mutate' &&
+ ((t = e.reason) === null || t === void 0 ? void 0 : t.kind) ===
+ 'AssignCurrentProperty'
+ ? ' (assign `.current`)'
+ : ''
+ }`;
+ case 'MutateFrozen':
+ return `MutateFrozen ${Kt(e.place)} reason=${JSON.stringify(
+ e.error.reason
+ )}`;
+ case 'MutateGlobal':
+ return `MutateGlobal ${Kt(e.place)} reason=${JSON.stringify(
+ e.error.reason
+ )}`;
+ case 'Impure':
+ return `Impure ${Kt(e.place)} reason=${JSON.stringify(e.error.reason)}`;
+ case 'Render':
+ return `Render ${Kt(e.place)}`;
+ default:
+ Me(e, `Unexpected kind '${e.kind}'`);
+ }
+ }
+ function Kt(e) {
+ return un(e.identifier);
+ }
+ function jB(e) {
+ let t = ['function '];
+ e.temporaries.length !== 0 &&
+ (t.push('<'),
+ t.push(e.temporaries.map((n) => `$${n.identifier.id}`).join(', ')),
+ t.push('>')),
+ t.push('('),
+ t.push('this=$' + String(e.receiver));
+ for (let n of e.params) t.push(', $' + String(n));
+ e.rest != null && t.push(`, ...$${String(e.rest)}`),
+ t.push('): '),
+ t.push('$' + String(e.returns) + ':');
+ for (let n of e.effects)
+ t.push(
+ `
+ ` + Si(n)
+ );
+ return t.join('');
+ }
+ var la;
+ function* rn(e) {
+ e.lvalue !== null && (yield e.lvalue), yield* yo(e.value);
+ }
+ function* yo(e) {
+ switch (e.kind) {
+ case 'DeclareContext':
+ case 'StoreContext':
+ case 'DeclareLocal':
+ case 'StoreLocal': {
+ yield e.lvalue.place;
+ break;
+ }
+ case 'Destructure': {
+ yield* kr(e.lvalue.pattern);
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ yield e.lvalue;
+ break;
+ }
+ }
+ }
+ function* sn(e) {
+ yield* Ot(e.value);
+ }
+ function* Ot(e) {
+ switch (e.kind) {
+ case 'NewExpression':
+ case 'CallExpression': {
+ yield e.callee, yield* iv(e.args);
+ break;
+ }
+ case 'BinaryExpression': {
+ yield e.left, yield e.right;
+ break;
+ }
+ case 'MethodCall': {
+ yield e.receiver, yield e.property, yield* iv(e.args);
+ break;
+ }
+ case 'DeclareContext':
+ case 'DeclareLocal':
+ break;
+ case 'LoadLocal':
+ case 'LoadContext': {
+ yield e.place;
+ break;
+ }
+ case 'StoreLocal': {
+ yield e.value;
+ break;
+ }
+ case 'StoreContext': {
+ yield e.lvalue.place, yield e.value;
+ break;
+ }
+ case 'StoreGlobal': {
+ yield e.value;
+ break;
+ }
+ case 'Destructure': {
+ yield e.value;
+ break;
+ }
+ case 'PropertyLoad': {
+ yield e.object;
+ break;
+ }
+ case 'PropertyDelete': {
+ yield e.object;
+ break;
+ }
+ case 'PropertyStore': {
+ yield e.object, yield e.value;
+ break;
+ }
+ case 'ComputedLoad': {
+ yield e.object, yield e.property;
+ break;
+ }
+ case 'ComputedDelete': {
+ yield e.object, yield e.property;
+ break;
+ }
+ case 'ComputedStore': {
+ yield e.object, yield e.property, yield e.value;
+ break;
+ }
+ case 'UnaryExpression': {
+ yield e.value;
+ break;
+ }
+ case 'JsxExpression': {
+ e.tag.kind === 'Identifier' && (yield e.tag);
+ for (let t of e.props)
+ switch (t.kind) {
+ case 'JsxAttribute': {
+ yield t.place;
+ break;
+ }
+ case 'JsxSpreadAttribute': {
+ yield t.argument;
+ break;
+ }
+ default:
+ Me(t, `Unexpected attribute kind \`${t.kind}\``);
+ }
+ e.children && (yield* e.children);
+ break;
+ }
+ case 'JsxFragment': {
+ yield* e.children;
+ break;
+ }
+ case 'ObjectExpression': {
+ for (let t of e.properties)
+ t.kind === 'ObjectProperty' &&
+ t.key.kind === 'computed' &&
+ (yield t.key.name),
+ yield t.place;
+ break;
+ }
+ case 'ArrayExpression': {
+ for (let t of e.elements)
+ t.kind === 'Identifier'
+ ? yield t
+ : t.kind === 'Spread' && (yield t.place);
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ yield* e.loweredFunc.func.context;
+ break;
+ }
+ case 'TaggedTemplateExpression': {
+ yield e.tag;
+ break;
+ }
+ case 'TypeCastExpression': {
+ yield e.value;
+ break;
+ }
+ case 'TemplateLiteral': {
+ yield* e.subexprs;
+ break;
+ }
+ case 'Await': {
+ yield e.value;
+ break;
+ }
+ case 'GetIterator': {
+ yield e.collection;
+ break;
+ }
+ case 'IteratorNext': {
+ yield e.iterator, yield e.collection;
+ break;
+ }
+ case 'NextPropertyOf': {
+ yield e.value;
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ yield e.value;
+ break;
+ }
+ case 'StartMemoize': {
+ if (e.deps != null)
+ for (let t of e.deps)
+ t.root.kind === 'NamedLocal' && (yield t.root.value);
+ break;
+ }
+ case 'FinishMemoize': {
+ yield e.decl;
+ break;
+ }
+ case 'Debugger':
+ case 'RegExpLiteral':
+ case 'MetaProperty':
+ case 'LoadGlobal':
+ case 'UnsupportedNode':
+ case 'Primitive':
+ case 'JSXText':
+ break;
+ default:
+ Me(e, `Unexpected instruction kind \`${e.kind}\``);
+ }
+ }
+ function* iv(e) {
+ for (let t of e) t.kind === 'Identifier' ? yield t : yield t.place;
+ }
+ function CB(e) {
+ switch (e.kind) {
+ case 'ArrayPattern': {
+ for (let t of e.items) if (t.kind === 'Spread') return !0;
+ break;
+ }
+ case 'ObjectPattern': {
+ for (let t of e.properties) if (t.kind === 'Spread') return !0;
+ break;
+ }
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ return !1;
+ }
+ function* kr(e) {
+ switch (e.kind) {
+ case 'ArrayPattern': {
+ for (let t of e.items)
+ if (t.kind === 'Identifier') yield t;
+ else if (t.kind === 'Spread') yield t.place;
+ else {
+ if (t.kind === 'Hole') continue;
+ Me(t, `Unexpected item kind \`${t.kind}\``);
+ }
+ break;
+ }
+ case 'ObjectPattern': {
+ for (let t of e.properties)
+ t.kind === 'ObjectProperty'
+ ? yield t.place
+ : t.kind === 'Spread'
+ ? yield t.place
+ : Me(t, `Unexpected item kind \`${t.kind}\``);
+ break;
+ }
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ }
+ function* DB(e) {
+ switch (e.kind) {
+ case 'ArrayPattern': {
+ for (let t of e.items)
+ if (t.kind === 'Identifier') yield t;
+ else if (t.kind === 'Spread') yield t;
+ else {
+ if (t.kind === 'Hole') continue;
+ Me(t, `Unexpected item kind \`${t.kind}\``);
+ }
+ break;
+ }
+ case 'ObjectPattern': {
+ for (let t of e.properties)
+ t.kind === 'ObjectProperty'
+ ? yield t.place
+ : t.kind === 'Spread'
+ ? yield t
+ : Me(t, `Unexpected item kind \`${t.kind}\``);
+ break;
+ }
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ }
+ function cI(e, t) {
+ switch (e.value.kind) {
+ case 'DeclareLocal':
+ case 'StoreLocal': {
+ let n = e.value.lvalue;
+ n.place = t(n.place);
+ break;
+ }
+ case 'Destructure': {
+ fI(e.value.lvalue.pattern, t);
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ e.value.lvalue = t(e.value.lvalue);
+ break;
+ }
+ }
+ e.lvalue !== null && (e.lvalue = t(e.lvalue));
+ }
+ function uI(e, t) {
+ dI(e.value, t);
+ }
+ function dI(e, t) {
+ switch (e.kind) {
+ case 'BinaryExpression': {
+ (e.left = t(e.left)), (e.right = t(e.right));
+ break;
+ }
+ case 'PropertyLoad': {
+ e.object = t(e.object);
+ break;
+ }
+ case 'PropertyDelete': {
+ e.object = t(e.object);
+ break;
+ }
+ case 'PropertyStore': {
+ (e.object = t(e.object)), (e.value = t(e.value));
+ break;
+ }
+ case 'ComputedLoad': {
+ (e.object = t(e.object)), (e.property = t(e.property));
+ break;
+ }
+ case 'ComputedDelete': {
+ (e.object = t(e.object)), (e.property = t(e.property));
+ break;
+ }
+ case 'ComputedStore': {
+ (e.object = t(e.object)),
+ (e.property = t(e.property)),
+ (e.value = t(e.value));
+ break;
+ }
+ case 'DeclareContext':
+ case 'DeclareLocal':
+ break;
+ case 'LoadLocal':
+ case 'LoadContext': {
+ e.place = t(e.place);
+ break;
+ }
+ case 'StoreLocal': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'StoreContext': {
+ (e.lvalue.place = t(e.lvalue.place)), (e.value = t(e.value));
+ break;
+ }
+ case 'StoreGlobal': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'Destructure': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'NewExpression':
+ case 'CallExpression': {
+ (e.callee = t(e.callee)), (e.args = gE(e.args, t));
+ break;
+ }
+ case 'MethodCall': {
+ (e.receiver = t(e.receiver)),
+ (e.property = t(e.property)),
+ (e.args = gE(e.args, t));
+ break;
+ }
+ case 'UnaryExpression': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'JsxExpression': {
+ e.tag.kind === 'Identifier' && (e.tag = t(e.tag));
+ for (let n of e.props)
+ switch (n.kind) {
+ case 'JsxAttribute': {
+ n.place = t(n.place);
+ break;
+ }
+ case 'JsxSpreadAttribute': {
+ n.argument = t(n.argument);
+ break;
+ }
+ default:
+ Me(n, `Unexpected attribute kind \`${n.kind}\``);
+ }
+ e.children && (e.children = e.children.map((n) => t(n)));
+ break;
+ }
+ case 'ObjectExpression': {
+ for (let n of e.properties)
+ n.kind === 'ObjectProperty' &&
+ n.key.kind === 'computed' &&
+ (n.key.name = t(n.key.name)),
+ (n.place = t(n.place));
+ break;
+ }
+ case 'ArrayExpression': {
+ e.elements = e.elements.map((n) =>
+ n.kind === 'Identifier'
+ ? t(n)
+ : (n.kind === 'Spread' && (n.place = t(n.place)), n)
+ );
+ break;
+ }
+ case 'JsxFragment': {
+ e.children = e.children.map((n) => t(n));
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ e.loweredFunc.func.context = e.loweredFunc.func.context.map((n) =>
+ t(n)
+ );
+ break;
+ }
+ case 'TaggedTemplateExpression': {
+ e.tag = t(e.tag);
+ break;
+ }
+ case 'TypeCastExpression': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'TemplateLiteral': {
+ e.subexprs = e.subexprs.map(t);
+ break;
+ }
+ case 'Await': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'GetIterator': {
+ e.collection = t(e.collection);
+ break;
+ }
+ case 'IteratorNext': {
+ (e.iterator = t(e.iterator)), (e.collection = t(e.collection));
+ break;
+ }
+ case 'NextPropertyOf': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'StartMemoize': {
+ if (e.deps != null)
+ for (let n of e.deps)
+ n.root.kind === 'NamedLocal' && (n.root.value = t(n.root.value));
+ break;
+ }
+ case 'FinishMemoize': {
+ e.decl = t(e.decl);
+ break;
+ }
+ case 'Debugger':
+ case 'RegExpLiteral':
+ case 'MetaProperty':
+ case 'LoadGlobal':
+ case 'UnsupportedNode':
+ case 'Primitive':
+ case 'JSXText':
+ break;
+ default:
+ Me(e, 'Unexpected instruction kind');
+ }
+ }
+ function gE(e, t) {
+ return e.map((n) =>
+ n.kind === 'Identifier' ? t(n) : ((n.place = t(n.place)), n)
+ );
+ }
+ function fI(e, t) {
+ switch (e.kind) {
+ case 'ArrayPattern': {
+ e.items = e.items.map((n) =>
+ n.kind === 'Identifier'
+ ? t(n)
+ : (n.kind === 'Spread' && (n.place = t(n.place)), n)
+ );
+ break;
+ }
+ case 'ObjectPattern': {
+ for (let n of e.properties) n.place = t(n.place);
+ break;
+ }
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ }
+ function pI(e, t) {
+ switch (e.kind) {
+ case 'goto':
+ return {
+ kind: 'goto',
+ block: t(e.block),
+ variant: e.variant,
+ id: V(0),
+ loc: e.loc,
+ };
+ case 'if': {
+ let n = t(e.consequent),
+ i = t(e.alternate),
+ r = t(e.fallthrough);
+ return {
+ kind: 'if',
+ test: e.test,
+ consequent: n,
+ alternate: i,
+ fallthrough: r,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'branch': {
+ let n = t(e.consequent),
+ i = t(e.alternate),
+ r = t(e.fallthrough);
+ return {
+ kind: 'branch',
+ test: e.test,
+ consequent: n,
+ alternate: i,
+ fallthrough: r,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'switch': {
+ let n = e.cases.map((r) => {
+ let a = t(r.block);
+ return {test: r.test, block: a};
+ }),
+ i = t(e.fallthrough);
+ return {
+ kind: 'switch',
+ test: e.test,
+ cases: n,
+ fallthrough: i,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'logical': {
+ let n = t(e.test),
+ i = t(e.fallthrough);
+ return {
+ kind: 'logical',
+ test: n,
+ fallthrough: i,
+ operator: e.operator,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'ternary': {
+ let n = t(e.test),
+ i = t(e.fallthrough);
+ return {kind: 'ternary', test: n, fallthrough: i, id: V(0), loc: e.loc};
+ }
+ case 'optional': {
+ let n = t(e.test),
+ i = t(e.fallthrough);
+ return {
+ kind: 'optional',
+ optional: e.optional,
+ test: n,
+ fallthrough: i,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'return':
+ return {
+ kind: 'return',
+ returnVariant: e.returnVariant,
+ loc: e.loc,
+ value: e.value,
+ id: V(0),
+ effects: e.effects,
+ };
+ case 'throw':
+ return e;
+ case 'do-while': {
+ let n = t(e.loop),
+ i = t(e.test),
+ r = t(e.fallthrough);
+ return {
+ kind: 'do-while',
+ loc: e.loc,
+ test: i,
+ loop: n,
+ fallthrough: r,
+ id: V(0),
+ };
+ }
+ case 'while': {
+ let n = t(e.test),
+ i = t(e.loop),
+ r = t(e.fallthrough);
+ return {
+ kind: 'while',
+ loc: e.loc,
+ test: n,
+ loop: i,
+ fallthrough: r,
+ id: V(0),
+ };
+ }
+ case 'for': {
+ let n = t(e.init),
+ i = t(e.test),
+ r = e.update !== null ? t(e.update) : null,
+ a = t(e.loop),
+ o = t(e.fallthrough);
+ return {
+ kind: 'for',
+ loc: e.loc,
+ init: n,
+ test: i,
+ update: r,
+ loop: a,
+ fallthrough: o,
+ id: V(0),
+ };
+ }
+ case 'for-of': {
+ let n = t(e.init),
+ i = t(e.loop),
+ r = t(e.test),
+ a = t(e.fallthrough);
+ return {
+ kind: 'for-of',
+ loc: e.loc,
+ init: n,
+ test: r,
+ loop: i,
+ fallthrough: a,
+ id: V(0),
+ };
+ }
+ case 'for-in': {
+ let n = t(e.init),
+ i = t(e.loop),
+ r = t(e.fallthrough);
+ return {
+ kind: 'for-in',
+ loc: e.loc,
+ init: n,
+ loop: i,
+ fallthrough: r,
+ id: V(0),
+ };
+ }
+ case 'label': {
+ let n = t(e.block),
+ i = t(e.fallthrough);
+ return {kind: 'label', block: n, fallthrough: i, id: V(0), loc: e.loc};
+ }
+ case 'sequence': {
+ let n = t(e.block),
+ i = t(e.fallthrough);
+ return {
+ kind: 'sequence',
+ block: n,
+ fallthrough: i,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'maybe-throw': {
+ let n = t(e.continuation),
+ i = t(e.handler);
+ return {
+ kind: 'maybe-throw',
+ continuation: n,
+ handler: i,
+ id: V(0),
+ loc: e.loc,
+ effects: e.effects,
+ };
+ }
+ case 'try': {
+ let n = t(e.block),
+ i = t(e.handler),
+ r = t(e.fallthrough);
+ return {
+ kind: 'try',
+ block: n,
+ handlerBinding: e.handlerBinding,
+ handler: i,
+ fallthrough: r,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'scope':
+ case 'pruned-scope': {
+ let n = t(e.block),
+ i = t(e.fallthrough);
+ return {
+ kind: e.kind,
+ scope: e.scope,
+ block: n,
+ fallthrough: i,
+ id: V(0),
+ loc: e.loc,
+ };
+ }
+ case 'unreachable':
+ case 'unsupported':
+ return e;
+ default:
+ Me(e, `Unexpected terminal kind \`${e.kind}\``);
+ }
+ }
+ function mI(e) {
+ switch (e.kind) {
+ case 'maybe-throw':
+ case 'goto':
+ case 'return':
+ case 'throw':
+ case 'unreachable':
+ case 'unsupported':
+ return !1;
+ case 'branch':
+ case 'try':
+ case 'do-while':
+ case 'for-of':
+ case 'for-in':
+ case 'for':
+ case 'if':
+ case 'label':
+ case 'logical':
+ case 'optional':
+ case 'sequence':
+ case 'switch':
+ case 'ternary':
+ case 'while':
+ case 'scope':
+ case 'pruned-scope':
+ return !0;
+ default:
+ Me(e, `Unexpected terminal kind \`${e.kind}\``);
+ }
+ }
+ function Ju(e) {
+ return mI(e) ? e.fallthrough : null;
+ }
+ function* go(e) {
+ switch (e.kind) {
+ case 'goto': {
+ yield e.block;
+ break;
+ }
+ case 'if': {
+ yield e.consequent, yield e.alternate;
+ break;
+ }
+ case 'branch': {
+ yield e.consequent, yield e.alternate;
+ break;
+ }
+ case 'switch': {
+ for (let t of e.cases) yield t.block;
+ break;
+ }
+ case 'optional':
+ case 'ternary':
+ case 'logical': {
+ yield e.test;
+ break;
+ }
+ case 'return':
+ break;
+ case 'throw':
+ break;
+ case 'do-while': {
+ yield e.loop;
+ break;
+ }
+ case 'while': {
+ yield e.test;
+ break;
+ }
+ case 'for': {
+ yield e.init;
+ break;
+ }
+ case 'for-of': {
+ yield e.init;
+ break;
+ }
+ case 'for-in': {
+ yield e.init;
+ break;
+ }
+ case 'label': {
+ yield e.block;
+ break;
+ }
+ case 'sequence': {
+ yield e.block;
+ break;
+ }
+ case 'maybe-throw': {
+ yield e.continuation, yield e.handler;
+ break;
+ }
+ case 'try': {
+ yield e.block;
+ break;
+ }
+ case 'scope':
+ case 'pruned-scope': {
+ yield e.block;
+ break;
+ }
+ case 'unreachable':
+ case 'unsupported':
+ break;
+ default:
+ Me(e, `Unexpected terminal kind \`${e.kind}\``);
+ }
+ }
+ function yI(e, t) {
+ switch (e.kind) {
+ case 'if': {
+ e.test = t(e.test);
+ break;
+ }
+ case 'branch': {
+ e.test = t(e.test);
+ break;
+ }
+ case 'switch': {
+ e.test = t(e.test);
+ for (let n of e.cases) n.test !== null && (n.test = t(n.test));
+ break;
+ }
+ case 'return':
+ case 'throw': {
+ e.value = t(e.value);
+ break;
+ }
+ case 'try': {
+ e.handlerBinding !== null
+ ? (e.handlerBinding = t(e.handlerBinding))
+ : (e.handlerBinding = null);
+ break;
+ }
+ case 'maybe-throw':
+ case 'sequence':
+ case 'label':
+ case 'optional':
+ case 'ternary':
+ case 'logical':
+ case 'do-while':
+ case 'while':
+ case 'for':
+ case 'for-of':
+ case 'for-in':
+ case 'goto':
+ case 'unreachable':
+ case 'unsupported':
+ case 'scope':
+ case 'pruned-scope':
+ break;
+ default:
+ Me(e, `Unexpected terminal kind \`${e.kind}\``);
+ }
+ }
+ function* Gt(e) {
+ switch (e.kind) {
+ case 'if': {
+ yield e.test;
+ break;
+ }
+ case 'branch': {
+ yield e.test;
+ break;
+ }
+ case 'switch': {
+ yield e.test;
+ for (let t of e.cases) t.test !== null && (yield t.test);
+ break;
+ }
+ case 'return':
+ case 'throw': {
+ yield e.value;
+ break;
+ }
+ case 'try': {
+ e.handlerBinding !== null && (yield e.handlerBinding);
+ break;
+ }
+ case 'maybe-throw':
+ case 'sequence':
+ case 'label':
+ case 'optional':
+ case 'ternary':
+ case 'logical':
+ case 'do-while':
+ case 'while':
+ case 'for':
+ case 'for-of':
+ case 'for-in':
+ case 'goto':
+ case 'unreachable':
+ case 'unsupported':
+ case 'scope':
+ case 'pruned-scope':
+ break;
+ default:
+ Me(e, `Unexpected terminal kind \`${e.kind}\``);
+ }
+ }
+ var _m = class {
+ constructor() {
+ la.set(this, []), (this.blockInfos = new Map());
+ }
+ recordScopes(t) {
+ var n, i;
+ let r = this.blockInfos.get(t.id);
+ if (r?.kind === 'begin') j(this, la, 'f').push(r.scope.id);
+ else if (r?.kind === 'end') {
+ let a = j(this, la, 'f').at(-1);
+ D.invariant(r.scope.id === a, {
+ reason:
+ 'Expected traversed block fallthrough to match top-most active scope',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc:
+ (i =
+ (n = t.instructions[0]) === null || n === void 0
+ ? void 0
+ : n.loc) !== null && i !== void 0
+ ? i
+ : t.terminal.id,
+ message: null,
+ },
+ ],
+ }),
+ j(this, la, 'f').pop();
+ }
+ (t.terminal.kind === 'scope' || t.terminal.kind === 'pruned-scope') &&
+ (D.invariant(
+ !this.blockInfos.has(t.terminal.block) &&
+ !this.blockInfos.has(t.terminal.fallthrough),
+ {
+ reason: 'Expected unique scope blocks and fallthroughs',
+ description: null,
+ details: [{kind: 'error', loc: t.terminal.loc, message: null}],
+ }
+ ),
+ this.blockInfos.set(t.terminal.block, {
+ kind: 'begin',
+ scope: t.terminal.scope,
+ pruned: t.terminal.kind === 'pruned-scope',
+ fallthrough: t.terminal.fallthrough,
+ }),
+ this.blockInfos.set(t.terminal.fallthrough, {
+ kind: 'end',
+ scope: t.terminal.scope,
+ pruned: t.terminal.kind === 'pruned-scope',
+ }));
+ }
+ isScopeActive(t) {
+ return j(this, la, 'f').indexOf(t) !== -1;
+ }
+ get currentScope() {
+ var t;
+ return (t = j(this, la, 'f').at(-1)) !== null && t !== void 0 ? t : null;
+ }
+ };
+ la = new WeakMap();
+ function Tm(e) {
+ let t = new Map(),
+ n = new Set();
+ for (let [, i] of e.body.blocks) {
+ for (let r of i.phis) {
+ cu(t, r.place.identifier);
+ for (let [, a] of r.operands) cu(t, a.identifier);
+ }
+ for (let r of i.instructions) {
+ D.invariant(r.lvalue.identifier.name === null, {
+ reason: 'Expected all lvalues to be temporaries',
+ description: `Found named lvalue \`${r.lvalue.identifier.name}\``,
+ details: [{kind: 'error', loc: r.lvalue.loc, message: null}],
+ suggestions: null,
+ }),
+ D.invariant(!n.has(r.lvalue.identifier.id), {
+ reason: 'Expected lvalues to be assigned exactly once',
+ description: `Found duplicate assignment of '${_e(r.lvalue)}'`,
+ details: [{kind: 'error', loc: r.lvalue.loc, message: null}],
+ suggestions: null,
+ }),
+ n.add(r.lvalue.identifier.id);
+ for (let a of rn(r)) cu(t, a.identifier, a.loc);
+ for (let a of Ot(r.value)) cu(t, a.identifier, a.loc);
+ }
+ for (let r of Gt(i.terminal)) cu(t, r.identifier, r.loc);
+ }
+ }
+ function cu(e, t, n = null) {
+ let i = e.get(t.id);
+ i === void 0
+ ? e.set(t.id, t)
+ : D.invariant(t === i, {
+ reason: 'Duplicate identifier object',
+ description: `Found duplicate identifier object for id ${t.id}`,
+ details: [{kind: 'error', loc: n ?? F, message: null}],
+ suggestions: null,
+ });
+ }
+ function Em(e) {
+ for (let [, t] of e.body.blocks)
+ pI(t.terminal, (n) => {
+ var i;
+ return (
+ D.invariant(e.body.blocks.has(n), {
+ reason: 'Terminal successor references unknown block',
+ description: `Block bb${n} does not exist for terminal '${aI(
+ t.terminal
+ )}'`,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = t.terminal.loc) !== null && i !== void 0 ? i : F,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ n
+ );
+ });
+ }
+ function AB(e) {
+ for (let [, t] of e.body.blocks)
+ for (let n of t.preds) {
+ let i = e.body.blocks.get(n);
+ D.invariant(i != null, {
+ reason: 'Expected predecessor block to exist',
+ description: `Block ${t.id} references non-existent ${n}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ D.invariant([...go(i.terminal)].includes(t.id), {
+ reason: 'Terminal successor does not reference correct predecessor',
+ description: `Block bb${t.id} has bb${i.id} as a predecessor, but bb${i.id}'s successors do not include bb${t.id}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ }
+ }
+ function gI(e) {
+ let t = new Set();
+ function n(i) {
+ let r = i.identifier.scope;
+ r != null && r.range.start !== r.range.end && t.add(r);
+ }
+ for (let [, i] of e.body.blocks) {
+ for (let r of i.instructions) {
+ for (let a of rn(r)) n(a);
+ for (let a of sn(r)) n(a);
+ }
+ for (let r of Gt(i.terminal)) n(r);
+ }
+ return t;
+ }
+ function MB(e, t) {
+ let n = e.start - t.start;
+ return n !== 0 ? n : t.end - e.end;
+ }
+ function vI(e, t, n, i, r) {
+ e.sort((l, d) => MB(t(l), t(d)));
+ let a = [],
+ o = e.map(t);
+ for (let l = 0; l < e.length; l++) {
+ let d = e[l],
+ u = o[l];
+ for (let p = a.length - 1; p >= 0; p--) {
+ let y = a[p],
+ m = t(y),
+ g = u.start >= m.end,
+ S = u.end <= m.end;
+ if (
+ (D.invariant(g || S, {
+ reason: 'Invalid nesting in program blocks or scopes',
+ description: `Items overlap but are not nested: ${m.start}:${m.end}(${u.start}:${u.end})`,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ g)
+ )
+ r(y, n), (a.length = p);
+ else break;
+ }
+ i(d, n), a.push(d);
+ }
+ let s = a.pop();
+ for (; s != null; ) r(s, n), (s = a.pop());
+ }
+ var vE = () => {};
+ function hE(e) {
+ var t, n;
+ let r = [...gI(e)].map((a) =>
+ Object.assign({kind: 'Scope', id: a.id}, a.range)
+ );
+ for (let [, a] of e.body.blocks) {
+ let o = Ju(a.terminal);
+ if (o != null) {
+ let s = e.body.blocks.get(o),
+ l =
+ (n =
+ (t = s.instructions[0]) === null || t === void 0
+ ? void 0
+ : t.id) !== null && n !== void 0
+ ? n
+ : s.terminal.id;
+ r.push({
+ kind: 'ProgramBlockSubtree',
+ id: a.id,
+ start: a.terminal.id,
+ end: l,
+ });
+ }
+ }
+ vI(r, (a) => a, null, vE, vE);
+ }
+ function NB(e) {
+ for (let [, t] of e.body.blocks) {
+ for (let n of t.phis) {
+ uu(n.place, `phi for block bb${t.id}`);
+ for (let [i, r] of n.operands)
+ uu(r, `phi predecessor bb${i} for block bb${t.id}`);
+ }
+ for (let n of t.instructions) {
+ for (let i of rn(n)) uu(i, `instruction [${n.id}]`);
+ for (let i of sn(n)) uu(i, `instruction [${n.id}]`);
+ }
+ for (let n of Gt(t.terminal)) uu(n, `terminal [${t.terminal.id}]`);
+ }
+ }
+ function uu(e, t) {
+ bE(e, e.identifier.mutableRange, t),
+ e.identifier.scope !== null && bE(e, e.identifier.scope.range, t);
+ }
+ function bE(e, t, n) {
+ D.invariant((t.start === 0 && t.end === 0) || t.end > t.start, {
+ reason: `Invalid mutable range: [${t.start}:${t.end}]`,
+ description: `${_e(e)} in ${n}`,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ });
+ }
+ var Np, ca, qn, fu, lr, Rp, Va, mr, Ja, av;
+ function $g(e, t) {
+ return {id: e, kind: t, instructions: []};
+ }
+ var Im = class {
+ get nextIdentifierId() {
+ return j(this, mr, 'f').nextIdentifierId;
+ }
+ get context() {
+ return j(this, Rp, 'f');
+ }
+ get bindings() {
+ return j(this, Va, 'f');
+ }
+ get environment() {
+ return j(this, mr, 'f');
+ }
+ constructor(t, n) {
+ var i, r, a;
+ Np.add(this),
+ ca.set(this, new Map()),
+ qn.set(this, void 0),
+ fu.set(this, void 0),
+ lr.set(this, []),
+ Rp.set(this, void 0),
+ Va.set(this, void 0),
+ mr.set(this, void 0),
+ Ja.set(this, []),
+ (this.errors = new D()),
+ (this.fbtDepth = 0),
+ at(this, mr, t, 'f'),
+ at(
+ this,
+ Va,
+ (i = n?.bindings) !== null && i !== void 0 ? i : new Map(),
+ 'f'
+ ),
+ at(
+ this,
+ Rp,
+ (r = n?.context) !== null && r !== void 0 ? r : new Map(),
+ 'f'
+ ),
+ at(this, fu, Zi(t.nextBlockId), 'f'),
+ at(
+ this,
+ qn,
+ $g(
+ j(this, fu, 'f'),
+ (a = n?.entryBlockKind) !== null && a !== void 0 ? a : 'block'
+ ),
+ 'f'
+ );
+ }
+ currentBlockKind() {
+ return j(this, qn, 'f').kind;
+ }
+ push(t) {
+ j(this, qn, 'f').instructions.push(t);
+ let n = j(this, Ja, 'f').at(-1);
+ if (n !== void 0) {
+ let i = this.reserve(this.currentBlockKind());
+ this.terminateWithContinuation(
+ {
+ kind: 'maybe-throw',
+ continuation: i.id,
+ handler: n,
+ id: V(0),
+ loc: t.loc,
+ effects: null,
+ },
+ i
+ );
+ }
+ }
+ enterTryCatch(t, n) {
+ j(this, Ja, 'f').push(t), n(), j(this, Ja, 'f').pop();
+ }
+ resolveThrowHandler() {
+ let t = j(this, Ja, 'f').at(-1);
+ return t ?? null;
+ }
+ makeTemporary(t) {
+ let n = this.nextIdentifierId;
+ return Du(n, t);
+ }
+ resolveIdentifier(t) {
+ let n = t.node.name,
+ i = j(this, Np, 'm', av).call(this, t);
+ if (i == null) return {kind: 'Global', name: n};
+ let r = j(this, mr, 'f').parentFunction.scope.parent.getBinding(n);
+ if (i === r) {
+ let o = i.path;
+ if (o.isImportDefaultSpecifier()) {
+ let s = o.parentPath;
+ return {kind: 'ImportDefault', name: n, module: s.node.source.value};
+ } else if (o.isImportSpecifier()) {
+ let s = o.parentPath;
+ return {
+ kind: 'ImportSpecifier',
+ name: n,
+ module: s.node.source.value,
+ imported:
+ o.node.imported.type === 'Identifier'
+ ? o.node.imported.name
+ : o.node.imported.value,
+ };
+ } else if (o.isImportNamespaceSpecifier()) {
+ let s = o.parentPath;
+ return {
+ kind: 'ImportNamespace',
+ name: n,
+ module: s.node.source.value,
+ };
+ } else return {kind: 'ModuleLocal', name: n};
+ }
+ let a = this.resolveBinding(i.identifier);
+ return (
+ a.name && a.name.value !== n && i.scope.rename(n, a.name.value),
+ {kind: 'Identifier', identifier: a, bindingKind: i.kind}
+ );
+ }
+ isContextIdentifier(t) {
+ let n = j(this, Np, 'm', av).call(this, t);
+ if (n) {
+ let i = j(this, mr, 'f').parentFunction.scope.parent.getBinding(
+ t.node.name
+ );
+ return n === i
+ ? !1
+ : j(this, mr, 'f').isContextIdentifier(n.identifier);
+ } else return !1;
+ }
+ resolveBinding(t) {
+ var n, i, r;
+ t.name === 'fbt' &&
+ D.throwDiagnostic({
+ category: K.Todo,
+ reason: 'Support local variables named `fbt`',
+ description:
+ 'Local variables named `fbt` may conflict with the fbt plugin and are not yet supported',
+ details: [
+ {
+ kind: 'error',
+ message: 'Rename to avoid conflict with fbt plugin',
+ loc: (n = t.loc) !== null && n !== void 0 ? n : F,
+ },
+ ],
+ }),
+ t.name === 'this' &&
+ D.throwDiagnostic({
+ category: K.UnsupportedSyntax,
+ reason: '`this` is not supported syntax',
+ description:
+ 'React Compiler does not support compiling functions that use `this`',
+ details: [
+ {
+ kind: 'error',
+ message: '`this` was used here',
+ loc: (i = t.loc) !== null && i !== void 0 ? i : F,
+ },
+ ],
+ });
+ let a = t.name,
+ o = a,
+ s = 0;
+ for (;;) {
+ let l = j(this, Va, 'f').get(o);
+ if (l === void 0) {
+ let d = this.nextIdentifierId,
+ u = {
+ id: d,
+ declarationId: gh(d),
+ name: uo(o),
+ mutableRange: {start: V(0), end: V(0)},
+ scope: null,
+ type: Gn(),
+ loc: (r = t.loc) !== null && r !== void 0 ? r : F,
+ };
+ return (
+ j(this, mr, 'f').programContext.addNewReference(o),
+ j(this, Va, 'f').set(o, {node: t, identifier: u}),
+ u
+ );
+ } else {
+ if (l.node === t) return l.identifier;
+ o = `${a}_${s++}`;
+ }
+ }
+ }
+ build() {
+ var t, n;
+ let i = {blocks: j(this, ca, 'f'), entry: j(this, fu, 'f')},
+ r = hI(i);
+ for (let [a, o] of i.blocks)
+ !r.has(a) &&
+ o.instructions.some((s) => s.value.kind === 'FunctionExpression') &&
+ D.throwTodo({
+ reason:
+ 'Support functions with unreachable code that may contain hoisted declarations',
+ loc:
+ (n =
+ (t = o.instructions[0]) === null || t === void 0
+ ? void 0
+ : t.loc) !== null && n !== void 0
+ ? n
+ : o.terminal.loc,
+ description: null,
+ suggestions: null,
+ });
+ return (i.blocks = r), bh(i), kh(i), Sh(i), fr(i), xa(i), i;
+ }
+ terminate(t, n) {
+ let {id: i, kind: r, instructions: a} = j(this, qn, 'f');
+ if (
+ (j(this, ca, 'f').set(i, {
+ kind: r,
+ id: i,
+ instructions: a,
+ terminal: t,
+ preds: new Set(),
+ phis: new Set(),
+ }),
+ n)
+ ) {
+ let o = j(this, mr, 'f').nextBlockId;
+ at(this, qn, $g(o, n), 'f');
+ }
+ return i;
+ }
+ terminateWithContinuation(t, n) {
+ let {id: i, kind: r, instructions: a} = j(this, qn, 'f');
+ j(this, ca, 'f').set(i, {
+ kind: r,
+ id: i,
+ instructions: a,
+ terminal: t,
+ preds: new Set(),
+ phis: new Set(),
+ }),
+ at(this, qn, n, 'f');
+ }
+ reserve(t) {
+ return $g(Zi(j(this, mr, 'f').nextBlockId), t);
+ }
+ complete(t, n) {
+ let {id: i, kind: r, instructions: a} = t;
+ j(this, ca, 'f').set(i, {
+ kind: r,
+ id: i,
+ instructions: a,
+ terminal: n,
+ preds: new Set(),
+ phis: new Set(),
+ });
+ }
+ enterReserved(t, n) {
+ let i = j(this, qn, 'f');
+ at(this, qn, t, 'f');
+ let r = n(),
+ {id: a, kind: o, instructions: s} = j(this, qn, 'f');
+ j(this, ca, 'f').set(a, {
+ kind: o,
+ id: a,
+ instructions: s,
+ terminal: r,
+ preds: new Set(),
+ phis: new Set(),
+ }),
+ at(this, qn, i, 'f');
+ }
+ enter(t, n) {
+ let i = this.reserve(t);
+ return this.enterReserved(i, () => n(i.id)), i.id;
+ }
+ label(t, n, i) {
+ j(this, lr, 'f').push({kind: 'label', breakBlock: n, label: t});
+ let r = i(),
+ a = j(this, lr, 'f').pop();
+ return (
+ D.invariant(
+ a != null &&
+ a.kind === 'label' &&
+ a.label === t &&
+ a.breakBlock === n,
+ {
+ reason: 'Mismatched label',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }
+ ),
+ r
+ );
+ }
+ switch(t, n, i) {
+ j(this, lr, 'f').push({kind: 'switch', breakBlock: n, label: t});
+ let r = i(),
+ a = j(this, lr, 'f').pop();
+ return (
+ D.invariant(
+ a != null &&
+ a.kind === 'switch' &&
+ a.label === t &&
+ a.breakBlock === n,
+ {
+ reason: 'Mismatched label',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }
+ ),
+ r
+ );
+ }
+ loop(t, n, i, r) {
+ j(this, lr, 'f').push({
+ kind: 'loop',
+ label: t,
+ continueBlock: n,
+ breakBlock: i,
+ });
+ let a = r(),
+ o = j(this, lr, 'f').pop();
+ return (
+ D.invariant(
+ o != null &&
+ o.kind === 'loop' &&
+ o.label === t &&
+ o.continueBlock === n &&
+ o.breakBlock === i,
+ {
+ reason: 'Mismatched loops',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }
+ ),
+ a
+ );
+ }
+ lookupBreak(t) {
+ for (let n = j(this, lr, 'f').length - 1; n >= 0; n--) {
+ let i = j(this, lr, 'f')[n];
+ if (
+ (t === null && (i.kind === 'loop' || i.kind === 'switch')) ||
+ t === i.label
+ )
+ return i.breakBlock;
+ }
+ D.invariant(!1, {
+ reason: 'Expected a loop or switch to be in scope',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ }
+ lookupContinue(t) {
+ for (let n = j(this, lr, 'f').length - 1; n >= 0; n--) {
+ let i = j(this, lr, 'f')[n];
+ if (i.kind === 'loop') {
+ if (t === null || t === i.label) return i.continueBlock;
+ } else
+ t !== null &&
+ i.label === t &&
+ D.invariant(!1, {
+ reason: 'Continue may only refer to a labeled loop',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ }
+ D.invariant(!1, {
+ reason: 'Expected a loop to be in scope',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ }
+ };
+ (ca = new WeakMap()),
+ (qn = new WeakMap()),
+ (fu = new WeakMap()),
+ (lr = new WeakMap()),
+ (Rp = new WeakMap()),
+ (Va = new WeakMap()),
+ (mr = new WeakMap()),
+ (Ja = new WeakMap()),
+ (Np = new WeakSet()),
+ (av = function (t) {
+ let n = t.node.name,
+ i = t.scope.getBinding(n);
+ return i ?? null;
+ });
+ function bh(e) {
+ for (let [, t] of e.blocks)
+ t.terminal.kind === 'for' &&
+ t.terminal.update !== null &&
+ !e.blocks.has(t.terminal.update) &&
+ (t.terminal.update = null);
+ }
+ function kh(e) {
+ let t = new Set();
+ for (let [n, i] of e.blocks) t.add(i.id);
+ for (let [n, i] of e.blocks)
+ i.terminal.kind === 'do-while' &&
+ (t.has(i.terminal.test) ||
+ (i.terminal = {
+ kind: 'goto',
+ block: i.terminal.loop,
+ variant: St.Break,
+ id: i.terminal.id,
+ loc: i.terminal.loc,
+ }));
+ }
+ function Pa(e) {
+ let t = hI(e);
+ e.blocks = t;
+ }
+ function hI(e) {
+ let t = new Set(),
+ n = new Set(),
+ i = new Set(),
+ r = [];
+ function a(s, l) {
+ let d = n.has(s),
+ u = t.has(s);
+ if ((t.add(s), l && n.add(s), u && (d || !l))) return;
+ let p = e.blocks.get(s);
+ D.invariant(p != null, {
+ reason: '[HIRBuilder] Unexpected null block',
+ description: `expected block ${s} to exist`,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let y = [...go(p.terminal)].reverse(),
+ m = Ju(p.terminal);
+ m != null && (l && i.add(m), a(m, !1));
+ for (let g of y) a(g, l);
+ u || r.push(s);
+ }
+ a(e.entry, !0);
+ let o = new Map();
+ for (let s of r.reverse()) {
+ let l = e.blocks.get(s);
+ n.has(s)
+ ? o.set(s, e.blocks.get(s))
+ : i.has(s) &&
+ o.set(
+ s,
+ Object.assign(Object.assign({}, l), {
+ instructions: [],
+ terminal: {
+ kind: 'unreachable',
+ id: l.terminal.id,
+ loc: l.terminal.loc,
+ },
+ })
+ );
+ }
+ return o;
+ }
+ function fr(e) {
+ let t = 0,
+ n = new Set();
+ for (let [i, r] of e.blocks) {
+ for (let a of r.instructions)
+ D.invariant(!n.has(a), {
+ reason: `${Vm(a)} already visited!`,
+ description: null,
+ details: [{kind: 'error', loc: a.loc, message: null}],
+ suggestions: null,
+ }),
+ n.add(a),
+ (a.id = V(++t));
+ r.terminal.id = V(++t);
+ }
+ }
+ function xa(e) {
+ for (let [, i] of e.blocks) i.preds.clear();
+ let t = new Set();
+ function n(i, r) {
+ let a = e.blocks.get(i);
+ if (
+ a == null ||
+ (D.invariant(a != null, {
+ reason: 'unexpected missing block',
+ description: `block ${i}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ r && a.preds.add(r.id),
+ t.has(i))
+ )
+ return;
+ t.add(i);
+ let {terminal: o} = a;
+ for (let s of go(o)) n(s, a);
+ }
+ n(e.entry, null);
+ }
+ function Sh(e) {
+ for (let [, t] of e.blocks)
+ if (t.terminal.kind === 'try' && !e.blocks.has(t.terminal.handler)) {
+ let n = t.terminal.handler,
+ i = t.terminal.fallthrough,
+ r = e.blocks.get(i);
+ (t.terminal = {
+ kind: 'goto',
+ block: t.terminal.block,
+ id: V(0),
+ loc: t.terminal.loc,
+ variant: St.Break,
+ }),
+ r != null &&
+ (r.preds.size === 1 && r.preds.has(n)
+ ? e.blocks.delete(i)
+ : r.preds.delete(n));
+ }
+ }
+ function _t(e, t) {
+ return {
+ kind: 'Identifier',
+ identifier: Du(e.nextIdentifierId, t),
+ reactive: !1,
+ effect: x.Unknown,
+ loc: F,
+ };
+ }
+ function RB(e, t) {
+ let n = _t(e, t.loc);
+ return (
+ (n.effect = t.effect),
+ (n.identifier.type = t.identifier.type),
+ (n.reactive = t.reactive),
+ n
+ );
+ }
+ function _h(e) {
+ var t, n;
+ for (let [, i] of e.blocks) {
+ let r = i.terminal;
+ if (r.kind === 'scope' || r.kind === 'pruned-scope') {
+ let a = e.blocks.get(r.fallthrough),
+ o =
+ (n =
+ (t = a.instructions[0]) === null || t === void 0
+ ? void 0
+ : t.id) !== null && n !== void 0
+ ? n
+ : a.terminal.id;
+ (r.scope.range.start = r.id), (r.scope.range.end = o);
+ }
+ }
+ }
+ var Vt = {kind: 'Primitive'},
+ LB = 0;
+ function Th() {
+ return ``;
+ }
+ function ue(e, t, n, i = null, r = !1) {
+ let a = i ?? Th(),
+ o = n.aliasing != null ? bI(n.aliasing, '', F) : null;
+ return (
+ Eh(
+ e,
+ a,
+ t,
+ Object.assign(Object.assign({}, n), {aliasing: o, hookKind: null})
+ ),
+ {kind: 'Function', return: n.returnType, shapeId: a, isConstructor: r}
+ );
+ }
+ function fn(e, t, n = null) {
+ let i = n ?? Th(),
+ r = t.aliasing != null ? bI(t.aliasing, '', F) : null;
+ return (
+ Eh(e, i, [], Object.assign(Object.assign({}, t), {aliasing: r})),
+ {kind: 'Function', return: t.returnType, shapeId: i, isConstructor: !1}
+ );
+ }
+ function bI(e, t, n) {
+ let i = new Map();
+ function r(y) {
+ D.invariant(!i.has(y), {
+ reason: 'Invalid type configuration for module',
+ description: `Expected aliasing signature to have unique names for receiver, params, rest, returns, and temporaries in module '${t}'`,
+ details: [{kind: 'error', loc: n, message: null}],
+ });
+ let m = WB(i.size);
+ return i.set(y, m), m;
+ }
+ function a(y) {
+ let m = i.get(y);
+ return (
+ D.invariant(m != null, {
+ reason: 'Invalid type configuration for module',
+ description: `Expected aliasing signature effects to reference known names from receiver/params/rest/returns/temporaries, but '${y}' is not a known name in '${t}'`,
+ details: [{kind: 'error', loc: n, message: null}],
+ }),
+ m
+ );
+ }
+ let o = r(e.receiver),
+ s = e.params.map(r),
+ l = e.rest != null ? r(e.rest) : null,
+ d = r(e.returns),
+ u = e.temporaries.map(r),
+ p = e.effects.map((y) => {
+ switch (y.kind) {
+ case 'ImmutableCapture':
+ case 'CreateFrom':
+ case 'Capture':
+ case 'Alias':
+ case 'Assign': {
+ let m = a(y.from),
+ g = a(y.into);
+ return {kind: y.kind, from: m, into: g};
+ }
+ case 'Mutate':
+ case 'MutateTransitiveConditionally': {
+ let m = a(y.value);
+ return {kind: y.kind, value: m};
+ }
+ case 'Create':
+ return {
+ kind: 'Create',
+ into: a(y.into),
+ reason: y.reason,
+ value: y.value,
+ };
+ case 'Freeze':
+ return {kind: 'Freeze', value: a(y.value), reason: y.reason};
+ case 'Impure':
+ return {
+ kind: 'Impure',
+ place: a(y.place),
+ error: D.throwTodo({
+ reason: 'Support impure effect declarations',
+ loc: F,
+ }),
+ };
+ case 'Apply': {
+ let m = a(y.receiver),
+ g = a(y.function),
+ S = y.args.map((O) =>
+ typeof O == 'string'
+ ? a(O)
+ : O.kind === 'Spread'
+ ? {kind: 'Spread', place: a(O.place)}
+ : O
+ ),
+ _ = a(y.into);
+ return {
+ kind: 'Apply',
+ receiver: m,
+ function: g,
+ mutatesFunction: y.mutatesFunction,
+ args: S,
+ into: _,
+ loc: n,
+ signature: null,
+ };
+ }
+ default:
+ Me(y, `Unexpected effect kind '${y.kind}'`);
+ }
+ });
+ return {
+ receiver: o.identifier.id,
+ params: s.map((y) => y.identifier.id),
+ rest: l != null ? l.identifier.id : null,
+ returns: d.identifier.id,
+ temporaries: u,
+ effects: p,
+ };
+ }
+ function Ut(e, t, n) {
+ let i = t ?? Th();
+ return Eh(e, i, n, null), {kind: 'Object', shapeId: i};
+ }
+ function Eh(e, t, n, i) {
+ let r = {properties: new Map(n), functionType: i};
+ return (
+ D.invariant(!e.has(t), {
+ reason: `[ObjectShape] Could not add shape to registry: name ${t} already exists.`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e.set(t, r),
+ r
+ );
+ }
+ var kI = 'BuiltInProps',
+ Ht = 'BuiltInArray',
+ Ha = 'BuiltInSet',
+ ov = 'BuiltInMap',
+ sv = 'BuiltInWeakSet',
+ lv = 'BuiltInWeakMap',
+ Ih = 'BuiltInFunction',
+ Ph = 'BuiltInJsx',
+ Jm = 'BuiltInObject',
+ SI = 'BuiltInUseState',
+ _I = 'BuiltInSetState',
+ TI = 'BuiltInUseActionState',
+ FB = 'BuiltInSetActionState',
+ ia = 'BuiltInUseRefId',
+ Pm = 'BuiltInRefValue',
+ ea = 'BuiltInMixedReadonly',
+ zB = 'BuiltInUseEffectHook',
+ BB = 'BuiltInUseLayoutEffectHook',
+ UB = 'BuiltInUseInsertionEffectHook',
+ ZB = 'BuiltInUseOperator',
+ EI = 'BuiltInUseReducer',
+ qB = 'BuiltInDispatch',
+ KB = 'BuiltInUseContextHook',
+ II = 'BuiltInUseTransition',
+ VB = 'BuiltInStartTransition',
+ xh = 'BuiltInFire',
+ PI = 'BuiltInFireFunction',
+ JB = 'BuiltInUseEffectEvent',
+ xI = 'BuiltInEffectEventFunction',
+ wI = 'BuiltInAutoDepsId',
+ OI = 'ReanimatedSharedValueId',
+ Oe = new Map();
+ Ut(Oe, kI, [['ref', {kind: 'Object', shapeId: ia}]]);
+ Ut(Oe, Ht, [
+ [
+ 'indexOf',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'includes',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'pop',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Store,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'at',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'concat',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Capture,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ['length', Vt],
+ [
+ 'push',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Capture,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ aliasing: {
+ receiver: '@receiver',
+ params: [],
+ rest: '@rest',
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {kind: 'Mutate', value: '@receiver'},
+ {kind: 'Capture', from: '@rest', into: '@receiver'},
+ {
+ kind: 'Create',
+ into: '@returns',
+ value: z.Primitive,
+ reason: qe.KnownReturnSignature,
+ },
+ ],
+ },
+ }),
+ ],
+ [
+ 'slice',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'map',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ aliasing: {
+ receiver: '@receiver',
+ params: ['@callback'],
+ rest: null,
+ returns: '@returns',
+ temporaries: ['@item', '@callbackReturn', '@thisArg'],
+ effects: [
+ {
+ kind: 'Create',
+ into: '@returns',
+ value: z.Mutable,
+ reason: qe.KnownReturnSignature,
+ },
+ {kind: 'CreateFrom', from: '@receiver', into: '@item'},
+ {
+ kind: 'Create',
+ into: '@thisArg',
+ value: z.Primitive,
+ reason: qe.KnownReturnSignature,
+ },
+ {
+ kind: 'Apply',
+ receiver: '@thisArg',
+ args: ['@item', {kind: 'Hole'}, '@receiver'],
+ function: '@callback',
+ into: '@callbackReturn',
+ mutatesFunction: !1,
+ },
+ {kind: 'Capture', from: '@callbackReturn', into: '@returns'},
+ ],
+ },
+ }),
+ ],
+ [
+ 'flatMap',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'filter',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'every',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'some',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'find',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'findIndex',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'join',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ]);
+ Ut(Oe, Jm, [
+ [
+ 'toString',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ]);
+ Ut(Oe, Ha, [
+ [
+ 'add',
+ ue(Oe, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ha},
+ calleeEffect: x.Store,
+ returnValueKind: z.Mutable,
+ aliasing: {
+ receiver: '@receiver',
+ params: [],
+ rest: '@rest',
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {kind: 'Assign', from: '@receiver', into: '@returns'},
+ {kind: 'Mutate', value: '@receiver'},
+ {kind: 'Capture', from: '@rest', into: '@receiver'},
+ ],
+ },
+ }),
+ ],
+ [
+ 'clear',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'delete',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'has',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ['size', Vt],
+ [
+ 'difference',
+ ue(Oe, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ha},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'union',
+ ue(Oe, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ha},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'symmetricalDifference',
+ ue(Oe, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ha},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'isSubsetOf',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'isSupersetOf',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'forEach',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: Vt,
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'entries',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'keys',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'values',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ]);
+ Ut(Oe, ov, [
+ [
+ 'clear',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'delete',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'get',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'has',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'set',
+ ue(Oe, [], {
+ positionalParams: [x.Capture, x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: ov},
+ calleeEffect: x.Store,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ['size', Vt],
+ [
+ 'forEach',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: Vt,
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'entries',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'keys',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'values',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ]);
+ Ut(Oe, sv, [
+ [
+ 'add',
+ ue(Oe, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: sv},
+ calleeEffect: x.Store,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'delete',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'has',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ]);
+ Ut(Oe, lv, [
+ [
+ 'delete',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Store,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'get',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'has',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'set',
+ ue(Oe, [], {
+ positionalParams: [x.Capture, x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: lv},
+ calleeEffect: x.Store,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ]);
+ Ut(Oe, SI, [
+ ['0', {kind: 'Poly'}],
+ [
+ '1',
+ ue(
+ Oe,
+ [],
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ },
+ _I
+ ),
+ ],
+ ]);
+ Ut(Oe, II, [
+ ['0', {kind: 'Primitive'}],
+ [
+ '1',
+ ue(
+ Oe,
+ [],
+ {
+ positionalParams: [],
+ restParam: null,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ },
+ VB
+ ),
+ ],
+ ]);
+ Ut(Oe, TI, [
+ ['0', {kind: 'Poly'}],
+ [
+ '1',
+ ue(
+ Oe,
+ [],
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ },
+ FB
+ ),
+ ],
+ ]);
+ Ut(Oe, EI, [
+ ['0', {kind: 'Poly'}],
+ [
+ '1',
+ ue(
+ Oe,
+ [],
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ },
+ qB
+ ),
+ ],
+ ]);
+ Ut(Oe, ia, [['current', {kind: 'Object', shapeId: Pm}]]);
+ Ut(Oe, Pm, [['*', {kind: 'Object', shapeId: Pm}]]);
+ Ut(Oe, OI, []);
+ ue(
+ Oe,
+ [],
+ {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ },
+ xI
+ );
+ Ut(Oe, ea, [
+ [
+ 'toString',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'indexOf',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'includes',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'at',
+ ue(Oe, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: ea},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'map',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ }),
+ ],
+ [
+ 'flatMap',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ }),
+ ],
+ [
+ 'filter',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ }),
+ ],
+ [
+ 'concat',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Capture,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'slice',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Capture,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'every',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'some',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'find',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Object', shapeId: ea},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Frozen,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'findIndex',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.ConditionallyMutate,
+ returnValueKind: z.Primitive,
+ noAlias: !0,
+ mutableOnlyIfOperandsAreMutable: !0,
+ }),
+ ],
+ [
+ 'join',
+ ue(Oe, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: Vt,
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ['*', {kind: 'Object', shapeId: ea}],
+ ]);
+ Ut(Oe, Ph, []);
+ Ut(Oe, Ih, []);
+ var HB = fn(
+ Oe,
+ {
+ positionalParams: [],
+ restParam: x.ConditionallyMutate,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'Custom',
+ returnValueKind: z.Mutable,
+ },
+ 'DefaultMutatingHook'
+ ),
+ $I = fn(
+ Oe,
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'Custom',
+ returnValueKind: z.Frozen,
+ aliasing: {
+ receiver: '@receiver',
+ params: [],
+ rest: '@rest',
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {kind: 'Freeze', value: '@rest', reason: qe.HookCaptured},
+ {
+ kind: 'Create',
+ into: '@returns',
+ value: z.Frozen,
+ reason: qe.HookReturn,
+ },
+ {kind: 'Alias', from: '@rest', into: '@returns'},
+ ],
+ },
+ },
+ 'DefaultNonmutatingHook'
+ );
+ function WB(e) {
+ return {
+ kind: 'Identifier',
+ effect: x.Unknown,
+ loc: F,
+ reactive: !1,
+ identifier: {
+ declarationId: gh(e),
+ id: yh(e),
+ loc: F,
+ mutableRange: {start: V(0), end: V(0)},
+ name: null,
+ scope: null,
+ type: Gn(),
+ },
+ };
+ }
+ function jI(e, t, n = null, i = new Map()) {
+ var r, a, o;
+ let s = new Im(t, {bindings: n, context: i}),
+ l = [];
+ for (let [g, S] of i ?? [])
+ l.push({
+ kind: 'Identifier',
+ identifier: s.resolveBinding(g),
+ effect: x.Unknown,
+ reactive: !1,
+ loc: S,
+ });
+ let d = null;
+ if (e.isFunctionDeclaration() || e.isFunctionExpression()) {
+ let g = e.get('id');
+ Wi(g) && (d = g.node.name);
+ }
+ let u = [];
+ e.get('params').forEach((g) => {
+ var S, _, O, P, M, w, I, U, A;
+ if (g.isIdentifier()) {
+ let q = s.resolveIdentifier(g);
+ if (q.kind !== 'Identifier') {
+ s.errors.pushDiagnostic(
+ Tt.create({
+ category: K.Invariant,
+ reason: 'Could not find binding',
+ description: `[BuildHIR] Could not find binding for param \`${g.node.name}\``,
+ }).withDetails({
+ kind: 'error',
+ loc: (S = g.node.loc) !== null && S !== void 0 ? S : null,
+ message: 'Could not find binding',
+ })
+ );
+ return;
+ }
+ let ae = {
+ kind: 'Identifier',
+ identifier: q.identifier,
+ effect: x.Unknown,
+ reactive: !1,
+ loc: (_ = g.node.loc) !== null && _ !== void 0 ? _ : F,
+ };
+ u.push(ae);
+ } else if (
+ g.isObjectPattern() ||
+ g.isArrayPattern() ||
+ g.isAssignmentPattern()
+ ) {
+ let q = {
+ kind: 'Identifier',
+ identifier: s.makeTemporary(
+ (O = g.node.loc) !== null && O !== void 0 ? O : F
+ ),
+ effect: x.Unknown,
+ reactive: !1,
+ loc: (P = g.node.loc) !== null && P !== void 0 ? P : F,
+ };
+ $n(q.identifier),
+ u.push(q),
+ Wn(
+ s,
+ (M = g.node.loc) !== null && M !== void 0 ? M : F,
+ Q.Let,
+ g,
+ q,
+ 'Assignment'
+ );
+ } else if (g.isRestElement()) {
+ let q = {
+ kind: 'Identifier',
+ identifier: s.makeTemporary(
+ (w = g.node.loc) !== null && w !== void 0 ? w : F
+ ),
+ effect: x.Unknown,
+ reactive: !1,
+ loc: (I = g.node.loc) !== null && I !== void 0 ? I : F,
+ };
+ u.push({kind: 'Spread', place: q}),
+ Wn(
+ s,
+ (U = g.node.loc) !== null && U !== void 0 ? U : F,
+ Q.Let,
+ g.get('argument'),
+ q,
+ 'Assignment'
+ );
+ } else
+ s.errors.pushDiagnostic(
+ Tt.create({
+ category: K.Todo,
+ reason: `Handle ${g.node.type} parameters`,
+ description: `[BuildHIR] Add support for ${g.node.type} parameters`,
+ }).withDetails({
+ kind: 'error',
+ loc: (A = g.node.loc) !== null && A !== void 0 ? A : null,
+ message: 'Unsupported parameter type',
+ })
+ );
+ });
+ let p = [],
+ y = e.get('body');
+ if (y.isExpression()) {
+ let g = s.reserve('block'),
+ S = {
+ kind: 'return',
+ returnVariant: 'Implicit',
+ loc: F,
+ value: ut(s, y),
+ id: V(0),
+ effects: null,
+ };
+ s.terminateWithContinuation(S, g);
+ } else
+ y.isBlockStatement()
+ ? (Pn(s, y), (p = y.get('directives').map((g) => g.node.value.value)))
+ : s.errors.pushDiagnostic(
+ Tt.create({
+ category: K.Syntax,
+ reason: 'Unexpected function body kind',
+ description: `Expected function body to be an expression or a block statement, got \`${y.type}\``,
+ }).withDetails({
+ kind: 'error',
+ loc: (r = y.node.loc) !== null && r !== void 0 ? r : null,
+ message: 'Expected a block statement or expression',
+ })
+ );
+ let m = null;
+ if (d != null) {
+ let g = W0(d);
+ g.isErr() ? s.errors.merge(g.unwrapErr()) : (m = g.unwrap().value);
+ }
+ return s.errors.hasAnyErrors()
+ ? gr(s.errors)
+ : (s.terminate(
+ {
+ kind: 'return',
+ returnVariant: 'Void',
+ loc: F,
+ value: Fe(s, {kind: 'Primitive', value: void 0, loc: F}),
+ id: V(0),
+ effects: null,
+ },
+ null
+ ),
+ zn({
+ id: m,
+ nameHint: null,
+ params: u,
+ fnType: n == null ? t.fnType : 'Other',
+ returnTypeAnnotation: null,
+ returns: _t(t, (a = e.node.loc) !== null && a !== void 0 ? a : F),
+ body: s.build(),
+ context: l,
+ generator: e.node.generator === !0,
+ async: e.node.async === !0,
+ loc: (o = e.node.loc) !== null && o !== void 0 ? o : F,
+ env: t,
+ effects: null,
+ aliasingEffects: null,
+ directives: p,
+ }));
+ }
+ function Pn(e, t, n = null) {
+ var i,
+ r,
+ a,
+ o,
+ s,
+ l,
+ d,
+ u,
+ p,
+ y,
+ m,
+ g,
+ S,
+ _,
+ O,
+ P,
+ M,
+ w,
+ I,
+ U,
+ A,
+ q,
+ ae,
+ le,
+ G,
+ ve,
+ de,
+ oe,
+ be,
+ $e,
+ Ie,
+ Pe,
+ ke,
+ je,
+ Ae,
+ Ye,
+ bt,
+ st,
+ tt,
+ yt,
+ dt,
+ qt,
+ J,
+ Xe,
+ it,
+ mt,
+ Et,
+ ft,
+ De,
+ Y,
+ ce,
+ Ze,
+ Ne,
+ X,
+ ee,
+ ge,
+ fe,
+ we,
+ me,
+ ze,
+ Ce;
+ let lt = t.node;
+ switch (lt.type) {
+ case 'ThrowStatement': {
+ let ne = t,
+ he = ut(e, ne.get('argument'));
+ e.resolveThrowHandler() != null &&
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerStatement) Support ThrowStatement inside of try/catch',
+ category: K.Todo,
+ loc: (i = ne.node.loc) !== null && i !== void 0 ? i : null,
+ suggestions: null,
+ });
+ let Ge = {
+ kind: 'throw',
+ value: he,
+ id: V(0),
+ loc: (r = ne.node.loc) !== null && r !== void 0 ? r : F,
+ };
+ e.terminate(Ge, 'block');
+ return;
+ }
+ case 'ReturnStatement': {
+ let ne = t,
+ he = ne.get('argument'),
+ Ke;
+ he.node === null
+ ? (Ke = Fe(e, {kind: 'Primitive', value: void 0, loc: F}))
+ : (Ke = ut(e, he));
+ let Ge = {
+ kind: 'return',
+ returnVariant: 'Explicit',
+ loc: (a = ne.node.loc) !== null && a !== void 0 ? a : F,
+ value: Ke,
+ id: V(0),
+ effects: null,
+ };
+ e.terminate(Ge, 'block');
+ return;
+ }
+ case 'IfStatement': {
+ let ne = t,
+ he = e.reserve('block'),
+ Ke = e.enter('block', (pt) => {
+ var Ve;
+ let et = ne.get('consequent');
+ return (
+ Pn(e, et),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (Ve = et.node.loc) !== null && Ve !== void 0 ? Ve : F,
+ }
+ );
+ }),
+ Ge,
+ Qe = ne.get('alternate');
+ Wi(Qe)
+ ? (Ge = e.enter('block', (pt) => {
+ var Ve, et;
+ return (
+ Pn(e, Qe),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Break,
+ id: V(0),
+ loc:
+ (et =
+ (Ve = Qe.node) === null || Ve === void 0
+ ? void 0
+ : Ve.loc) !== null && et !== void 0
+ ? et
+ : F,
+ }
+ );
+ }))
+ : (Ge = he.id);
+ let It = {
+ kind: 'if',
+ test: ut(e, ne.get('test')),
+ consequent: Ke,
+ alternate: Ge,
+ fallthrough: he.id,
+ id: V(0),
+ loc: (o = ne.node.loc) !== null && o !== void 0 ? o : F,
+ };
+ e.terminateWithContinuation(It, he);
+ return;
+ }
+ case 'BlockStatement': {
+ let ne = t,
+ he = ne.get('body'),
+ Ke = new Set();
+ for (let [, Ge] of Object.entries(ne.scope.bindings))
+ Ge.kind !== 'param' && Ke.add(Ge.identifier);
+ for (let Ge of he) {
+ let Qe = new Set(),
+ se = Ge.isFunctionDeclaration() ? 1 : 0,
+ It = {
+ enter: () => {
+ se++;
+ },
+ exit: () => {
+ se--;
+ },
+ };
+ Ge.traverse({
+ FunctionExpression: It,
+ FunctionDeclaration: It,
+ ArrowFunctionExpression: It,
+ ObjectMethod: It,
+ Identifier(pt) {
+ if (
+ !pt.isReferencedIdentifier() &&
+ pt.parent.type !== 'AssignmentExpression'
+ )
+ return;
+ let et = pt.scope.getBinding(pt.node.name);
+ et != null &&
+ Ke.has(et.identifier) &&
+ (se > 0 || et.kind === 'hoisted') &&
+ Qe.add(pt);
+ },
+ }),
+ Ge.traverse({
+ Identifier(pt) {
+ Ke.has(pt.node) && Ke.delete(pt.node);
+ },
+ });
+ for (let pt of Qe) {
+ let Ve = ne.scope.getBinding(pt.node.name);
+ if (
+ (D.invariant(Ve != null, {
+ reason: 'Expected to find binding for hoisted identifier',
+ description: `Could not find a binding for ${pt.node.name}`,
+ suggestions: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (s = pt.node.loc) !== null && s !== void 0 ? s : F,
+ message: null,
+ },
+ ],
+ }),
+ e.environment.isHoistedIdentifier(Ve.identifier))
+ )
+ continue;
+ let et;
+ if (Ve.kind === 'const' || Ve.kind === 'var') et = Q.HoistedConst;
+ else if (Ve.kind === 'let') et = Q.HoistedLet;
+ else if (Ve.path.isFunctionDeclaration()) et = Q.HoistedFunction;
+ else if (Ve.path.isVariableDeclarator()) {
+ e.errors.push({
+ category: K.Todo,
+ reason: 'Handle non-const declarations for hoisting',
+ description: `variable "${Ve.identifier.name}" declared with ${Ve.kind}`,
+ suggestions: null,
+ loc:
+ (d = pt.parentPath.node.loc) !== null && d !== void 0 ? d : F,
+ });
+ continue;
+ } else {
+ e.errors.push({
+ category: K.Todo,
+ reason: 'Unsupported declaration type for hoisting',
+ description: `variable "${Ve.identifier.name}" declared with ${Ve.path.type}`,
+ suggestions: null,
+ loc:
+ (l = pt.parentPath.node.loc) !== null && l !== void 0 ? l : F,
+ });
+ continue;
+ }
+ let $t = e.resolveIdentifier(pt);
+ D.invariant($t.kind === 'Identifier', {
+ reason:
+ 'Expected hoisted binding to be a local identifier, not a global',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (u = pt.node.loc) !== null && u !== void 0 ? u : F,
+ message: null,
+ },
+ ],
+ });
+ let an = {
+ effect: x.Unknown,
+ identifier: $t.identifier,
+ kind: 'Identifier',
+ reactive: !1,
+ loc: (p = pt.node.loc) !== null && p !== void 0 ? p : F,
+ };
+ Fe(e, {
+ kind: 'DeclareContext',
+ lvalue: {kind: et, place: an},
+ loc: (y = pt.node.loc) !== null && y !== void 0 ? y : F,
+ }),
+ e.environment.addHoistedIdentifier(Ve.identifier);
+ }
+ Pn(e, Ge);
+ }
+ return;
+ }
+ case 'BreakStatement': {
+ let ne = t,
+ he = e.lookupBreak(
+ (g =
+ (m = ne.node.label) === null || m === void 0
+ ? void 0
+ : m.name) !== null && g !== void 0
+ ? g
+ : null
+ );
+ e.terminate(
+ {
+ kind: 'goto',
+ block: he,
+ variant: St.Break,
+ id: V(0),
+ loc: (S = ne.node.loc) !== null && S !== void 0 ? S : F,
+ },
+ 'block'
+ );
+ return;
+ }
+ case 'ContinueStatement': {
+ let ne = t,
+ he = e.lookupContinue(
+ (O =
+ (_ = ne.node.label) === null || _ === void 0
+ ? void 0
+ : _.name) !== null && O !== void 0
+ ? O
+ : null
+ );
+ e.terminate(
+ {
+ kind: 'goto',
+ block: he,
+ variant: St.Continue,
+ id: V(0),
+ loc: (P = ne.node.loc) !== null && P !== void 0 ? P : F,
+ },
+ 'block'
+ );
+ return;
+ }
+ case 'ForStatement': {
+ let ne = t,
+ he = e.reserve('loop'),
+ Ke = e.reserve('block'),
+ Ge = e.enter('loop', (Ve) => {
+ var et, $t, an, Jt;
+ let pn = ne.get('init');
+ return pn.isVariableDeclaration()
+ ? (Pn(e, pn),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (Jt = pn.node.loc) !== null && Jt !== void 0 ? Jt : F,
+ })
+ : (e.errors.push({
+ reason:
+ '(BuildHIR::lowerStatement) Handle non-variable initialization in ForStatement',
+ category: K.Todo,
+ loc: (et = ne.node.loc) !== null && et !== void 0 ? et : null,
+ suggestions: null,
+ }),
+ {
+ kind: 'unsupported',
+ id: V(0),
+ loc:
+ (an =
+ ($t = pn.node) === null || $t === void 0
+ ? void 0
+ : $t.loc) !== null && an !== void 0
+ ? an
+ : F,
+ });
+ }),
+ Qe = null,
+ se = ne.get('update');
+ Wi(se) &&
+ (Qe = e.enter('loop', (Ve) => {
+ var et, $t;
+ return (
+ ut(e, se),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Break,
+ id: V(0),
+ loc:
+ ($t =
+ (et = se.node) === null || et === void 0
+ ? void 0
+ : et.loc) !== null && $t !== void 0
+ ? $t
+ : F,
+ }
+ );
+ }));
+ let It = e.enter('block', (Ve) =>
+ e.loop(n, Qe ?? he.id, Ke.id, () => {
+ var et;
+ let $t = ne.get('body');
+ return (
+ Pn(e, $t),
+ {
+ kind: 'goto',
+ block: Qe ?? he.id,
+ variant: St.Continue,
+ id: V(0),
+ loc: (et = $t.node.loc) !== null && et !== void 0 ? et : F,
+ }
+ );
+ })
+ );
+ e.terminateWithContinuation(
+ {
+ kind: 'for',
+ loc: (M = lt.loc) !== null && M !== void 0 ? M : F,
+ init: Ge,
+ test: he.id,
+ update: Qe,
+ loop: It,
+ fallthrough: Ke.id,
+ id: V(0),
+ },
+ he
+ );
+ let pt = ne.get('test');
+ pt.node == null
+ ? e.errors.push({
+ reason:
+ '(BuildHIR::lowerStatement) Handle empty test in ForStatement',
+ category: K.Todo,
+ loc: (w = ne.node.loc) !== null && w !== void 0 ? w : null,
+ suggestions: null,
+ })
+ : e.terminateWithContinuation(
+ {
+ kind: 'branch',
+ test: ut(e, pt),
+ consequent: It,
+ alternate: Ke.id,
+ fallthrough: Ke.id,
+ id: V(0),
+ loc: (I = ne.node.loc) !== null && I !== void 0 ? I : F,
+ },
+ Ke
+ );
+ return;
+ }
+ case 'WhileStatement': {
+ let ne = t,
+ he = e.reserve('loop'),
+ Ke = e.reserve('block'),
+ Ge = e.enter('block', (pt) =>
+ e.loop(n, he.id, Ke.id, () => {
+ var Ve;
+ let et = ne.get('body');
+ return (
+ Pn(e, et),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Continue,
+ id: V(0),
+ loc: (Ve = et.node.loc) !== null && Ve !== void 0 ? Ve : F,
+ }
+ );
+ })
+ ),
+ Qe = (U = ne.node.loc) !== null && U !== void 0 ? U : F;
+ e.terminateWithContinuation(
+ {
+ kind: 'while',
+ loc: Qe,
+ test: he.id,
+ loop: Ge,
+ fallthrough: Ke.id,
+ id: V(0),
+ },
+ he
+ );
+ let It = {
+ kind: 'branch',
+ test: ut(e, ne.get('test')),
+ consequent: Ge,
+ alternate: Ke.id,
+ fallthrough: he.id,
+ id: V(0),
+ loc: (A = ne.node.loc) !== null && A !== void 0 ? A : F,
+ };
+ e.terminateWithContinuation(It, Ke);
+ return;
+ }
+ case 'LabeledStatement': {
+ let ne = t,
+ he = ne.node.label.name;
+ switch (ne.get('body').node.type) {
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ case 'ForStatement':
+ case 'WhileStatement':
+ case 'DoWhileStatement': {
+ Pn(e, ne.get('body'), he);
+ break;
+ }
+ default: {
+ let Ge = e.reserve('block'),
+ Qe = e.enter('block', () => {
+ var se;
+ let It = ne.get('body');
+ return (
+ e.label(he, Ge.id, () => {
+ Pn(e, It);
+ }),
+ {
+ kind: 'goto',
+ block: Ge.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (se = It.node.loc) !== null && se !== void 0 ? se : F,
+ }
+ );
+ });
+ e.terminateWithContinuation(
+ {
+ kind: 'label',
+ block: Qe,
+ fallthrough: Ge.id,
+ id: V(0),
+ loc: (q = ne.node.loc) !== null && q !== void 0 ? q : F,
+ },
+ Ge
+ );
+ }
+ }
+ return;
+ }
+ case 'SwitchStatement': {
+ let ne = t,
+ he = e.reserve('block'),
+ Ke = he.id,
+ Ge = [],
+ Qe = !1;
+ for (let It = ne.get('cases').length - 1; It >= 0; It--) {
+ let pt = ne.get('cases')[It],
+ Ve = pt.get('test');
+ if (Ve.node == null) {
+ if (Qe) {
+ e.errors.push({
+ reason:
+ 'Expected at most one `default` branch in a switch statement, this code should have failed to parse',
+ category: K.Syntax,
+ loc: (ae = pt.node.loc) !== null && ae !== void 0 ? ae : null,
+ suggestions: null,
+ });
+ break;
+ }
+ Qe = !0;
+ }
+ let et = e.enter('block', (an) =>
+ e.switch(n, he.id, () => {
+ var Jt;
+ return (
+ pt.get('consequent').forEach((pn) => Pn(e, pn)),
+ {
+ kind: 'goto',
+ block: Ke,
+ variant: St.Break,
+ id: V(0),
+ loc: (Jt = pt.node.loc) !== null && Jt !== void 0 ? Jt : F,
+ }
+ );
+ })
+ ),
+ $t = null;
+ Wi(Ve) && ($t = DI(e, Ve)), Ge.push({test: $t, block: et}), (Ke = et);
+ }
+ Ge.reverse(), Qe || Ge.push({test: null, block: he.id});
+ let se = ut(e, ne.get('discriminant'));
+ e.terminateWithContinuation(
+ {
+ kind: 'switch',
+ test: se,
+ cases: Ge,
+ fallthrough: he.id,
+ id: V(0),
+ loc: (le = ne.node.loc) !== null && le !== void 0 ? le : F,
+ },
+ he
+ );
+ return;
+ }
+ case 'VariableDeclaration': {
+ let ne = t,
+ he = ne.node.kind;
+ if (he === 'var') {
+ e.errors.push({
+ reason: `(BuildHIR::lowerStatement) Handle ${he} kinds in VariableDeclaration`,
+ category: K.Todo,
+ loc: (G = ne.node.loc) !== null && G !== void 0 ? G : null,
+ suggestions: null,
+ });
+ return;
+ }
+ let Ke = he === 'let' ? Q.Let : Q.Const;
+ for (let Ge of ne.get('declarations')) {
+ let Qe = Ge.get('id'),
+ se = Ge.get('init');
+ if (Wi(se)) {
+ let It = ut(e, se);
+ Wn(
+ e,
+ (ve = ne.node.loc) !== null && ve !== void 0 ? ve : F,
+ Ke,
+ Qe,
+ It,
+ Qe.isObjectPattern() || Qe.isArrayPattern()
+ ? 'Destructure'
+ : 'Assignment'
+ );
+ } else if (Qe.isIdentifier()) {
+ let It = e.resolveIdentifier(Qe);
+ if (It.kind !== 'Identifier')
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerAssignment) Could not find binding for declaration.',
+ category: K.Invariant,
+ loc: (de = Qe.node.loc) !== null && de !== void 0 ? de : null,
+ suggestions: null,
+ });
+ else {
+ let pt = {
+ effect: x.Unknown,
+ identifier: It.identifier,
+ kind: 'Identifier',
+ reactive: !1,
+ loc: (oe = Qe.node.loc) !== null && oe !== void 0 ? oe : F,
+ };
+ if (e.isContextIdentifier(Qe)) {
+ if (Ke === Q.Const) {
+ let Ve = Ge.parentPath.node.start;
+ e.errors.push({
+ reason: 'Expect `const` declaration not to be reassigned',
+ category: K.Syntax,
+ loc:
+ (be = Qe.node.loc) !== null && be !== void 0 ? be : null,
+ suggestions: [
+ {
+ description: 'Change to a `let` declaration',
+ op: _i.Replace,
+ range: [Ve, Ve + 5],
+ text: 'let',
+ },
+ ],
+ });
+ }
+ Fe(e, {
+ kind: 'DeclareContext',
+ lvalue: {kind: Q.Let, place: pt},
+ loc: ($e = Qe.node.loc) !== null && $e !== void 0 ? $e : F,
+ });
+ } else {
+ let Ve = Qe.get('typeAnnotation'),
+ et;
+ Ve.isTSTypeAnnotation() || Ve.isTypeAnnotation()
+ ? (et = Ve.get('typeAnnotation').node)
+ : (et = null),
+ Fe(e, {
+ kind: 'DeclareLocal',
+ lvalue: {kind: Ke, place: pt},
+ type: et,
+ loc: (Ie = Qe.node.loc) !== null && Ie !== void 0 ? Ie : F,
+ });
+ }
+ }
+ } else
+ e.errors.push({
+ reason:
+ 'Expected variable declaration to be an identifier if no initializer was provided',
+ description: `Got a \`${Qe.type}\``,
+ category: K.Syntax,
+ loc: (Pe = ne.node.loc) !== null && Pe !== void 0 ? Pe : null,
+ suggestions: null,
+ });
+ }
+ return;
+ }
+ case 'ExpressionStatement': {
+ let he = t.get('expression');
+ ut(e, he);
+ return;
+ }
+ case 'DoWhileStatement': {
+ let ne = t,
+ he = e.reserve('loop'),
+ Ke = e.reserve('block'),
+ Ge = e.enter('block', (pt) =>
+ e.loop(n, he.id, Ke.id, () => {
+ var Ve;
+ let et = ne.get('body');
+ return (
+ Pn(e, et),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Continue,
+ id: V(0),
+ loc: (Ve = et.node.loc) !== null && Ve !== void 0 ? Ve : F,
+ }
+ );
+ })
+ ),
+ Qe = (ke = ne.node.loc) !== null && ke !== void 0 ? ke : F;
+ e.terminateWithContinuation(
+ {
+ kind: 'do-while',
+ loc: Qe,
+ test: he.id,
+ loop: Ge,
+ fallthrough: Ke.id,
+ id: V(0),
+ },
+ he
+ );
+ let It = {
+ kind: 'branch',
+ test: ut(e, ne.get('test')),
+ consequent: Ge,
+ alternate: Ke.id,
+ fallthrough: he.id,
+ id: V(0),
+ loc: Qe,
+ };
+ e.terminateWithContinuation(It, Ke);
+ return;
+ }
+ case 'FunctionDeclaration': {
+ let ne = t;
+ ne.skip(),
+ D.invariant(ne.get('id').type === 'Identifier', {
+ reason: 'function declarations must have a name',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (je = ne.node.loc) !== null && je !== void 0 ? je : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let he = ne.get('id'),
+ Ke = Fe(e, MI(e, ne));
+ Wn(
+ e,
+ (Ae = ne.node.loc) !== null && Ae !== void 0 ? Ae : F,
+ Q.Function,
+ he,
+ Ke,
+ 'Assignment'
+ );
+ return;
+ }
+ case 'ForOfStatement': {
+ let ne = t,
+ he = e.reserve('block'),
+ Ke = e.reserve('loop'),
+ Ge = e.reserve('loop');
+ if (ne.node.await) {
+ e.errors.push({
+ reason: '(BuildHIR::lowerStatement) Handle for-await loops',
+ category: K.Todo,
+ loc: (Ye = ne.node.loc) !== null && Ye !== void 0 ? Ye : null,
+ suggestions: null,
+ });
+ return;
+ }
+ let Qe = e.enter('block', (Jt) =>
+ e.loop(n, Ke.id, he.id, () => {
+ var pn;
+ let Sr = ne.get('body');
+ return (
+ Pn(e, Sr),
+ {
+ kind: 'goto',
+ block: Ke.id,
+ variant: St.Continue,
+ id: V(0),
+ loc: (pn = Sr.node.loc) !== null && pn !== void 0 ? pn : F,
+ }
+ );
+ })
+ ),
+ se = (bt = ne.node.loc) !== null && bt !== void 0 ? bt : F,
+ It = ut(e, ne.get('right'));
+ e.terminateWithContinuation(
+ {
+ kind: 'for-of',
+ loc: se,
+ init: Ke.id,
+ test: Ge.id,
+ loop: Qe,
+ fallthrough: he.id,
+ id: V(0),
+ },
+ Ke
+ );
+ let pt = Fe(e, {
+ kind: 'GetIterator',
+ loc: It.loc,
+ collection: Object.assign({}, It),
+ });
+ e.terminateWithContinuation(
+ {
+ id: V(0),
+ kind: 'goto',
+ block: Ge.id,
+ variant: St.Break,
+ loc: (st = ne.node.loc) !== null && st !== void 0 ? st : F,
+ },
+ Ge
+ );
+ let Ve = ne.get('left'),
+ et = (tt = Ve.node.loc) !== null && tt !== void 0 ? tt : F,
+ $t,
+ an = Fe(e, {
+ kind: 'IteratorNext',
+ loc: et,
+ iterator: Object.assign({}, pt),
+ collection: Object.assign({}, It),
+ });
+ if (Ve.isVariableDeclaration()) {
+ let Jt = Ve.get('declarations');
+ D.invariant(Jt.length === 1, {
+ reason: `Expected only one declaration in the init of a ForOfStatement, got ${Jt.length}`,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (yt = Ve.node.loc) !== null && yt !== void 0 ? yt : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let pn = Jt[0].get('id'),
+ Sr = Wn(e, et, Q.Let, pn, an, 'Assignment');
+ $t = Fe(e, Sr);
+ } else {
+ D.invariant(Ve.isLVal(), {
+ reason: 'Expected ForOf init to be a variable declaration or lval',
+ description: null,
+ details: [{kind: 'error', loc: et, message: null}],
+ });
+ let Jt = Wn(e, et, Q.Reassign, Ve, an, 'Assignment');
+ $t = Fe(e, Jt);
+ }
+ e.terminateWithContinuation(
+ {
+ id: V(0),
+ kind: 'branch',
+ test: $t,
+ consequent: Qe,
+ alternate: he.id,
+ loc: (dt = ne.node.loc) !== null && dt !== void 0 ? dt : F,
+ fallthrough: he.id,
+ },
+ he
+ );
+ return;
+ }
+ case 'ForInStatement': {
+ let ne = t,
+ he = e.reserve('block'),
+ Ke = e.reserve('loop'),
+ Ge = e.enter('block', ($t) =>
+ e.loop(n, Ke.id, he.id, () => {
+ var an;
+ let Jt = ne.get('body');
+ return (
+ Pn(e, Jt),
+ {
+ kind: 'goto',
+ block: Ke.id,
+ variant: St.Continue,
+ id: V(0),
+ loc: (an = Jt.node.loc) !== null && an !== void 0 ? an : F,
+ }
+ );
+ })
+ ),
+ Qe = (qt = ne.node.loc) !== null && qt !== void 0 ? qt : F,
+ se = ut(e, ne.get('right'));
+ e.terminateWithContinuation(
+ {
+ kind: 'for-in',
+ loc: Qe,
+ init: Ke.id,
+ loop: Ge,
+ fallthrough: he.id,
+ id: V(0),
+ },
+ Ke
+ );
+ let It = ne.get('left'),
+ pt = (J = It.node.loc) !== null && J !== void 0 ? J : F,
+ Ve,
+ et = Fe(e, {kind: 'NextPropertyOf', loc: pt, value: se});
+ if (It.isVariableDeclaration()) {
+ let $t = It.get('declarations');
+ D.invariant($t.length === 1, {
+ reason: `Expected only one declaration in the init of a ForInStatement, got ${$t.length}`,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (Xe = It.node.loc) !== null && Xe !== void 0 ? Xe : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let an = $t[0].get('id'),
+ Jt = Wn(e, pt, Q.Let, an, et, 'Assignment');
+ Ve = Fe(e, Jt);
+ } else {
+ D.invariant(It.isLVal(), {
+ reason: 'Expected ForIn init to be a variable declaration or lval',
+ description: null,
+ details: [{kind: 'error', loc: pt, message: null}],
+ });
+ let $t = Wn(e, pt, Q.Reassign, It, et, 'Assignment');
+ Ve = Fe(e, $t);
+ }
+ e.terminateWithContinuation(
+ {
+ id: V(0),
+ kind: 'branch',
+ test: Ve,
+ consequent: Ge,
+ alternate: he.id,
+ fallthrough: he.id,
+ loc: (it = ne.node.loc) !== null && it !== void 0 ? it : F,
+ },
+ he
+ );
+ return;
+ }
+ case 'DebuggerStatement': {
+ let he = (mt = t.node.loc) !== null && mt !== void 0 ? mt : F;
+ e.push({
+ id: V(0),
+ lvalue: Ln(e, he),
+ value: {kind: 'Debugger', loc: he},
+ effects: null,
+ loc: he,
+ });
+ return;
+ }
+ case 'EmptyStatement':
+ return;
+ case 'TryStatement': {
+ let ne = t,
+ he = e.reserve('block'),
+ Ke = ne.get('handler');
+ if (!Wi(Ke)) {
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerStatement) Handle TryStatement without a catch clause',
+ category: K.Todo,
+ loc: (Et = ne.node.loc) !== null && Et !== void 0 ? Et : null,
+ suggestions: null,
+ });
+ return;
+ }
+ Wi(ne.get('finalizer')) &&
+ e.errors.push({
+ reason:
+ "(BuildHIR::lowerStatement) Handle TryStatement with a finalizer ('finally') clause",
+ category: K.Todo,
+ loc: (ft = ne.node.loc) !== null && ft !== void 0 ? ft : null,
+ suggestions: null,
+ });
+ let Ge = Ke.get('param'),
+ Qe = null;
+ if (Wi(Ge)) {
+ let pt = {
+ kind: 'Identifier',
+ identifier: e.makeTemporary(
+ (De = Ge.node.loc) !== null && De !== void 0 ? De : F
+ ),
+ effect: x.Unknown,
+ reactive: !1,
+ loc: (Y = Ge.node.loc) !== null && Y !== void 0 ? Y : F,
+ };
+ $n(pt.identifier),
+ Fe(e, {
+ kind: 'DeclareLocal',
+ lvalue: {kind: Q.Catch, place: Object.assign({}, pt)},
+ type: null,
+ loc: (ce = Ge.node.loc) !== null && ce !== void 0 ? ce : F,
+ }),
+ (Qe = {path: Ge, place: pt});
+ }
+ let se = e.enter('catch', (pt) => {
+ var Ve, et;
+ return (
+ Qe !== null &&
+ Wn(
+ e,
+ (Ve = Qe.path.node.loc) !== null && Ve !== void 0 ? Ve : F,
+ Q.Catch,
+ Qe.path,
+ Object.assign({}, Qe.place),
+ 'Assignment'
+ ),
+ Pn(e, Ke.get('body')),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (et = Ke.node.loc) !== null && et !== void 0 ? et : F,
+ }
+ );
+ }),
+ It = e.enter('block', (pt) => {
+ var Ve;
+ let et = ne.get('block');
+ return (
+ e.enterTryCatch(se, () => {
+ Pn(e, et);
+ }),
+ {
+ kind: 'goto',
+ block: he.id,
+ variant: St.Try,
+ id: V(0),
+ loc: (Ve = et.node.loc) !== null && Ve !== void 0 ? Ve : F,
+ }
+ );
+ });
+ e.terminateWithContinuation(
+ {
+ kind: 'try',
+ block: It,
+ handlerBinding: Qe !== null ? Object.assign({}, Qe.place) : null,
+ handler: se,
+ fallthrough: he.id,
+ id: V(0),
+ loc: (Ze = ne.node.loc) !== null && Ze !== void 0 ? Ze : F,
+ },
+ he
+ );
+ return;
+ }
+ case 'WithStatement': {
+ e.errors.push({
+ reason: "JavaScript 'with' syntax is not supported",
+ description:
+ "'with' syntax is considered deprecated and removed from JavaScript standards, consider alternatives",
+ category: K.UnsupportedSyntax,
+ loc: (Ne = t.node.loc) !== null && Ne !== void 0 ? Ne : null,
+ suggestions: null,
+ }),
+ Fe(e, {
+ kind: 'UnsupportedNode',
+ loc: (X = t.node.loc) !== null && X !== void 0 ? X : F,
+ node: t.node,
+ });
+ return;
+ }
+ case 'ClassDeclaration': {
+ e.errors.push({
+ reason: 'Inline `class` declarations are not supported',
+ description: 'Move class declarations outside of components/hooks',
+ category: K.UnsupportedSyntax,
+ loc: (ee = t.node.loc) !== null && ee !== void 0 ? ee : null,
+ suggestions: null,
+ }),
+ Fe(e, {
+ kind: 'UnsupportedNode',
+ loc: (ge = t.node.loc) !== null && ge !== void 0 ? ge : F,
+ node: t.node,
+ });
+ return;
+ }
+ case 'EnumDeclaration':
+ case 'TSEnumDeclaration': {
+ Fe(e, {
+ kind: 'UnsupportedNode',
+ loc: (fe = t.node.loc) !== null && fe !== void 0 ? fe : F,
+ node: t.node,
+ });
+ return;
+ }
+ case 'ExportAllDeclaration':
+ case 'ExportDefaultDeclaration':
+ case 'ExportNamedDeclaration':
+ case 'ImportDeclaration':
+ case 'TSExportAssignment':
+ case 'TSImportEqualsDeclaration': {
+ e.errors.push({
+ reason:
+ 'JavaScript `import` and `export` statements may only appear at the top level of a module',
+ category: K.Syntax,
+ loc: (we = t.node.loc) !== null && we !== void 0 ? we : null,
+ suggestions: null,
+ }),
+ Fe(e, {
+ kind: 'UnsupportedNode',
+ loc: (me = t.node.loc) !== null && me !== void 0 ? me : F,
+ node: t.node,
+ });
+ return;
+ }
+ case 'TSNamespaceExportDeclaration': {
+ e.errors.push({
+ reason:
+ 'TypeScript `namespace` statements may only appear at the top level of a module',
+ category: K.Syntax,
+ loc: (ze = t.node.loc) !== null && ze !== void 0 ? ze : null,
+ suggestions: null,
+ }),
+ Fe(e, {
+ kind: 'UnsupportedNode',
+ loc: (Ce = t.node.loc) !== null && Ce !== void 0 ? Ce : F,
+ node: t.node,
+ });
+ return;
+ }
+ case 'DeclareClass':
+ case 'DeclareExportAllDeclaration':
+ case 'DeclareExportDeclaration':
+ case 'DeclareFunction':
+ case 'DeclareInterface':
+ case 'DeclareModule':
+ case 'DeclareModuleExports':
+ case 'DeclareOpaqueType':
+ case 'DeclareTypeAlias':
+ case 'DeclareVariable':
+ case 'InterfaceDeclaration':
+ case 'OpaqueType':
+ case 'TSDeclareFunction':
+ case 'TSInterfaceDeclaration':
+ case 'TSModuleDeclaration':
+ case 'TSTypeAliasDeclaration':
+ case 'TypeAlias':
+ return;
+ default:
+ return Me(lt, `Unsupported statement kind '${lt.type}'`);
+ }
+ }
+ function GB(e, t) {
+ var n;
+ let i = (n = t.node.loc) !== null && n !== void 0 ? n : F,
+ r = NI(e, t);
+ return r
+ ? {kind: 'ObjectMethod', loc: i, loweredFunc: r}
+ : {kind: 'UnsupportedNode', node: t.node, loc: i};
+ }
+ function cv(e, t) {
+ var n;
+ let i = t.get('key');
+ return i.isStringLiteral()
+ ? {kind: 'string', name: i.node.value}
+ : t.node.computed && i.isExpression()
+ ? {kind: 'computed', name: ut(e, i)}
+ : i.isIdentifier()
+ ? {kind: 'identifier', name: i.node.name}
+ : i.isNumericLiteral()
+ ? {kind: 'identifier', name: String(i.node.value)}
+ : (e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Expected Identifier, got ${i.type} key in ObjectExpression`,
+ category: K.Todo,
+ loc: (n = i.node.loc) !== null && n !== void 0 ? n : null,
+ suggestions: null,
+ }),
+ null);
+ }
+ function CI(e, t) {
+ var n,
+ i,
+ r,
+ a,
+ o,
+ s,
+ l,
+ d,
+ u,
+ p,
+ y,
+ m,
+ g,
+ S,
+ _,
+ O,
+ P,
+ M,
+ w,
+ I,
+ U,
+ A,
+ q,
+ ae,
+ le,
+ G,
+ ve,
+ de,
+ oe,
+ be,
+ $e,
+ Ie,
+ Pe,
+ ke,
+ je,
+ Ae,
+ Ye,
+ bt,
+ st,
+ tt,
+ yt,
+ dt,
+ qt,
+ J,
+ Xe,
+ it,
+ mt,
+ Et;
+ let ft = t.node,
+ De = (n = ft.loc) !== null && n !== void 0 ? n : F;
+ switch (ft.type) {
+ case 'Identifier': {
+ let Y = t,
+ ce = Ou(e, Y);
+ return {kind: $h(e, Y), place: ce, loc: De};
+ }
+ case 'NullLiteral':
+ return {kind: 'Primitive', value: null, loc: De};
+ case 'BooleanLiteral':
+ case 'NumericLiteral':
+ case 'StringLiteral':
+ return {kind: 'Primitive', value: t.node.value, loc: De};
+ case 'ObjectExpression': {
+ let ce = t.get('properties'),
+ Ze = [];
+ for (let Ne of ce)
+ if (Ne.isObjectProperty()) {
+ let X = cv(e, Ne);
+ if (!X) continue;
+ let ee = Ne.get('value');
+ if (!ee.isExpression()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${ee.type} values in ObjectExpression`,
+ category: K.Todo,
+ loc: (i = ee.node.loc) !== null && i !== void 0 ? i : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ let ge = ut(e, ee);
+ Ze.push({
+ kind: 'ObjectProperty',
+ type: 'property',
+ place: ge,
+ key: X,
+ });
+ } else if (Ne.isSpreadElement()) {
+ let X = ut(e, Ne.get('argument'));
+ Ze.push({kind: 'Spread', place: X});
+ } else if (Ne.isObjectMethod()) {
+ if (Ne.node.kind !== 'method') {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${Ne.node.kind} functions in ObjectExpression`,
+ category: K.Todo,
+ loc: (r = Ne.node.loc) !== null && r !== void 0 ? r : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ let X = GB(e, Ne),
+ ee = Fe(e, X),
+ ge = cv(e, Ne);
+ if (!ge) continue;
+ Ze.push({
+ kind: 'ObjectProperty',
+ type: 'method',
+ place: ee,
+ key: ge,
+ });
+ } else {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${Ne.type} properties in ObjectExpression`,
+ category: K.Todo,
+ loc: (a = Ne.node.loc) !== null && a !== void 0 ? a : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ return {kind: 'ObjectExpression', properties: Ze, loc: De};
+ }
+ case 'ArrayExpression': {
+ let Y = t,
+ ce = [];
+ for (let Ze of Y.get('elements'))
+ if (Ze.node == null) {
+ ce.push({kind: 'Hole'});
+ continue;
+ } else if (Ze.isExpression()) ce.push(ut(e, Ze));
+ else if (Ze.isSpreadElement()) {
+ let Ne = ut(e, Ze.get('argument'));
+ ce.push({kind: 'Spread', place: Ne});
+ } else {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${Ze.type} elements in ArrayExpression`,
+ category: K.Todo,
+ loc: (o = Ze.node.loc) !== null && o !== void 0 ? o : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ return {kind: 'ArrayExpression', elements: ce, loc: De};
+ }
+ case 'NewExpression': {
+ let Y = t,
+ ce = Y.get('callee');
+ if (!ce.isExpression())
+ return (
+ e.errors.push({
+ reason:
+ 'Expected an expression as the `new` expression receiver (v8 intrinsics are not supported)',
+ description: `Got a \`${ce.node.type}\``,
+ category: K.Syntax,
+ loc: (s = ce.node.loc) !== null && s !== void 0 ? s : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ let Ze = ut(e, ce),
+ Ne = Lp(e, Y.get('arguments'));
+ return {kind: 'NewExpression', callee: Ze, args: Ne, loc: De};
+ }
+ case 'OptionalCallExpression':
+ return Oh(e, t, null);
+ case 'CallExpression': {
+ let Y = t,
+ ce = Y.get('callee');
+ if (!ce.isExpression())
+ return (
+ e.errors.push({
+ reason: `Expected Expression, got ${ce.type} in CallExpression (v8 intrinsics not supported). This error is likely caused by a bug in React Compiler. Please file an issue`,
+ category: K.Todo,
+ loc: (l = ce.node.loc) !== null && l !== void 0 ? l : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ if (ce.isMemberExpression()) {
+ let Ze = ma(e, ce),
+ Ne = Fe(e, Ze.value),
+ X = Lp(e, Y.get('arguments'));
+ return {
+ kind: 'MethodCall',
+ receiver: Ze.object,
+ property: Object.assign({}, Ne),
+ args: X,
+ loc: De,
+ };
+ } else {
+ let Ze = ut(e, ce),
+ Ne = Lp(e, Y.get('arguments'));
+ return {kind: 'CallExpression', callee: Ze, args: Ne, loc: De};
+ }
+ }
+ case 'BinaryExpression': {
+ let Y = t,
+ ce = Y.get('left');
+ if (!ce.isExpression())
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Expected Expression, got ${ce.type} lval in BinaryExpression`,
+ category: K.Todo,
+ loc: (d = ce.node.loc) !== null && d !== void 0 ? d : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ let Ze = ut(e, ce),
+ Ne = ut(e, Y.get('right')),
+ X = Y.node.operator;
+ return X === '|>'
+ ? (e.errors.push({
+ reason: '(BuildHIR::lowerExpression) Pipe operator not supported',
+ category: K.Todo,
+ loc: (u = ce.node.loc) !== null && u !== void 0 ? u : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De})
+ : {
+ kind: 'BinaryExpression',
+ operator: X,
+ left: Ze,
+ right: Ne,
+ loc: De,
+ };
+ }
+ case 'SequenceExpression': {
+ let Y = t,
+ ce = (p = Y.node.loc) !== null && p !== void 0 ? p : F,
+ Ze = e.reserve(e.currentBlockKind()),
+ Ne = Ln(e, ce),
+ X = e.enter('sequence', (ee) => {
+ var ge;
+ let fe = null;
+ for (let we of Y.get('expressions')) fe = ut(e, we);
+ return (
+ fe === null
+ ? e.errors.push({
+ reason:
+ 'Expected sequence expression to have at least one expression',
+ category: K.Syntax,
+ loc:
+ (ge = Y.node.loc) !== null && ge !== void 0 ? ge : null,
+ suggestions: null,
+ })
+ : Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, Ne)},
+ value: fe,
+ type: null,
+ loc: ce,
+ }),
+ {kind: 'goto', id: V(0), block: Ze.id, loc: ce, variant: St.Break}
+ );
+ });
+ return (
+ e.terminateWithContinuation(
+ {kind: 'sequence', block: X, fallthrough: Ze.id, id: V(0), loc: ce},
+ Ze
+ ),
+ {kind: 'LoadLocal', place: Ne, loc: Ne.loc}
+ );
+ }
+ case 'ConditionalExpression': {
+ let Y = t,
+ ce = (y = Y.node.loc) !== null && y !== void 0 ? y : F,
+ Ze = e.reserve(e.currentBlockKind()),
+ Ne = e.reserve('value'),
+ X = Ln(e, ce),
+ ee = e.enter('value', (we) => {
+ var me;
+ let ze = Y.get('consequent'),
+ Ce = ut(e, ze);
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, X)},
+ value: Ce,
+ type: null,
+ loc: ce,
+ }),
+ {
+ kind: 'goto',
+ block: Ze.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (me = ze.node.loc) !== null && me !== void 0 ? me : F,
+ }
+ );
+ }),
+ ge = e.enter('value', (we) => {
+ var me;
+ let ze = Y.get('alternate'),
+ Ce = ut(e, ze);
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, X)},
+ value: Ce,
+ type: null,
+ loc: ce,
+ }),
+ {
+ kind: 'goto',
+ block: Ze.id,
+ variant: St.Break,
+ id: V(0),
+ loc: (me = ze.node.loc) !== null && me !== void 0 ? me : F,
+ }
+ );
+ });
+ e.terminateWithContinuation(
+ {kind: 'ternary', fallthrough: Ze.id, id: V(0), test: Ne.id, loc: ce},
+ Ne
+ );
+ let fe = ut(e, Y.get('test'));
+ return (
+ e.terminateWithContinuation(
+ {
+ kind: 'branch',
+ test: Object.assign({}, fe),
+ consequent: ee,
+ alternate: ge,
+ fallthrough: Ze.id,
+ id: V(0),
+ loc: ce,
+ },
+ Ze
+ ),
+ {kind: 'LoadLocal', place: X, loc: X.loc}
+ );
+ }
+ case 'LogicalExpression': {
+ let Y = t,
+ ce = (m = Y.node.loc) !== null && m !== void 0 ? m : F,
+ Ze = e.reserve(e.currentBlockKind()),
+ Ne = e.reserve('value'),
+ X = Ln(e, ce),
+ ee = Ln(
+ e,
+ (g = Y.get('left').node.loc) !== null && g !== void 0 ? g : F
+ ),
+ ge = e.enter(
+ 'value',
+ () => (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, X)},
+ value: Object.assign({}, ee),
+ type: null,
+ loc: ee.loc,
+ }),
+ {
+ kind: 'goto',
+ block: Ze.id,
+ variant: St.Break,
+ id: V(0),
+ loc: ee.loc,
+ }
+ )
+ ),
+ fe = e.enter('value', () => {
+ let me = ut(e, Y.get('right'));
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, X)},
+ value: Object.assign({}, me),
+ type: null,
+ loc: me.loc,
+ }),
+ {
+ kind: 'goto',
+ block: Ze.id,
+ variant: St.Break,
+ id: V(0),
+ loc: me.loc,
+ }
+ );
+ });
+ e.terminateWithContinuation(
+ {
+ kind: 'logical',
+ fallthrough: Ze.id,
+ id: V(0),
+ test: Ne.id,
+ operator: Y.node.operator,
+ loc: ce,
+ },
+ Ne
+ );
+ let we = ut(e, Y.get('left'));
+ return (
+ e.push({
+ id: V(0),
+ lvalue: Object.assign({}, ee),
+ value: {kind: 'LoadLocal', place: we, loc: ce},
+ effects: null,
+ loc: ce,
+ }),
+ e.terminateWithContinuation(
+ {
+ kind: 'branch',
+ test: Object.assign({}, ee),
+ consequent: ge,
+ alternate: fe,
+ fallthrough: Ze.id,
+ id: V(0),
+ loc: ce,
+ },
+ Ze
+ ),
+ {kind: 'LoadLocal', place: X, loc: X.loc}
+ );
+ }
+ case 'AssignmentExpression': {
+ let Y = t,
+ ce = Y.node.operator;
+ if (ce === '=') {
+ let ge = Y.get('left');
+ return ge.isLVal()
+ ? Wn(
+ e,
+ (S = ge.node.loc) !== null && S !== void 0 ? S : F,
+ Q.Reassign,
+ ge,
+ ut(e, Y.get('right')),
+ ge.isArrayPattern() || ge.isObjectPattern()
+ ? 'Destructure'
+ : 'Assignment'
+ )
+ : (e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Unsupported syntax on the left side of an AssignmentExpression',
+ description: `Expected an LVal, got: ${ge.type}`,
+ category: K.Todo,
+ loc: (_ = ge.node.loc) !== null && _ !== void 0 ? _ : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De});
+ }
+ let Ne = {
+ '+=': '+',
+ '-=': '-',
+ '/=': '/',
+ '%=': '%',
+ '*=': '*',
+ '**=': '**',
+ '&=': '&',
+ '|=': '|',
+ '>>=': '>>',
+ '>>>=': '>>>',
+ '<<=': '<<',
+ '^=': '^',
+ }[ce];
+ if (Ne == null)
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${ce} operators in AssignmentExpression`,
+ category: K.Todo,
+ loc: (O = Y.node.loc) !== null && O !== void 0 ? O : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ let X = Y.get('left');
+ switch (X.node.type) {
+ case 'Identifier': {
+ let ge = X,
+ fe = ut(e, ge),
+ we = ut(e, Y.get('right')),
+ me = Fe(e, {
+ kind: 'BinaryExpression',
+ operator: Ne,
+ left: fe,
+ right: we,
+ loc: De,
+ });
+ if (e.resolveIdentifier(ge).kind === 'Identifier') {
+ let Ce = Ou(e, ge);
+ return Wa(e, ge) === 'StoreLocal'
+ ? (Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {place: Object.assign({}, Ce), kind: Q.Reassign},
+ value: Object.assign({}, me),
+ type: null,
+ loc: De,
+ }),
+ {kind: 'LoadLocal', place: Ce, loc: De})
+ : (Fe(e, {
+ kind: 'StoreContext',
+ lvalue: {place: Object.assign({}, Ce), kind: Q.Reassign},
+ value: Object.assign({}, me),
+ loc: De,
+ }),
+ {kind: 'LoadContext', place: Ce, loc: De});
+ } else {
+ let Ce = Fe(e, {
+ kind: 'StoreGlobal',
+ name: ge.node.name,
+ value: Object.assign({}, me),
+ loc: De,
+ });
+ return {kind: 'LoadLocal', place: Ce, loc: Ce.loc};
+ }
+ }
+ case 'MemberExpression': {
+ let ge = X,
+ {object: fe, property: we, value: me} = ma(e, ge),
+ ze = Fe(e, me),
+ Ce = Fe(e, {
+ kind: 'BinaryExpression',
+ operator: Ne,
+ left: Object.assign({}, ze),
+ right: ut(e, Y.get('right')),
+ loc: (P = ge.node.loc) !== null && P !== void 0 ? P : F,
+ });
+ return typeof we == 'string' || typeof we == 'number'
+ ? {
+ kind: 'PropertyStore',
+ object: Object.assign({}, fe),
+ property: we,
+ value: Object.assign({}, Ce),
+ loc: (M = ge.node.loc) !== null && M !== void 0 ? M : F,
+ }
+ : {
+ kind: 'ComputedStore',
+ object: Object.assign({}, fe),
+ property: Object.assign({}, we),
+ value: Object.assign({}, Ce),
+ loc: (w = ge.node.loc) !== null && w !== void 0 ? w : F,
+ };
+ }
+ default:
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Expected Identifier or MemberExpression, got ${Y.type} lval in AssignmentExpression`,
+ category: K.Todo,
+ loc: (I = Y.node.loc) !== null && I !== void 0 ? I : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ }
+ }
+ case 'OptionalMemberExpression': {
+ let Y = t,
+ {value: ce} = wh(e, Y, null);
+ return {kind: 'LoadLocal', place: ce, loc: ce.loc};
+ }
+ case 'MemberExpression': {
+ let Y = t,
+ {value: ce} = ma(e, Y),
+ Ze = Fe(e, ce);
+ return {kind: 'LoadLocal', place: Ze, loc: Ze.loc};
+ }
+ case 'JSXElement': {
+ let Y = t,
+ ce = Y.get('openingElement'),
+ Ze = (U = ce.node.loc) !== null && U !== void 0 ? U : F,
+ Ne = XB(e, ce.get('name')),
+ X = [];
+ for (let fe of ce.get('attributes')) {
+ if (fe.isJSXSpreadAttribute()) {
+ let lt = ut(e, fe.get('argument'));
+ X.push({kind: 'JsxSpreadAttribute', argument: lt});
+ continue;
+ }
+ if (!fe.isJSXAttribute()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${fe.type} attributes in JSXElement`,
+ category: K.Todo,
+ loc: (A = fe.node.loc) !== null && A !== void 0 ? A : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ let we = fe.get('name'),
+ me;
+ if (we.isJSXIdentifier())
+ (me = we.node.name),
+ me.indexOf(':') !== -1 &&
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Unexpected colon in attribute name \`${me}\``,
+ category: K.Todo,
+ loc: (q = we.node.loc) !== null && q !== void 0 ? q : null,
+ suggestions: null,
+ });
+ else {
+ D.invariant(we.isJSXNamespacedName(), {
+ reason: 'Refinement',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (ae = we.node.loc) !== null && ae !== void 0 ? ae : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let lt = we.node.namespace.name,
+ ne = we.node.name.name;
+ me = `${lt}:${ne}`;
+ }
+ let ze = fe.get('value'),
+ Ce;
+ if (ze.isJSXElement() || ze.isStringLiteral()) Ce = ut(e, ze);
+ else if (ze.type == null)
+ Ce = Fe(e, {
+ kind: 'Primitive',
+ value: !0,
+ loc: (le = fe.node.loc) !== null && le !== void 0 ? le : F,
+ });
+ else {
+ if (!ze.isJSXExpressionContainer()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${ze.type} attribute values in JSXElement`,
+ category: K.Todo,
+ loc:
+ (ve =
+ (G = ze.node) === null || G === void 0 ? void 0 : G.loc) !==
+ null && ve !== void 0
+ ? ve
+ : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ let lt = ze.get('expression');
+ if (!lt.isExpression()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${lt.type} expressions in JSXExpressionContainer within JSXElement`,
+ category: K.Todo,
+ loc: (de = ze.node.loc) !== null && de !== void 0 ? de : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ Ce = ut(e, lt);
+ }
+ X.push({kind: 'JsxAttribute', name: me, place: Ce});
+ }
+ let ee =
+ Ne.kind === 'BuiltinTag' && (Ne.name === 'fbt' || Ne.name === 'fbs');
+ if (ee) {
+ let fe = Ne.name,
+ we = ce.get('name'),
+ me = we.isJSXIdentifier() ? e.resolveIdentifier(we) : null;
+ me != null &&
+ D.invariant(me.kind !== 'Identifier', {
+ reason: `<${fe}> tags should be module-level imports`,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (oe = we.node.loc) !== null && oe !== void 0 ? oe : F,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let ze = {
+ enum: new Array(),
+ plural: new Array(),
+ pronoun: new Array(),
+ };
+ Y.traverse({
+ JSXClosingElement(Ce) {
+ Ce.skip();
+ },
+ JSXNamespacedName(Ce) {
+ var lt, ne, he;
+ if (Ce.node.namespace.name === fe)
+ switch (Ce.node.name.name) {
+ case 'enum':
+ ze.enum.push(
+ (lt = Ce.node.loc) !== null && lt !== void 0 ? lt : F
+ );
+ break;
+ case 'plural':
+ ze.plural.push(
+ (ne = Ce.node.loc) !== null && ne !== void 0 ? ne : F
+ );
+ break;
+ case 'pronoun':
+ ze.pronoun.push(
+ (he = Ce.node.loc) !== null && he !== void 0 ? he : F
+ );
+ break;
+ }
+ },
+ });
+ for (let [Ce, lt] of Object.entries(ze))
+ lt.length > 1 &&
+ D.throwDiagnostic({
+ category: K.Todo,
+ reason: 'Support duplicate fbt tags',
+ description: `Support \`<${fe}>\` tags with multiple \`<${fe}:${Ce}>\` values`,
+ details: lt.map((ne) => ({
+ kind: 'error',
+ message: `Multiple \`<${fe}:${Ce}>\` tags found`,
+ loc: ne,
+ })),
+ });
+ }
+ ee && e.fbtDepth++;
+ let ge = Y.get('children')
+ .map((fe) => kE(e, fe))
+ .filter(SE);
+ return (
+ ee && e.fbtDepth--,
+ {
+ kind: 'JsxExpression',
+ tag: Ne,
+ props: X,
+ children: ge.length === 0 ? null : ge,
+ loc: De,
+ openingLoc: Ze,
+ closingLoc:
+ ($e =
+ (be = Y.get('closingElement').node) === null || be === void 0
+ ? void 0
+ : be.loc) !== null && $e !== void 0
+ ? $e
+ : F,
+ }
+ );
+ }
+ case 'JSXFragment':
+ return {
+ kind: 'JsxFragment',
+ children: t
+ .get('children')
+ .map((Ze) => kE(e, Ze))
+ .filter(SE),
+ loc: De,
+ };
+ case 'ArrowFunctionExpression':
+ case 'FunctionExpression':
+ return MI(e, t);
+ case 'TaggedTemplateExpression': {
+ let Y = t;
+ if (Y.get('quasi').get('expressions').length !== 0)
+ return (
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Handle tagged template with interpolations',
+ category: K.Todo,
+ loc: (Ie = t.node.loc) !== null && Ie !== void 0 ? Ie : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ D.invariant(Y.get('quasi').get('quasis').length == 1, {
+ reason:
+ "there should be only one quasi as we don't support interpolations yet",
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (Pe = Y.node.loc) !== null && Pe !== void 0 ? Pe : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let ce = Y.get('quasi').get('quasis').at(0).node.value;
+ return ce.raw !== ce.cooked
+ ? (e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Handle tagged template where cooked value is different from raw value',
+ category: K.Todo,
+ loc: (ke = t.node.loc) !== null && ke !== void 0 ? ke : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De})
+ : {
+ kind: 'TaggedTemplateExpression',
+ tag: ut(e, Y.get('tag')),
+ value: ce,
+ loc: De,
+ };
+ }
+ case 'TemplateLiteral': {
+ let Y = t,
+ ce = Y.get('expressions'),
+ Ze = Y.get('quasis');
+ return ce.length !== Ze.length - 1
+ ? (e.errors.push({
+ reason:
+ 'Unexpected quasi and subexpression lengths in template literal',
+ category: K.Syntax,
+ loc: (je = t.node.loc) !== null && je !== void 0 ? je : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De})
+ : ce.some((X) => !X.isExpression())
+ ? (e.errors.push({
+ reason:
+ '(BuildHIR::lowerAssignment) Handle TSType in TemplateLiteral.',
+ category: K.Todo,
+ loc: (Ae = t.node.loc) !== null && Ae !== void 0 ? Ae : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De})
+ : {
+ kind: 'TemplateLiteral',
+ subexprs: ce.map((X) => ut(e, X)),
+ quasis: Y.get('quasis').map((X) => X.node.value),
+ loc: De,
+ };
+ }
+ case 'UnaryExpression': {
+ let Y = t;
+ if (Y.node.operator === 'delete') {
+ let ce = Y.get('argument');
+ if (ce.isMemberExpression()) {
+ let {object: Ze, property: Ne} = ma(e, ce);
+ return typeof Ne == 'string' || typeof Ne == 'number'
+ ? {kind: 'PropertyDelete', object: Ze, property: Ne, loc: De}
+ : {kind: 'ComputedDelete', object: Ze, property: Ne, loc: De};
+ } else
+ return (
+ e.errors.push({
+ reason: 'Only object properties can be deleted',
+ category: K.Syntax,
+ loc: (Ye = Y.node.loc) !== null && Ye !== void 0 ? Ye : null,
+ suggestions: [
+ {
+ description: 'Remove this line',
+ range: [Y.node.start, Y.node.end],
+ op: _i.Remove,
+ },
+ ],
+ }),
+ {kind: 'UnsupportedNode', node: Y.node, loc: De}
+ );
+ } else
+ return Y.node.operator === 'throw'
+ ? (e.errors.push({
+ reason: 'Throw expressions are not supported',
+ category: K.Syntax,
+ loc: (bt = Y.node.loc) !== null && bt !== void 0 ? bt : null,
+ suggestions: [
+ {
+ description: 'Remove this line',
+ range: [Y.node.start, Y.node.end],
+ op: _i.Remove,
+ },
+ ],
+ }),
+ {kind: 'UnsupportedNode', node: Y.node, loc: De})
+ : {
+ kind: 'UnaryExpression',
+ operator: Y.node.operator,
+ value: ut(e, Y.get('argument')),
+ loc: De,
+ };
+ }
+ case 'AwaitExpression':
+ return {kind: 'Await', value: ut(e, t.get('argument')), loc: De};
+ case 'TypeCastExpression': {
+ let Y = t,
+ ce = Y.get('typeAnnotation').get('typeAnnotation');
+ return {
+ kind: 'TypeCastExpression',
+ value: ut(e, Y.get('expression')),
+ typeAnnotation: ce.node,
+ typeAnnotationKind: 'cast',
+ type: Fp(ce.node),
+ loc: De,
+ };
+ }
+ case 'TSSatisfiesExpression': {
+ let Y = t,
+ ce = Y.get('typeAnnotation');
+ return {
+ kind: 'TypeCastExpression',
+ value: ut(e, Y.get('expression')),
+ typeAnnotation: ce.node,
+ typeAnnotationKind: 'satisfies',
+ type: Fp(ce.node),
+ loc: De,
+ };
+ }
+ case 'TSAsExpression': {
+ let Y = t,
+ ce = Y.get('typeAnnotation');
+ return {
+ kind: 'TypeCastExpression',
+ value: ut(e, Y.get('expression')),
+ typeAnnotation: ce.node,
+ typeAnnotationKind: 'as',
+ type: Fp(ce.node),
+ loc: De,
+ };
+ }
+ case 'UpdateExpression': {
+ let Y = t,
+ ce = Y.get('argument');
+ if (ce.isMemberExpression()) {
+ let X = Y.node.operator === '++' ? '+' : '-',
+ ee = ce,
+ {object: ge, property: fe, value: we} = ma(e, ee),
+ me = Fe(e, we),
+ ze = Fe(e, {
+ kind: 'BinaryExpression',
+ operator: X,
+ left: Object.assign({}, me),
+ right: Fe(e, {kind: 'Primitive', value: 1, loc: F}),
+ loc: (st = ee.node.loc) !== null && st !== void 0 ? st : F,
+ }),
+ Ce;
+ return (
+ typeof fe == 'string' || typeof fe == 'number'
+ ? (Ce = Fe(e, {
+ kind: 'PropertyStore',
+ object: Object.assign({}, ge),
+ property: fe,
+ value: Object.assign({}, ze),
+ loc: (tt = ee.node.loc) !== null && tt !== void 0 ? tt : F,
+ }))
+ : (Ce = Fe(e, {
+ kind: 'ComputedStore',
+ object: Object.assign({}, ge),
+ property: Object.assign({}, fe),
+ value: Object.assign({}, ze),
+ loc: (yt = ee.node.loc) !== null && yt !== void 0 ? yt : F,
+ })),
+ {
+ kind: 'LoadLocal',
+ place: Y.node.prefix
+ ? Object.assign({}, Ce)
+ : Object.assign({}, me),
+ loc: De,
+ }
+ );
+ }
+ if (ce.isIdentifier()) {
+ if (e.isContextIdentifier(ce))
+ return (
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Handle UpdateExpression to variables captured within lambdas.',
+ category: K.Todo,
+ loc: (qt = t.node.loc) !== null && qt !== void 0 ? qt : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ } else
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle UpdateExpression with ${ce.type} argument`,
+ category: K.Todo,
+ loc: (dt = t.node.loc) !== null && dt !== void 0 ? dt : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ let Ze = Ga(
+ e,
+ (J = ce.node.loc) !== null && J !== void 0 ? J : F,
+ Q.Reassign,
+ ce
+ );
+ if (Ze === null)
+ return (
+ e.errors.hasAnyErrors() ||
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Found an invalid UpdateExpression without a previously reported error',
+ category: K.Invariant,
+ loc: De,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ if (Ze.kind === 'Global')
+ return (
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Support UpdateExpression where argument is a global',
+ category: K.Todo,
+ loc: De,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ let Ne = Ou(e, ce);
+ return Y.node.prefix
+ ? {
+ kind: 'PrefixUpdate',
+ lvalue: Ze,
+ operation: Y.node.operator,
+ value: Ne,
+ loc: De,
+ }
+ : {
+ kind: 'PostfixUpdate',
+ lvalue: Ze,
+ operation: Y.node.operator,
+ value: Ne,
+ loc: De,
+ };
+ }
+ case 'RegExpLiteral': {
+ let Y = t;
+ return {
+ kind: 'RegExpLiteral',
+ pattern: Y.node.pattern,
+ flags: Y.node.flags,
+ loc: (Xe = Y.node.loc) !== null && Xe !== void 0 ? Xe : F,
+ };
+ }
+ case 'TSInstantiationExpression':
+ case 'TSNonNullExpression':
+ return CI(e, t.get('expression'));
+ case 'MetaProperty': {
+ let Y = t;
+ return Y.node.meta.name === 'import' && Y.node.property.name === 'meta'
+ ? {
+ kind: 'MetaProperty',
+ meta: Y.node.meta.name,
+ property: Y.node.property.name,
+ loc: (it = Y.node.loc) !== null && it !== void 0 ? it : F,
+ }
+ : (e.errors.push({
+ reason:
+ '(BuildHIR::lowerExpression) Handle MetaProperty expressions other than import.meta',
+ category: K.Todo,
+ loc: (mt = t.node.loc) !== null && mt !== void 0 ? mt : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De});
+ }
+ default:
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${t.type} expressions`,
+ category: K.Todo,
+ loc: (Et = t.node.loc) !== null && Et !== void 0 ? Et : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: ft, loc: De}
+ );
+ }
+ }
+ function wh(e, t, n) {
+ var i;
+ let r = t.node.optional,
+ a = (i = t.node.loc) !== null && i !== void 0 ? i : F,
+ o = Ln(e, a),
+ s = e.reserve(e.currentBlockKind()),
+ l = e.reserve('value'),
+ d =
+ n !== null
+ ? n
+ : e.enter('value', () => {
+ let y = Fe(e, {kind: 'Primitive', value: void 0, loc: a});
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, o)},
+ value: Object.assign({}, y),
+ type: null,
+ loc: a,
+ }),
+ {kind: 'goto', variant: St.Break, block: s.id, id: V(0), loc: a}
+ );
+ }),
+ u = null,
+ p = e.enter('value', () => {
+ let y = t.get('object');
+ if (y.isOptionalMemberExpression()) {
+ let {value: m} = wh(e, y, d);
+ u = m;
+ } else if (y.isOptionalCallExpression()) {
+ let m = Oh(e, y, d);
+ u = Fe(e, m);
+ } else u = ut(e, y);
+ return {
+ kind: 'branch',
+ test: Object.assign({}, u),
+ consequent: l.id,
+ alternate: d,
+ fallthrough: s.id,
+ id: V(0),
+ loc: a,
+ };
+ });
+ return (
+ D.invariant(u !== null, {
+ reason: 'Satisfy type checker',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e.enterReserved(l, () => {
+ let {value: y} = ma(e, t, u),
+ m = Fe(e, y);
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, o)},
+ value: Object.assign({}, m),
+ type: null,
+ loc: a,
+ }),
+ {kind: 'goto', variant: St.Break, block: s.id, id: V(0), loc: a}
+ );
+ }),
+ e.terminateWithContinuation(
+ {
+ kind: 'optional',
+ optional: r,
+ test: p,
+ fallthrough: s.id,
+ id: V(0),
+ loc: a,
+ },
+ s
+ ),
+ {object: u, value: o}
+ );
+ }
+ function Oh(e, t, n) {
+ var i;
+ let r = t.node.optional,
+ a = t.get('callee'),
+ o = (i = t.node.loc) !== null && i !== void 0 ? i : F,
+ s = Ln(e, o),
+ l = e.reserve(e.currentBlockKind()),
+ d = e.reserve('value'),
+ u =
+ n !== null
+ ? n
+ : e.enter('value', () => {
+ let m = Fe(e, {kind: 'Primitive', value: void 0, loc: o});
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, s)},
+ value: Object.assign({}, m),
+ type: null,
+ loc: o,
+ }),
+ {kind: 'goto', variant: St.Break, block: l.id, id: V(0), loc: o}
+ );
+ }),
+ p,
+ y = e.enter('value', () => {
+ if (a.isOptionalCallExpression()) {
+ let g = Oh(e, a, u);
+ p = {kind: 'CallExpression', callee: Fe(e, g)};
+ } else if (a.isOptionalMemberExpression()) {
+ let {object: g, value: S} = wh(e, a, u);
+ p = {kind: 'MethodCall', receiver: g, property: S};
+ } else if (a.isMemberExpression()) {
+ let g = ma(e, a),
+ S = Fe(e, g.value);
+ p = {kind: 'MethodCall', receiver: g.object, property: S};
+ } else p = {kind: 'CallExpression', callee: ut(e, a)};
+ let m = p.kind === 'CallExpression' ? p.callee : p.property;
+ return {
+ kind: 'branch',
+ test: Object.assign({}, m),
+ consequent: d.id,
+ alternate: u,
+ fallthrough: l.id,
+ id: V(0),
+ loc: o,
+ };
+ });
+ return (
+ e.enterReserved(d, () => {
+ let m = Lp(e, t.get('arguments')),
+ g = Ln(e, o);
+ return (
+ p.kind === 'CallExpression'
+ ? e.push({
+ id: V(0),
+ lvalue: Object.assign({}, g),
+ value: {
+ kind: 'CallExpression',
+ callee: Object.assign({}, p.callee),
+ args: m,
+ loc: o,
+ },
+ effects: null,
+ loc: o,
+ })
+ : e.push({
+ id: V(0),
+ lvalue: Object.assign({}, g),
+ value: {
+ kind: 'MethodCall',
+ receiver: Object.assign({}, p.receiver),
+ property: Object.assign({}, p.property),
+ args: m,
+ loc: o,
+ },
+ effects: null,
+ loc: o,
+ }),
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, s)},
+ value: Object.assign({}, g),
+ type: null,
+ loc: o,
+ }),
+ {kind: 'goto', variant: St.Break, block: l.id, id: V(0), loc: o}
+ );
+ }),
+ e.terminateWithContinuation(
+ {
+ kind: 'optional',
+ optional: r,
+ test: y,
+ fallthrough: l.id,
+ id: V(0),
+ loc: o,
+ },
+ l
+ ),
+ {kind: 'LoadLocal', place: s, loc: s.loc}
+ );
+ }
+ function DI(e, t) {
+ var n;
+ return (
+ Cn(e, t, !0) ||
+ e.errors.push({
+ reason: `(BuildHIR::node.lowerReorderableExpression) Expression type \`${t.type}\` cannot be safely reordered`,
+ category: K.Todo,
+ loc: (n = t.node.loc) !== null && n !== void 0 ? n : null,
+ suggestions: null,
+ }),
+ ut(e, t)
+ );
+ }
+ function Cn(e, t, n) {
+ switch (t.node.type) {
+ case 'Identifier':
+ return e.resolveIdentifier(t).kind === 'Identifier' ? n : !0;
+ case 'TSInstantiationExpression': {
+ let i = t.get('expression');
+ return Cn(e, i, n);
+ }
+ case 'RegExpLiteral':
+ case 'StringLiteral':
+ case 'NumericLiteral':
+ case 'NullLiteral':
+ case 'BooleanLiteral':
+ case 'BigIntLiteral':
+ return !0;
+ case 'UnaryExpression': {
+ let i = t;
+ switch (t.node.operator) {
+ case '!':
+ case '+':
+ case '-':
+ return Cn(e, i.get('argument'), n);
+ default:
+ return !1;
+ }
+ }
+ case 'TSAsExpression':
+ case 'TSNonNullExpression':
+ case 'TypeCastExpression':
+ return Cn(e, t.get('expression'), n);
+ case 'LogicalExpression': {
+ let i = t;
+ return Cn(e, i.get('left'), n) && Cn(e, i.get('right'), n);
+ }
+ case 'ConditionalExpression': {
+ let i = t;
+ return (
+ Cn(e, i.get('test'), n) &&
+ Cn(e, i.get('consequent'), n) &&
+ Cn(e, i.get('alternate'), n)
+ );
+ }
+ case 'ArrayExpression':
+ return t.get('elements').every((i) => i.isExpression() && Cn(e, i, n));
+ case 'ObjectExpression':
+ return t.get('properties').every((i) => {
+ if (!i.isObjectProperty() || i.node.computed) return !1;
+ let r = i.get('value');
+ return r.isExpression() && Cn(e, r, n);
+ });
+ case 'MemberExpression': {
+ let r = t;
+ for (; r.isMemberExpression(); ) r = r.get('object');
+ return !!(
+ r.isIdentifier() && e.resolveIdentifier(r).kind !== 'Identifier'
+ );
+ }
+ case 'ArrowFunctionExpression': {
+ let r = t.get('body');
+ return r.node.type === 'BlockStatement'
+ ? r.node.body.length === 0
+ : (so(r.isExpression(), 'Expected an expression'), Cn(e, r, !1));
+ }
+ case 'CallExpression': {
+ let i = t,
+ r = i.get('callee');
+ return (
+ r.isExpression() &&
+ Cn(e, r, n) &&
+ i.get('arguments').every((a) => a.isExpression() && Cn(e, a, n))
+ );
+ }
+ default:
+ return !1;
+ }
+ }
+ function Lp(e, t) {
+ var n;
+ let i = [];
+ for (let r of t)
+ r.isSpreadElement()
+ ? i.push({kind: 'Spread', place: ut(e, r.get('argument'))})
+ : r.isExpression()
+ ? i.push(ut(e, r))
+ : e.errors.push({
+ reason: `(BuildHIR::lowerExpression) Handle ${r.type} arguments in CallExpression`,
+ category: K.Todo,
+ loc: (n = r.node.loc) !== null && n !== void 0 ? n : null,
+ suggestions: null,
+ });
+ return i;
+ }
+ function ma(e, t, n = null) {
+ var i, r, a;
+ let o = t.node,
+ s = (i = o.loc) !== null && i !== void 0 ? i : F,
+ l = t.get('object'),
+ d = t.get('property'),
+ u = n ?? ut(e, l);
+ if (!t.node.computed || t.node.property.type === 'NumericLiteral') {
+ let p;
+ if (d.isIdentifier()) p = d.node.name;
+ else if (d.isNumericLiteral()) p = d.node.value;
+ else
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerMemberExpression) Handle ${d.type} property`,
+ category: K.Todo,
+ loc: (r = d.node.loc) !== null && r !== void 0 ? r : null,
+ suggestions: null,
+ }),
+ {
+ object: u,
+ property: d.toString(),
+ value: {kind: 'UnsupportedNode', node: o, loc: s},
+ }
+ );
+ let y = {
+ kind: 'PropertyLoad',
+ object: Object.assign({}, u),
+ property: p,
+ loc: s,
+ };
+ return {object: u, property: p, value: y};
+ } else {
+ if (!d.isExpression())
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerMemberExpression) Expected Expression, got ${d.type} property`,
+ category: K.Todo,
+ loc: (a = d.node.loc) !== null && a !== void 0 ? a : null,
+ suggestions: null,
+ }),
+ {
+ object: u,
+ property: d.toString(),
+ value: {kind: 'UnsupportedNode', node: o, loc: s},
+ }
+ );
+ let p = ut(e, d),
+ y = {
+ kind: 'ComputedLoad',
+ object: Object.assign({}, u),
+ property: Object.assign({}, p),
+ loc: s,
+ };
+ return {object: u, property: p, value: y};
+ }
+ }
+ function XB(e, t) {
+ var n, i, r;
+ let a = t.node,
+ o = (n = a.loc) !== null && n !== void 0 ? n : F;
+ if (t.isJSXIdentifier()) {
+ let s = t.node.name;
+ if (s.match(/^[A-Z]/)) {
+ let l = $h(e, t);
+ return Fe(e, {kind: l, place: Ou(e, t), loc: o});
+ } else return {kind: 'BuiltinTag', name: s, loc: o};
+ } else {
+ if (t.isJSXMemberExpression()) return AI(e, t);
+ if (t.isJSXNamespacedName()) {
+ let s = t.node.namespace.name,
+ l = t.node.name.name,
+ d = `${s}:${l}`;
+ return (
+ (s.indexOf(':') !== -1 || l.indexOf(':') !== -1) &&
+ e.errors.push({
+ reason:
+ 'Expected JSXNamespacedName to have no colons in the namespace or name',
+ description: `Got \`${s}\` : \`${l}\``,
+ category: K.Syntax,
+ loc: (i = t.node.loc) !== null && i !== void 0 ? i : null,
+ suggestions: null,
+ }),
+ Fe(e, {kind: 'Primitive', value: d, loc: o})
+ );
+ } else
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerJsxElementName) Handle ${t.type} tags`,
+ category: K.Todo,
+ loc: (r = t.node.loc) !== null && r !== void 0 ? r : null,
+ suggestions: null,
+ }),
+ Fe(e, {kind: 'UnsupportedNode', node: a, loc: o})
+ );
+ }
+ }
+ function AI(e, t) {
+ var n, i, r;
+ let a = (n = t.node.loc) !== null && n !== void 0 ? n : F,
+ o = t.get('object'),
+ s;
+ if (o.isJSXMemberExpression()) s = AI(e, o);
+ else {
+ D.invariant(o.isJSXIdentifier(), {
+ reason: `TypeScript refinement fail: expected 'JsxIdentifier', got \`${o.node.type}\``,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = o.node.loc) !== null && i !== void 0 ? i : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let d = $h(e, o);
+ s = Fe(e, {
+ kind: d,
+ place: Ou(e, o),
+ loc: (r = t.node.loc) !== null && r !== void 0 ? r : F,
+ });
+ }
+ let l = t.get('property').node.name;
+ return Fe(e, {kind: 'PropertyLoad', object: s, property: l, loc: a});
+ }
+ function kE(e, t) {
+ var n, i, r;
+ let a = t.node,
+ o = (n = a.loc) !== null && n !== void 0 ? n : F;
+ if (t.isJSXElement() || t.isJSXFragment()) return ut(e, t);
+ if (t.isJSXExpressionContainer()) {
+ let s = t.get('expression');
+ return s.isJSXEmptyExpression()
+ ? null
+ : (D.invariant(s.isExpression(), {
+ reason: `(BuildHIR::lowerJsxElement) Expected Expression but found ${s.type}!`,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = s.node.loc) !== null && i !== void 0 ? i : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ ut(e, s));
+ } else if (t.isJSXText()) {
+ let s;
+ return (
+ e.fbtDepth > 0 ? (s = t.node.value) : (s = YB(t.node.value)),
+ s === null ? null : Fe(e, {kind: 'JSXText', value: s, loc: o})
+ );
+ } else
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerJsxElement) Unhandled JsxElement, got: ${t.type}`,
+ category: K.Todo,
+ loc: (r = t.node.loc) !== null && r !== void 0 ? r : null,
+ suggestions: null,
+ }),
+ Fe(e, {kind: 'UnsupportedNode', node: a, loc: o})
+ );
+ }
+ function YB(e) {
+ let t = e.split(/\r\n|\n|\r/),
+ n = 0;
+ for (let r = 0; r < t.length; r++) t[r].match(/[^ \t]/) && (n = r);
+ let i = '';
+ for (let r = 0; r < t.length; r++) {
+ let a = t[r],
+ o = r === 0,
+ s = r === t.length - 1,
+ l = r === n,
+ d = a.replace(/\t/g, ' ');
+ o || (d = d.replace(/^[ ]+/, '')),
+ s || (d = d.replace(/[ ]+$/, '')),
+ d && (l || (d += ' '), (i += d));
+ }
+ return i.length !== 0 ? i : null;
+ }
+ function MI(e, t) {
+ var n;
+ let i = t.node,
+ r = (n = i.loc) !== null && n !== void 0 ? n : F,
+ a = NI(e, t);
+ return a
+ ? {
+ kind: 'FunctionExpression',
+ name: a.func.id,
+ nameHint: null,
+ type: t.node.type,
+ loc: r,
+ loweredFunc: a,
+ }
+ : {kind: 'UnsupportedNode', node: i, loc: r};
+ }
+ function NI(e, t) {
+ let n = e.environment.parentFunction.scope,
+ i = eU(t, n),
+ r = jI(t, e.environment, e.bindings, new Map([...e.context, ...i])),
+ a;
+ if (r.isErr()) {
+ let o = r.unwrapErr();
+ return e.errors.merge(o), null;
+ }
+ return (a = r.unwrap()), {func: a};
+ }
+ function ut(e, t) {
+ let n = CI(e, t);
+ return Fe(e, n);
+ }
+ function Fe(e, t) {
+ if (t.kind === 'LoadLocal' && t.place.identifier.name === null)
+ return t.place;
+ let n = Ln(e, t.loc);
+ return (
+ e.push({
+ id: V(0),
+ lvalue: Object.assign({}, n),
+ value: t,
+ effects: null,
+ loc: t.loc,
+ }),
+ n
+ );
+ }
+ function Ou(e, t) {
+ var n, i;
+ let a = (n = t.node.loc) !== null && n !== void 0 ? n : F,
+ o = e.resolveIdentifier(t);
+ switch (o.kind) {
+ case 'Identifier':
+ return {
+ kind: 'Identifier',
+ identifier: o.identifier,
+ effect: x.Unknown,
+ reactive: !1,
+ loc: a,
+ };
+ default:
+ return (
+ o.kind === 'Global' &&
+ o.name === 'eval' &&
+ e.errors.push({
+ reason: "The 'eval' function is not supported",
+ description:
+ 'Eval is an anti-pattern in JavaScript, and the code executed cannot be evaluated by React Compiler',
+ category: K.UnsupportedSyntax,
+ loc: (i = t.node.loc) !== null && i !== void 0 ? i : null,
+ suggestions: null,
+ }),
+ Fe(e, {kind: 'LoadGlobal', binding: o, loc: a})
+ );
+ }
+ }
+ function Ln(e, t) {
+ return {
+ kind: 'Identifier',
+ identifier: e.makeTemporary(t),
+ effect: x.Unknown,
+ reactive: !1,
+ loc: t,
+ };
+ }
+ function Wa(e, t) {
+ return e.isContextIdentifier(t) ? 'StoreContext' : 'StoreLocal';
+ }
+ function $h(e, t) {
+ return e.isContextIdentifier(t) ? 'LoadContext' : 'LoadLocal';
+ }
+ function Ga(e, t, n, i) {
+ var r, a;
+ let o = e.resolveIdentifier(i);
+ return o.kind !== 'Identifier'
+ ? n === Q.Reassign
+ ? {kind: 'Global', name: i.node.name}
+ : (e.errors.push({
+ reason:
+ '(BuildHIR::lowerAssignment) Could not find binding for declaration.',
+ category: K.Invariant,
+ loc: (r = i.node.loc) !== null && r !== void 0 ? r : null,
+ suggestions: null,
+ }),
+ null)
+ : o.bindingKind === 'const' && n === Q.Reassign
+ ? (e.errors.push({
+ reason: 'Cannot reassign a `const` variable',
+ category: K.Syntax,
+ loc: (a = i.node.loc) !== null && a !== void 0 ? a : null,
+ description:
+ o.identifier.name != null
+ ? `\`${o.identifier.name.value}\` is declared as const`
+ : null,
+ }),
+ null)
+ : {
+ kind: 'Identifier',
+ identifier: o.identifier,
+ effect: x.Unknown,
+ reactive: !1,
+ loc: t,
+ };
+ }
+ function Wn(e, t, n, i, r, a) {
+ var o,
+ s,
+ l,
+ d,
+ u,
+ p,
+ y,
+ m,
+ g,
+ S,
+ _,
+ O,
+ P,
+ M,
+ w,
+ I,
+ U,
+ A,
+ q,
+ ae,
+ le,
+ G,
+ ve,
+ de,
+ oe,
+ be,
+ $e;
+ let Ie = i.node;
+ switch (Ie.type) {
+ case 'Identifier': {
+ let Pe = i,
+ ke = Ga(e, t, n, Pe);
+ if (ke === null)
+ return {
+ kind: 'UnsupportedNode',
+ loc: (o = Pe.node.loc) !== null && o !== void 0 ? o : F,
+ node: Pe.node,
+ };
+ if (ke.kind === 'Global') {
+ let Ye = Fe(e, {
+ kind: 'StoreGlobal',
+ name: ke.name,
+ value: r,
+ loc: t,
+ });
+ return {kind: 'LoadLocal', place: Ye, loc: Ye.loc};
+ }
+ let je = e.environment.isHoistedIdentifier(Pe.node),
+ Ae;
+ if (e.isContextIdentifier(Pe))
+ n === Q.Const &&
+ !je &&
+ e.errors.push({
+ reason: 'Expected `const` declaration not to be reassigned',
+ category: K.Syntax,
+ loc: (s = Pe.node.loc) !== null && s !== void 0 ? s : null,
+ suggestions: null,
+ }),
+ n !== Q.Const && n !== Q.Reassign && n !== Q.Let && n !== Q.Function
+ ? (e.errors.push({
+ reason: 'Unexpected context variable kind',
+ category: K.Syntax,
+ loc: (l = Pe.node.loc) !== null && l !== void 0 ? l : null,
+ suggestions: null,
+ }),
+ (Ae = Fe(e, {
+ kind: 'UnsupportedNode',
+ node: Ie,
+ loc: (d = Ie.loc) !== null && d !== void 0 ? d : F,
+ })))
+ : (Ae = Fe(e, {
+ kind: 'StoreContext',
+ lvalue: {place: Object.assign({}, ke), kind: n},
+ value: r,
+ loc: t,
+ }));
+ else {
+ let Ye = Pe.get('typeAnnotation'),
+ bt;
+ Ye.isTSTypeAnnotation() || Ye.isTypeAnnotation()
+ ? (bt = Ye.get('typeAnnotation').node)
+ : (bt = null),
+ (Ae = Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {place: Object.assign({}, ke), kind: n},
+ value: r,
+ type: bt,
+ loc: t,
+ }));
+ }
+ return {kind: 'LoadLocal', place: Ae, loc: Ae.loc};
+ }
+ case 'MemberExpression': {
+ D.invariant(n === Q.Reassign, {
+ reason:
+ 'MemberExpression may only appear in an assignment expression',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (u = i.node.loc) !== null && u !== void 0 ? u : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let Pe = i,
+ ke = Pe.get('property'),
+ je = ut(e, Pe.get('object'));
+ if (!Pe.node.computed || Pe.get('property').isNumericLiteral()) {
+ let Ae;
+ if (ke.isIdentifier())
+ Ae = Fe(e, {
+ kind: 'PropertyStore',
+ object: je,
+ property: ke.node.name,
+ value: r,
+ loc: t,
+ });
+ else if (ke.isNumericLiteral())
+ Ae = Fe(e, {
+ kind: 'PropertyStore',
+ object: je,
+ property: ke.node.value,
+ value: r,
+ loc: t,
+ });
+ else
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerAssignment) Handle ${ke.type} properties in MemberExpression`,
+ category: K.Todo,
+ loc: (p = ke.node.loc) !== null && p !== void 0 ? p : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: Ie, loc: t}
+ );
+ return {kind: 'LoadLocal', place: Ae, loc: Ae.loc};
+ } else {
+ if (!ke.isExpression())
+ return (
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerAssignment) Expected private name to appear as a non-computed property',
+ category: K.Todo,
+ loc: (y = ke.node.loc) !== null && y !== void 0 ? y : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: Ie, loc: t}
+ );
+ let Ae = ut(e, ke),
+ Ye = Fe(e, {
+ kind: 'ComputedStore',
+ object: je,
+ property: Ae,
+ value: r,
+ loc: t,
+ });
+ return {kind: 'LoadLocal', place: Ye, loc: Ye.loc};
+ }
+ }
+ case 'ArrayPattern': {
+ let ke = i.get('elements'),
+ je = [],
+ Ae = [],
+ Ye =
+ n === Q.Reassign &&
+ (ke.some((st) => !st.isIdentifier()) ||
+ ke.some(
+ (st) =>
+ st.isIdentifier() &&
+ (Wa(e, st) !== 'StoreLocal' ||
+ e.resolveIdentifier(st).kind !== 'Identifier')
+ ));
+ for (let st = 0; st < ke.length; st++) {
+ let tt = ke[st];
+ if (tt.node == null) {
+ je.push({kind: 'Hole'});
+ continue;
+ }
+ if (tt.isRestElement()) {
+ let yt = tt.get('argument');
+ if (
+ yt.isIdentifier() &&
+ !Ye &&
+ (a === 'Assignment' || Wa(e, yt) === 'StoreLocal')
+ ) {
+ let dt = Ga(
+ e,
+ (m = tt.node.loc) !== null && m !== void 0 ? m : F,
+ n,
+ yt
+ );
+ if (dt === null) continue;
+ if (dt.kind === 'Global') {
+ e.errors.push({
+ category: K.Todo,
+ reason:
+ 'Expected reassignment of globals to enable forceTemporaries',
+ loc: (g = tt.node.loc) !== null && g !== void 0 ? g : F,
+ });
+ continue;
+ }
+ je.push({kind: 'Spread', place: dt});
+ } else {
+ let dt = Ln(
+ e,
+ (S = tt.node.loc) !== null && S !== void 0 ? S : F
+ );
+ $n(dt.identifier),
+ je.push({kind: 'Spread', place: Object.assign({}, dt)}),
+ Ae.push({place: dt, path: yt});
+ }
+ } else if (
+ tt.isIdentifier() &&
+ !Ye &&
+ (a === 'Assignment' || Wa(e, tt) === 'StoreLocal')
+ ) {
+ let yt = Ga(
+ e,
+ (_ = tt.node.loc) !== null && _ !== void 0 ? _ : F,
+ n,
+ tt
+ );
+ if (yt === null) continue;
+ if (yt.kind === 'Global') {
+ e.errors.push({
+ category: K.Todo,
+ reason:
+ 'Expected reassignment of globals to enable forceTemporaries',
+ loc: (O = tt.node.loc) !== null && O !== void 0 ? O : F,
+ });
+ continue;
+ }
+ je.push(yt);
+ } else {
+ let yt = Ln(e, (P = tt.node.loc) !== null && P !== void 0 ? P : F);
+ $n(yt.identifier),
+ je.push(Object.assign({}, yt)),
+ Ae.push({place: yt, path: tt});
+ }
+ }
+ let bt = Fe(e, {
+ kind: 'Destructure',
+ lvalue: {kind: n, pattern: {kind: 'ArrayPattern', items: je}},
+ value: r,
+ loc: t,
+ });
+ for (let {place: st, path: tt} of Ae)
+ Wn(
+ e,
+ (M = tt.node.loc) !== null && M !== void 0 ? M : t,
+ n,
+ tt,
+ st,
+ a
+ );
+ return {kind: 'LoadLocal', place: bt, loc: r.loc};
+ }
+ case 'ObjectPattern': {
+ let ke = i.get('properties'),
+ je = [],
+ Ae = [],
+ Ye =
+ n === Q.Reassign &&
+ ke.some(
+ (st) =>
+ st.isRestElement() ||
+ (st.isObjectProperty() &&
+ (!st.get('value').isIdentifier() ||
+ e.resolveIdentifier(st.get('value')).kind !== 'Identifier'))
+ );
+ for (let st = 0; st < ke.length; st++) {
+ let tt = ke[st];
+ if (tt.isRestElement()) {
+ let yt = tt.get('argument');
+ if (!yt.isIdentifier()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerAssignment) Handle ${yt.node.type} rest element in ObjectPattern`,
+ category: K.Todo,
+ loc: (w = yt.node.loc) !== null && w !== void 0 ? w : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ if (Ye || Wa(e, yt) === 'StoreContext') {
+ let dt = Ln(
+ e,
+ (I = tt.node.loc) !== null && I !== void 0 ? I : F
+ );
+ $n(dt.identifier),
+ je.push({kind: 'Spread', place: Object.assign({}, dt)}),
+ Ae.push({place: dt, path: yt});
+ } else {
+ let dt = Ga(
+ e,
+ (U = tt.node.loc) !== null && U !== void 0 ? U : F,
+ n,
+ yt
+ );
+ if (dt === null) continue;
+ if (dt.kind === 'Global') {
+ e.errors.push({
+ category: K.Todo,
+ reason:
+ 'Expected reassignment of globals to enable forceTemporaries',
+ loc: (A = tt.node.loc) !== null && A !== void 0 ? A : F,
+ });
+ continue;
+ }
+ je.push({kind: 'Spread', place: dt});
+ }
+ } else {
+ if (!tt.isObjectProperty()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerAssignment) Handle ${tt.type} properties in ObjectPattern`,
+ category: K.Todo,
+ loc: (q = tt.node.loc) !== null && q !== void 0 ? q : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ if (tt.node.computed) {
+ e.errors.push({
+ reason:
+ '(BuildHIR::lowerAssignment) Handle computed properties in ObjectPattern',
+ category: K.Todo,
+ loc: (ae = tt.node.loc) !== null && ae !== void 0 ? ae : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ let yt = cv(e, tt);
+ if (!yt) continue;
+ let dt = tt.get('value');
+ if (!dt.isLVal()) {
+ e.errors.push({
+ reason: `(BuildHIR::lowerAssignment) Expected object property value to be an LVal, got: ${dt.type}`,
+ category: K.Todo,
+ loc: (le = dt.node.loc) !== null && le !== void 0 ? le : null,
+ suggestions: null,
+ });
+ continue;
+ }
+ if (
+ dt.isIdentifier() &&
+ !Ye &&
+ (a === 'Assignment' || Wa(e, dt) === 'StoreLocal')
+ ) {
+ let qt = Ga(
+ e,
+ (G = dt.node.loc) !== null && G !== void 0 ? G : F,
+ n,
+ dt
+ );
+ if (qt === null) continue;
+ if (qt.kind === 'Global') {
+ e.errors.push({
+ category: K.Todo,
+ reason:
+ 'Expected reassignment of globals to enable forceTemporaries',
+ loc: (ve = dt.node.loc) !== null && ve !== void 0 ? ve : F,
+ });
+ continue;
+ }
+ je.push({
+ kind: 'ObjectProperty',
+ type: 'property',
+ place: qt,
+ key: yt,
+ });
+ } else {
+ let qt = Ln(
+ e,
+ (de = dt.node.loc) !== null && de !== void 0 ? de : F
+ );
+ $n(qt.identifier),
+ je.push({
+ kind: 'ObjectProperty',
+ type: 'property',
+ place: Object.assign({}, qt),
+ key: yt,
+ }),
+ Ae.push({place: qt, path: dt});
+ }
+ }
+ }
+ let bt = Fe(e, {
+ kind: 'Destructure',
+ lvalue: {kind: n, pattern: {kind: 'ObjectPattern', properties: je}},
+ value: r,
+ loc: t,
+ });
+ for (let {place: st, path: tt} of Ae)
+ Wn(
+ e,
+ (oe = tt.node.loc) !== null && oe !== void 0 ? oe : t,
+ n,
+ tt,
+ st,
+ a
+ );
+ return {kind: 'LoadLocal', place: bt, loc: r.loc};
+ }
+ case 'AssignmentPattern': {
+ let Pe = i,
+ ke = (be = Pe.node.loc) !== null && be !== void 0 ? be : F,
+ je = Ln(e, ke),
+ Ae = e.reserve('value'),
+ Ye = e.reserve(e.currentBlockKind()),
+ bt = e.enter('value', () => {
+ let dt = DI(e, Pe.get('right'));
+ return (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, je)},
+ value: Object.assign({}, dt),
+ type: null,
+ loc: ke,
+ }),
+ {kind: 'goto', variant: St.Break, block: Ye.id, id: V(0), loc: ke}
+ );
+ }),
+ st = e.enter(
+ 'value',
+ () => (
+ Fe(e, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, je)},
+ value: Object.assign({}, r),
+ type: null,
+ loc: ke,
+ }),
+ {kind: 'goto', variant: St.Break, block: Ye.id, id: V(0), loc: ke}
+ )
+ );
+ e.terminateWithContinuation(
+ {kind: 'ternary', test: Ae.id, fallthrough: Ye.id, id: V(0), loc: ke},
+ Ae
+ );
+ let tt = Fe(e, {kind: 'Primitive', value: void 0, loc: ke}),
+ yt = Fe(e, {
+ kind: 'BinaryExpression',
+ left: Object.assign({}, r),
+ operator: '===',
+ right: Object.assign({}, tt),
+ loc: ke,
+ });
+ return (
+ e.terminateWithContinuation(
+ {
+ kind: 'branch',
+ test: Object.assign({}, yt),
+ consequent: bt,
+ alternate: st,
+ fallthrough: Ye.id,
+ id: V(0),
+ loc: ke,
+ },
+ Ye
+ ),
+ Wn(e, ke, n, Pe.get('left'), je, a)
+ );
+ }
+ default:
+ return (
+ e.errors.push({
+ reason: `(BuildHIR::lowerAssignment) Handle ${i.type} assignments`,
+ category: K.Todo,
+ loc: ($e = i.node.loc) !== null && $e !== void 0 ? $e : null,
+ suggestions: null,
+ }),
+ {kind: 'UnsupportedNode', node: Ie, loc: t}
+ );
+ }
+ }
+ function QB({from: e, to: t}) {
+ let n = new Set();
+ for (; e && (n.add(e), e !== t); ) e = e.parent;
+ return n;
+ }
+ function eU(e, t) {
+ let n = new Map(),
+ i = QB({from: e.scope.parent, to: t});
+ function r(a) {
+ var o, s;
+ let l;
+ if (a.isJSXOpeningElement()) {
+ let u = a.get('name');
+ if (!(u.isJSXMemberExpression() || u.isJSXIdentifier())) return;
+ let p = u;
+ for (; p.isJSXMemberExpression(); ) p = p.get('object');
+ so(p.isJSXIdentifier(), 'Invalid logic in gatherCapturedDeps'), (l = p);
+ } else l = a;
+ a.skip();
+ let d = l.scope.getBinding(l.node.name);
+ d !== void 0 &&
+ i.has(d.scope) &&
+ !n.has(d.identifier) &&
+ n.set(
+ d.identifier,
+ (s =
+ (o = a.node.loc) !== null && o !== void 0
+ ? o
+ : d.identifier.loc) !== null && s !== void 0
+ ? s
+ : F
+ );
+ }
+ return (
+ e.traverse({
+ TypeAnnotation(a) {
+ a.skip();
+ },
+ TSTypeAnnotation(a) {
+ a.skip();
+ },
+ TypeAlias(a) {
+ a.skip();
+ },
+ TSTypeAliasDeclaration(a) {
+ a.skip();
+ },
+ Expression(a) {
+ if (a.isAssignmentExpression()) {
+ let o = a.get('left');
+ o.isIdentifier() && r(o);
+ return;
+ } else
+ a.isJSXElement()
+ ? r(a.get('openingElement'))
+ : a.isIdentifier() && r(a);
+ },
+ }),
+ n
+ );
+ }
+ function SE(e) {
+ return e !== null;
+ }
+ function Fp(e) {
+ switch (e.type) {
+ case 'GenericTypeAnnotation': {
+ let t = e.id;
+ return t.type === 'Identifier' && t.name === 'Array'
+ ? {kind: 'Object', shapeId: Ht}
+ : Gn();
+ }
+ case 'TSTypeReference': {
+ let t = e.typeName;
+ return t.type === 'Identifier' && t.name === 'Array'
+ ? {kind: 'Object', shapeId: Ht}
+ : Gn();
+ }
+ case 'ArrayTypeAnnotation':
+ case 'TSArrayType':
+ return {kind: 'Object', shapeId: Ht};
+ case 'BooleanLiteralTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'NullLiteralTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'TSBooleanKeyword':
+ case 'TSNullKeyword':
+ case 'TSNumberKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSUndefinedKeyword':
+ case 'TSVoidKeyword':
+ case 'VoidTypeAnnotation':
+ return {kind: 'Primitive'};
+ default:
+ return Gn();
+ }
+ }
+ function tU(e) {
+ let t = [];
+ vI(
+ [...gI(e)],
+ (a) => a.range,
+ {fallthroughs: new Map(), rewrites: t, env: e.env},
+ nU,
+ rU
+ );
+ let n = new Map(),
+ i = new Map();
+ t.reverse();
+ for (let [, a] of e.body.blocks) {
+ let o = {
+ nextBlockId: a.id,
+ rewrites: [],
+ nextPreds: a.preds,
+ instrSliceIdx: 0,
+ source: a,
+ };
+ for (let s = 0; s < a.instructions.length + 1; s++) {
+ let l =
+ s < a.instructions.length ? a.instructions[s].id : a.terminal.id,
+ d = t.at(-1);
+ for (; d != null && d.instrId <= l; )
+ iU(d, s, o), t.pop(), (d = t.at(-1));
+ }
+ if (o.rewrites.length > 0) {
+ let s = {
+ id: o.nextBlockId,
+ kind: a.kind,
+ preds: o.nextPreds,
+ terminal: a.terminal,
+ instructions: a.instructions.slice(o.instrSliceIdx),
+ phis: new Set(),
+ };
+ o.rewrites.push(s);
+ for (let l of o.rewrites) i.set(l.id, l);
+ n.set(a.id, s.id);
+ } else i.set(a.id, a);
+ }
+ let r = e.body.blocks;
+ e.body.blocks = i;
+ for (let [, a] of r)
+ for (let o of a.phis)
+ for (let [s, l] of o.operands) {
+ let d = n.get(s);
+ d != null && (o.operands.delete(s), o.operands.set(d, l));
+ }
+ Pa(e.body), xa(e.body), fr(e.body), _h(e.body);
+ }
+ function nU(e, t) {
+ let n = t.env.nextBlockId,
+ i = t.env.nextBlockId;
+ t.rewrites.push({
+ kind: 'StartScope',
+ blockId: n,
+ fallthroughId: i,
+ instrId: e.range.start,
+ scope: e,
+ }),
+ t.fallthroughs.set(e.id, i);
+ }
+ function rU(e, t) {
+ let n = t.fallthroughs.get(e.id);
+ D.invariant(n != null, {
+ reason: 'Expected scope to exist',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ t.rewrites.push({
+ kind: 'EndScope',
+ fallthroughId: n,
+ instrId: e.range.end,
+ });
+ }
+ function iU(e, t, n) {
+ let i =
+ e.kind === 'StartScope'
+ ? {
+ kind: 'scope',
+ fallthrough: e.fallthroughId,
+ block: e.blockId,
+ scope: e.scope,
+ id: e.instrId,
+ loc: F,
+ }
+ : {
+ kind: 'goto',
+ variant: St.Break,
+ block: e.fallthroughId,
+ id: e.instrId,
+ loc: F,
+ },
+ r = n.nextBlockId;
+ n.rewrites.push({
+ kind: n.source.kind,
+ id: r,
+ instructions: n.source.instructions.slice(n.instrSliceIdx, t),
+ preds: n.nextPreds,
+ phis: n.rewrites.length === 0 ? n.source.phis : new Set(),
+ terminal: i,
+ }),
+ (n.nextPreds = new Set([r])),
+ (n.nextBlockId = e.kind === 'StartScope' ? e.blockId : e.fallthroughId),
+ (n.instrSliceIdx = t);
+ }
+ var xm = {},
+ aU = {
+ get exports() {
+ return xm;
+ },
+ set exports(e) {
+ xm = e;
+ },
+ },
+ wm = {},
+ oU = {
+ get exports() {
+ return wm;
+ },
+ set exports(e) {
+ wm = e;
+ },
+ },
+ jg,
+ _E;
+ function sU() {
+ return (
+ _E ||
+ ((_E = 1),
+ (jg = {
+ aliceblue: [240, 248, 255],
+ antiquewhite: [250, 235, 215],
+ aqua: [0, 255, 255],
+ aquamarine: [127, 255, 212],
+ azure: [240, 255, 255],
+ beige: [245, 245, 220],
+ bisque: [255, 228, 196],
+ black: [0, 0, 0],
+ blanchedalmond: [255, 235, 205],
+ blue: [0, 0, 255],
+ blueviolet: [138, 43, 226],
+ brown: [165, 42, 42],
+ burlywood: [222, 184, 135],
+ cadetblue: [95, 158, 160],
+ chartreuse: [127, 255, 0],
+ chocolate: [210, 105, 30],
+ coral: [255, 127, 80],
+ cornflowerblue: [100, 149, 237],
+ cornsilk: [255, 248, 220],
+ crimson: [220, 20, 60],
+ cyan: [0, 255, 255],
+ darkblue: [0, 0, 139],
+ darkcyan: [0, 139, 139],
+ darkgoldenrod: [184, 134, 11],
+ darkgray: [169, 169, 169],
+ darkgreen: [0, 100, 0],
+ darkgrey: [169, 169, 169],
+ darkkhaki: [189, 183, 107],
+ darkmagenta: [139, 0, 139],
+ darkolivegreen: [85, 107, 47],
+ darkorange: [255, 140, 0],
+ darkorchid: [153, 50, 204],
+ darkred: [139, 0, 0],
+ darksalmon: [233, 150, 122],
+ darkseagreen: [143, 188, 143],
+ darkslateblue: [72, 61, 139],
+ darkslategray: [47, 79, 79],
+ darkslategrey: [47, 79, 79],
+ darkturquoise: [0, 206, 209],
+ darkviolet: [148, 0, 211],
+ deeppink: [255, 20, 147],
+ deepskyblue: [0, 191, 255],
+ dimgray: [105, 105, 105],
+ dimgrey: [105, 105, 105],
+ dodgerblue: [30, 144, 255],
+ firebrick: [178, 34, 34],
+ floralwhite: [255, 250, 240],
+ forestgreen: [34, 139, 34],
+ fuchsia: [255, 0, 255],
+ gainsboro: [220, 220, 220],
+ ghostwhite: [248, 248, 255],
+ gold: [255, 215, 0],
+ goldenrod: [218, 165, 32],
+ gray: [128, 128, 128],
+ green: [0, 128, 0],
+ greenyellow: [173, 255, 47],
+ grey: [128, 128, 128],
+ honeydew: [240, 255, 240],
+ hotpink: [255, 105, 180],
+ indianred: [205, 92, 92],
+ indigo: [75, 0, 130],
+ ivory: [255, 255, 240],
+ khaki: [240, 230, 140],
+ lavender: [230, 230, 250],
+ lavenderblush: [255, 240, 245],
+ lawngreen: [124, 252, 0],
+ lemonchiffon: [255, 250, 205],
+ lightblue: [173, 216, 230],
+ lightcoral: [240, 128, 128],
+ lightcyan: [224, 255, 255],
+ lightgoldenrodyellow: [250, 250, 210],
+ lightgray: [211, 211, 211],
+ lightgreen: [144, 238, 144],
+ lightgrey: [211, 211, 211],
+ lightpink: [255, 182, 193],
+ lightsalmon: [255, 160, 122],
+ lightseagreen: [32, 178, 170],
+ lightskyblue: [135, 206, 250],
+ lightslategray: [119, 136, 153],
+ lightslategrey: [119, 136, 153],
+ lightsteelblue: [176, 196, 222],
+ lightyellow: [255, 255, 224],
+ lime: [0, 255, 0],
+ limegreen: [50, 205, 50],
+ linen: [250, 240, 230],
+ magenta: [255, 0, 255],
+ maroon: [128, 0, 0],
+ mediumaquamarine: [102, 205, 170],
+ mediumblue: [0, 0, 205],
+ mediumorchid: [186, 85, 211],
+ mediumpurple: [147, 112, 219],
+ mediumseagreen: [60, 179, 113],
+ mediumslateblue: [123, 104, 238],
+ mediumspringgreen: [0, 250, 154],
+ mediumturquoise: [72, 209, 204],
+ mediumvioletred: [199, 21, 133],
+ midnightblue: [25, 25, 112],
+ mintcream: [245, 255, 250],
+ mistyrose: [255, 228, 225],
+ moccasin: [255, 228, 181],
+ navajowhite: [255, 222, 173],
+ navy: [0, 0, 128],
+ oldlace: [253, 245, 230],
+ olive: [128, 128, 0],
+ olivedrab: [107, 142, 35],
+ orange: [255, 165, 0],
+ orangered: [255, 69, 0],
+ orchid: [218, 112, 214],
+ palegoldenrod: [238, 232, 170],
+ palegreen: [152, 251, 152],
+ paleturquoise: [175, 238, 238],
+ palevioletred: [219, 112, 147],
+ papayawhip: [255, 239, 213],
+ peachpuff: [255, 218, 185],
+ peru: [205, 133, 63],
+ pink: [255, 192, 203],
+ plum: [221, 160, 221],
+ powderblue: [176, 224, 230],
+ purple: [128, 0, 128],
+ rebeccapurple: [102, 51, 153],
+ red: [255, 0, 0],
+ rosybrown: [188, 143, 143],
+ royalblue: [65, 105, 225],
+ saddlebrown: [139, 69, 19],
+ salmon: [250, 128, 114],
+ sandybrown: [244, 164, 96],
+ seagreen: [46, 139, 87],
+ seashell: [255, 245, 238],
+ sienna: [160, 82, 45],
+ silver: [192, 192, 192],
+ skyblue: [135, 206, 235],
+ slateblue: [106, 90, 205],
+ slategray: [112, 128, 144],
+ slategrey: [112, 128, 144],
+ snow: [255, 250, 250],
+ springgreen: [0, 255, 127],
+ steelblue: [70, 130, 180],
+ tan: [210, 180, 140],
+ teal: [0, 128, 128],
+ thistle: [216, 191, 216],
+ tomato: [255, 99, 71],
+ turquoise: [64, 224, 208],
+ violet: [238, 130, 238],
+ wheat: [245, 222, 179],
+ white: [255, 255, 255],
+ whitesmoke: [245, 245, 245],
+ yellow: [255, 255, 0],
+ yellowgreen: [154, 205, 50],
+ })),
+ jg
+ );
+ }
+ var TE;
+ function RI() {
+ if (TE) return wm;
+ TE = 1;
+ var e = sU(),
+ t = {};
+ for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
+ var i = (oU.exports = {
+ rgb: {channels: 3, labels: 'rgb'},
+ hsl: {channels: 3, labels: 'hsl'},
+ hsv: {channels: 3, labels: 'hsv'},
+ hwb: {channels: 3, labels: 'hwb'},
+ cmyk: {channels: 4, labels: 'cmyk'},
+ xyz: {channels: 3, labels: 'xyz'},
+ lab: {channels: 3, labels: 'lab'},
+ lch: {channels: 3, labels: 'lch'},
+ hex: {channels: 1, labels: ['hex']},
+ keyword: {channels: 1, labels: ['keyword']},
+ ansi16: {channels: 1, labels: ['ansi16']},
+ ansi256: {channels: 1, labels: ['ansi256']},
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
+ gray: {channels: 1, labels: ['gray']},
+ });
+ for (var r in i)
+ if (i.hasOwnProperty(r)) {
+ if (!('channels' in i[r]))
+ throw new Error('missing channels property: ' + r);
+ if (!('labels' in i[r]))
+ throw new Error('missing channel labels property: ' + r);
+ if (i[r].labels.length !== i[r].channels)
+ throw new Error('channel and label counts mismatch: ' + r);
+ var a = i[r].channels,
+ o = i[r].labels;
+ delete i[r].channels,
+ delete i[r].labels,
+ Object.defineProperty(i[r], 'channels', {value: a}),
+ Object.defineProperty(i[r], 'labels', {value: o});
+ }
+ (i.rgb.hsl = function (l) {
+ var d = l[0] / 255,
+ u = l[1] / 255,
+ p = l[2] / 255,
+ y = Math.min(d, u, p),
+ m = Math.max(d, u, p),
+ g = m - y,
+ S,
+ _,
+ O;
+ return (
+ m === y
+ ? (S = 0)
+ : d === m
+ ? (S = (u - p) / g)
+ : u === m
+ ? (S = 2 + (p - d) / g)
+ : p === m && (S = 4 + (d - u) / g),
+ (S = Math.min(S * 60, 360)),
+ S < 0 && (S += 360),
+ (O = (y + m) / 2),
+ m === y
+ ? (_ = 0)
+ : O <= 0.5
+ ? (_ = g / (m + y))
+ : (_ = g / (2 - m - y)),
+ [S, _ * 100, O * 100]
+ );
+ }),
+ (i.rgb.hsv = function (l) {
+ var d,
+ u,
+ p,
+ y,
+ m,
+ g = l[0] / 255,
+ S = l[1] / 255,
+ _ = l[2] / 255,
+ O = Math.max(g, S, _),
+ P = O - Math.min(g, S, _),
+ M = function (w) {
+ return (O - w) / 6 / P + 1 / 2;
+ };
+ return (
+ P === 0
+ ? (y = m = 0)
+ : ((m = P / O),
+ (d = M(g)),
+ (u = M(S)),
+ (p = M(_)),
+ g === O
+ ? (y = p - u)
+ : S === O
+ ? (y = 1 / 3 + d - p)
+ : _ === O && (y = 2 / 3 + u - d),
+ y < 0 ? (y += 1) : y > 1 && (y -= 1)),
+ [y * 360, m * 100, O * 100]
+ );
+ }),
+ (i.rgb.hwb = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y = i.rgb.hsl(l)[0],
+ m = (1 / 255) * Math.min(d, Math.min(u, p));
+ return (
+ (p = 1 - (1 / 255) * Math.max(d, Math.max(u, p))),
+ [y, m * 100, p * 100]
+ );
+ }),
+ (i.rgb.cmyk = function (l) {
+ var d = l[0] / 255,
+ u = l[1] / 255,
+ p = l[2] / 255,
+ y,
+ m,
+ g,
+ S;
+ return (
+ (S = Math.min(1 - d, 1 - u, 1 - p)),
+ (y = (1 - d - S) / (1 - S) || 0),
+ (m = (1 - u - S) / (1 - S) || 0),
+ (g = (1 - p - S) / (1 - S) || 0),
+ [y * 100, m * 100, g * 100, S * 100]
+ );
+ });
+ function s(l, d) {
+ return (
+ Math.pow(l[0] - d[0], 2) +
+ Math.pow(l[1] - d[1], 2) +
+ Math.pow(l[2] - d[2], 2)
+ );
+ }
+ return (
+ (i.rgb.keyword = function (l) {
+ var d = t[l];
+ if (d) return d;
+ var u = 1 / 0,
+ p;
+ for (var y in e)
+ if (e.hasOwnProperty(y)) {
+ var m = e[y],
+ g = s(l, m);
+ g < u && ((u = g), (p = y));
+ }
+ return p;
+ }),
+ (i.keyword.rgb = function (l) {
+ return e[l];
+ }),
+ (i.rgb.xyz = function (l) {
+ var d = l[0] / 255,
+ u = l[1] / 255,
+ p = l[2] / 255;
+ (d = d > 0.04045 ? Math.pow((d + 0.055) / 1.055, 2.4) : d / 12.92),
+ (u = u > 0.04045 ? Math.pow((u + 0.055) / 1.055, 2.4) : u / 12.92),
+ (p = p > 0.04045 ? Math.pow((p + 0.055) / 1.055, 2.4) : p / 12.92);
+ var y = d * 0.4124 + u * 0.3576 + p * 0.1805,
+ m = d * 0.2126 + u * 0.7152 + p * 0.0722,
+ g = d * 0.0193 + u * 0.1192 + p * 0.9505;
+ return [y * 100, m * 100, g * 100];
+ }),
+ (i.rgb.lab = function (l) {
+ var d = i.rgb.xyz(l),
+ u = d[0],
+ p = d[1],
+ y = d[2],
+ m,
+ g,
+ S;
+ return (
+ (u /= 95.047),
+ (p /= 100),
+ (y /= 108.883),
+ (u = u > 0.008856 ? Math.pow(u, 1 / 3) : 7.787 * u + 16 / 116),
+ (p = p > 0.008856 ? Math.pow(p, 1 / 3) : 7.787 * p + 16 / 116),
+ (y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116),
+ (m = 116 * p - 16),
+ (g = 500 * (u - p)),
+ (S = 200 * (p - y)),
+ [m, g, S]
+ );
+ }),
+ (i.hsl.rgb = function (l) {
+ var d = l[0] / 360,
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y,
+ m,
+ g,
+ S,
+ _;
+ if (u === 0) return (_ = p * 255), [_, _, _];
+ p < 0.5 ? (m = p * (1 + u)) : (m = p + u - p * u),
+ (y = 2 * p - m),
+ (S = [0, 0, 0]);
+ for (var O = 0; O < 3; O++)
+ (g = d + (1 / 3) * -(O - 1)),
+ g < 0 && g++,
+ g > 1 && g--,
+ 6 * g < 1
+ ? (_ = y + (m - y) * 6 * g)
+ : 2 * g < 1
+ ? (_ = m)
+ : 3 * g < 2
+ ? (_ = y + (m - y) * (2 / 3 - g) * 6)
+ : (_ = y),
+ (S[O] = _ * 255);
+ return S;
+ }),
+ (i.hsl.hsv = function (l) {
+ var d = l[0],
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y = u,
+ m = Math.max(p, 0.01),
+ g,
+ S;
+ return (
+ (p *= 2),
+ (u *= p <= 1 ? p : 2 - p),
+ (y *= m <= 1 ? m : 2 - m),
+ (S = (p + u) / 2),
+ (g = p === 0 ? (2 * y) / (m + y) : (2 * u) / (p + u)),
+ [d, g * 100, S * 100]
+ );
+ }),
+ (i.hsv.rgb = function (l) {
+ var d = l[0] / 60,
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y = Math.floor(d) % 6,
+ m = d - Math.floor(d),
+ g = 255 * p * (1 - u),
+ S = 255 * p * (1 - u * m),
+ _ = 255 * p * (1 - u * (1 - m));
+ switch (((p *= 255), y)) {
+ case 0:
+ return [p, _, g];
+ case 1:
+ return [S, p, g];
+ case 2:
+ return [g, p, _];
+ case 3:
+ return [g, S, p];
+ case 4:
+ return [_, g, p];
+ case 5:
+ return [p, g, S];
+ }
+ }),
+ (i.hsv.hsl = function (l) {
+ var d = l[0],
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y = Math.max(p, 0.01),
+ m,
+ g,
+ S;
+ return (
+ (S = (2 - u) * p),
+ (m = (2 - u) * y),
+ (g = u * y),
+ (g /= m <= 1 ? m : 2 - m),
+ (g = g || 0),
+ (S /= 2),
+ [d, g * 100, S * 100]
+ );
+ }),
+ (i.hwb.rgb = function (l) {
+ var d = l[0] / 360,
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y = u + p,
+ m,
+ g,
+ S,
+ _;
+ y > 1 && ((u /= y), (p /= y)),
+ (m = Math.floor(6 * d)),
+ (g = 1 - p),
+ (S = 6 * d - m),
+ m & 1 && (S = 1 - S),
+ (_ = u + S * (g - u));
+ var O, P, M;
+ switch (m) {
+ default:
+ case 6:
+ case 0:
+ (O = g), (P = _), (M = u);
+ break;
+ case 1:
+ (O = _), (P = g), (M = u);
+ break;
+ case 2:
+ (O = u), (P = g), (M = _);
+ break;
+ case 3:
+ (O = u), (P = _), (M = g);
+ break;
+ case 4:
+ (O = _), (P = u), (M = g);
+ break;
+ case 5:
+ (O = g), (P = u), (M = _);
+ break;
+ }
+ return [O * 255, P * 255, M * 255];
+ }),
+ (i.cmyk.rgb = function (l) {
+ var d = l[0] / 100,
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y = l[3] / 100,
+ m,
+ g,
+ S;
+ return (
+ (m = 1 - Math.min(1, d * (1 - y) + y)),
+ (g = 1 - Math.min(1, u * (1 - y) + y)),
+ (S = 1 - Math.min(1, p * (1 - y) + y)),
+ [m * 255, g * 255, S * 255]
+ );
+ }),
+ (i.xyz.rgb = function (l) {
+ var d = l[0] / 100,
+ u = l[1] / 100,
+ p = l[2] / 100,
+ y,
+ m,
+ g;
+ return (
+ (y = d * 3.2406 + u * -1.5372 + p * -0.4986),
+ (m = d * -0.9689 + u * 1.8758 + p * 0.0415),
+ (g = d * 0.0557 + u * -0.204 + p * 1.057),
+ (y =
+ y > 0.0031308 ? 1.055 * Math.pow(y, 1 / 2.4) - 0.055 : y * 12.92),
+ (m =
+ m > 0.0031308 ? 1.055 * Math.pow(m, 1 / 2.4) - 0.055 : m * 12.92),
+ (g =
+ g > 0.0031308 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92),
+ (y = Math.min(Math.max(0, y), 1)),
+ (m = Math.min(Math.max(0, m), 1)),
+ (g = Math.min(Math.max(0, g), 1)),
+ [y * 255, m * 255, g * 255]
+ );
+ }),
+ (i.xyz.lab = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y,
+ m,
+ g;
+ return (
+ (d /= 95.047),
+ (u /= 100),
+ (p /= 108.883),
+ (d = d > 0.008856 ? Math.pow(d, 1 / 3) : 7.787 * d + 16 / 116),
+ (u = u > 0.008856 ? Math.pow(u, 1 / 3) : 7.787 * u + 16 / 116),
+ (p = p > 0.008856 ? Math.pow(p, 1 / 3) : 7.787 * p + 16 / 116),
+ (y = 116 * u - 16),
+ (m = 500 * (d - u)),
+ (g = 200 * (u - p)),
+ [y, m, g]
+ );
+ }),
+ (i.lab.xyz = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y,
+ m,
+ g;
+ (m = (d + 16) / 116), (y = u / 500 + m), (g = m - p / 200);
+ var S = Math.pow(m, 3),
+ _ = Math.pow(y, 3),
+ O = Math.pow(g, 3);
+ return (
+ (m = S > 0.008856 ? S : (m - 16 / 116) / 7.787),
+ (y = _ > 0.008856 ? _ : (y - 16 / 116) / 7.787),
+ (g = O > 0.008856 ? O : (g - 16 / 116) / 7.787),
+ (y *= 95.047),
+ (m *= 100),
+ (g *= 108.883),
+ [y, m, g]
+ );
+ }),
+ (i.lab.lch = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y,
+ m,
+ g;
+ return (
+ (y = Math.atan2(p, u)),
+ (m = (y * 360) / 2 / Math.PI),
+ m < 0 && (m += 360),
+ (g = Math.sqrt(u * u + p * p)),
+ [d, g, m]
+ );
+ }),
+ (i.lch.lab = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y,
+ m,
+ g;
+ return (
+ (g = (p / 360) * 2 * Math.PI),
+ (y = u * Math.cos(g)),
+ (m = u * Math.sin(g)),
+ [d, y, m]
+ );
+ }),
+ (i.rgb.ansi16 = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2],
+ y = 1 in arguments ? arguments[1] : i.rgb.hsv(l)[2];
+ if (((y = Math.round(y / 50)), y === 0)) return 30;
+ var m =
+ 30 +
+ ((Math.round(p / 255) << 2) |
+ (Math.round(u / 255) << 1) |
+ Math.round(d / 255));
+ return y === 2 && (m += 60), m;
+ }),
+ (i.hsv.ansi16 = function (l) {
+ return i.rgb.ansi16(i.hsv.rgb(l), l[2]);
+ }),
+ (i.rgb.ansi256 = function (l) {
+ var d = l[0],
+ u = l[1],
+ p = l[2];
+ if (d === u && u === p)
+ return d < 8
+ ? 16
+ : d > 248
+ ? 231
+ : Math.round(((d - 8) / 247) * 24) + 232;
+ var y =
+ 16 +
+ 36 * Math.round((d / 255) * 5) +
+ 6 * Math.round((u / 255) * 5) +
+ Math.round((p / 255) * 5);
+ return y;
+ }),
+ (i.ansi16.rgb = function (l) {
+ var d = l % 10;
+ if (d === 0 || d === 7)
+ return l > 50 && (d += 3.5), (d = (d / 10.5) * 255), [d, d, d];
+ var u = (~~(l > 50) + 1) * 0.5,
+ p = (d & 1) * u * 255,
+ y = ((d >> 1) & 1) * u * 255,
+ m = ((d >> 2) & 1) * u * 255;
+ return [p, y, m];
+ }),
+ (i.ansi256.rgb = function (l) {
+ if (l >= 232) {
+ var d = (l - 232) * 10 + 8;
+ return [d, d, d];
+ }
+ l -= 16;
+ var u,
+ p = (Math.floor(l / 36) / 5) * 255,
+ y = (Math.floor((u = l % 36) / 6) / 5) * 255,
+ m = ((u % 6) / 5) * 255;
+ return [p, y, m];
+ }),
+ (i.rgb.hex = function (l) {
+ var d =
+ ((Math.round(l[0]) & 255) << 16) +
+ ((Math.round(l[1]) & 255) << 8) +
+ (Math.round(l[2]) & 255),
+ u = d.toString(16).toUpperCase();
+ return '000000'.substring(u.length) + u;
+ }),
+ (i.hex.rgb = function (l) {
+ var d = l.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+ if (!d) return [0, 0, 0];
+ var u = d[0];
+ d[0].length === 3 &&
+ (u = u
+ .split('')
+ .map(function (S) {
+ return S + S;
+ })
+ .join(''));
+ var p = parseInt(u, 16),
+ y = (p >> 16) & 255,
+ m = (p >> 8) & 255,
+ g = p & 255;
+ return [y, m, g];
+ }),
+ (i.rgb.hcg = function (l) {
+ var d = l[0] / 255,
+ u = l[1] / 255,
+ p = l[2] / 255,
+ y = Math.max(Math.max(d, u), p),
+ m = Math.min(Math.min(d, u), p),
+ g = y - m,
+ S,
+ _;
+ return (
+ g < 1 ? (S = m / (1 - g)) : (S = 0),
+ g <= 0
+ ? (_ = 0)
+ : y === d
+ ? (_ = ((u - p) / g) % 6)
+ : y === u
+ ? (_ = 2 + (p - d) / g)
+ : (_ = 4 + (d - u) / g + 4),
+ (_ /= 6),
+ (_ %= 1),
+ [_ * 360, g * 100, S * 100]
+ );
+ }),
+ (i.hsl.hcg = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = 1,
+ y = 0;
+ return (
+ u < 0.5 ? (p = 2 * d * u) : (p = 2 * d * (1 - u)),
+ p < 1 && (y = (u - 0.5 * p) / (1 - p)),
+ [l[0], p * 100, y * 100]
+ );
+ }),
+ (i.hsv.hcg = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = d * u,
+ y = 0;
+ return p < 1 && (y = (u - p) / (1 - p)), [l[0], p * 100, y * 100];
+ }),
+ (i.hcg.rgb = function (l) {
+ var d = l[0] / 360,
+ u = l[1] / 100,
+ p = l[2] / 100;
+ if (u === 0) return [p * 255, p * 255, p * 255];
+ var y = [0, 0, 0],
+ m = (d % 1) * 6,
+ g = m % 1,
+ S = 1 - g,
+ _ = 0;
+ switch (Math.floor(m)) {
+ case 0:
+ (y[0] = 1), (y[1] = g), (y[2] = 0);
+ break;
+ case 1:
+ (y[0] = S), (y[1] = 1), (y[2] = 0);
+ break;
+ case 2:
+ (y[0] = 0), (y[1] = 1), (y[2] = g);
+ break;
+ case 3:
+ (y[0] = 0), (y[1] = S), (y[2] = 1);
+ break;
+ case 4:
+ (y[0] = g), (y[1] = 0), (y[2] = 1);
+ break;
+ default:
+ (y[0] = 1), (y[1] = 0), (y[2] = S);
+ }
+ return (
+ (_ = (1 - u) * p),
+ [(u * y[0] + _) * 255, (u * y[1] + _) * 255, (u * y[2] + _) * 255]
+ );
+ }),
+ (i.hcg.hsv = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = d + u * (1 - d),
+ y = 0;
+ return p > 0 && (y = d / p), [l[0], y * 100, p * 100];
+ }),
+ (i.hcg.hsl = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = u * (1 - d) + 0.5 * d,
+ y = 0;
+ return (
+ p > 0 && p < 0.5
+ ? (y = d / (2 * p))
+ : p >= 0.5 && p < 1 && (y = d / (2 * (1 - p))),
+ [l[0], y * 100, p * 100]
+ );
+ }),
+ (i.hcg.hwb = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = d + u * (1 - d);
+ return [l[0], (p - d) * 100, (1 - p) * 100];
+ }),
+ (i.hwb.hcg = function (l) {
+ var d = l[1] / 100,
+ u = l[2] / 100,
+ p = 1 - u,
+ y = p - d,
+ m = 0;
+ return y < 1 && (m = (p - y) / (1 - y)), [l[0], y * 100, m * 100];
+ }),
+ (i.apple.rgb = function (l) {
+ return [
+ (l[0] / 65535) * 255,
+ (l[1] / 65535) * 255,
+ (l[2] / 65535) * 255,
+ ];
+ }),
+ (i.rgb.apple = function (l) {
+ return [
+ (l[0] / 255) * 65535,
+ (l[1] / 255) * 65535,
+ (l[2] / 255) * 65535,
+ ];
+ }),
+ (i.gray.rgb = function (l) {
+ return [(l[0] / 100) * 255, (l[0] / 100) * 255, (l[0] / 100) * 255];
+ }),
+ (i.gray.hsl = i.gray.hsv =
+ function (l) {
+ return [0, 0, l[0]];
+ }),
+ (i.gray.hwb = function (l) {
+ return [0, 100, l[0]];
+ }),
+ (i.gray.cmyk = function (l) {
+ return [0, 0, 0, l[0]];
+ }),
+ (i.gray.lab = function (l) {
+ return [l[0], 0, 0];
+ }),
+ (i.gray.hex = function (l) {
+ var d = Math.round((l[0] / 100) * 255) & 255,
+ u = (d << 16) + (d << 8) + d,
+ p = u.toString(16).toUpperCase();
+ return '000000'.substring(p.length) + p;
+ }),
+ (i.rgb.gray = function (l) {
+ var d = (l[0] + l[1] + l[2]) / 3;
+ return [(d / 255) * 100];
+ }),
+ wm
+ );
+ }
+ var Cg, EE;
+ function lU() {
+ if (EE) return Cg;
+ EE = 1;
+ var e = RI();
+ function t() {
+ for (var a = {}, o = Object.keys(e), s = o.length, l = 0; l < s; l++)
+ a[o[l]] = {distance: -1, parent: null};
+ return a;
+ }
+ function n(a) {
+ var o = t(),
+ s = [a];
+ for (o[a].distance = 0; s.length; )
+ for (
+ var l = s.pop(), d = Object.keys(e[l]), u = d.length, p = 0;
+ p < u;
+ p++
+ ) {
+ var y = d[p],
+ m = o[y];
+ m.distance === -1 &&
+ ((m.distance = o[l].distance + 1), (m.parent = l), s.unshift(y));
+ }
+ return o;
+ }
+ function i(a, o) {
+ return function (s) {
+ return o(a(s));
+ };
+ }
+ function r(a, o) {
+ for (
+ var s = [o[a].parent, a], l = e[o[a].parent][a], d = o[a].parent;
+ o[d].parent;
+
+ )
+ s.unshift(o[d].parent),
+ (l = i(e[o[d].parent][d], l)),
+ (d = o[d].parent);
+ return (l.conversion = s), l;
+ }
+ return (
+ (Cg = function (a) {
+ for (
+ var o = n(a), s = {}, l = Object.keys(o), d = l.length, u = 0;
+ u < d;
+ u++
+ ) {
+ var p = l[u],
+ y = o[p];
+ y.parent !== null && (s[p] = r(p, o));
+ }
+ return s;
+ }),
+ Cg
+ );
+ }
+ var Dg, IE;
+ function cU() {
+ if (IE) return Dg;
+ IE = 1;
+ var e = RI(),
+ t = lU(),
+ n = {},
+ i = Object.keys(e);
+ function r(o) {
+ var s = function (l) {
+ return l == null
+ ? l
+ : (arguments.length > 1 &&
+ (l = Array.prototype.slice.call(arguments)),
+ o(l));
+ };
+ return 'conversion' in o && (s.conversion = o.conversion), s;
+ }
+ function a(o) {
+ var s = function (l) {
+ if (l == null) return l;
+ arguments.length > 1 && (l = Array.prototype.slice.call(arguments));
+ var d = o(l);
+ if (typeof d == 'object')
+ for (var u = d.length, p = 0; p < u; p++) d[p] = Math.round(d[p]);
+ return d;
+ };
+ return 'conversion' in o && (s.conversion = o.conversion), s;
+ }
+ return (
+ i.forEach(function (o) {
+ (n[o] = {}),
+ Object.defineProperty(n[o], 'channels', {value: e[o].channels}),
+ Object.defineProperty(n[o], 'labels', {value: e[o].labels});
+ var s = t(o),
+ l = Object.keys(s);
+ l.forEach(function (d) {
+ var u = s[d];
+ (n[o][d] = a(u)), (n[o][d].raw = r(u));
+ });
+ }),
+ (Dg = n),
+ Dg
+ );
+ }
+ var PE;
+ function LI() {
+ return (
+ PE ||
+ ((PE = 1),
+ (function (e) {
+ let t = cU(),
+ n = (o, s) =>
+ function () {
+ return `\x1B[${o.apply(t, arguments) + s}m`;
+ },
+ i = (o, s) =>
+ function () {
+ let l = o.apply(t, arguments);
+ return `\x1B[${38 + s};5;${l}m`;
+ },
+ r = (o, s) =>
+ function () {
+ let l = o.apply(t, arguments);
+ return `\x1B[${38 + s};2;${l[0]};${l[1]};${l[2]}m`;
+ };
+ function a() {
+ let o = new Map(),
+ s = {
+ modifier: {
+ reset: [0, 0],
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ 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],
+ gray: [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],
+ bgRedBright: [101, 49],
+ bgGreenBright: [102, 49],
+ bgYellowBright: [103, 49],
+ bgBlueBright: [104, 49],
+ bgMagentaBright: [105, 49],
+ bgCyanBright: [106, 49],
+ bgWhiteBright: [107, 49],
+ },
+ };
+ s.color.grey = s.color.gray;
+ for (let u of Object.keys(s)) {
+ let p = s[u];
+ for (let y of Object.keys(p)) {
+ let m = p[y];
+ (s[y] = {open: `\x1B[${m[0]}m`, close: `\x1B[${m[1]}m`}),
+ (p[y] = s[y]),
+ o.set(m[0], m[1]);
+ }
+ Object.defineProperty(s, u, {value: p, enumerable: !1}),
+ Object.defineProperty(s, 'codes', {value: o, enumerable: !1});
+ }
+ let l = (u) => u,
+ d = (u, p, y) => [u, p, y];
+ (s.color.close = '\x1B[39m'),
+ (s.bgColor.close = '\x1B[49m'),
+ (s.color.ansi = {ansi: n(l, 0)}),
+ (s.color.ansi256 = {ansi256: i(l, 0)}),
+ (s.color.ansi16m = {rgb: r(d, 0)}),
+ (s.bgColor.ansi = {ansi: n(l, 10)}),
+ (s.bgColor.ansi256 = {ansi256: i(l, 10)}),
+ (s.bgColor.ansi16m = {rgb: r(d, 10)});
+ for (let u of Object.keys(t)) {
+ if (typeof t[u] != 'object') continue;
+ let p = t[u];
+ u === 'ansi16' && (u = 'ansi'),
+ 'ansi16' in p &&
+ ((s.color.ansi[u] = n(p.ansi16, 0)),
+ (s.bgColor.ansi[u] = n(p.ansi16, 10))),
+ 'ansi256' in p &&
+ ((s.color.ansi256[u] = i(p.ansi256, 0)),
+ (s.bgColor.ansi256[u] = i(p.ansi256, 10))),
+ 'rgb' in p &&
+ ((s.color.ansi16m[u] = r(p.rgb, 0)),
+ (s.bgColor.ansi16m[u] = r(p.rgb, 10)));
+ }
+ return s;
+ }
+ Object.defineProperty(e, 'exports', {enumerable: !0, get: a});
+ })(aU)),
+ xm
+ );
+ }
+ var oa = {},
+ xE;
+ function Hm() {
+ if (xE) return oa;
+ (xE = 1),
+ Object.defineProperty(oa, '__esModule', {value: !0}),
+ (oa.printIteratorEntries = t),
+ (oa.printIteratorValues = n),
+ (oa.printListItems = i),
+ (oa.printObjectProperties = r);
+ let e = (a) => {
+ let o = Object.keys(a).sort();
+ return (
+ Object.getOwnPropertySymbols &&
+ Object.getOwnPropertySymbols(a).forEach((s) => {
+ Object.getOwnPropertyDescriptor(a, s).enumerable && o.push(s);
+ }),
+ o
+ );
+ };
+ function t(a, o, s, l, d, u, p = ': ') {
+ let y = '',
+ m = a.next();
+ if (!m.done) {
+ y += o.spacingOuter;
+ let g = s + o.indent;
+ for (; !m.done; ) {
+ let S = u(m.value[0], o, g, l, d),
+ _ = u(m.value[1], o, g, l, d);
+ (y += g + S + p + _),
+ (m = a.next()),
+ m.done ? o.min || (y += ',') : (y += ',' + o.spacingInner);
+ }
+ y += o.spacingOuter + s;
+ }
+ return y;
+ }
+ function n(a, o, s, l, d, u) {
+ let p = '',
+ y = a.next();
+ if (!y.done) {
+ p += o.spacingOuter;
+ let m = s + o.indent;
+ for (; !y.done; )
+ (p += m + u(y.value, o, m, l, d)),
+ (y = a.next()),
+ y.done ? o.min || (p += ',') : (p += ',' + o.spacingInner);
+ p += o.spacingOuter + s;
+ }
+ return p;
+ }
+ function i(a, o, s, l, d, u) {
+ let p = '';
+ if (a.length) {
+ p += o.spacingOuter;
+ let y = s + o.indent;
+ for (let m = 0; m < a.length; m++)
+ (p += y + u(a[m], o, y, l, d)),
+ m < a.length - 1
+ ? (p += ',' + o.spacingInner)
+ : o.min || (p += ',');
+ p += o.spacingOuter + s;
+ }
+ return p;
+ }
+ function r(a, o, s, l, d, u) {
+ let p = '',
+ y = e(a);
+ if (y.length) {
+ p += o.spacingOuter;
+ let m = s + o.indent;
+ for (let g = 0; g < y.length; g++) {
+ let S = y[g],
+ _ = u(S, o, m, l, d),
+ O = u(a[S], o, m, l, d);
+ (p += m + _ + ': ' + O),
+ g < y.length - 1
+ ? (p += ',' + o.spacingInner)
+ : o.min || (p += ',');
+ }
+ p += o.spacingOuter + s;
+ }
+ return p;
+ }
+ return oa;
+ }
+ var wi = {},
+ wE;
+ function uU() {
+ if (wE) return wi;
+ (wE = 1),
+ Object.defineProperty(wi, '__esModule', {value: !0}),
+ (wi.default = wi.test = wi.serialize = void 0);
+ var e = Hm(),
+ t = co['jest-symbol-do-not-touch'] || co.Symbol;
+ let n = t.for('jest.asymmetricMatcher'),
+ i = ' ',
+ r = (l, d, u, p, y, m) => {
+ let g = l.toString();
+ return g === 'ArrayContaining' || g === 'ArrayNotContaining'
+ ? ++p > d.maxDepth
+ ? '[' + g + ']'
+ : g + i + '[' + (0, e.printListItems)(l.sample, d, u, p, y, m) + ']'
+ : g === 'ObjectContaining' || g === 'ObjectNotContaining'
+ ? ++p > d.maxDepth
+ ? '[' + g + ']'
+ : g +
+ i +
+ '{' +
+ (0, e.printObjectProperties)(l.sample, d, u, p, y, m) +
+ '}'
+ : g === 'StringMatching' ||
+ g === 'StringNotMatching' ||
+ g === 'StringContaining' ||
+ g === 'StringNotContaining'
+ ? g + i + m(l.sample, d, u, p, y)
+ : l.toAsymmetricMatcher();
+ };
+ wi.serialize = r;
+ let a = (l) => l && l.$$typeof === n;
+ wi.test = a;
+ var s = {serialize: r, test: a};
+ return (wi.default = s), wi;
+ }
+ var Oi = {},
+ Ag,
+ OE;
+ function dU() {
+ return (
+ OE ||
+ ((OE = 1),
+ (Ag = (e) => {
+ e = Object.assign({onlyFirst: !1}, e);
+ let t = [
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))',
+ ].join('|');
+ return new RegExp(t, e.onlyFirst ? void 0 : 'g');
+ })),
+ Ag
+ );
+ }
+ var $E;
+ function fU() {
+ if ($E) return Oi;
+ ($E = 1),
+ Object.defineProperty(Oi, '__esModule', {value: !0}),
+ (Oi.default = Oi.serialize = Oi.test = void 0);
+ var e = n(dU()),
+ t = n(LI());
+ function n(l) {
+ return l && l.__esModule ? l : {default: l};
+ }
+ let i = (l) =>
+ l.replace((0, e.default)(), (d) => {
+ switch (d) {
+ case t.default.red.close:
+ case t.default.green.close:
+ case t.default.cyan.close:
+ case t.default.gray.close:
+ case t.default.white.close:
+ case t.default.yellow.close:
+ case t.default.bgRed.close:
+ case t.default.bgGreen.close:
+ case t.default.bgYellow.close:
+ case t.default.inverse.close:
+ case t.default.dim.close:
+ case t.default.bold.close:
+ case t.default.reset.open:
+ case t.default.reset.close:
+ return '>';
+ case t.default.red.open:
+ return '';
+ case t.default.green.open:
+ return '';
+ case t.default.cyan.open:
+ return '';
+ case t.default.gray.open:
+ return '';
+ case t.default.white.open:
+ return '';
+ case t.default.yellow.open:
+ return '';
+ case t.default.bgRed.open:
+ return '';
+ case t.default.bgGreen.open:
+ return '';
+ case t.default.bgYellow.open:
+ return '';
+ case t.default.inverse.open:
+ return '';
+ case t.default.dim.open:
+ return '';
+ case t.default.bold.open:
+ return '';
+ default:
+ return '';
+ }
+ }),
+ r = (l) => typeof l == 'string' && !!l.match((0, e.default)());
+ Oi.test = r;
+ let a = (l, d, u, p, y, m) => m(i(l), d, u, p, y);
+ Oi.serialize = a;
+ var s = {serialize: a, test: r};
+ return (Oi.default = s), Oi;
+ }
+ var $i = {},
+ jE;
+ function pU() {
+ if (jE) return $i;
+ (jE = 1),
+ Object.defineProperty($i, '__esModule', {value: !0}),
+ ($i.default = $i.serialize = $i.test = void 0);
+ var e = Hm();
+ function t(y) {
+ for (var m = 1; m < arguments.length; m++) {
+ var g = arguments[m] != null ? arguments[m] : {},
+ S = Object.keys(g);
+ typeof Object.getOwnPropertySymbols == 'function' &&
+ (S = S.concat(
+ Object.getOwnPropertySymbols(g).filter(function (_) {
+ return Object.getOwnPropertyDescriptor(g, _).enumerable;
+ })
+ )),
+ S.forEach(function (_) {
+ n(y, _, g[_]);
+ });
+ }
+ return y;
+ }
+ function n(y, m, g) {
+ return (
+ m in y
+ ? Object.defineProperty(y, m, {
+ value: g,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ })
+ : (y[m] = g),
+ y
+ );
+ }
+ let i = ' ',
+ r = ['DOMStringMap', 'NamedNodeMap'],
+ a = /^(HTML\w*Collection|NodeList)$/,
+ o = (y) => r.indexOf(y) !== -1 || a.test(y),
+ s = (y) =>
+ y && y.constructor && y.constructor.name && o(y.constructor.name);
+ $i.test = s;
+ let l = (y, m) => ((y[m.name] = m.value), y),
+ d = (y, m, g, S, _, O) => {
+ let P = y.constructor.name;
+ return ++S > m.maxDepth
+ ? '[' + P + ']'
+ : (m.min ? '' : P + i) +
+ (r.indexOf(P) !== -1
+ ? '{' +
+ (0, e.printObjectProperties)(
+ P === 'NamedNodeMap'
+ ? Array.prototype.reduce.call(y, l, {})
+ : t({}, y),
+ m,
+ g,
+ S,
+ _,
+ O
+ ) +
+ '}'
+ : '[' +
+ (0, e.printListItems)(Array.from(y), m, g, S, _, O) +
+ ']');
+ };
+ $i.serialize = d;
+ var p = {serialize: d, test: s};
+ return ($i.default = p), $i;
+ }
+ var ji = {},
+ En = {},
+ $p = {},
+ CE;
+ function mU() {
+ if (CE) return $p;
+ (CE = 1),
+ Object.defineProperty($p, '__esModule', {value: !0}),
+ ($p.default = e);
+ function e(t) {
+ return t.replace(//g, '>');
+ }
+ return $p;
+ }
+ var DE;
+ function jh() {
+ if (DE) return En;
+ (DE = 1),
+ Object.defineProperty(En, '__esModule', {value: !0}),
+ (En.printElementAsLeaf =
+ En.printElement =
+ En.printComment =
+ En.printText =
+ En.printChildren =
+ En.printProps =
+ void 0);
+ var e = t(mU());
+ function t(l) {
+ return l && l.__esModule ? l : {default: l};
+ }
+ let n = (l, d, u, p, y, m, g) => {
+ let S = p + u.indent,
+ _ = u.colors;
+ return l
+ .map((O) => {
+ let P = d[O],
+ M = g(P, u, S, y, m);
+ return (
+ typeof P != 'string' &&
+ (M.indexOf(`
+`) !== -1 && (M = u.spacingOuter + S + M + u.spacingOuter + p),
+ (M = '{' + M + '}')),
+ u.spacingInner +
+ p +
+ _.prop.open +
+ O +
+ _.prop.close +
+ '=' +
+ _.value.open +
+ M +
+ _.value.close
+ );
+ })
+ .join('');
+ };
+ En.printProps = n;
+ let i = (l, d, u, p, y, m) =>
+ l
+ .map(
+ (g) =>
+ d.spacingOuter +
+ u +
+ (typeof g == 'string' ? r(g, d) : m(g, d, u, p, y))
+ )
+ .join('');
+ En.printChildren = i;
+ let r = (l, d) => {
+ let u = d.colors.content;
+ return u.open + (0, e.default)(l) + u.close;
+ };
+ En.printText = r;
+ let a = (l, d) => {
+ let u = d.colors.comment;
+ return u.open + '' + u.close;
+ };
+ En.printComment = a;
+ let o = (l, d, u, p, y) => {
+ let m = p.colors.tag;
+ return (
+ m.open +
+ '<' +
+ l +
+ (d && m.close + d + p.spacingOuter + y + m.open) +
+ (u
+ ? '>' + m.close + u + p.spacingOuter + y + m.open + '' + l
+ : (d && !p.min ? '' : ' ') + '/') +
+ '>' +
+ m.close
+ );
+ };
+ En.printElement = o;
+ let s = (l, d) => {
+ let u = d.colors.tag;
+ return u.open + '<' + l + u.close + ' \u2026' + u.open + ' />' + u.close;
+ };
+ return (En.printElementAsLeaf = s), En;
+ }
+ var AE;
+ function yU() {
+ if (AE) return ji;
+ (AE = 1),
+ Object.defineProperty(ji, '__esModule', {value: !0}),
+ (ji.default = ji.serialize = ji.test = void 0);
+ var e = jh();
+ let t = 1,
+ n = 3,
+ i = 8,
+ r = 11,
+ a = /^((HTML|SVG)\w*)?Element$/,
+ o = (g, S) =>
+ (g === t && a.test(S)) ||
+ (g === n && S === 'Text') ||
+ (g === i && S === 'Comment') ||
+ (g === r && S === 'DocumentFragment'),
+ s = (g) =>
+ g &&
+ g.constructor &&
+ g.constructor.name &&
+ o(g.nodeType, g.constructor.name);
+ ji.test = s;
+ function l(g) {
+ return g.nodeType === n;
+ }
+ function d(g) {
+ return g.nodeType === i;
+ }
+ function u(g) {
+ return g.nodeType === r;
+ }
+ let p = (g, S, _, O, P, M) => {
+ if (l(g)) return (0, e.printText)(g.data, S);
+ if (d(g)) return (0, e.printComment)(g.data, S);
+ let w = u(g) ? 'DocumentFragment' : g.tagName.toLowerCase();
+ return ++O > S.maxDepth
+ ? (0, e.printElementAsLeaf)(w, S)
+ : (0, e.printElement)(
+ w,
+ (0, e.printProps)(
+ u(g)
+ ? []
+ : Array.from(g.attributes)
+ .map((I) => I.name)
+ .sort(),
+ u(g)
+ ? []
+ : Array.from(g.attributes).reduce(
+ (I, U) => ((I[U.name] = U.value), I),
+ {}
+ ),
+ S,
+ _ + S.indent,
+ O,
+ P,
+ M
+ ),
+ (0, e.printChildren)(
+ Array.prototype.slice.call(g.childNodes || g.children),
+ S,
+ _ + S.indent,
+ O,
+ P,
+ M
+ ),
+ S,
+ _
+ );
+ };
+ ji.serialize = p;
+ var m = {serialize: p, test: s};
+ return (ji.default = m), ji;
+ }
+ var Ci = {},
+ ME;
+ function gU() {
+ if (ME) return Ci;
+ (ME = 1),
+ Object.defineProperty(Ci, '__esModule', {value: !0}),
+ (Ci.default = Ci.test = Ci.serialize = void 0);
+ var e = Hm();
+ let t = '@@__IMMUTABLE_ITERABLE__@@',
+ n = '@@__IMMUTABLE_LIST__@@',
+ i = '@@__IMMUTABLE_KEYED__@@',
+ r = '@@__IMMUTABLE_MAP__@@',
+ a = '@@__IMMUTABLE_ORDERED__@@',
+ o = '@@__IMMUTABLE_RECORD__@@',
+ s = '@@__IMMUTABLE_SEQ__@@',
+ l = '@@__IMMUTABLE_SET__@@',
+ d = '@@__IMMUTABLE_STACK__@@',
+ u = (A) => 'Immutable.' + A,
+ p = (A) => '[' + A + ']',
+ y = ' ',
+ m = '\u2026',
+ g = (A, q, ae, le, G, ve, de) =>
+ ++le > q.maxDepth
+ ? p(u(de))
+ : u(de) +
+ y +
+ '{' +
+ (0, e.printIteratorEntries)(A.entries(), q, ae, le, G, ve) +
+ '}',
+ S = (A) => {
+ let q = 0;
+ return {
+ next() {
+ if (q < A._keys.length) {
+ let ae = A._keys[q++];
+ return {done: !1, value: [ae, A.get(ae)]};
+ }
+ return {done: !0};
+ },
+ };
+ },
+ _ = (A, q, ae, le, G, ve) => {
+ let de = u(A._name || 'Record');
+ return ++le > q.maxDepth
+ ? p(de)
+ : de +
+ y +
+ '{' +
+ (0, e.printIteratorEntries)(S(A), q, ae, le, G, ve) +
+ '}';
+ },
+ O = (A, q, ae, le, G, ve) => {
+ let de = u('Seq');
+ return ++le > q.maxDepth
+ ? p(de)
+ : A[i]
+ ? de +
+ y +
+ '{' +
+ (A._iter || A._object
+ ? (0, e.printIteratorEntries)(A.entries(), q, ae, le, G, ve)
+ : m) +
+ '}'
+ : de +
+ y +
+ '[' +
+ (A._iter || A._array || A._collection || A._iterable
+ ? (0, e.printIteratorValues)(A.values(), q, ae, le, G, ve)
+ : m) +
+ ']';
+ },
+ P = (A, q, ae, le, G, ve, de) =>
+ ++le > q.maxDepth
+ ? p(u(de))
+ : u(de) +
+ y +
+ '[' +
+ (0, e.printIteratorValues)(A.values(), q, ae, le, G, ve) +
+ ']',
+ M = (A, q, ae, le, G, ve) =>
+ A[r]
+ ? g(A, q, ae, le, G, ve, A[a] ? 'OrderedMap' : 'Map')
+ : A[n]
+ ? P(A, q, ae, le, G, ve, 'List')
+ : A[l]
+ ? P(A, q, ae, le, G, ve, A[a] ? 'OrderedSet' : 'Set')
+ : A[d]
+ ? P(A, q, ae, le, G, ve, 'Stack')
+ : A[s]
+ ? O(A, q, ae, le, G, ve)
+ : _(A, q, ae, le, G, ve);
+ Ci.serialize = M;
+ let w = (A) => A && (A[t] === !0 || A[o] === !0);
+ Ci.test = w;
+ var U = {serialize: M, test: w};
+ return (Ci.default = U), Ci;
+ }
+ var Di = {},
+ Om = {},
+ vU = {
+ get exports() {
+ return Om;
+ },
+ set exports(e) {
+ Om = e;
+ },
+ },
+ Lt = {},
+ NE;
+ function hU() {
+ if (NE) return Lt;
+ NE = 1;
+ var e = typeof Symbol == 'function' && Symbol.for,
+ t = e ? Symbol.for('react.element') : 60103,
+ n = e ? Symbol.for('react.portal') : 60106,
+ i = e ? Symbol.for('react.fragment') : 60107,
+ r = e ? Symbol.for('react.strict_mode') : 60108,
+ a = e ? Symbol.for('react.profiler') : 60114,
+ o = e ? Symbol.for('react.provider') : 60109,
+ s = e ? Symbol.for('react.context') : 60110,
+ l = e ? Symbol.for('react.async_mode') : 60111,
+ d = e ? Symbol.for('react.concurrent_mode') : 60111,
+ u = e ? Symbol.for('react.forward_ref') : 60112,
+ p = e ? Symbol.for('react.suspense') : 60113,
+ y = e ? Symbol.for('react.suspense_list') : 60120,
+ m = e ? Symbol.for('react.memo') : 60115,
+ g = e ? Symbol.for('react.lazy') : 60116,
+ S = e ? Symbol.for('react.block') : 60121,
+ _ = e ? Symbol.for('react.fundamental') : 60117,
+ O = e ? Symbol.for('react.responder') : 60118,
+ P = e ? Symbol.for('react.scope') : 60119;
+ function M(I) {
+ if (typeof I == 'object' && I !== null) {
+ var U = I.$$typeof;
+ switch (U) {
+ case t:
+ switch (((I = I.type), I)) {
+ case l:
+ case d:
+ case i:
+ case a:
+ case r:
+ case p:
+ return I;
+ default:
+ switch (((I = I && I.$$typeof), I)) {
+ case s:
+ case u:
+ case g:
+ case m:
+ case o:
+ return I;
+ default:
+ return U;
+ }
+ }
+ case n:
+ return U;
+ }
+ }
+ }
+ function w(I) {
+ return M(I) === d;
+ }
+ return (
+ (Lt.AsyncMode = l),
+ (Lt.ConcurrentMode = d),
+ (Lt.ContextConsumer = s),
+ (Lt.ContextProvider = o),
+ (Lt.Element = t),
+ (Lt.ForwardRef = u),
+ (Lt.Fragment = i),
+ (Lt.Lazy = g),
+ (Lt.Memo = m),
+ (Lt.Portal = n),
+ (Lt.Profiler = a),
+ (Lt.StrictMode = r),
+ (Lt.Suspense = p),
+ (Lt.isAsyncMode = function (I) {
+ return w(I) || M(I) === l;
+ }),
+ (Lt.isConcurrentMode = w),
+ (Lt.isContextConsumer = function (I) {
+ return M(I) === s;
+ }),
+ (Lt.isContextProvider = function (I) {
+ return M(I) === o;
+ }),
+ (Lt.isElement = function (I) {
+ return typeof I == 'object' && I !== null && I.$$typeof === t;
+ }),
+ (Lt.isForwardRef = function (I) {
+ return M(I) === u;
+ }),
+ (Lt.isFragment = function (I) {
+ return M(I) === i;
+ }),
+ (Lt.isLazy = function (I) {
+ return M(I) === g;
+ }),
+ (Lt.isMemo = function (I) {
+ return M(I) === m;
+ }),
+ (Lt.isPortal = function (I) {
+ return M(I) === n;
+ }),
+ (Lt.isProfiler = function (I) {
+ return M(I) === a;
+ }),
+ (Lt.isStrictMode = function (I) {
+ return M(I) === r;
+ }),
+ (Lt.isSuspense = function (I) {
+ return M(I) === p;
+ }),
+ (Lt.isValidElementType = function (I) {
+ return (
+ typeof I == 'string' ||
+ typeof I == 'function' ||
+ I === i ||
+ I === d ||
+ I === a ||
+ I === r ||
+ I === p ||
+ I === y ||
+ (typeof I == 'object' &&
+ I !== null &&
+ (I.$$typeof === g ||
+ I.$$typeof === m ||
+ I.$$typeof === o ||
+ I.$$typeof === s ||
+ I.$$typeof === u ||
+ I.$$typeof === _ ||
+ I.$$typeof === O ||
+ I.$$typeof === P ||
+ I.$$typeof === S))
+ );
+ }),
+ (Lt.typeOf = M),
+ Lt
+ );
+ }
+ var RE;
+ function bU() {
+ return (
+ RE ||
+ ((RE = 1),
+ (function (e) {
+ e.exports = hU();
+ })(vU)),
+ Om
+ );
+ }
+ var LE;
+ function kU() {
+ if (LE) return Di;
+ (LE = 1),
+ Object.defineProperty(Di, '__esModule', {value: !0}),
+ (Di.default = Di.test = Di.serialize = void 0);
+ var e = n(bU()),
+ t = jh();
+ function n(u) {
+ if (u && u.__esModule) return u;
+ var p = {};
+ if (u != null) {
+ for (var y in u)
+ if (Object.prototype.hasOwnProperty.call(u, y)) {
+ var m =
+ Object.defineProperty && Object.getOwnPropertyDescriptor
+ ? Object.getOwnPropertyDescriptor(u, y)
+ : {};
+ m.get || m.set ? Object.defineProperty(p, y, m) : (p[y] = u[y]);
+ }
+ }
+ return (p.default = u), p;
+ }
+ let i = (u, p = []) => (
+ Array.isArray(u)
+ ? u.forEach((y) => {
+ i(y, p);
+ })
+ : u != null && u !== !1 && p.push(u),
+ p
+ ),
+ r = (u) => {
+ let p = u.type;
+ if (typeof p == 'string') return p;
+ if (typeof p == 'function') return p.displayName || p.name || 'Unknown';
+ if (e.isFragment(u)) return 'React.Fragment';
+ if (e.isSuspense(u)) return 'React.Suspense';
+ if (typeof p == 'object' && p !== null) {
+ if (e.isContextProvider(u)) return 'Context.Provider';
+ if (e.isContextConsumer(u)) return 'Context.Consumer';
+ if (e.isForwardRef(u)) {
+ let y = p.render.displayName || p.render.name || '';
+ return y !== '' ? 'ForwardRef(' + y + ')' : 'ForwardRef';
+ }
+ if (e.isMemo(p)) {
+ let y = p.displayName || p.type.displayName || p.type.name || '';
+ return y !== '' ? 'Memo(' + y + ')' : 'Memo';
+ }
+ }
+ return 'UNDEFINED';
+ },
+ a = (u) => {
+ let p = u.props;
+ return Object.keys(p)
+ .filter((y) => y !== 'children' && p[y] !== void 0)
+ .sort();
+ },
+ o = (u, p, y, m, g, S) =>
+ ++m > p.maxDepth
+ ? (0, t.printElementAsLeaf)(r(u), p)
+ : (0, t.printElement)(
+ r(u),
+ (0, t.printProps)(a(u), u.props, p, y + p.indent, m, g, S),
+ (0, t.printChildren)(
+ i(u.props.children),
+ p,
+ y + p.indent,
+ m,
+ g,
+ S
+ ),
+ p,
+ y
+ );
+ Di.serialize = o;
+ let s = (u) => u && e.isElement(u);
+ Di.test = s;
+ var d = {serialize: o, test: s};
+ return (Di.default = d), Di;
+ }
+ var Ai = {},
+ FE;
+ function SU() {
+ if (FE) return Ai;
+ (FE = 1),
+ Object.defineProperty(Ai, '__esModule', {value: !0}),
+ (Ai.default = Ai.test = Ai.serialize = void 0);
+ var e = jh(),
+ t = co['jest-symbol-do-not-touch'] || co.Symbol;
+ let n = t.for('react.test.json'),
+ i = (l) => {
+ let d = l.props;
+ return d
+ ? Object.keys(d)
+ .filter((u) => d[u] !== void 0)
+ .sort()
+ : [];
+ },
+ r = (l, d, u, p, y, m) =>
+ ++p > d.maxDepth
+ ? (0, e.printElementAsLeaf)(l.type, d)
+ : (0, e.printElement)(
+ l.type,
+ l.props
+ ? (0, e.printProps)(i(l), l.props, d, u + d.indent, p, y, m)
+ : '',
+ l.children
+ ? (0, e.printChildren)(l.children, d, u + d.indent, p, y, m)
+ : '',
+ d,
+ u
+ );
+ Ai.serialize = r;
+ let a = (l) => l && l.$$typeof === n;
+ Ai.test = a;
+ var s = {serialize: r, test: a};
+ return (Ai.default = s), Ai;
+ }
+ var Mg, zE;
+ function _U() {
+ if (zE) return Mg;
+ zE = 1;
+ var e = d(LI()),
+ t = Hm(),
+ n = d(uU()),
+ i = d(fU()),
+ r = d(pU()),
+ a = d(yU()),
+ o = d(gU()),
+ s = d(kU()),
+ l = d(SU());
+ function d(J) {
+ return J && J.__esModule ? J : {default: J};
+ }
+ var u = co['jest-symbol-do-not-touch'] || co.Symbol;
+ let p = Object.prototype.toString,
+ y = Date.prototype.toISOString,
+ m = Error.prototype.toString,
+ g = RegExp.prototype.toString,
+ S = u.prototype.toString,
+ _ = (J) =>
+ (typeof J.constructor == 'function' && J.constructor.name) || 'Object',
+ O = (J) => typeof window < 'u' && J === window,
+ P = /^Symbol\((.*)\)(.*)$/,
+ M = /\n/gi;
+ class w extends Error {
+ constructor(Xe, it) {
+ super(Xe), (this.stack = it), (this.name = this.constructor.name);
+ }
+ }
+ function I(J) {
+ return (
+ J === '[object Array]' ||
+ J === '[object ArrayBuffer]' ||
+ J === '[object DataView]' ||
+ J === '[object Float32Array]' ||
+ J === '[object Float64Array]' ||
+ J === '[object Int8Array]' ||
+ J === '[object Int16Array]' ||
+ J === '[object Int32Array]' ||
+ J === '[object Uint8Array]' ||
+ J === '[object Uint8ClampedArray]' ||
+ J === '[object Uint16Array]' ||
+ J === '[object Uint32Array]'
+ );
+ }
+ function U(J) {
+ return Object.is(J, -0) ? '-0' : String(J);
+ }
+ function A(J) {
+ return `${J}n`;
+ }
+ function q(J, Xe) {
+ return Xe ? '[Function ' + (J.name || 'anonymous') + ']' : '[Function]';
+ }
+ function ae(J) {
+ return S.call(J).replace(P, 'Symbol($1)');
+ }
+ function le(J) {
+ return '[' + m.call(J) + ']';
+ }
+ function G(J, Xe, it, mt) {
+ if (J === !0 || J === !1) return '' + J;
+ if (J === void 0) return 'undefined';
+ if (J === null) return 'null';
+ let Et = typeof J;
+ if (Et === 'number') return U(J);
+ if (Et === 'bigint') return A(J);
+ if (Et === 'string')
+ return mt ? '"' + J.replace(/"|\\/g, '\\$&') + '"' : '"' + J + '"';
+ if (Et === 'function') return q(J, Xe);
+ if (Et === 'symbol') return ae(J);
+ let ft = p.call(J);
+ return ft === '[object WeakMap]'
+ ? 'WeakMap {}'
+ : ft === '[object WeakSet]'
+ ? 'WeakSet {}'
+ : ft === '[object Function]' || ft === '[object GeneratorFunction]'
+ ? q(J, Xe)
+ : ft === '[object Symbol]'
+ ? ae(J)
+ : ft === '[object Date]'
+ ? isNaN(+J)
+ ? 'Date { NaN }'
+ : y.call(J)
+ : ft === '[object Error]'
+ ? le(J)
+ : ft === '[object RegExp]'
+ ? it
+ ? g.call(J).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&')
+ : g.call(J)
+ : J instanceof Error
+ ? le(J)
+ : null;
+ }
+ function ve(J, Xe, it, mt, Et, ft) {
+ if (Et.indexOf(J) !== -1) return '[Circular]';
+ (Et = Et.slice()), Et.push(J);
+ let De = ++mt > Xe.maxDepth,
+ Y = Xe.min;
+ if (
+ Xe.callToJSON &&
+ !De &&
+ J.toJSON &&
+ typeof J.toJSON == 'function' &&
+ !ft
+ )
+ return $e(J.toJSON(), Xe, it, mt, Et, !0);
+ let ce = p.call(J);
+ return ce === '[object Arguments]'
+ ? De
+ ? '[Arguments]'
+ : (Y ? '' : 'Arguments ') +
+ '[' +
+ (0, t.printListItems)(J, Xe, it, mt, Et, $e) +
+ ']'
+ : I(ce)
+ ? De
+ ? '[' + J.constructor.name + ']'
+ : (Y ? '' : J.constructor.name + ' ') +
+ '[' +
+ (0, t.printListItems)(J, Xe, it, mt, Et, $e) +
+ ']'
+ : ce === '[object Map]'
+ ? De
+ ? '[Map]'
+ : 'Map {' +
+ (0, t.printIteratorEntries)(
+ J.entries(),
+ Xe,
+ it,
+ mt,
+ Et,
+ $e,
+ ' => '
+ ) +
+ '}'
+ : ce === '[object Set]'
+ ? De
+ ? '[Set]'
+ : 'Set {' +
+ (0, t.printIteratorValues)(J.values(), Xe, it, mt, Et, $e) +
+ '}'
+ : De || O(J)
+ ? '[' + _(J) + ']'
+ : (Y ? '' : _(J) + ' ') +
+ '{' +
+ (0, t.printObjectProperties)(J, Xe, it, mt, Et, $e) +
+ '}';
+ }
+ function de(J) {
+ return J.serialize != null;
+ }
+ function oe(J, Xe, it, mt, Et, ft) {
+ let De;
+ try {
+ De = de(J)
+ ? J.serialize(Xe, it, mt, Et, ft, $e)
+ : J.print(
+ Xe,
+ (Y) => $e(Y, it, mt, Et, ft),
+ (Y) => {
+ let ce = mt + it.indent;
+ return (
+ ce +
+ Y.replace(
+ M,
+ `
+` + ce
+ )
+ );
+ },
+ {
+ edgeSpacing: it.spacingOuter,
+ min: it.min,
+ spacing: it.spacingInner,
+ },
+ it.colors
+ );
+ } catch (Y) {
+ throw new w(Y.message, Y.stack);
+ }
+ if (typeof De != 'string')
+ throw new Error(
+ `pretty-format: Plugin must return type "string" but instead returned "${typeof De}".`
+ );
+ return De;
+ }
+ function be(J, Xe) {
+ for (let it = 0; it < J.length; it++)
+ try {
+ if (J[it].test(Xe)) return J[it];
+ } catch (mt) {
+ throw new w(mt.message, mt.stack);
+ }
+ return null;
+ }
+ function $e(J, Xe, it, mt, Et, ft) {
+ let De = be(Xe.plugins, J);
+ if (De !== null) return oe(De, J, Xe, it, mt, Et);
+ let Y = G(J, Xe.printFunctionName, Xe.escapeRegex, Xe.escapeString);
+ return Y !== null ? Y : ve(J, Xe, it, mt, Et, ft);
+ }
+ let Ie = {
+ comment: 'gray',
+ content: 'reset',
+ prop: 'yellow',
+ tag: 'cyan',
+ value: 'green',
+ },
+ Pe = Object.keys(Ie),
+ ke = {
+ callToJSON: !0,
+ escapeRegex: !1,
+ escapeString: !0,
+ highlight: !1,
+ indent: 2,
+ maxDepth: 1 / 0,
+ min: !1,
+ plugins: [],
+ printFunctionName: !0,
+ theme: Ie,
+ };
+ function je(J) {
+ if (
+ (Object.keys(J).forEach((Xe) => {
+ if (!ke.hasOwnProperty(Xe))
+ throw new Error(`pretty-format: Unknown option "${Xe}".`);
+ }),
+ J.min && J.indent !== void 0 && J.indent !== 0)
+ )
+ throw new Error(
+ 'pretty-format: Options "min" and "indent" cannot be used together.'
+ );
+ if (J.theme !== void 0) {
+ if (J.theme === null)
+ throw new Error('pretty-format: Option "theme" must not be null.');
+ if (typeof J.theme != 'object')
+ throw new Error(
+ `pretty-format: Option "theme" must be of type "object" but instead received "${typeof J.theme}".`
+ );
+ }
+ }
+ let Ae = (J) =>
+ Pe.reduce((Xe, it) => {
+ let mt = J.theme && J.theme[it] !== void 0 ? J.theme[it] : Ie[it],
+ Et = mt && e.default[mt];
+ if (Et && typeof Et.close == 'string' && typeof Et.open == 'string')
+ Xe[it] = Et;
+ else
+ throw new Error(
+ `pretty-format: Option "theme" has a key "${it}" whose value "${mt}" is undefined in ansi-styles.`
+ );
+ return Xe;
+ }, Object.create(null)),
+ Ye = () =>
+ Pe.reduce(
+ (J, Xe) => ((J[Xe] = {close: '', open: ''}), J),
+ Object.create(null)
+ ),
+ bt = (J) =>
+ J && J.printFunctionName !== void 0
+ ? J.printFunctionName
+ : ke.printFunctionName,
+ st = (J) =>
+ J && J.escapeRegex !== void 0 ? J.escapeRegex : ke.escapeRegex,
+ tt = (J) =>
+ J && J.escapeString !== void 0 ? J.escapeString : ke.escapeString,
+ yt = (J) => ({
+ callToJSON: J && J.callToJSON !== void 0 ? J.callToJSON : ke.callToJSON,
+ colors: J && J.highlight ? Ae(J) : Ye(),
+ escapeRegex: st(J),
+ escapeString: tt(J),
+ indent:
+ J && J.min ? '' : dt(J && J.indent !== void 0 ? J.indent : ke.indent),
+ maxDepth: J && J.maxDepth !== void 0 ? J.maxDepth : ke.maxDepth,
+ min: J && J.min !== void 0 ? J.min : ke.min,
+ plugins: J && J.plugins !== void 0 ? J.plugins : ke.plugins,
+ printFunctionName: bt(J),
+ spacingInner:
+ J && J.min
+ ? ' '
+ : `
+`,
+ spacingOuter:
+ J && J.min
+ ? ''
+ : `
+`,
+ });
+ function dt(J) {
+ return new Array(J + 1).join(' ');
+ }
+ function qt(J, Xe) {
+ if (Xe && (je(Xe), Xe.plugins)) {
+ let mt = be(Xe.plugins, J);
+ if (mt !== null) return oe(mt, J, yt(Xe), '', 0, []);
+ }
+ let it = G(J, bt(Xe), st(Xe), tt(Xe));
+ return it !== null ? it : ve(J, yt(Xe), '', 0, []);
+ }
+ return (
+ (qt.plugins = {
+ AsymmetricMatcher: n.default,
+ ConvertAnsi: i.default,
+ DOMCollection: r.default,
+ DOMElement: a.default,
+ Immutable: o.default,
+ ReactElement: s.default,
+ ReactTestComponent: l.default,
+ }),
+ (Mg = qt),
+ Mg
+ );
+ }
+ var TU = _U(),
+ FI = ah(TU),
+ zp,
+ pu;
+ function zI(e, t) {
+ let n = PU(e, t.includeThrowsAsExitNode),
+ i = EU(n);
+ if (!t.includeThrowsAsExitNode)
+ for (let [r] of e.body.blocks) i.has(r) || i.set(r, r);
+ return new uv(n.entry, i);
+ }
+ var uv = class {
+ constructor(t, n) {
+ zp.set(this, void 0),
+ pu.set(this, void 0),
+ at(this, zp, t, 'f'),
+ at(this, pu, n, 'f');
+ }
+ get exit() {
+ return j(this, zp, 'f');
+ }
+ get(t) {
+ let n = j(this, pu, 'f').get(t);
+ return (
+ D.invariant(n !== void 0, {
+ reason: 'Unknown node',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ n === t ? null : n
+ );
+ }
+ debug() {
+ let t = new Map();
+ for (let [n, i] of j(this, pu, 'f')) t.set(`bb${n}`, `bb${i}`);
+ return FI({exit: `bb${this.exit}`, postDominators: t});
+ }
+ };
+ (zp = new WeakMap()), (pu = new WeakMap());
+ function EU(e) {
+ let t = new Map();
+ t.set(e.entry, e.entry);
+ let n = !0;
+ for (; n; ) {
+ n = !1;
+ for (let [i, r] of e.nodes) {
+ if (r.id === e.entry) continue;
+ let a = null;
+ for (let o of r.preds)
+ if (t.has(o)) {
+ a = o;
+ break;
+ }
+ D.invariant(a !== null, {
+ reason: `At least one predecessor must have been visited for block ${i}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ for (let o of r.preds) {
+ if (o === a) continue;
+ t.get(o) !== void 0 && (a = IU(o, a, e, t));
+ }
+ t.get(i) !== a && (t.set(i, a), (n = !0));
+ }
+ }
+ return t;
+ }
+ function IU(e, t, n, i) {
+ let r = n.nodes.get(e),
+ a = n.nodes.get(t);
+ for (; r !== a; ) {
+ for (; r.index > a.index; ) {
+ let o = i.get(r.id);
+ r = n.nodes.get(o);
+ }
+ for (; a.index > r.index; ) {
+ let o = i.get(a.id);
+ a = n.nodes.get(o);
+ }
+ }
+ return r.id;
+ }
+ function PU(e, t) {
+ let n = new Map(),
+ i = e.env.nextBlockId,
+ r = {id: i, index: 0, preds: new Set(), succs: new Set()};
+ n.set(i, r);
+ for (let [u, p] of e.body.blocks) {
+ let y = {
+ id: u,
+ index: 0,
+ preds: new Set(go(p.terminal)),
+ succs: new Set(p.preds),
+ };
+ (p.terminal.kind === 'return' || (p.terminal.kind === 'throw' && t)) &&
+ (y.preds.add(i), r.succs.add(u)),
+ n.set(u, y);
+ }
+ let a = new Set(),
+ o = [];
+ function s(u) {
+ if (a.has(u)) return;
+ a.add(u);
+ let p = n.get(u);
+ for (let y of p.succs) s(y);
+ o.push(u);
+ }
+ s(i);
+ let l = {entry: i, nodes: new Map()},
+ d = 0;
+ for (let u of o.reverse()) {
+ let p = n.get(u);
+ (p.index = d++), l.nodes.set(u, p);
+ }
+ return l;
+ }
+ var Je = new Map(Oe),
+ xU = new Set([
+ 'Object',
+ 'Function',
+ 'RegExp',
+ 'Date',
+ 'Error',
+ 'TypeError',
+ 'RangeError',
+ 'ReferenceError',
+ 'SyntaxError',
+ 'URIError',
+ 'EvalError',
+ 'DataView',
+ 'Float32Array',
+ 'Float64Array',
+ 'Int8Array',
+ 'Int16Array',
+ 'Int32Array',
+ 'WeakMap',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Uint16Array',
+ 'Uint32Array',
+ 'ArrayBuffer',
+ 'JSON',
+ 'console',
+ 'eval',
+ ]),
+ Wm = [
+ [
+ 'Object',
+ Ut(Je, 'Object', [
+ [
+ 'keys',
+ ue(Je, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'fromEntries',
+ ue(Je, [], {
+ positionalParams: [x.ConditionallyMutate],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Jm},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'entries',
+ ue(Je, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ aliasing: {
+ receiver: '@receiver',
+ params: ['@object'],
+ rest: null,
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {
+ kind: 'Create',
+ into: '@returns',
+ reason: qe.KnownReturnSignature,
+ value: z.Mutable,
+ },
+ {kind: 'Capture', from: '@object', into: '@returns'},
+ ],
+ },
+ }),
+ ],
+ [
+ 'keys',
+ ue(Je, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ aliasing: {
+ receiver: '@receiver',
+ params: ['@object'],
+ rest: null,
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {
+ kind: 'Create',
+ into: '@returns',
+ reason: qe.KnownReturnSignature,
+ value: z.Mutable,
+ },
+ {kind: 'ImmutableCapture', from: '@object', into: '@returns'},
+ ],
+ },
+ }),
+ ],
+ [
+ 'values',
+ ue(Je, [], {
+ positionalParams: [x.Capture],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ aliasing: {
+ receiver: '@receiver',
+ params: ['@object'],
+ rest: null,
+ returns: '@returns',
+ temporaries: [],
+ effects: [
+ {
+ kind: 'Create',
+ into: '@returns',
+ reason: qe.KnownReturnSignature,
+ value: z.Mutable,
+ },
+ {kind: 'Capture', from: '@object', into: '@returns'},
+ ],
+ },
+ }),
+ ],
+ ]),
+ ],
+ [
+ 'Array',
+ Ut(Je, 'Array', [
+ [
+ 'isArray',
+ ue(Je, [], {
+ positionalParams: [x.Read],
+ restParam: null,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'from',
+ ue(Je, [], {
+ positionalParams: [
+ x.ConditionallyMutateIterator,
+ x.ConditionallyMutate,
+ x.ConditionallyMutate,
+ ],
+ restParam: x.Read,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'of',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Object', shapeId: Ht},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ]),
+ ],
+ [
+ 'performance',
+ Ut(Je, 'performance', [
+ [
+ 'now',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ impure: !0,
+ canonicalName: 'performance.now',
+ }),
+ ],
+ ]),
+ ],
+ [
+ 'Date',
+ Ut(Je, 'Date', [
+ [
+ 'now',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ impure: !0,
+ canonicalName: 'Date.now',
+ }),
+ ],
+ ]),
+ ],
+ [
+ 'Math',
+ Ut(Je, 'Math', [
+ ['PI', {kind: 'Primitive'}],
+ [
+ 'max',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'min',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'trunc',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'ceil',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'floor',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'pow',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'random',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ impure: !0,
+ canonicalName: 'Math.random',
+ }),
+ ],
+ ]),
+ ],
+ ['Infinity', {kind: 'Primitive'}],
+ ['NaN', {kind: 'Primitive'}],
+ [
+ 'console',
+ Ut(Je, 'console', [
+ [
+ 'error',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'info',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'log',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'table',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'trace',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'warn',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ ]),
+ ],
+ [
+ 'Boolean',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'Number',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'String',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'parseInt',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'parseFloat',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'isNaN',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'isFinite',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'encodeURI',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'encodeURIComponent',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'decodeURI',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'decodeURIComponent',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Primitive,
+ }),
+ ],
+ [
+ 'Map',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [x.ConditionallyMutateIterator],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: ov},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ },
+ null,
+ !0
+ ),
+ ],
+ [
+ 'Set',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [x.ConditionallyMutateIterator],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: Ha},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ },
+ null,
+ !0
+ ),
+ ],
+ [
+ 'WeakMap',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [x.ConditionallyMutateIterator],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: lv},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ },
+ null,
+ !0
+ ),
+ ],
+ [
+ 'WeakSet',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [x.ConditionallyMutateIterator],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: sv},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ },
+ null,
+ !0
+ ),
+ ],
+ ],
+ BI = [
+ [
+ 'useContext',
+ fn(
+ Je,
+ {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'useContext',
+ returnValueKind: z.Frozen,
+ returnValueReason: qe.Context,
+ },
+ KB
+ ),
+ ],
+ [
+ 'useState',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Object', shapeId: SI},
+ calleeEffect: x.Read,
+ hookKind: 'useState',
+ returnValueKind: z.Frozen,
+ returnValueReason: qe.State,
+ }),
+ ],
+ [
+ 'useActionState',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Object', shapeId: TI},
+ calleeEffect: x.Read,
+ hookKind: 'useActionState',
+ returnValueKind: z.Frozen,
+ returnValueReason: qe.State,
+ }),
+ ],
+ [
+ 'useReducer',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Object', shapeId: EI},
+ calleeEffect: x.Read,
+ hookKind: 'useReducer',
+ returnValueKind: z.Frozen,
+ returnValueReason: qe.ReducerState,
+ }),
+ ],
+ [
+ 'useRef',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Capture,
+ returnType: {kind: 'Object', shapeId: ia},
+ calleeEffect: x.Read,
+ hookKind: 'useRef',
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ [
+ 'useImperativeHandle',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ hookKind: 'useImperativeHandle',
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'useMemo',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'useMemo',
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'useCallback',
+ fn(Je, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'useCallback',
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'useEffect',
+ fn(
+ Je,
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Primitive'},
+ calleeEffect: x.Read,
+ hookKind: 'useEffect',
+ returnValueKind: z.Frozen,
+ aliasing: {
+ receiver: '@receiver',
+ params: [],
+ rest: '@rest',
+ returns: '@returns',
+ temporaries: ['@effect'],
+ effects: [
+ {kind: 'Freeze', value: '@rest', reason: qe.Effect},
+ {
+ kind: 'Create',
+ into: '@effect',
+ value: z.Frozen,
+ reason: qe.KnownReturnSignature,
+ },
+ {kind: 'Capture', from: '@rest', into: '@effect'},
+ {
+ kind: 'Create',
+ into: '@returns',
+ value: z.Primitive,
+ reason: qe.KnownReturnSignature,
+ },
+ ],
+ },
+ },
+ zB
+ ),
+ ],
+ [
+ 'useLayoutEffect',
+ fn(
+ Je,
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'useLayoutEffect',
+ returnValueKind: z.Frozen,
+ },
+ BB
+ ),
+ ],
+ [
+ 'useInsertionEffect',
+ fn(
+ Je,
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ hookKind: 'useInsertionEffect',
+ returnValueKind: z.Frozen,
+ },
+ UB
+ ),
+ ],
+ [
+ 'useTransition',
+ fn(Je, {
+ positionalParams: [],
+ restParam: null,
+ returnType: {kind: 'Object', shapeId: II},
+ calleeEffect: x.Read,
+ hookKind: 'useTransition',
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'use',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Frozen,
+ },
+ ZB
+ ),
+ ],
+ [
+ 'fire',
+ ue(
+ Je,
+ [],
+ {
+ positionalParams: [],
+ restParam: null,
+ returnType: {
+ kind: 'Function',
+ return: {kind: 'Poly'},
+ shapeId: PI,
+ isConstructor: !1,
+ },
+ calleeEffect: x.Read,
+ returnValueKind: z.Frozen,
+ },
+ xh
+ ),
+ ],
+ [
+ 'useEffectEvent',
+ fn(
+ Je,
+ {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {
+ kind: 'Function',
+ return: {kind: 'Poly'},
+ shapeId: xI,
+ isConstructor: !1,
+ },
+ calleeEffect: x.Read,
+ hookKind: 'useEffectEvent',
+ returnValueKind: z.Frozen,
+ },
+ JB
+ ),
+ ],
+ ['AUTODEPS', Ut(Je, wI, [])],
+ ];
+ Wm.push(
+ [
+ 'React',
+ Ut(Je, null, [
+ ...BI,
+ [
+ 'createElement',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'cloneElement',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Frozen,
+ }),
+ ],
+ [
+ 'createRef',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Capture,
+ returnType: {kind: 'Object', shapeId: ia},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ }),
+ ],
+ ]),
+ ],
+ [
+ '_jsx',
+ ue(Je, [], {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Frozen,
+ }),
+ ]
+ );
+ var vo = new Map(BI);
+ for (let e of xU) vo.set(e, {kind: 'Poly'});
+ for (let [e, t] of Wm) vo.set(e, t);
+ vo.set('globalThis', Ut(Je, 'globalThis', Wm));
+ vo.set('global', Ut(Je, 'global', Wm));
+ function Bp(e, t, n, i, r) {
+ var a, o, s, l, d, u;
+ switch (n.kind) {
+ case 'type':
+ switch (n.name) {
+ case 'Array':
+ return {kind: 'Object', shapeId: Ht};
+ case 'MixedReadonly':
+ return {kind: 'Object', shapeId: ea};
+ case 'Primitive':
+ return {kind: 'Primitive'};
+ case 'Ref':
+ return {kind: 'Object', shapeId: ia};
+ case 'Any':
+ return {kind: 'Poly'};
+ default:
+ Me(n.name, `Unexpected type '${n.name}'`);
+ }
+ case 'function':
+ return ue(t, [], {
+ positionalParams: n.positionalParams,
+ restParam: n.restParam,
+ calleeEffect: n.calleeEffect,
+ returnType: Bp(e, t, n.returnType, i, r),
+ returnValueKind: n.returnValueKind,
+ noAlias: n.noAlias === !0,
+ mutableOnlyIfOperandsAreMutable:
+ n.mutableOnlyIfOperandsAreMutable === !0,
+ aliasing: n.aliasing,
+ knownIncompatible:
+ (a = n.knownIncompatible) !== null && a !== void 0 ? a : null,
+ });
+ case 'hook':
+ return fn(t, {
+ hookKind: 'Custom',
+ positionalParams:
+ (o = n.positionalParams) !== null && o !== void 0 ? o : [],
+ restParam: (s = n.restParam) !== null && s !== void 0 ? s : x.Freeze,
+ calleeEffect: x.Read,
+ returnType: Bp(e, t, n.returnType, i, r),
+ returnValueKind:
+ (l = n.returnValueKind) !== null && l !== void 0 ? l : z.Frozen,
+ noAlias: n.noAlias === !0,
+ aliasing: n.aliasing,
+ knownIncompatible:
+ (d = n.knownIncompatible) !== null && d !== void 0 ? d : null,
+ });
+ case 'object':
+ return Ut(
+ t,
+ null,
+ Object.entries(
+ (u = n.properties) !== null && u !== void 0 ? u : {}
+ ).map(([p, y]) => {
+ var m;
+ let g = Bp(e, t, y, i, r),
+ S = cn(p),
+ _ = !1;
+ if (g.kind === 'Function' && g.shapeId !== null) {
+ let O = t.get(g.shapeId);
+ ((m = O?.functionType) === null || m === void 0
+ ? void 0
+ : m.hookKind) !== null && (_ = !0);
+ }
+ return (
+ S !== _ &&
+ D.throwInvalidConfig({
+ reason: 'Invalid type configuration for module',
+ description: `Expected type for object property '${p}' from module '${i}' ${
+ S ? 'to be a hook' : 'not to be a hook'
+ } based on the property name`,
+ loc: r,
+ }),
+ [p, g]
+ );
+ })
+ );
+ default:
+ Me(n, `Unexpected type kind '${n.kind}'`);
+ }
+ }
+ function wU(e) {
+ let t = [
+ 'useFrameCallback',
+ 'useAnimatedStyle',
+ 'useAnimatedProps',
+ 'useAnimatedScrollHandler',
+ 'useAnimatedReaction',
+ 'useWorkletCallback',
+ ],
+ n = [];
+ for (let a of t)
+ n.push([
+ a,
+ fn(e, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Poly'},
+ returnValueKind: z.Frozen,
+ noAlias: !0,
+ calleeEffect: x.Read,
+ hookKind: 'Custom',
+ }),
+ ]);
+ let i = ['useSharedValue', 'useDerivedValue'];
+ for (let a of i)
+ n.push([
+ a,
+ fn(e, {
+ positionalParams: [],
+ restParam: x.Freeze,
+ returnType: {kind: 'Object', shapeId: OI},
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ calleeEffect: x.Read,
+ hookKind: 'Custom',
+ }),
+ ]);
+ let r = [
+ 'withTiming',
+ 'withSpring',
+ 'createAnimatedPropAdapter',
+ 'withDecay',
+ 'withRepeat',
+ 'runOnUI',
+ 'executeOnUIRuntimeSync',
+ ];
+ for (let a of r)
+ n.push([
+ a,
+ ue(e, [], {
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'Poly'},
+ calleeEffect: x.Read,
+ returnValueKind: z.Mutable,
+ noAlias: !0,
+ }),
+ ]);
+ return Ut(e, null, n);
+ }
+ var OU = W.z
+ .record(
+ W.z.string(),
+ W.z.lazy(() => Gm)
+ )
+ .refine(
+ (e) =>
+ Object.keys(e).every(
+ (t) => t === '*' || t === 'default' || $.isValidIdentifier(t)
+ ),
+ 'Expected all "object" property names to be valid identifier, `*` to match any property, of `default` to define a module default export'
+ ),
+ $U = W.z.object({kind: W.z.literal('object'), properties: OU.nullable()}),
+ Wt = W.z
+ .string()
+ .refine((e) => e.startsWith('@'), {
+ message: "Placeholder names must start with '@'",
+ }),
+ jU = W.z.object({kind: W.z.literal('Freeze'), value: Wt, reason: X0}),
+ CU = W.z.object({kind: W.z.literal('Mutate'), value: Wt}),
+ DU = W.z.object({
+ kind: W.z.literal('MutateTransitiveConditionally'),
+ value: Wt,
+ }),
+ AU = W.z.object({
+ kind: W.z.literal('Create'),
+ into: Wt,
+ value: mh,
+ reason: X0,
+ }),
+ MU = W.z.object({kind: W.z.literal('Assign'), from: Wt, into: Wt}),
+ NU = W.z.object({kind: W.z.literal('Alias'), from: Wt, into: Wt}),
+ RU = W.z.object({
+ kind: W.z.literal('ImmutableCapture'),
+ from: Wt,
+ into: Wt,
+ }),
+ LU = W.z.object({kind: W.z.literal('Capture'), from: Wt, into: Wt}),
+ FU = W.z.object({kind: W.z.literal('CreateFrom'), from: Wt, into: Wt}),
+ zU = W.z.union([
+ Wt,
+ W.z.object({kind: W.z.literal('Spread'), place: Wt}),
+ W.z.object({kind: W.z.literal('Hole')}),
+ ]),
+ BU = W.z.object({
+ kind: W.z.literal('Apply'),
+ receiver: Wt,
+ function: Wt,
+ mutatesFunction: W.z.boolean(),
+ args: W.z.array(zU),
+ into: Wt,
+ }),
+ UU = W.z.object({kind: W.z.literal('Impure'), place: Wt}),
+ ZU = W.z.union([jU, AU, FU, MU, NU, LU, RU, UU, CU, DU, BU]),
+ UI = W.z.object({
+ receiver: Wt,
+ params: W.z.array(Wt),
+ rest: Wt.nullable(),
+ returns: Wt,
+ effects: W.z.array(ZU),
+ temporaries: W.z.array(Wt),
+ }),
+ qU = W.z.object({
+ kind: W.z.literal('function'),
+ positionalParams: W.z.array(wu),
+ restParam: wu.nullable(),
+ calleeEffect: wu,
+ returnType: W.z.lazy(() => Gm),
+ returnValueKind: mh,
+ noAlias: W.z.boolean().nullable().optional(),
+ mutableOnlyIfOperandsAreMutable: W.z.boolean().nullable().optional(),
+ impure: W.z.boolean().nullable().optional(),
+ canonicalName: W.z.string().nullable().optional(),
+ aliasing: UI.nullable().optional(),
+ knownIncompatible: W.z.string().nullable().optional(),
+ }),
+ KU = W.z.object({
+ kind: W.z.literal('hook'),
+ positionalParams: W.z.array(wu).nullable().optional(),
+ restParam: wu.nullable().optional(),
+ returnType: W.z.lazy(() => Gm),
+ returnValueKind: mh.nullable().optional(),
+ noAlias: W.z.boolean().nullable().optional(),
+ aliasing: UI.nullable().optional(),
+ knownIncompatible: W.z.string().nullable().optional(),
+ }),
+ VU = W.z.union([
+ W.z.literal('Any'),
+ W.z.literal('Ref'),
+ W.z.literal('Array'),
+ W.z.literal('Primitive'),
+ W.z.literal('MixedReadonly'),
+ ]),
+ JU = W.z.object({kind: W.z.literal('type'), name: VU}),
+ Gm = W.z.union([$U, qU, KU, JU]);
+ function jp(e, t) {
+ D.throwInvalidJS({
+ reason: `Typedchecker does not currently support type annotation: ${e}`,
+ loc: t,
+ });
+ }
+ var Up, Zp, qp, Kp, ua, Xa;
+ function ZI(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected TypeParameterId to be a non-negative integer',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e
+ );
+ }
+ var BE = 0;
+ function HU(e, t) {
+ let n = 0;
+ function i(r, a, o, s, l = null) {
+ var d, u, p;
+ switch (r.kind) {
+ case 'TypeApp':
+ return r.type.kind === 'Def' &&
+ r.type.def.kind === 'Poly' &&
+ r.type.def.t_out.kind === 'Def' &&
+ r.type.def.t_out.def.kind === 'Type' &&
+ r.type.def.t_out.def.type.kind === 'Opaque' &&
+ r.type.def.t_out.def.type.opaquetype.opaque_name === 'Client' &&
+ r.targs.length === 1
+ ? i(r.targs[0], a, o, 'client')
+ : r.type.kind === 'Def' &&
+ r.type.def.kind === 'Poly' &&
+ r.type.def.t_out.kind === 'Def' &&
+ r.type.def.t_out.def.kind === 'Type' &&
+ r.type.def.t_out.def.type.kind === 'Opaque' &&
+ r.type.def.t_out.def.type.opaquetype.opaque_name === 'Server' &&
+ r.targs.length === 1
+ ? i(r.targs[0], a, o, 'server')
+ : Yt.todo(s);
+ case 'Open':
+ return Yt.mixed(s);
+ case 'Any':
+ return Yt.todo(s);
+ case 'Annot':
+ return i(r.type, a, o, s, l);
+ case 'Opaque': {
+ if (
+ r.opaquetype.opaque_name === 'Client' &&
+ r.opaquetype.super_t != null
+ )
+ return i(r.opaquetype.super_t, a, o, 'client');
+ if (
+ r.opaquetype.opaque_name === 'Server' &&
+ r.opaquetype.super_t != null
+ )
+ return i(r.opaquetype.super_t, a, o, 'server');
+ let y =
+ (d = r.opaquetype.underlying_t) !== null && d !== void 0
+ ? d
+ : r.opaquetype.super_t;
+ return y != null ? i(y, a, o, s, l) : Yt.todo(s);
+ }
+ case 'Def':
+ switch (r.def.kind) {
+ case 'EnumValue':
+ return i(r.def.enum_info.representation_t, a, o, s, l);
+ case 'EnumObject':
+ return Yt.enum(s);
+ case 'Empty':
+ return Yt.todo(s);
+ case 'Instance': {
+ let y = new Map();
+ for (let m in r.def.instance.inst.own_props) {
+ let g = r.def.instance.inst.own_props[m];
+ g.kind === 'Field'
+ ? y.set(m, i(g.type, a, o, s))
+ : D.invariant(!1, {
+ reason: `Unsupported property kind ${g.kind}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ }
+ return Yt.class(
+ (u = r.def.instance.inst.class_name) !== null && u !== void 0
+ ? u
+ : '[anonymous class]',
+ y,
+ s
+ );
+ }
+ case 'Type':
+ return i(r.def.type, a, o, s, l);
+ case 'NumGeneral':
+ case 'SingletonNum':
+ return Yt.number(s);
+ case 'StrGeneral':
+ case 'SingletonStr':
+ return Yt.string(s);
+ case 'BoolGeneral':
+ case 'SingletonBool':
+ return Yt.boolean(s);
+ case 'Void':
+ return Yt.void(s);
+ case 'Null':
+ return Yt.void(s);
+ case 'Mixed':
+ return Yt.mixed(s);
+ case 'Arr':
+ return r.def.arrtype.kind === 'ArrayAT' ||
+ r.def.arrtype.kind === 'ROArrayAT'
+ ? Yt.array(i(r.def.arrtype.elem_t, a, o, s), s)
+ : Yt.tuple(
+ BE,
+ r.def.arrtype.elements.map((y) => i(y.t, a, o, s)),
+ s
+ );
+ case 'Obj': {
+ let y = new Map();
+ for (let m in r.def.objtype.props) {
+ let g = r.def.objtype.props[m];
+ g.kind === 'Field'
+ ? y.set(m, i(g.type, a, o, s))
+ : D.invariant(!1, {
+ reason: `Unsupported property kind ${g.kind}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ }
+ return Yt.object(BE, y, s);
+ }
+ case 'Class': {
+ if (r.def.type.kind === 'ThisInstance') {
+ let y = new Map();
+ for (let m in r.def.type.instance.inst.own_props) {
+ let g = r.def.type.instance.inst.own_props[m];
+ g.kind === 'Field'
+ ? y.set(m, i(g.type, a, o, s))
+ : D.invariant(!1, {
+ reason: `Unsupported property kind ${g.kind}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ }
+ return Yt.class(
+ (p = r.def.type.instance.inst.class_name) !== null &&
+ p !== void 0
+ ? p
+ : '[anonymous class]',
+ y,
+ s
+ );
+ }
+ D.invariant(!1, {
+ reason: `Unsupported class instance type ${r.def.type.kind}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ }
+ case 'Fun':
+ return Yt.function(
+ l,
+ r.def.funtype.params.map((y) => i(y.type, a, o, s)),
+ i(r.def.funtype.return_t, a, o, s),
+ s
+ );
+ case 'Poly': {
+ let y = o,
+ m = r.def.tparams.map((g) => {
+ let S = ZI(n++),
+ _ = i(g.bound, a, y, s);
+ return (
+ (y = new Map(y)),
+ y.set(g.name, S),
+ {name: g.name, id: S, bound: _}
+ );
+ });
+ return i(r.def.t_out, a, y, s, m);
+ }
+ case 'ReactAbstractComponent': {
+ let y = new Map(),
+ m = null,
+ g = i(r.def.config, a, o, s);
+ return (
+ g.type.kind === 'Object'
+ ? g.type.members.forEach((S, _) => {
+ _ === 'children' ? (m = S) : y.set(_, S);
+ })
+ : D.invariant(!1, {
+ reason: `Unsupported component props type ${g.type.kind}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ Yt.component(y, m, s)
+ );
+ }
+ case 'Renders':
+ return Yt.todo(s);
+ default:
+ jp('Renders', F);
+ }
+ case 'Generic': {
+ let y = o.get(r.name);
+ return (
+ y == null && jp(r.name, F), Yt.generic(y, s, i(r.bound, a, o, s))
+ );
+ }
+ case 'Union': {
+ let y = r.members.map((m) => i(m, a, o, s));
+ if (
+ y.length === 1 ||
+ ((y[0].type.kind === 'Number' ||
+ y[0].type.kind === 'String' ||
+ y[0].type.kind === 'Boolean') &&
+ y.filter((g) => g.type.kind === y[0].type.kind).length ===
+ y.length)
+ )
+ return y[0];
+ if (
+ y[0].type.kind === 'Array' &&
+ (y[0].type.element.type.kind === 'Number' ||
+ y[0].type.element.type.kind === 'String' ||
+ y[0].type.element.type.kind === 'Boolean')
+ ) {
+ let m = y[0].type.element;
+ if (
+ y.filter(
+ (S) =>
+ S.type.kind === 'Array' &&
+ S.type.element.type.kind === m.type.kind
+ ).length === y.length
+ )
+ return y[0];
+ }
+ return Yt.union(y, s);
+ }
+ case 'Eval': {
+ if (
+ r.destructor.kind === 'ReactDRO' ||
+ r.destructor.kind === 'ReactCheckComponentConfig'
+ )
+ return i(r.type, a, o, s, l);
+ jp(`EvalT(${r.destructor.kind})`, F);
+ }
+ case 'Optional':
+ return Yt.union([i(r.type, a, o, s), Yt.void(s)], s);
+ default:
+ jp(r.kind, F);
+ }
+ }
+ return i(e, t, new Map(), 'shared');
+ }
+ function mu(e) {
+ return `${e.start.line}:${e.start.column}-${e.end.line}:${e.end.column}`;
+ }
+ function WU(e) {
+ let t = new Map();
+ for (let n of e) {
+ let i = {
+ start: {
+ line: n.loc.start.line,
+ column: n.loc.start.column - 1,
+ index: n.loc.start.index,
+ },
+ end: n.loc.end,
+ filename: n.loc.filename,
+ identifierName: n.loc.identifierName,
+ };
+ t.set(mu(i), n.type);
+ }
+ return t;
+ }
+ var UE = null,
+ Ng = null,
+ dv = class {
+ constructor() {
+ (this.moduleEnv = new Map()),
+ Up.set(this, 0),
+ Zp.set(this, 0),
+ qp.set(this, new Map()),
+ Kp.set(this, new Map()),
+ ua.set(this, []),
+ Xa.set(this, new Map());
+ }
+ init(t, n) {
+ D.invariant(t.config.flowTypeProvider != null, {
+ reason: 'Expected flowDumpTypes to be defined in environment config',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let i;
+ n === UE || ((UE = n), (Ng = t.config.flowTypeProvider(n))), (i = Ng);
+ let r = WU(i),
+ a = new Map();
+ for (let [o, s] of r)
+ typeof o != 'symbol' && a.set(o, HU(JSON.parse(s), o));
+ at(this, Xa, a, 'f');
+ }
+ setType(t, n) {
+ (typeof t.loc != 'symbol' && j(this, Xa, 'f').has(mu(t.loc))) ||
+ j(this, qp, 'f').set(t.id, n);
+ }
+ getType(t) {
+ let n = this.getTypeOrNull(t);
+ if (n == null)
+ throw new Error(
+ `Type not found for ${t.id}, ${
+ typeof t.loc == 'symbol' ? 'generated loc' : mu(t.loc)
+ }`
+ );
+ return n;
+ }
+ getTypeOrNull(t) {
+ var n;
+ let i =
+ (n = j(this, qp, 'f').get(t.id)) !== null && n !== void 0 ? n : null;
+ if (i == null && typeof t.loc != 'symbol') {
+ let r = j(this, Xa, 'f').get(mu(t.loc));
+ return r ?? null;
+ }
+ return i;
+ }
+ getTypeByLoc(t) {
+ if (typeof t == 'symbol') return null;
+ let n = j(this, Xa, 'f').get(mu(t));
+ return n ?? null;
+ }
+ nextNominalId() {
+ var t, n;
+ return at(this, Up, ((n = j(this, Up, 'f')), (t = n++), n), 'f'), t;
+ }
+ nextTypeParameterId() {
+ var t, n;
+ return ZI(
+ (at(this, Zp, ((n = j(this, Zp, 'f')), (t = n++), n), 'f'), t)
+ );
+ }
+ addBinding(t, n) {
+ j(this, Kp, 'f').set(t, n);
+ }
+ resolveBinding(t) {
+ var n;
+ return (n = j(this, Kp, 'f').get(t)) !== null && n !== void 0
+ ? n
+ : null;
+ }
+ pushGeneric(t, n) {
+ j(this, ua, 'f').unshift([t, n]);
+ }
+ popGeneric(t) {
+ for (let n = 0; n < j(this, ua, 'f').length; n++)
+ if (j(this, ua, 'f')[n][0] === t) {
+ j(this, ua, 'f').splice(n, 1);
+ return;
+ }
+ }
+ getGeneric(t) {
+ for (let [n, i] of j(this, ua, 'f')) if (t === n) return i;
+ return null;
+ }
+ };
+ (Up = new WeakMap()),
+ (Zp = new WeakMap()),
+ (qp = new WeakMap()),
+ (Kp = new WeakMap()),
+ (ua = new WeakMap()),
+ (Xa = new WeakMap());
+ var ZE = {
+ number(e) {
+ return {kind: 'Concrete', type: {kind: 'Number'}, platform: e};
+ },
+ string(e) {
+ return {kind: 'Concrete', type: {kind: 'String'}, platform: e};
+ },
+ boolean(e) {
+ return {kind: 'Concrete', type: {kind: 'Boolean'}, platform: e};
+ },
+ void(e) {
+ return {kind: 'Concrete', type: {kind: 'Void'}, platform: e};
+ },
+ mixed(e) {
+ return {kind: 'Concrete', type: {kind: 'Mixed'}, platform: e};
+ },
+ enum(e) {
+ return {kind: 'Concrete', type: {kind: 'Enum'}, platform: e};
+ },
+ todo(e) {
+ return {kind: 'Concrete', type: {kind: 'Mixed'}, platform: e};
+ },
+ },
+ Yt = Object.assign(Object.assign({}, ZE), {
+ nullable(e, t) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Nullable', type: e},
+ platform: t,
+ };
+ },
+ array(e, t) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Array', element: e},
+ platform: t,
+ };
+ },
+ set(e, t) {
+ return {kind: 'Concrete', type: {kind: 'Set', element: e}, platform: t};
+ },
+ map(e, t, n) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Map', key: e, value: t},
+ platform: n,
+ };
+ },
+ function(e, t, n, i) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Function', typeParameters: e, params: t, returnType: n},
+ platform: i,
+ };
+ },
+ component(e, t, n) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Component', props: e, children: t},
+ platform: n,
+ };
+ },
+ object(e, t, n) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Object', id: e, members: t},
+ platform: n,
+ };
+ },
+ class(e, t, n) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Instance', name: e, members: t},
+ platform: n,
+ };
+ },
+ tuple(e, t, n) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Tuple', id: e, members: t},
+ platform: n,
+ };
+ },
+ generic(e, t, n = ZE.mixed(t)) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Generic', id: e, bound: n},
+ platform: t,
+ };
+ },
+ union(e, t) {
+ return {
+ kind: 'Concrete',
+ type: {kind: 'Union', members: e},
+ platform: t,
+ };
+ },
+ });
+ function GU(e) {
+ switch (e) {
+ case 'react-hook-form':
+ return {
+ kind: 'object',
+ properties: {
+ useForm: {
+ kind: 'hook',
+ returnType: {
+ kind: 'object',
+ properties: {
+ watch: {
+ kind: 'function',
+ positionalParams: [],
+ restParam: x.Read,
+ calleeEffect: x.Read,
+ returnType: {kind: 'type', name: 'Any'},
+ returnValueKind: z.Mutable,
+ knownIncompatible:
+ "React Hook Form's `useForm()` API returns a `watch()` function which cannot be memoized safely.",
+ },
+ },
+ },
+ },
+ },
+ };
+ case '@tanstack/react-table':
+ return {
+ kind: 'object',
+ properties: {
+ useReactTable: {
+ kind: 'hook',
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'type', name: 'Any'},
+ knownIncompatible:
+ "TanStack Table's `useReactTable()` API returns functions that cannot be memoized safely",
+ },
+ },
+ };
+ case '@tanstack/react-virtual':
+ return {
+ kind: 'object',
+ properties: {
+ useVirtualizer: {
+ kind: 'hook',
+ positionalParams: [],
+ restParam: x.Read,
+ returnType: {kind: 'type', name: 'Any'},
+ knownIncompatible:
+ "TanStack Virtual's `useVirtualizer()` API returns functions that cannot be memoized safely",
+ },
+ },
+ };
+ }
+ return null;
+ }
+ var xn,
+ bi,
+ Li,
+ $u,
+ Vp,
+ Jp,
+ Hp,
+ yu,
+ Wp,
+ gu,
+ vu,
+ da,
+ fv,
+ pv,
+ vi,
+ XU = W.z.object({
+ elementSymbol: W.z.union([
+ W.z.literal('react.element'),
+ W.z.literal('react.transitional.element'),
+ ]),
+ globalDevVar: W.z.string(),
+ }),
+ Qi = W.z.object({source: W.z.string(), importSpecifierName: W.z.string()}),
+ YU = W.z
+ .object({
+ fn: Qi,
+ gating: Qi.nullable(),
+ globalGating: W.z.string().nullable(),
+ })
+ .refine(
+ (e) => e.gating != null || e.globalGating != null,
+ 'Expected at least one of gating or globalGating'
+ ),
+ QU = 'useFire',
+ qE = 'false',
+ e4 = W.z.string(),
+ t4 = W.z.object({
+ effectKind: W.z.nativeEnum(x),
+ valueKind: W.z.nativeEnum(z),
+ noAlias: W.z.boolean().default(!1),
+ transitiveMixedData: W.z.boolean().default(!1),
+ }),
+ qI = W.z.object({
+ customHooks: W.z.map(W.z.string(), t4).default(new Map()),
+ moduleTypeProvider: W.z.nullable(W.z.any()).default(null),
+ customMacros: W.z.nullable(W.z.array(e4)).default(null),
+ enableResetCacheOnSourceFileChanges: W.z
+ .nullable(W.z.boolean())
+ .default(null),
+ enablePreserveExistingMemoizationGuarantees: W.z.boolean().default(!0),
+ validatePreserveExistingMemoizationGuarantees: W.z.boolean().default(!0),
+ enablePreserveExistingManualUseMemo: W.z.boolean().default(!1),
+ enableForest: W.z.boolean().default(!1),
+ enableUseTypeAnnotations: W.z.boolean().default(!1),
+ flowTypeProvider: W.z.nullable(W.z.any()).default(null),
+ enableOptionalDependencies: W.z.boolean().default(!0),
+ enableFire: W.z.boolean().default(!1),
+ enableNameAnonymousFunctions: W.z.boolean().default(!1),
+ inferEffectDependencies: W.z
+ .nullable(
+ W.z.array(
+ W.z.object({
+ function: Qi,
+ autodepsIndex: W.z.number().min(1, 'autodepsIndex must be > 0'),
+ })
+ )
+ )
+ .default(null),
+ inlineJsxTransform: XU.nullable().default(null),
+ validateHooksUsage: W.z.boolean().default(!0),
+ validateRefAccessDuringRender: W.z.boolean().default(!0),
+ validateNoSetStateInRender: W.z.boolean().default(!0),
+ validateNoSetStateInEffects: W.z.boolean().default(!1),
+ validateNoDerivedComputationsInEffects: W.z.boolean().default(!1),
+ validateNoDerivedComputationsInEffects_exp: W.z.boolean().default(!1),
+ validateNoJSXInTryStatements: W.z.boolean().default(!1),
+ validateStaticComponents: W.z.boolean().default(!1),
+ validateMemoizedEffectDependencies: W.z.boolean().default(!1),
+ validateNoCapitalizedCalls: W.z
+ .nullable(W.z.array(W.z.string()))
+ .default(null),
+ validateBlocklistedImports: W.z
+ .nullable(W.z.array(W.z.string()))
+ .default(null),
+ validateNoImpureFunctionsInRender: W.z.boolean().default(!1),
+ validateNoFreezingKnownMutableFunctions: W.z.boolean().default(!1),
+ enableAssumeHooksFollowRulesOfReact: W.z.boolean().default(!0),
+ enableTransitivelyFreezeFunctionExpressions: W.z.boolean().default(!0),
+ enableEmitFreeze: Qi.nullable().default(null),
+ enableEmitHookGuards: Qi.nullable().default(null),
+ enableInstructionReordering: W.z.boolean().default(!1),
+ enableFunctionOutlining: W.z.boolean().default(!0),
+ enableJsxOutlining: W.z.boolean().default(!1),
+ enableEmitInstrumentForget: YU.nullable().default(null),
+ assertValidMutableRanges: W.z.boolean().default(!1),
+ enableChangeVariableCodegen: W.z.boolean().default(!1),
+ enableMemoizationComments: W.z.boolean().default(!1),
+ throwUnknownException__testonly: W.z.boolean().default(!1),
+ enableTreatFunctionDepsAsConditional: W.z.boolean().default(!1),
+ disableMemoizationForDebugging: W.z.boolean().default(!1),
+ enableChangeDetectionForDebugging: Qi.nullable().default(null),
+ enableCustomTypeDefinitionForReanimated: W.z.boolean().default(!1),
+ hookPattern: W.z.string().nullable().default(null),
+ enableTreatRefLikeIdentifiersAsRefs: W.z.boolean().default(!0),
+ enableTreatSetIdentifiersAsStateSetters: W.z.boolean().default(!1),
+ lowerContextAccess: Qi.nullable().default(null),
+ validateNoVoidUseMemo: W.z.boolean().default(!0),
+ validateNoDynamicallyCreatedComponentsOrHooks: W.z.boolean().default(!1),
+ enableAllowSetStateFromRefsInEffects: W.z.boolean().default(!0),
+ }),
+ Nu = class {
+ constructor(t, n, i, r, a, o, s, l, d, u) {
+ xn.add(this),
+ bi.set(this, void 0),
+ Li.set(this, void 0),
+ $u.set(this, new Map()),
+ Vp.set(this, 0),
+ Jp.set(this, 0),
+ Hp.set(this, 0),
+ yu.set(this, void 0),
+ Wp.set(this, []),
+ (this.inferredEffectLocations = new Set()),
+ gu.set(this, void 0),
+ vu.set(this, void 0),
+ da.set(this, void 0),
+ at(this, yu, t, 'f'),
+ (this.fnType = n),
+ (this.compilerMode = i),
+ (this.config = r),
+ (this.filename = l),
+ (this.code = d),
+ (this.logger = s),
+ (this.programContext = u),
+ at(this, Li, new Map(Je), 'f'),
+ at(this, bi, new Map(vo), 'f'),
+ (this.hasFireRewrite = !1),
+ (this.hasInferredEffect = !1),
+ r.disableMemoizationForDebugging &&
+ r.enableChangeDetectionForDebugging != null &&
+ D.throwInvalidConfig({
+ reason:
+ "Invalid environment config: the 'disableMemoizationForDebugging' and 'enableChangeDetectionForDebugging' options cannot be used together",
+ description: null,
+ loc: null,
+ suggestions: null,
+ });
+ for (let [p, y] of this.config.customHooks)
+ D.invariant(!j(this, bi, 'f').has(p), {
+ reason: `[Globals] Found existing definition in global registry for custom hook ${p}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ j(this, bi, 'f').set(
+ p,
+ fn(j(this, Li, 'f'), {
+ positionalParams: [],
+ restParam: y.effectKind,
+ returnType: y.transitiveMixedData
+ ? {kind: 'Object', shapeId: ea}
+ : {kind: 'Poly'},
+ returnValueKind: y.valueKind,
+ calleeEffect: x.Read,
+ hookKind: 'Custom',
+ noAlias: y.noAlias,
+ })
+ );
+ if (r.enableCustomTypeDefinitionForReanimated) {
+ let p = wU(j(this, Li, 'f'));
+ j(this, $u, 'f').set(n4, p);
+ }
+ (this.parentFunction = o),
+ at(this, gu, a, 'f'),
+ at(this, vu, new Set(), 'f'),
+ r.flowTypeProvider != null
+ ? (at(this, da, new dv(), 'f'),
+ D.invariant(d != null, {
+ reason:
+ 'Expected Environment to be initialized with source code when a Flow type provider is specified',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ j(this, da, 'f').init(this, d))
+ : at(this, da, null, 'f');
+ }
+ get typeContext() {
+ return (
+ D.invariant(j(this, da, 'f') != null, {
+ reason: 'Flow type environment not initialized',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ j(this, da, 'f')
+ );
+ }
+ get isInferredMemoEnabled() {
+ return this.compilerMode !== 'no_inferred_memo';
+ }
+ get nextIdentifierId() {
+ var t, n;
+ return yh(
+ (at(this, Vp, ((n = j(this, Vp, 'f')), (t = n++), n), 'f'), t)
+ );
+ }
+ get nextBlockId() {
+ var t, n;
+ return Zi(
+ (at(this, Jp, ((n = j(this, Jp, 'f')), (t = n++), n), 'f'), t)
+ );
+ }
+ get nextScopeId() {
+ var t, n;
+ return Q0(
+ (at(this, Hp, ((n = j(this, Hp, 'f')), (t = n++), n), 'f'), t)
+ );
+ }
+ get scope() {
+ return j(this, yu, 'f');
+ }
+ logErrors(t) {
+ if (!(t.isOk() || this.logger == null))
+ for (let n of t.unwrapErr().details)
+ this.logger.logEvent(this.filename, {
+ kind: 'CompileError',
+ detail: n,
+ fnLoc: null,
+ });
+ }
+ isContextIdentifier(t) {
+ return j(this, gu, 'f').has(t);
+ }
+ isHoistedIdentifier(t) {
+ return j(this, vu, 'f').has(t);
+ }
+ generateGloballyUniqueIdentifierName(t) {
+ let n = j(this, yu, 'f').generateUidIdentifier(t ?? void 0);
+ return uo(n.name);
+ }
+ outlineFunction(t, n) {
+ j(this, Wp, 'f').push({fn: t, type: n});
+ }
+ getOutlinedFunctions() {
+ return j(this, Wp, 'f');
+ }
+ getGlobalDeclaration(t, n) {
+ var i, r, a, o;
+ if (this.config.hookPattern != null) {
+ let s = new RegExp(this.config.hookPattern).exec(t.name);
+ if (s != null && typeof s[1] == 'string' && cn(s[1])) {
+ let l = s[1];
+ return (i = j(this, bi, 'f').get(l)) !== null && i !== void 0
+ ? i
+ : j(this, xn, 'm', vi).call(this);
+ }
+ }
+ switch (t.kind) {
+ case 'ModuleLocal':
+ return cn(t.name) ? j(this, xn, 'm', vi).call(this) : null;
+ case 'Global':
+ return (r = j(this, bi, 'f').get(t.name)) !== null && r !== void 0
+ ? r
+ : cn(t.name)
+ ? j(this, xn, 'm', vi).call(this)
+ : null;
+ case 'ImportSpecifier': {
+ if (j(this, xn, 'm', pv).call(this, t.module))
+ return (a = j(this, bi, 'f').get(t.imported)) !== null &&
+ a !== void 0
+ ? a
+ : cn(t.imported) || cn(t.name)
+ ? j(this, xn, 'm', vi).call(this)
+ : null;
+ {
+ let s = j(this, xn, 'm', fv).call(this, t.module, n);
+ if (s !== null) {
+ let l = this.getPropertyType(s, t.imported);
+ if (l != null) {
+ let d = cn(t.imported),
+ u = Au(this, l) != null;
+ return (
+ d !== u &&
+ D.throwInvalidConfig({
+ reason: 'Invalid type configuration for module',
+ description: `Expected type for \`import {${
+ t.imported
+ }} from '${t.module}'\` ${
+ d ? 'to be a hook' : 'not to be a hook'
+ } based on the exported name`,
+ loc: n,
+ }),
+ l
+ );
+ }
+ }
+ return cn(t.imported) || cn(t.name)
+ ? j(this, xn, 'm', vi).call(this)
+ : null;
+ }
+ }
+ case 'ImportDefault':
+ case 'ImportNamespace': {
+ if (j(this, xn, 'm', pv).call(this, t.module))
+ return (o = j(this, bi, 'f').get(t.name)) !== null && o !== void 0
+ ? o
+ : cn(t.name)
+ ? j(this, xn, 'm', vi).call(this)
+ : null;
+ {
+ let s = j(this, xn, 'm', fv).call(this, t.module, n);
+ if (s !== null) {
+ let l = null;
+ if (t.kind === 'ImportDefault') {
+ let d = this.getPropertyType(s, 'default');
+ d !== null && (l = d);
+ } else l = s;
+ if (l !== null) {
+ let d = cn(t.module),
+ u = Au(this, l) != null;
+ return (
+ d !== u &&
+ D.throwInvalidConfig({
+ reason: 'Invalid type configuration for module',
+ description: `Expected type for \`import ... from '${
+ t.module
+ }'\` ${
+ d ? 'to be a hook' : 'not to be a hook'
+ } based on the module name`,
+ loc: n,
+ }),
+ l
+ );
+ }
+ }
+ return cn(t.name) ? j(this, xn, 'm', vi).call(this) : null;
+ }
+ }
+ }
+ }
+ getFallthroughPropertyType(t, n) {
+ var i;
+ let r = null;
+ if (
+ ((t.kind === 'Object' || t.kind === 'Function') && (r = t.shapeId),
+ r !== null)
+ ) {
+ let a = j(this, Li, 'f').get(r);
+ return (
+ D.invariant(a !== void 0, {
+ reason: `[HIR] Forget internal error: cannot resolve shape ${r}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ (i = a.properties.get('*')) !== null && i !== void 0 ? i : null
+ );
+ }
+ return null;
+ }
+ getPropertyType(t, n) {
+ var i, r, a;
+ let o = null;
+ if (
+ ((t.kind === 'Object' || t.kind === 'Function') && (o = t.shapeId),
+ o !== null)
+ ) {
+ let s = j(this, Li, 'f').get(o);
+ return (
+ D.invariant(s !== void 0, {
+ reason: `[HIR] Forget internal error: cannot resolve shape ${o}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ typeof n == 'string'
+ ? (r =
+ (i = s.properties.get(n)) !== null && i !== void 0
+ ? i
+ : s.properties.get('*')) !== null && r !== void 0
+ ? r
+ : cn(n)
+ ? j(this, xn, 'm', vi).call(this)
+ : null
+ : (a = s.properties.get('*')) !== null && a !== void 0
+ ? a
+ : null
+ );
+ } else if (typeof n == 'string' && cn(n))
+ return j(this, xn, 'm', vi).call(this);
+ return null;
+ }
+ getFunctionSignature(t) {
+ let {shapeId: n} = t;
+ if (n !== null) {
+ let i = j(this, Li, 'f').get(n);
+ return (
+ D.invariant(i !== void 0, {
+ reason: `[HIR] Forget internal error: cannot resolve shape ${n}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ i.functionType
+ );
+ }
+ return null;
+ }
+ addHoistedIdentifier(t) {
+ j(this, gu, 'f').add(t), j(this, vu, 'f').add(t);
+ }
+ };
+ (bi = new WeakMap()),
+ (Li = new WeakMap()),
+ ($u = new WeakMap()),
+ (Vp = new WeakMap()),
+ (Jp = new WeakMap()),
+ (Hp = new WeakMap()),
+ (yu = new WeakMap()),
+ (Wp = new WeakMap()),
+ (gu = new WeakMap()),
+ (vu = new WeakMap()),
+ (da = new WeakMap()),
+ (xn = new WeakSet()),
+ (fv = function (t, n) {
+ var i;
+ let r = j(this, $u, 'f').get(t);
+ if (r === void 0) {
+ let a =
+ (i = this.config.moduleTypeProvider) !== null && i !== void 0
+ ? i
+ : GU;
+ if (a == null) return null;
+ typeof a != 'function' &&
+ D.throwInvalidConfig({
+ reason: 'Expected a function for `moduleTypeProvider`',
+ loc: n,
+ });
+ let o = a(t);
+ if (o != null) {
+ let s = Gm.safeParse(o);
+ s.success ||
+ D.throwInvalidConfig({
+ reason:
+ 'Could not parse module type, the configured `moduleTypeProvider` function returned an invalid module description',
+ description: s.error.toString(),
+ loc: n,
+ });
+ let l = s.data;
+ r = Bp(j(this, bi, 'f'), j(this, Li, 'f'), l, t, n);
+ } else r = null;
+ j(this, $u, 'f').set(t, r);
+ }
+ return r;
+ }),
+ (pv = function (t) {
+ return t.toLowerCase() === 'react' || t.toLowerCase() === 'react-dom';
+ }),
+ (vi = function () {
+ return this.config.enableAssumeHooksFollowRulesOfReact ? $I : HB;
+ });
+ Nu.knownReactModules = ['react', 'react-dom'];
+ var n4 = 'react-native-reanimated';
+ function cn(e) {
+ return /^use[A-Z0-9]/.test(e);
+ }
+ function KI(e) {
+ let t = qI.safeParse(e);
+ return t.success ? zn(t.data) : gr(t.error);
+ }
+ function r4(e) {
+ let t = qI.safeParse(e);
+ if (t.success) return t.data;
+ D.throwInvalidConfig({
+ reason:
+ 'Could not validate environment config. Update React Compiler config to fix the error',
+ description: `${ju.fromZodError(t.error)}`,
+ loc: null,
+ suggestions: null,
+ });
+ }
+ function i4(e) {
+ let t = Qi.safeParse(e);
+ if (t.success) return t.data;
+ D.throwInvalidConfig({
+ reason:
+ 'Could not parse external function. Update React Compiler config to fix the error',
+ description: `${ju.fromZodError(t.error)}`,
+ loc: null,
+ suggestions: null,
+ });
+ }
+ var VI = 'default',
+ hu;
+ function Hu(e) {
+ let t = new mv(),
+ n = new Set();
+ for (let [, i] of e.body.blocks) {
+ let r = Ju(i.terminal);
+ r !== null && n.add(r);
+ for (let l of i.instructions)
+ (l.value.kind === 'FunctionExpression' ||
+ l.value.kind === 'ObjectMethod') &&
+ Hu(l.value.loweredFunc.func);
+ if (i.preds.size !== 1 || i.kind !== 'block' || n.has(i.id)) continue;
+ let a = Array.from(i.preds)[0],
+ o = t.get(a),
+ s = e.body.blocks.get(o);
+ if (
+ (D.invariant(s !== void 0, {
+ reason: `Expected predecessor ${o} to exist`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ !(s.terminal.kind !== 'goto' || s.kind !== 'block'))
+ ) {
+ for (let l of i.phis) {
+ D.invariant(l.operands.size === 1, {
+ reason: `Found a block with a single predecessor but where a phi has multiple (${l.operands.size}) operands`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ let d = Array.from(l.operands.values())[0],
+ u = {
+ kind: 'Identifier',
+ identifier: l.place.identifier,
+ effect: x.ConditionallyMutate,
+ reactive: !1,
+ loc: F,
+ },
+ p = {
+ id: s.terminal.id,
+ lvalue: Object.assign({}, u),
+ value: {kind: 'LoadLocal', place: Object.assign({}, d), loc: F},
+ effects: [
+ {
+ kind: 'Alias',
+ from: Object.assign({}, d),
+ into: Object.assign({}, u),
+ },
+ ],
+ loc: F,
+ };
+ s.instructions.push(p);
+ }
+ s.instructions.push(...i.instructions),
+ (s.terminal = i.terminal),
+ t.merge(i.id, o),
+ e.body.blocks.delete(i.id);
+ }
+ }
+ for (let [, i] of e.body.blocks)
+ for (let r of i.phis)
+ for (let [a, o] of r.operands) {
+ let s = t.get(a);
+ s !== a && (r.operands.delete(a), r.operands.set(s, o));
+ }
+ xa(e.body);
+ for (let [, {terminal: i}] of e.body.blocks)
+ mI(i) && (i.fallthrough = t.get(i.fallthrough));
+ }
+ var mv = class {
+ constructor() {
+ hu.set(this, new Map());
+ }
+ merge(t, n) {
+ let i = this.get(n);
+ j(this, hu, 'f').set(t, i);
+ }
+ get(t) {
+ var n;
+ let i = t;
+ for (; j(this, hu, 'f').has(i); )
+ i = (n = j(this, hu, 'f').get(i)) !== null && n !== void 0 ? n : i;
+ return i;
+ }
+ };
+ hu = new WeakMap();
+ var Dn,
+ Sa = class {
+ constructor() {
+ Dn.set(this, new Map());
+ }
+ union(t) {
+ let n = t.shift();
+ D.invariant(n != null, {
+ reason: 'Expected set to be non-empty',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ let i = this.find(n);
+ i == null && ((i = n), j(this, Dn, 'f').set(n, n));
+ for (let r of t) {
+ let a = j(this, Dn, 'f').get(r);
+ if (a == null) {
+ j(this, Dn, 'f').set(r, i);
+ continue;
+ } else {
+ if (a === i) continue;
+ {
+ let o = r;
+ for (; a !== i; )
+ j(this, Dn, 'f').set(o, i),
+ (o = a),
+ (a = j(this, Dn, 'f').get(o));
+ }
+ }
+ }
+ }
+ find(t) {
+ if (!j(this, Dn, 'f').has(t)) return null;
+ let n = j(this, Dn, 'f').get(t);
+ if (n === t) return t;
+ let i = this.find(n);
+ return j(this, Dn, 'f').set(t, i), i;
+ }
+ has(t) {
+ return j(this, Dn, 'f').has(t);
+ }
+ canonicalize() {
+ let t = new Map();
+ for (let n of j(this, Dn, 'f').keys()) {
+ let i = this.find(n);
+ t.set(n, i);
+ }
+ return t;
+ }
+ forEach(t) {
+ for (let n of j(this, Dn, 'f').keys()) {
+ let i = this.find(n);
+ t(n, i);
+ }
+ }
+ buildSets() {
+ let t = new Map(),
+ n = new Map();
+ return (
+ this.forEach((i, r) => {
+ let a = t.get(r);
+ a == null && ((a = t.size), t.set(r, a));
+ let o = n.get(a);
+ o === void 0 && ((o = new Set()), n.set(a, o)), o.add(i);
+ }),
+ [...n.values()]
+ );
+ }
+ get size() {
+ return j(this, Dn, 'f').size;
+ }
+ };
+ Dn = new WeakMap();
+ function JI(e) {
+ var t, n;
+ let i = WI(e),
+ r = new Map();
+ i.forEach((o, s) => {
+ let l = r.get(s);
+ l === void 0
+ ? ((l = {
+ id: e.env.nextScopeId,
+ range: o.mutableRange,
+ dependencies: new Set(),
+ declarations: new Map(),
+ reassignments: new Set(),
+ earlyReturnValue: null,
+ merged: new Set(),
+ loc: o.loc,
+ }),
+ r.set(s, l))
+ : (l.range.start === 0
+ ? (l.range.start = o.mutableRange.start)
+ : o.mutableRange.start !== 0 &&
+ (l.range.start = V(
+ Math.min(l.range.start, o.mutableRange.start)
+ )),
+ (l.range.end = V(Math.max(l.range.end, o.mutableRange.end))),
+ (l.loc = a4(l.loc, o.loc))),
+ (o.scope = l),
+ (o.mutableRange = l.range);
+ });
+ let a = 0;
+ for (let [, o] of e.body.blocks) {
+ for (let s of o.instructions) a = V(Math.max(a, s.id));
+ a = V(Math.max(a, o.terminal.id));
+ }
+ for (let [, o] of r)
+ (o.range.start === 0 ||
+ o.range.end === 0 ||
+ a === 0 ||
+ o.range.end > a + 1) &&
+ ((n =
+ (t = e.env.logger) === null || t === void 0
+ ? void 0
+ : t.debugLogIRs) === null ||
+ n === void 0 ||
+ n.call(t, {
+ kind: 'hir',
+ name: 'InferReactiveScopeVariables (invalid scope)',
+ value: e,
+ }),
+ D.invariant(!1, {
+ reason: 'Invalid mutable range for scope',
+ details: [{kind: 'error', loc: F, message: null}],
+ description: `Scope @${o.id} has range [${o.range.start}:${
+ o.range.end
+ }] but the valid range is [1:${a + 1}]`,
+ }));
+ }
+ function a4(e, t) {
+ return e === F
+ ? t
+ : t === F
+ ? e
+ : {
+ filename: e.filename,
+ identifierName: e.identifierName,
+ start: {
+ index: Math.min(e.start.index, t.start.index),
+ line: Math.min(e.start.line, t.start.line),
+ column: Math.min(e.start.column, t.start.column),
+ },
+ end: {
+ index: Math.max(e.end.index, t.end.index),
+ line: Math.max(e.end.line, t.end.line),
+ column: Math.max(e.end.column, t.end.column),
+ },
+ };
+ }
+ function ta(e, t) {
+ return HI(e, t.identifier.mutableRange);
+ }
+ function HI({id: e}, t) {
+ return e >= t.start && e < t.end;
+ }
+ function o4(e, t) {
+ let {value: n} = t;
+ switch (n.kind) {
+ case 'Destructure':
+ return CB(n.lvalue.pattern);
+ case 'PostfixUpdate':
+ case 'PrefixUpdate':
+ case 'Await':
+ case 'DeclareLocal':
+ case 'DeclareContext':
+ case 'StoreLocal':
+ case 'LoadGlobal':
+ case 'MetaProperty':
+ case 'TypeCastExpression':
+ case 'LoadLocal':
+ case 'LoadContext':
+ case 'StoreContext':
+ case 'PropertyDelete':
+ case 'ComputedLoad':
+ case 'ComputedDelete':
+ case 'JSXText':
+ case 'TemplateLiteral':
+ case 'Primitive':
+ case 'GetIterator':
+ case 'IteratorNext':
+ case 'NextPropertyOf':
+ case 'Debugger':
+ case 'StartMemoize':
+ case 'FinishMemoize':
+ case 'UnaryExpression':
+ case 'BinaryExpression':
+ case 'PropertyLoad':
+ case 'StoreGlobal':
+ return !1;
+ case 'TaggedTemplateExpression':
+ case 'CallExpression':
+ case 'MethodCall':
+ return t.lvalue.identifier.type.kind !== 'Primitive';
+ case 'RegExpLiteral':
+ case 'PropertyStore':
+ case 'ComputedStore':
+ case 'ArrayExpression':
+ case 'JsxExpression':
+ case 'JsxFragment':
+ case 'NewExpression':
+ case 'ObjectExpression':
+ case 'UnsupportedNode':
+ case 'ObjectMethod':
+ case 'FunctionExpression':
+ return !0;
+ default:
+ Me(n, `Unexpected value kind \`${n.kind}\``);
+ }
+ }
+ function WI(e) {
+ var t, n;
+ let i = new Sa(),
+ r = new Map();
+ function a(o) {
+ r.has(o.identifier.declarationId) ||
+ r.set(o.identifier.declarationId, o.identifier);
+ }
+ for (let [o, s] of e.body.blocks) {
+ for (let l of s.phis)
+ if (
+ l.place.identifier.mutableRange.start + 1 !==
+ l.place.identifier.mutableRange.end &&
+ l.place.identifier.mutableRange.end >
+ ((n =
+ (t = s.instructions.at(0)) === null || t === void 0
+ ? void 0
+ : t.id) !== null && n !== void 0
+ ? n
+ : s.terminal.id)
+ ) {
+ let d = [l.place.identifier],
+ u = r.get(l.place.identifier.declarationId);
+ u !== void 0 && d.push(u);
+ for (let [p, y] of l.operands) d.push(y.identifier);
+ i.union(d);
+ } else if (e.env.config.enableForest)
+ for (let [, d] of l.operands)
+ i.union([l.place.identifier, d.identifier]);
+ for (let l of s.instructions) {
+ let d = [],
+ u = l.lvalue.identifier.mutableRange;
+ if (
+ ((u.end > u.start + 1 || o4(e.env, l)) && d.push(l.lvalue.identifier),
+ l.value.kind === 'DeclareLocal' || l.value.kind === 'DeclareContext')
+ )
+ a(l.value.lvalue.place);
+ else if (
+ l.value.kind === 'StoreLocal' ||
+ l.value.kind === 'StoreContext'
+ )
+ a(l.value.lvalue.place),
+ l.value.lvalue.place.identifier.mutableRange.end >
+ l.value.lvalue.place.identifier.mutableRange.start + 1 &&
+ d.push(l.value.lvalue.place.identifier),
+ ta(l, l.value.value) &&
+ l.value.value.identifier.mutableRange.start > 0 &&
+ d.push(l.value.value.identifier);
+ else if (l.value.kind === 'Destructure') {
+ for (let p of kr(l.value.lvalue.pattern))
+ a(p),
+ p.identifier.mutableRange.end >
+ p.identifier.mutableRange.start + 1 && d.push(p.identifier);
+ ta(l, l.value.value) &&
+ l.value.value.identifier.mutableRange.start > 0 &&
+ d.push(l.value.value.identifier);
+ } else if (l.value.kind === 'MethodCall') {
+ for (let p of sn(l))
+ ta(l, p) &&
+ p.identifier.mutableRange.start > 0 &&
+ d.push(p.identifier);
+ d.push(l.value.property.identifier);
+ } else
+ for (let p of sn(l))
+ if (ta(l, p) && p.identifier.mutableRange.start > 0) {
+ if (
+ (l.value.kind === 'FunctionExpression' ||
+ l.value.kind === 'ObjectMethod') &&
+ p.identifier.type.kind === 'Primitive'
+ )
+ continue;
+ d.push(p.identifier);
+ }
+ d.length !== 0 && i.union(d);
+ }
+ }
+ return i;
+ }
+ function s4(e) {
+ let t = l4(e),
+ n = c4(e, t);
+ n.forEach((i, r) => {
+ i !== r &&
+ ((r.range.start = V(Math.min(r.range.start, i.range.start))),
+ (r.range.end = V(Math.max(r.range.end, i.range.end))));
+ });
+ for (let [i, r] of t.placeScopes) {
+ let a = n.find(r);
+ a !== null && a !== r && (i.identifier.scope = a);
+ }
+ }
+ function l4(e) {
+ let t = new Map(),
+ n = new Map(),
+ i = new Map();
+ function r(a) {
+ let o = a.identifier.scope;
+ o != null &&
+ (i.set(a, o),
+ o.range.start !== o.range.end &&
+ (Xn(t, o.range.start, new Set()).add(o),
+ Xn(n, o.range.end, new Set()).add(o)));
+ }
+ for (let [, a] of e.body.blocks) {
+ for (let o of a.instructions) {
+ for (let s of rn(o)) r(s);
+ for (let s of sn(o)) r(s);
+ }
+ for (let o of Gt(a.terminal)) r(o);
+ }
+ return {
+ scopeStarts: [...t.entries()]
+ .map(([a, o]) => ({id: a, scopes: o}))
+ .sort((a, o) => o.id - a.id),
+ scopeEnds: [...n.entries()]
+ .map(([a, o]) => ({id: a, scopes: o}))
+ .sort((a, o) => o.id - a.id),
+ placeScopes: i,
+ };
+ }
+ function KE(e, {scopeEnds: t, scopeStarts: n}, {activeScopes: i, joined: r}) {
+ let a = t.at(-1);
+ if (a != null && a.id <= e) {
+ t.pop();
+ let s = [...a.scopes].sort((l, d) => d.range.start - l.range.start);
+ for (let l of s) {
+ let d = i.indexOf(l);
+ d !== -1 &&
+ (d !== i.length - 1 && r.union([l, ...i.slice(d + 1)]),
+ i.splice(d, 1));
+ }
+ }
+ let o = n.at(-1);
+ if (o != null && o.id <= e) {
+ n.pop();
+ let s = [...o.scopes].sort((l, d) => d.range.end - l.range.end);
+ i.push(...s);
+ for (let l = 1; l < s.length; l++) {
+ let d = s[l - 1],
+ u = s[l];
+ d.range.end === u.range.end && r.union([d, u]);
+ }
+ }
+ }
+ function Rg(e, t, {activeScopes: n, joined: i}) {
+ let r = Km(e, t);
+ if (r != null && ta({id: e}, t)) {
+ let a = n.indexOf(r);
+ a !== -1 && a !== n.length - 1 && i.union([r, ...n.slice(a + 1)]);
+ }
+ }
+ function c4(e, t) {
+ let n = {joined: new Sa(), activeScopes: []};
+ for (let [, i] of e.body.blocks) {
+ for (let r of i.instructions) {
+ KE(r.id, t, n);
+ for (let a of sn(r))
+ ((r.value.kind === 'FunctionExpression' ||
+ r.value.kind === 'ObjectMethod') &&
+ a.identifier.type.kind === 'Primitive') ||
+ Rg(r.id, a, n);
+ for (let a of rn(r)) Rg(r.id, a, n);
+ }
+ KE(i.terminal.id, t, n);
+ for (let r of Gt(i.terminal)) Rg(i.terminal.id, r, n);
+ }
+ return n.joined;
+ }
+ function u4(e) {
+ var t;
+ let n = [],
+ i = new Map();
+ for (let [r, a] of e.body.blocks) {
+ let o = a.terminal;
+ if (o.kind === 'label') {
+ let {block: s, fallthrough: l} = o,
+ d = e.body.blocks.get(s),
+ u = e.body.blocks.get(l);
+ d.terminal.kind === 'goto' &&
+ d.terminal.variant === St.Break &&
+ d.terminal.block === l &&
+ d.kind === 'block' &&
+ u.kind === 'block' &&
+ n.push({label: r, next: s, fallthrough: l});
+ }
+ }
+ for (let {label: r, next: a, fallthrough: o} of n) {
+ let s = (t = i.get(r)) !== null && t !== void 0 ? t : r,
+ l = e.body.blocks.get(s),
+ d = e.body.blocks.get(a),
+ u = e.body.blocks.get(o);
+ D.invariant(d.phis.size === 0 && u.phis.size === 0, {
+ reason: 'Unexpected phis when merging label blocks',
+ description: null,
+ details: [{kind: 'error', loc: l.terminal.loc, message: null}],
+ }),
+ D.invariant(
+ d.preds.size === 1 &&
+ u.preds.size === 1 &&
+ d.preds.has(r) &&
+ u.preds.has(a),
+ {
+ reason: 'Unexpected block predecessors when merging label blocks',
+ description: null,
+ details: [{kind: 'error', loc: l.terminal.loc, message: null}],
+ }
+ ),
+ l.instructions.push(...d.instructions, ...u.instructions),
+ (l.terminal = u.terminal),
+ e.body.blocks.delete(a),
+ e.body.blocks.delete(o),
+ i.set(o, s);
+ }
+ for (let [r, a] of e.body.blocks)
+ for (let o of a.preds) {
+ let s = i.get(o);
+ s != null && (a.preds.delete(o), a.preds.add(s));
+ }
+ }
+ function d4(e) {
+ return Object.prototype.hasOwnProperty.call(e, '__componentDeclaration');
+ }
+ function f4(e) {
+ return Object.prototype.hasOwnProperty.call(e, '__hookDeclaration');
+ }
+ var GI = {reassigned: !1, reassignedByInnerFn: !1, referencedByInnerFn: !1},
+ Cp = {
+ enter: function (e, t) {
+ t.currentFn.push(e);
+ },
+ exit: function (e, t) {
+ t.currentFn.pop();
+ },
+ };
+ function p4(e) {
+ let t = {currentFn: [], identifiers: new Map()};
+ e.traverse(
+ {
+ FunctionDeclaration: Cp,
+ FunctionExpression: Cp,
+ ArrowFunctionExpression: Cp,
+ ObjectMethod: Cp,
+ AssignmentExpression(i, r) {
+ var a, o;
+ let s = i.get('left');
+ if (s.isLVal()) {
+ let l =
+ (a = r.currentFn.at(-1)) !== null && a !== void 0 ? a : null;
+ ya(l, r.identifiers, s);
+ } else
+ D.throwTodo({
+ reason:
+ 'Unsupported syntax on the left side of an AssignmentExpression',
+ description: `Expected an LVal, got: ${s.type}`,
+ loc: (o = s.node.loc) !== null && o !== void 0 ? o : null,
+ });
+ },
+ UpdateExpression(i, r) {
+ var a;
+ let o = i.get('argument'),
+ s = (a = r.currentFn.at(-1)) !== null && a !== void 0 ? a : null;
+ o.isLVal() && ya(s, r.identifiers, o);
+ },
+ Identifier(i, r) {
+ var a;
+ let o = (a = r.currentFn.at(-1)) !== null && a !== void 0 ? a : null;
+ i.isReferencedIdentifier() && m4(o, r.identifiers, i);
+ },
+ },
+ t
+ );
+ let n = new Set();
+ for (let [i, r] of t.identifiers.entries())
+ (r.reassignedByInnerFn || (r.reassigned && r.referencedByInnerFn)) &&
+ n.add(i);
+ return n;
+ }
+ function m4(e, t, n) {
+ let i = n.node.name,
+ r = n.scope.getBinding(i);
+ if (r == null) return;
+ let a = Xn(t, r.identifier, Object.assign({}, GI));
+ if (e != null) {
+ let o = e.scope.parent.getBinding(i);
+ r === o && (a.referencedByInnerFn = !0);
+ }
+ }
+ function ya(e, t, n) {
+ var i, r, a;
+ let o = n.node;
+ switch (o.type) {
+ case 'Identifier': {
+ let s = n,
+ l = s.node.name,
+ d = s.scope.getBinding(l);
+ if (d == null) break;
+ let u = Xn(t, d.identifier, Object.assign({}, GI));
+ if (((u.reassigned = !0), e != null)) {
+ let p = e.scope.parent.getBinding(l);
+ d === p && (u.reassignedByInnerFn = !0);
+ }
+ break;
+ }
+ case 'ArrayPattern': {
+ let s = n;
+ for (let l of s.get('elements')) y4(l) && ya(e, t, l);
+ break;
+ }
+ case 'ObjectPattern': {
+ let s = n;
+ for (let l of s.get('properties'))
+ if (l.isObjectProperty()) {
+ let d = l.get('value');
+ D.invariant(d.isLVal(), {
+ reason: `[FindContextIdentifiers] Expected object property value to be an LVal, got: ${d.type}`,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = d.node.loc) !== null && i !== void 0 ? i : F,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ ya(e, t, d);
+ } else
+ D.invariant(l.isRestElement(), {
+ reason:
+ '[FindContextIdentifiers] Invalid assumptions for babel types.',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (r = l.node.loc) !== null && r !== void 0 ? r : F,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ ya(e, t, l);
+ break;
+ }
+ case 'AssignmentPattern': {
+ let l = n.get('left');
+ ya(e, t, l);
+ break;
+ }
+ case 'RestElement': {
+ ya(e, t, n.get('argument'));
+ break;
+ }
+ case 'MemberExpression':
+ break;
+ default:
+ D.throwTodo({
+ reason: `[FindContextIdentifiers] Cannot handle Object destructuring assignment target ${o.type}`,
+ description: null,
+ loc: (a = o.loc) !== null && a !== void 0 ? a : F,
+ suggestions: null,
+ });
+ }
+ }
+ function y4(e) {
+ return e.node != null;
+ }
+ function Ch(e, t) {
+ let n = e.body,
+ i = t ?? new Map(),
+ r = !1,
+ a = new Set(),
+ o = i.size;
+ do {
+ o = i.size;
+ for (let [s, l] of n.blocks) {
+ if (!r) for (let u of l.preds) a.has(u) || (r = !0);
+ a.add(s);
+ e: for (let u of l.phis) {
+ u.operands.forEach((y, m) => du(y, i));
+ let p = null;
+ for (let [y, m] of u.operands)
+ if (
+ !(
+ (p !== null && m.identifier.id === p.id) ||
+ m.identifier.id === u.place.identifier.id
+ )
+ ) {
+ if (p !== null) continue e;
+ p = m.identifier;
+ }
+ D.invariant(p !== null, {
+ reason: 'Expected phis to be non-empty',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ i.set(u.place.identifier, p),
+ l.phis.delete(u);
+ }
+ for (let u of l.instructions) {
+ for (let p of rn(u)) du(p, i);
+ for (let p of sn(u)) du(p, i);
+ if (
+ u.value.kind === 'FunctionExpression' ||
+ u.value.kind === 'ObjectMethod'
+ ) {
+ let {context: p} = u.value.loweredFunc.func;
+ for (let y of p) du(y, i);
+ Ch(u.value.loweredFunc.func, i);
+ }
+ }
+ let {terminal: d} = l;
+ for (let u of Gt(d)) du(u, i);
+ }
+ } while (i.size > o && r);
+ }
+ function du(e, t) {
+ let n = t.get(e.identifier);
+ n != null && (e.identifier = n);
+ }
+ var fa,
+ Mi,
+ bu,
+ Gp,
+ Xp,
+ Yp,
+ yv = class {
+ constructor(t, n) {
+ fa.set(this, new Map()),
+ Mi.set(this, null),
+ (this.unsealedPreds = new Map()),
+ bu.set(this, void 0),
+ Gp.set(this, void 0),
+ Xp.set(this, new Set()),
+ Yp.set(this, new Set()),
+ at(this, bu, new Map(n), 'f'),
+ at(this, Gp, t, 'f');
+ }
+ get nextSsaId() {
+ return j(this, Gp, 'f').nextIdentifierId;
+ }
+ defineFunction(t) {
+ for (let [n, i] of t.body.blocks) j(this, bu, 'f').set(n, i);
+ }
+ enter(t) {
+ let n = j(this, Mi, 'f');
+ t(), at(this, Mi, n, 'f');
+ }
+ state() {
+ return (
+ D.invariant(j(this, Mi, 'f') !== null, {
+ reason: 'we need to be in a block to access state!',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ j(this, fa, 'f').get(j(this, Mi, 'f'))
+ );
+ }
+ makeId(t) {
+ return {
+ id: this.nextSsaId,
+ declarationId: t.declarationId,
+ name: t.name,
+ mutableRange: {start: V(0), end: V(0)},
+ scope: null,
+ type: Gn(),
+ loc: t.loc,
+ };
+ }
+ defineContext(t) {
+ let n = this.definePlace(t);
+ return j(this, Yp, 'f').add(t.identifier), n;
+ }
+ definePlace(t) {
+ let n = t.identifier;
+ if (
+ (j(this, Xp, 'f').has(n) &&
+ D.throwTodo({
+ reason:
+ '[hoisting] EnterSSA: Expected identifier to be defined before being used',
+ description: `Identifier ${un(n)} is undefined`,
+ loc: t.loc,
+ suggestions: null,
+ }),
+ j(this, Yp, 'f').has(n))
+ )
+ return this.getPlace(t);
+ let i = this.makeId(n);
+ return (
+ this.state().defs.set(n, i),
+ Object.assign(Object.assign({}, t), {identifier: i})
+ );
+ }
+ getPlace(t) {
+ let n = this.getIdAt(t, j(this, Mi, 'f').id);
+ return Object.assign(Object.assign({}, t), {identifier: n});
+ }
+ getIdAt(t, n) {
+ let i = j(this, bu, 'f').get(n),
+ r = j(this, fa, 'f').get(i);
+ if (r.defs.has(t.identifier)) return r.defs.get(t.identifier);
+ if (i.preds.size == 0)
+ return j(this, Xp, 'f').add(t.identifier), t.identifier;
+ if (this.unsealedPreds.get(i) > 0) {
+ let o = this.makeId(t.identifier);
+ return (
+ r.incompletePhis.push({
+ oldPlace: t,
+ newPlace: Object.assign(Object.assign({}, t), {identifier: o}),
+ }),
+ r.defs.set(t.identifier, o),
+ o
+ );
+ }
+ if (i.preds.size == 1) {
+ let [o] = i.preds,
+ s = this.getIdAt(t, o);
+ return r.defs.set(t.identifier, s), s;
+ }
+ let a = this.makeId(t.identifier);
+ return (
+ r.defs.set(t.identifier, a),
+ this.addPhi(
+ i,
+ t,
+ Object.assign(Object.assign({}, t), {identifier: a})
+ )
+ );
+ }
+ addPhi(t, n, i) {
+ let r = new Map();
+ for (let o of t.preds) {
+ let s = this.getIdAt(n, o);
+ r.set(o, Object.assign(Object.assign({}, n), {identifier: s}));
+ }
+ let a = {kind: 'Phi', place: i, operands: r};
+ return t.phis.add(a), i.identifier;
+ }
+ fixIncompletePhis(t) {
+ let n = j(this, fa, 'f').get(t);
+ for (let i of n.incompletePhis) this.addPhi(t, i.oldPlace, i.newPlace);
+ }
+ startBlock(t) {
+ at(this, Mi, t, 'f'),
+ j(this, fa, 'f').set(t, {defs: new Map(), incompletePhis: []});
+ }
+ print() {
+ var t;
+ let n = [];
+ for (let [i, r] of j(this, fa, 'f')) {
+ n.push(`bb${i.id}:`);
+ for (let [a, o] of r.defs) n.push(` $${un(a)}: $${un(o)}`);
+ for (let a of r.incompletePhis)
+ n.push(` iphi $${_e(a.newPlace)} = $${_e(a.oldPlace)}`);
+ }
+ n.push(
+ `current block: bb${
+ (t = j(this, Mi, 'f')) === null || t === void 0 ? void 0 : t.id
+ }`
+ ),
+ console.log(
+ n.join(`
+`)
+ );
+ }
+ };
+ (fa = new WeakMap()),
+ (Mi = new WeakMap()),
+ (bu = new WeakMap()),
+ (Gp = new WeakMap()),
+ (Xp = new WeakMap()),
+ (Yp = new WeakMap());
+ function XI(e) {
+ let t = new yv(e.env, e.body.blocks);
+ YI(e, t, e.body.entry);
+ }
+ function YI(e, t, n) {
+ let i = new Set();
+ for (let [r, a] of e.body.blocks) {
+ D.invariant(!i.has(a), {
+ reason: `found a cycle! visiting bb${a.id} again`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ i.add(a),
+ t.startBlock(a),
+ r === n &&
+ (D.invariant(e.context.length === 0, {
+ reason:
+ 'Expected function context to be empty for outer function declarations',
+ description: null,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ suggestions: null,
+ }),
+ (e.params = e.params.map((o) =>
+ o.kind === 'Identifier'
+ ? t.definePlace(o)
+ : {kind: 'Spread', place: t.definePlace(o.place)}
+ )));
+ for (let o of a.instructions)
+ if (
+ (uI(o, (s) => t.getPlace(s)),
+ cI(o, (s) => t.definePlace(s)),
+ o.value.kind === 'FunctionExpression' ||
+ o.value.kind === 'ObjectMethod')
+ ) {
+ let s = o.value.loweredFunc.func,
+ l = s.body.blocks.get(s.body.entry);
+ D.invariant(l.preds.size === 0, {
+ reason:
+ 'Expected function expression entry block to have zero predecessors',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ l.preds.add(r),
+ t.defineFunction(s),
+ t.enter(() => {
+ (s.params = s.params.map((d) =>
+ d.kind === 'Identifier'
+ ? t.definePlace(d)
+ : {kind: 'Spread', place: t.definePlace(d.place)}
+ )),
+ YI(s, t, n);
+ }),
+ l.preds.clear();
+ }
+ yI(a.terminal, (o) => t.getPlace(o));
+ for (let o of go(a.terminal)) {
+ let s = e.body.blocks.get(o),
+ l;
+ t.unsealedPreds.has(s)
+ ? (l = t.unsealedPreds.get(s) - 1)
+ : (l = s.preds.size - 1),
+ t.unsealedPreds.set(s, l),
+ l === 0 && i.has(s) && t.fixIncompletePhis(s);
+ }
+ }
+ }
+ function QI(e) {
+ let t = new Map();
+ for (let n of e.params) {
+ let i = n.kind === 'Identifier' ? n : n.place;
+ i.identifier.name !== null &&
+ t.set(i.identifier.declarationId, {kind: Q.Let, place: i});
+ }
+ for (let n of e.context)
+ n.identifier.name !== null &&
+ t.set(n.identifier.declarationId, {kind: Q.Let, place: n});
+ for (let [, n] of e.body.blocks)
+ for (let i of n.instructions) {
+ let {value: r} = i;
+ switch (r.kind) {
+ case 'DeclareLocal': {
+ let a = r.lvalue;
+ D.invariant(!t.has(a.place.identifier.declarationId), {
+ reason:
+ 'Expected variable not to be defined prior to declaration',
+ description: `${_e(a.place)} was already defined`,
+ details: [{kind: 'error', loc: a.place.loc, message: null}],
+ }),
+ t.set(a.place.identifier.declarationId, a);
+ break;
+ }
+ case 'StoreLocal': {
+ let a = r.lvalue;
+ if (a.place.identifier.name !== null) {
+ let o = t.get(a.place.identifier.declarationId);
+ o === void 0
+ ? (D.invariant(!t.has(a.place.identifier.declarationId), {
+ reason:
+ 'Expected variable not to be defined prior to declaration',
+ description: `${_e(a.place)} was already defined`,
+ details: [{kind: 'error', loc: a.place.loc, message: null}],
+ }),
+ t.set(a.place.identifier.declarationId, a),
+ (a.kind = Q.Const))
+ : ((o.kind = Q.Let), (a.kind = Q.Reassign));
+ }
+ break;
+ }
+ case 'Destructure': {
+ let a = r.lvalue,
+ o = null;
+ for (let s of kr(a.pattern))
+ if (s.identifier.name === null)
+ D.invariant(o === null || o === Q.Const, {
+ reason: 'Expected consistent kind for destructuring',
+ description: `other places were \`${o}\` but '${_e(
+ s
+ )}' is const`,
+ details: [
+ {
+ kind: 'error',
+ loc: s.loc,
+ message: 'Expected consistent kind for destructuring',
+ },
+ ],
+ suggestions: null,
+ }),
+ (o = Q.Const);
+ else {
+ let l = t.get(s.identifier.declarationId);
+ l === void 0
+ ? (D.invariant(n.kind !== 'value', {
+ reason:
+ 'TODO: Handle reassignment in a value block where the original declaration was removed by dead code elimination (DCE)',
+ description: null,
+ details: [{kind: 'error', loc: s.loc, message: null}],
+ suggestions: null,
+ }),
+ t.set(s.identifier.declarationId, a),
+ D.invariant(o === null || o === Q.Const, {
+ reason: 'Expected consistent kind for destructuring',
+ description: `Other places were \`${o}\` but '${_e(
+ s
+ )}' is const`,
+ details: [
+ {
+ kind: 'error',
+ loc: s.loc,
+ message: 'Expected consistent kind for destructuring',
+ },
+ ],
+ suggestions: null,
+ }),
+ (o = Q.Const))
+ : (D.invariant(o === null || o === Q.Reassign, {
+ reason: 'Expected consistent kind for destructuring',
+ description: `Other places were \`${o}\` but '${_e(
+ s
+ )}' is reassigned`,
+ details: [
+ {
+ kind: 'error',
+ loc: s.loc,
+ message: 'Expected consistent kind for destructuring',
+ },
+ ],
+ suggestions: null,
+ }),
+ (o = Q.Reassign),
+ (l.kind = Q.Let));
+ }
+ D.invariant(o !== null, {
+ reason: 'Expected at least one operand',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ (a.kind = o);
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ let a = r.lvalue,
+ o = t.get(a.identifier.declarationId);
+ D.invariant(o !== void 0, {
+ reason: 'Expected variable to have been defined',
+ description: `No declaration for ${_e(a)}`,
+ details: [{kind: 'error', loc: a.loc, message: null}],
+ }),
+ (o.kind = Q.Let);
+ break;
+ }
+ }
+ }
+ }
+ function g4(e) {
+ eP(e, new Map());
+ }
+ function eP(e, t) {
+ for (; v4(e, t); ) {
+ Pa(e.body), bh(e.body), kh(e.body), Sh(e.body), fr(e.body), xa(e.body);
+ for (let [, i] of e.body.blocks)
+ for (let r of i.phis)
+ for (let [a] of r.operands) i.preds.has(a) || r.operands.delete(a);
+ Ch(e), Hu(e), Tm(e), Em(e);
+ }
+ }
+ function v4(e, t) {
+ let n = !1;
+ for (let [, i] of e.body.blocks) {
+ for (let a of i.phis) {
+ let o = h4(a, t);
+ o !== null && t.set(a.place.identifier.id, o);
+ }
+ for (let a = 0; a < i.instructions.length; a++) {
+ if (i.kind === 'sequence' && a === i.instructions.length - 1) continue;
+ let o = i.instructions[a],
+ s = b4(t, o);
+ s !== null && t.set(o.lvalue.identifier.id, s);
+ }
+ let r = i.terminal;
+ switch (r.kind) {
+ case 'if': {
+ let a = Kn(t, r.test);
+ if (a !== null && a.kind === 'Primitive') {
+ n = !0;
+ let o = a.value ? r.consequent : r.alternate;
+ i.terminal = {
+ kind: 'goto',
+ variant: St.Break,
+ block: o,
+ id: r.id,
+ loc: r.loc,
+ };
+ }
+ break;
+ }
+ }
+ }
+ return n;
+ }
+ function h4(e, t) {
+ var n;
+ let i = null;
+ for (let [, r] of e.operands) {
+ let a = (n = t.get(r.identifier.id)) !== null && n !== void 0 ? n : null;
+ if (a === null) return null;
+ if (i === null) {
+ i = a;
+ continue;
+ }
+ if (a.kind !== i.kind) return null;
+ switch (a.kind) {
+ case 'Primitive': {
+ if (
+ (D.invariant(i.kind === 'Primitive', {
+ reason: 'value kind expected to be Primitive',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ a.value !== i.value)
+ )
+ return null;
+ break;
+ }
+ case 'LoadGlobal': {
+ if (
+ (D.invariant(i.kind === 'LoadGlobal', {
+ reason: 'value kind expected to be LoadGlobal',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ a.binding.name !== i.binding.name)
+ )
+ return null;
+ break;
+ }
+ default:
+ return null;
+ }
+ }
+ return i;
+ }
+ function b4(e, t) {
+ let n = t.value;
+ switch (n.kind) {
+ case 'Primitive':
+ return n;
+ case 'LoadGlobal':
+ return n;
+ case 'ComputedLoad': {
+ let i = Kn(e, n.property);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ ((typeof i.value == 'string' && $.isValidIdentifier(i.value)) ||
+ typeof i.value == 'number')
+ ) {
+ let r = {
+ kind: 'PropertyLoad',
+ loc: n.loc,
+ property: i.value,
+ object: n.object,
+ };
+ t.value = r;
+ }
+ return null;
+ }
+ case 'ComputedStore': {
+ let i = Kn(e, n.property);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ ((typeof i.value == 'string' && $.isValidIdentifier(i.value)) ||
+ typeof i.value == 'number')
+ ) {
+ let r = {
+ kind: 'PropertyStore',
+ loc: n.loc,
+ property: i.value,
+ object: n.object,
+ value: n.value,
+ };
+ t.value = r;
+ }
+ return null;
+ }
+ case 'PostfixUpdate': {
+ let i = Kn(e, n.value);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ typeof i.value == 'number'
+ ) {
+ let r = n.operation === '++' ? i.value + 1 : i.value - 1;
+ return (
+ e.set(n.lvalue.identifier.id, {
+ kind: 'Primitive',
+ value: r,
+ loc: n.loc,
+ }),
+ i
+ );
+ }
+ return null;
+ }
+ case 'PrefixUpdate': {
+ let i = Kn(e, n.value);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ typeof i.value == 'number'
+ ) {
+ let r = {
+ kind: 'Primitive',
+ value: n.operation === '++' ? i.value + 1 : i.value - 1,
+ loc: n.loc,
+ };
+ return e.set(n.lvalue.identifier.id, r), r;
+ }
+ return null;
+ }
+ case 'UnaryExpression':
+ switch (n.operator) {
+ case '!': {
+ let i = Kn(e, n.value);
+ if (i !== null && i.kind === 'Primitive') {
+ let r = {kind: 'Primitive', value: !i.value, loc: n.loc};
+ return (t.value = r), r;
+ }
+ return null;
+ }
+ case '-': {
+ let i = Kn(e, n.value);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ typeof i.value == 'number'
+ ) {
+ let r = {kind: 'Primitive', value: i.value * -1, loc: n.loc};
+ return (t.value = r), r;
+ }
+ return null;
+ }
+ default:
+ return null;
+ }
+ case 'BinaryExpression': {
+ let i = Kn(e, n.left),
+ r = Kn(e, n.right);
+ if (
+ i !== null &&
+ r !== null &&
+ i.kind === 'Primitive' &&
+ r.kind === 'Primitive'
+ ) {
+ let a = i.value,
+ o = r.value,
+ s = null;
+ switch (n.operator) {
+ case '+': {
+ typeof a == 'number' && typeof o == 'number'
+ ? (s = {kind: 'Primitive', value: a + o, loc: n.loc})
+ : typeof a == 'string' &&
+ typeof o == 'string' &&
+ (s = {kind: 'Primitive', value: a + o, loc: n.loc});
+ break;
+ }
+ case '-': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a - o, loc: n.loc});
+ break;
+ }
+ case '*': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a * o, loc: n.loc});
+ break;
+ }
+ case '/': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a / o, loc: n.loc});
+ break;
+ }
+ case '|': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a | o, loc: n.loc});
+ break;
+ }
+ case '&': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a & o, loc: n.loc});
+ break;
+ }
+ case '^': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a ^ o, loc: n.loc});
+ break;
+ }
+ case '<<': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a << o, loc: n.loc});
+ break;
+ }
+ case '>>': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a >> o, loc: n.loc});
+ break;
+ }
+ case '>>>': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a >>> o, loc: n.loc});
+ break;
+ }
+ case '%': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a % o, loc: n.loc});
+ break;
+ }
+ case '**': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: Math.pow(a, o), loc: n.loc});
+ break;
+ }
+ case '<': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a < o, loc: n.loc});
+ break;
+ }
+ case '<=': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a <= o, loc: n.loc});
+ break;
+ }
+ case '>': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a > o, loc: n.loc});
+ break;
+ }
+ case '>=': {
+ typeof a == 'number' &&
+ typeof o == 'number' &&
+ (s = {kind: 'Primitive', value: a >= o, loc: n.loc});
+ break;
+ }
+ case '==': {
+ s = {kind: 'Primitive', value: a == o, loc: n.loc};
+ break;
+ }
+ case '===': {
+ s = {kind: 'Primitive', value: a === o, loc: n.loc};
+ break;
+ }
+ case '!=': {
+ s = {kind: 'Primitive', value: a != o, loc: n.loc};
+ break;
+ }
+ case '!==': {
+ s = {kind: 'Primitive', value: a !== o, loc: n.loc};
+ break;
+ }
+ }
+ if (s !== null) return (t.value = s), s;
+ }
+ return null;
+ }
+ case 'PropertyLoad': {
+ let i = Kn(e, n.object);
+ if (
+ i !== null &&
+ i.kind === 'Primitive' &&
+ typeof i.value == 'string' &&
+ n.property === 'length'
+ ) {
+ let r = {kind: 'Primitive', value: i.value.length, loc: n.loc};
+ return (t.value = r), r;
+ }
+ return null;
+ }
+ case 'TemplateLiteral': {
+ if (n.subexprs.length === 0) {
+ let o = {
+ kind: 'Primitive',
+ value: n.quasis.map((s) => s.cooked).join(''),
+ loc: n.loc,
+ };
+ return (t.value = o), o;
+ }
+ if (
+ n.subexprs.length !== n.quasis.length - 1 ||
+ n.quasis.some((o) => o.cooked === void 0)
+ )
+ return null;
+ let i = 0,
+ r = n.quasis[i].cooked;
+ ++i;
+ for (let o of n.subexprs) {
+ let s = Kn(e, o);
+ if (!s || s.kind !== 'Primitive') return null;
+ let l = s.value;
+ if (
+ typeof l != 'number' &&
+ typeof l != 'string' &&
+ typeof l != 'boolean' &&
+ !(typeof l == 'object' && l === null)
+ )
+ return null;
+ let d = n.quasis[i].cooked;
+ if ((++i, d === void 0)) return null;
+ r = r.concat(l, d);
+ }
+ let a = {kind: 'Primitive', value: r, loc: n.loc};
+ return (t.value = a), a;
+ }
+ case 'LoadLocal': {
+ let i = Kn(e, n.place);
+ return i !== null && (t.value = i), i;
+ }
+ case 'StoreLocal': {
+ let i = Kn(e, n.value);
+ return i !== null && e.set(n.lvalue.place.identifier.id, i), i;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression':
+ return eP(n.loweredFunc.func, e), null;
+ default:
+ return null;
+ }
+ }
+ function Kn(e, t) {
+ var n;
+ return (n = e.get(t.identifier.id)) !== null && n !== void 0 ? n : null;
+ }
+ function Xm(e) {
+ let t = S4(e);
+ for (let [, n] of e.body.blocks) {
+ for (let i of n.phis)
+ t.isIdOrNameUsed(i.place.identifier) || n.phis.delete(i);
+ ra(n.instructions, (i) => t.isIdOrNameUsed(i.lvalue.identifier));
+ for (let i = 0; i < n.instructions.length; i++)
+ (n.kind !== 'block' && i === n.instructions.length - 1) ||
+ _4(n.instructions[i], t);
+ }
+ ra(e.context, (n) => t.isIdOrNameUsed(n.identifier));
+ }
+ var k4 = class {
+ constructor() {
+ (this.named = new Set()), (this.identifiers = new Set());
+ }
+ reference(t) {
+ this.identifiers.add(t.id),
+ t.name !== null && this.named.add(t.name.value);
+ }
+ isIdOrNameUsed(t) {
+ return (
+ this.identifiers.has(t.id) ||
+ (t.name !== null && this.named.has(t.name.value))
+ );
+ }
+ isIdUsed(t) {
+ return this.identifiers.has(t.id);
+ }
+ get count() {
+ return this.identifiers.size;
+ }
+ };
+ function S4(e) {
+ let t = E4(e),
+ n = [...e.body.blocks.values()].reverse(),
+ i = new k4(),
+ r = i.count;
+ do {
+ r = i.count;
+ for (let a of n) {
+ for (let o of Gt(a.terminal)) i.reference(o.identifier);
+ for (let o = a.instructions.length - 1; o >= 0; o--) {
+ let s = a.instructions[o];
+ if (a.kind !== 'block' && o === a.instructions.length - 1) {
+ i.reference(s.lvalue.identifier);
+ for (let d of Ot(s.value)) i.reference(d.identifier);
+ } else if (i.isIdOrNameUsed(s.lvalue.identifier) || !T4(s.value, i))
+ if (
+ (i.reference(s.lvalue.identifier), s.value.kind === 'StoreLocal')
+ )
+ (s.value.lvalue.kind === Q.Reassign ||
+ i.isIdUsed(s.value.lvalue.place.identifier)) &&
+ i.reference(s.value.value.identifier);
+ else for (let d of Ot(s.value)) i.reference(d.identifier);
+ }
+ for (let o of a.phis)
+ if (i.isIdOrNameUsed(o.place.identifier))
+ for (let [s, l] of o.operands) i.reference(l.identifier);
+ }
+ } while (i.count > r && t);
+ return i;
+ }
+ function _4(e, t) {
+ if (e.value.kind === 'Destructure')
+ switch (e.value.lvalue.pattern.kind) {
+ case 'ArrayPattern': {
+ let n = 0,
+ i = e.value.lvalue.pattern.items;
+ for (let r = 0; r < i.length; r++) {
+ let a = i[r];
+ a.kind === 'Identifier'
+ ? t.isIdOrNameUsed(a.identifier)
+ ? (n = r)
+ : (i[r] = {kind: 'Hole'})
+ : a.kind === 'Spread' &&
+ (t.isIdOrNameUsed(a.place.identifier)
+ ? (n = r)
+ : (i[r] = {kind: 'Hole'}));
+ }
+ i.length = n + 1;
+ break;
+ }
+ case 'ObjectPattern': {
+ let n = null;
+ for (let i of e.value.lvalue.pattern.properties)
+ if (i.kind === 'ObjectProperty')
+ t.isIdOrNameUsed(i.place.identifier) &&
+ (n ?? (n = []), n.push(i));
+ else if (t.isIdOrNameUsed(i.place.identifier)) {
+ n = null;
+ break;
+ }
+ n !== null && (e.value.lvalue.pattern.properties = n);
+ break;
+ }
+ default:
+ Me(
+ e.value.lvalue.pattern,
+ `Unexpected pattern kind '${e.value.lvalue.pattern.kind}'`
+ );
+ }
+ else
+ e.value.kind === 'StoreLocal' &&
+ e.value.lvalue.kind !== Q.Reassign &&
+ !t.isIdUsed(e.value.lvalue.place.identifier) &&
+ (e.value = {
+ kind: 'DeclareLocal',
+ lvalue: e.value.lvalue,
+ type: e.value.type,
+ loc: e.value.loc,
+ });
+ }
+ function T4(e, t) {
+ switch (e.kind) {
+ case 'DeclareLocal':
+ return !t.isIdOrNameUsed(e.lvalue.place.identifier);
+ case 'StoreLocal':
+ return e.lvalue.kind === Q.Reassign
+ ? !t.isIdUsed(e.lvalue.place.identifier)
+ : !t.isIdOrNameUsed(e.lvalue.place.identifier);
+ case 'Destructure': {
+ let n = !1,
+ i = !1;
+ for (let r of kr(e.lvalue.pattern))
+ t.isIdUsed(r.identifier)
+ ? ((n = !0), (i = !0))
+ : t.isIdOrNameUsed(r.identifier) && (n = !0);
+ return e.lvalue.kind === Q.Reassign ? !i : !n;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate':
+ return !t.isIdUsed(e.lvalue.identifier);
+ case 'Debugger':
+ return !1;
+ case 'Await':
+ case 'CallExpression':
+ case 'ComputedDelete':
+ case 'ComputedStore':
+ case 'PropertyDelete':
+ case 'MethodCall':
+ case 'PropertyStore':
+ case 'StoreGlobal':
+ return !1;
+ case 'NewExpression':
+ case 'UnsupportedNode':
+ case 'TaggedTemplateExpression':
+ return !1;
+ case 'GetIterator':
+ case 'NextPropertyOf':
+ case 'IteratorNext':
+ return !1;
+ case 'LoadContext':
+ case 'DeclareContext':
+ case 'StoreContext':
+ return !1;
+ case 'StartMemoize':
+ case 'FinishMemoize':
+ return !1;
+ case 'RegExpLiteral':
+ case 'MetaProperty':
+ case 'LoadGlobal':
+ case 'ArrayExpression':
+ case 'BinaryExpression':
+ case 'ComputedLoad':
+ case 'ObjectMethod':
+ case 'FunctionExpression':
+ case 'LoadLocal':
+ case 'JsxExpression':
+ case 'JsxFragment':
+ case 'JSXText':
+ case 'ObjectExpression':
+ case 'Primitive':
+ case 'PropertyLoad':
+ case 'TemplateLiteral':
+ case 'TypeCastExpression':
+ case 'UnaryExpression':
+ return !0;
+ default:
+ Me(e, `Unexepcted value kind \`${e.kind}\``);
+ }
+ }
+ function E4(e) {
+ return I4(e).size > 0;
+ }
+ function I4(e) {
+ let t = new Set(),
+ n = new Set();
+ for (let [i, r] of e.body.blocks) {
+ for (let a of r.preds) t.has(a) || n.add(i);
+ t.add(i);
+ }
+ return n;
+ }
+ function VE(e) {
+ let t = P4(e);
+ if (t) {
+ Pa(e.body), bh(e.body), kh(e.body), Sh(e.body), fr(e.body), Hu(e);
+ for (let [, n] of e.body.blocks)
+ for (let i of n.phis)
+ for (let [r, a] of i.operands)
+ if (!n.preds.has(r)) {
+ let o = t.get(r);
+ D.invariant(o != null, {
+ reason:
+ "Expected non-existing phi operand's predecessor to have been mapped to a new terminal",
+ details: [{kind: 'error', loc: F, message: null}],
+ description: `Could not find mapping for predecessor bb${r} in block bb${
+ n.id
+ } for phi ${_e(i.place)}`,
+ suggestions: null,
+ }),
+ i.operands.delete(r),
+ i.operands.set(o, a);
+ }
+ Tm(e), Em(e);
+ }
+ }
+ function P4(e) {
+ var t;
+ let n = new Map();
+ for (let [i, r] of e.body.blocks) {
+ let a = r.terminal;
+ if (a.kind !== 'maybe-throw') continue;
+ if (!r.instructions.some((s) => x4(s))) {
+ let s = (t = n.get(r.id)) !== null && t !== void 0 ? t : r.id;
+ n.set(a.continuation, s),
+ (r.terminal = {
+ kind: 'goto',
+ block: a.continuation,
+ variant: St.Break,
+ id: a.id,
+ loc: a.loc,
+ });
+ }
+ }
+ return n.size > 0 ? n : null;
+ }
+ function x4(e) {
+ switch (e.value.kind) {
+ case 'Primitive':
+ case 'ArrayExpression':
+ case 'ObjectExpression':
+ return !1;
+ default:
+ return !0;
+ }
+ }
+ function tP(e, t) {
+ var n;
+ let i = new Map();
+ for (let [r, a] of [...e.body.blocks]) {
+ let o = null,
+ s = a.instructions.length;
+ for (let l = 0; l < s; l++) {
+ let d = a.instructions[l];
+ if (a.kind === 'value') {
+ (n = e.env.logger) === null ||
+ n === void 0 ||
+ n.logEvent(e.env.filename, {
+ kind: 'CompileDiagnostic',
+ fnLoc: null,
+ detail: {
+ category: K.Todo,
+ reason: 'JSX Inlining is not supported on value blocks',
+ loc: d.loc,
+ },
+ });
+ continue;
+ }
+ switch (d.value.kind) {
+ case 'JsxExpression':
+ case 'JsxFragment': {
+ let u = a.instructions.slice(0, l),
+ p = a.instructions.slice(l, l + 1),
+ y = [];
+ o ?? (o = a.instructions.slice(l + 1));
+ let m = e.env.nextBlockId,
+ g = {
+ kind: a.kind,
+ id: m,
+ instructions: o,
+ terminal: a.terminal,
+ preds: new Set(),
+ phis: new Set(),
+ },
+ S = _t(e.env, d.value.loc);
+ $n(S.identifier);
+ let _ = _t(e.env, d.value.loc),
+ O = Object.assign(Object.assign({}, S), {
+ identifier: Og(e.env.nextIdentifierId, S.identifier),
+ }),
+ P = Object.assign(Object.assign({}, S), {
+ identifier: Og(e.env.nextIdentifierId, S.identifier),
+ }),
+ M = {
+ id: V(0),
+ lvalue: Object.assign({}, _),
+ value: {
+ kind: 'DeclareLocal',
+ lvalue: {place: Object.assign({}, S), kind: Q.Let},
+ type: null,
+ loc: d.value.loc,
+ },
+ effects: null,
+ loc: d.loc,
+ };
+ u.push(M);
+ let w = _t(e.env, d.value.loc),
+ I = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, w), {effect: x.Mutate}),
+ value: {
+ kind: 'LoadGlobal',
+ binding: {kind: 'Global', name: t.globalDevVar},
+ loc: d.value.loc,
+ },
+ effects: null,
+ loc: d.loc,
+ };
+ u.push(I);
+ let U = e.env.nextBlockId,
+ A = e.env.nextBlockId,
+ q = {
+ kind: 'if',
+ test: Object.assign(Object.assign({}, w), {effect: x.Read}),
+ consequent: U,
+ alternate: A,
+ fallthrough: m,
+ loc: d.loc,
+ id: V(0),
+ };
+ (a.instructions = u), (a.terminal = q);
+ let ae = {
+ id: U,
+ instructions: p,
+ kind: 'block',
+ phis: new Set(),
+ preds: new Set(),
+ terminal: {
+ kind: 'goto',
+ block: m,
+ variant: St.Break,
+ id: V(0),
+ loc: d.loc,
+ },
+ };
+ e.body.blocks.set(U, ae);
+ let le = _t(e.env, d.value.loc),
+ G = {
+ id: V(0),
+ lvalue: Object.assign({}, le),
+ value: {
+ kind: 'StoreLocal',
+ lvalue: {place: P, kind: Q.Reassign},
+ value: Object.assign({}, d.lvalue),
+ type: null,
+ loc: d.value.loc,
+ },
+ effects: null,
+ loc: d.loc,
+ };
+ p.push(G);
+ let ve = {
+ kind: 'goto',
+ block: m,
+ variant: St.Break,
+ id: V(0),
+ loc: d.loc,
+ },
+ de = {
+ id: A,
+ instructions: y,
+ kind: 'block',
+ phis: new Set(),
+ preds: new Set(),
+ terminal: ve,
+ };
+ e.body.blocks.set(A, de);
+ let {
+ refProperty: oe,
+ keyProperty: be,
+ propsProperty: $e,
+ } = O4(
+ e,
+ d,
+ y,
+ d.value.kind === 'JsxExpression' ? d.value.props : [],
+ d.value.children
+ ),
+ Ie = _t(e.env, d.value.loc),
+ Pe = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, Ie), {effect: x.Store}),
+ value: {
+ kind: 'ObjectExpression',
+ properties: [
+ JE(e, d, y, '$$typeof', t.elementSymbol),
+ d.value.kind === 'JsxExpression'
+ ? w4(e, d, y, d.value.tag)
+ : JE(e, d, y, 'type', 'react.fragment'),
+ oe,
+ be,
+ $e,
+ ],
+ loc: d.value.loc,
+ },
+ effects: null,
+ loc: d.loc,
+ };
+ y.push(Pe);
+ let ke = {
+ id: V(0),
+ lvalue: Object.assign({}, _t(e.env, d.value.loc)),
+ value: {
+ kind: 'StoreLocal',
+ lvalue: {place: Object.assign({}, P), kind: Q.Reassign},
+ value: Object.assign({}, Pe.lvalue),
+ type: null,
+ loc: d.value.loc,
+ },
+ effects: null,
+ loc: d.loc,
+ };
+ y.push(ke);
+ let je = new Map();
+ je.set(U, Object.assign({}, P)), je.set(A, Object.assign({}, O));
+ let Ae = Og(e.env.nextIdentifierId, S.identifier),
+ Ye = Object.assign(Object.assign({}, _t(e.env, d.value.loc)), {
+ identifier: Ae,
+ }),
+ bt = new Set([{kind: 'Phi', operands: je, place: Ye}]);
+ (g.phis = bt),
+ e.body.blocks.set(m, g),
+ i.set(d.lvalue.identifier.declarationId, {
+ identifier: Ae,
+ blockIdsToIgnore: new Set([U, A]),
+ });
+ break;
+ }
+ case 'FunctionExpression':
+ case 'ObjectMethod': {
+ tP(d.value.loweredFunc.func, t);
+ break;
+ }
+ }
+ }
+ }
+ for (let [r, a] of e.body.blocks) {
+ for (let o of a.instructions)
+ uI(o, (s) => Lg(s, r, i)),
+ cI(o, (s) => $4(s, r, i)),
+ dI(o.value, (s) => Lg(s, r, i));
+ if ((yI(a.terminal, (o) => Lg(o, r, i)), a.terminal.kind === 'scope')) {
+ let o = a.terminal.scope;
+ for (let s of o.dependencies) s.identifier = HE(s.identifier, i);
+ for (let [s, l] of [...o.declarations]) {
+ let d = HE(l.identifier, i);
+ d.id !== s &&
+ (o.declarations.delete(s),
+ o.declarations.set(l.identifier.id, {
+ identifier: d,
+ scope: l.scope,
+ }));
+ }
+ }
+ }
+ Pa(e.body), xa(e.body), fr(e.body), _h(e.body);
+ }
+ function JE(e, t, n, i, r) {
+ let a = _t(e.env, t.value.loc),
+ o = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, a), {effect: x.Mutate}),
+ value: {
+ kind: 'LoadGlobal',
+ binding: {kind: 'Global', name: 'Symbol'},
+ loc: t.value.loc,
+ },
+ effects: null,
+ loc: t.loc,
+ };
+ n.push(o);
+ let s = _t(e.env, t.value.loc),
+ l = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, s), {effect: x.Read}),
+ value: {
+ kind: 'PropertyLoad',
+ object: Object.assign({}, o.lvalue),
+ property: 'for',
+ loc: t.value.loc,
+ },
+ effects: null,
+ loc: t.loc,
+ };
+ n.push(l);
+ let d = _t(e.env, t.value.loc),
+ u = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, d), {effect: x.Mutate}),
+ value: {kind: 'Primitive', value: r, loc: t.value.loc},
+ effects: null,
+ loc: t.loc,
+ };
+ n.push(u);
+ let p = _t(e.env, t.value.loc),
+ y = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, p), {effect: x.Mutate}),
+ value: {
+ kind: 'MethodCall',
+ receiver: o.lvalue,
+ property: l.lvalue,
+ args: [u.lvalue],
+ loc: t.value.loc,
+ },
+ effects: null,
+ loc: t.loc,
+ },
+ m = {
+ kind: 'ObjectProperty',
+ key: {name: i, kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, p), {effect: x.Capture}),
+ };
+ return n.push(y), m;
+ }
+ function w4(e, t, n, i) {
+ let r;
+ switch (i.kind) {
+ case 'BuiltinTag': {
+ let a = _t(e.env, t.value.loc),
+ o = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, a), {effect: x.Mutate}),
+ value: {kind: 'Primitive', value: i.name, loc: t.value.loc},
+ effects: null,
+ loc: t.loc,
+ };
+ (r = {
+ kind: 'ObjectProperty',
+ key: {name: 'type', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, a), {effect: x.Capture}),
+ }),
+ n.push(o);
+ break;
+ }
+ case 'Identifier': {
+ r = {
+ kind: 'ObjectProperty',
+ key: {name: 'type', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, i), {effect: x.Capture}),
+ };
+ break;
+ }
+ }
+ return r;
+ }
+ function O4(e, t, n, i, r) {
+ let a,
+ o,
+ s = [],
+ l = i.filter((m) => m.kind === 'JsxAttribute' && m.name !== 'key'),
+ d = i.filter((m) => m.kind === 'JsxSpreadAttribute'),
+ u = l.length === 0 && d.length === 1;
+ i.forEach((m) => {
+ switch (m.kind) {
+ case 'JsxAttribute': {
+ switch (m.name) {
+ case 'key': {
+ o = {
+ kind: 'ObjectProperty',
+ key: {name: 'key', kind: 'string'},
+ type: 'property',
+ place: Object.assign({}, m.place),
+ };
+ break;
+ }
+ case 'ref': {
+ a = {
+ kind: 'ObjectProperty',
+ key: {name: 'ref', kind: 'string'},
+ type: 'property',
+ place: Object.assign({}, m.place),
+ };
+ let g = {
+ kind: 'ObjectProperty',
+ key: {name: 'ref', kind: 'string'},
+ type: 'property',
+ place: Object.assign({}, m.place),
+ };
+ s.push(g);
+ break;
+ }
+ default: {
+ let g = {
+ kind: 'ObjectProperty',
+ key: {name: m.name, kind: 'string'},
+ type: 'property',
+ place: Object.assign({}, m.place),
+ };
+ s.push(g);
+ }
+ }
+ break;
+ }
+ case 'JsxSpreadAttribute': {
+ s.push({kind: 'Spread', place: Object.assign({}, m.argument)});
+ break;
+ }
+ }
+ });
+ let p = _t(e.env, t.value.loc);
+ if (r) {
+ let m;
+ if (r.length === 1)
+ m = {
+ kind: 'ObjectProperty',
+ key: {name: 'children', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, r[0]), {effect: x.Capture}),
+ };
+ else {
+ let g = _t(e.env, t.value.loc),
+ S = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, g), {effect: x.Mutate}),
+ value: {
+ kind: 'ArrayExpression',
+ elements: [...r],
+ loc: t.value.loc,
+ },
+ effects: null,
+ loc: t.loc,
+ };
+ n.push(S),
+ (m = {
+ kind: 'ObjectProperty',
+ key: {name: 'children', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, g), {effect: x.Capture}),
+ });
+ }
+ s.push(m);
+ }
+ if (a == null) {
+ let m = _t(e.env, t.value.loc),
+ g = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, m), {effect: x.Mutate}),
+ value: {kind: 'Primitive', value: null, loc: t.value.loc},
+ effects: null,
+ loc: t.loc,
+ };
+ (a = {
+ kind: 'ObjectProperty',
+ key: {name: 'ref', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, m), {effect: x.Capture}),
+ }),
+ n.push(g);
+ }
+ if (o == null) {
+ let m = _t(e.env, t.value.loc),
+ g = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, m), {effect: x.Mutate}),
+ value: {kind: 'Primitive', value: null, loc: t.value.loc},
+ effects: null,
+ loc: t.loc,
+ };
+ (o = {
+ kind: 'ObjectProperty',
+ key: {name: 'key', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, m), {effect: x.Capture}),
+ }),
+ n.push(g);
+ }
+ let y;
+ if (u) {
+ let m = d[0];
+ D.invariant(m.kind === 'JsxSpreadAttribute', {
+ reason: 'Spread prop attribute must be of kind JSXSpreadAttribute',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ }),
+ (y = {
+ kind: 'ObjectProperty',
+ key: {name: 'props', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, m.argument), {
+ effect: x.Mutate,
+ }),
+ });
+ } else {
+ let m = {
+ id: V(0),
+ lvalue: Object.assign(Object.assign({}, p), {effect: x.Mutate}),
+ value: {kind: 'ObjectExpression', properties: s, loc: t.value.loc},
+ effects: null,
+ loc: t.loc,
+ };
+ (y = {
+ kind: 'ObjectProperty',
+ key: {name: 'props', kind: 'string'},
+ type: 'property',
+ place: Object.assign(Object.assign({}, p), {effect: x.Capture}),
+ }),
+ n.push(m);
+ }
+ return {refProperty: a, keyProperty: o, propsProperty: y};
+ }
+ function Lg(e, t, n) {
+ let i = n.get(e.identifier.declarationId);
+ return i == null || i.blockIdsToIgnore.has(t)
+ ? e
+ : Object.assign(Object.assign({}, e), {identifier: i.identifier});
+ }
+ function $4(e, t, n) {
+ let i = n.get(e.identifier.declarationId);
+ return i == null || i.blockIdsToIgnore.has(t)
+ ? e
+ : Object.assign(Object.assign({}, e), {identifier: i.identifier});
+ }
+ function HE(e, t) {
+ let n = t.get(e.declarationId);
+ return n == null ? e : n.identifier;
+ }
+ function j4(e) {
+ let t = new Set(),
+ n = new Sa();
+ for (let [i, r] of e.body.blocks)
+ for (let {lvalue: a, value: o} of r.instructions)
+ if (o.kind === 'ObjectMethod') t.add(a.identifier);
+ else if (o.kind === 'ObjectExpression') {
+ for (let s of Ot(o))
+ if (t.has(s.identifier)) {
+ let l = s.identifier.scope,
+ d = a.identifier.scope;
+ D.invariant(l != null && d != null, {
+ reason:
+ 'Internal error: Expected all ObjectExpressions and ObjectMethods to have non-null scope.',
+ description: null,
+ suggestions: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ n.union([l, d]);
+ }
+ }
+ return n;
+ }
+ function nP(e) {
+ for (let [n, i] of e.body.blocks)
+ for (let {value: r} of i.instructions)
+ (r.kind === 'ObjectMethod' || r.kind === 'FunctionExpression') &&
+ nP(r.loweredFunc.func);
+ let t = j4(e).canonicalize();
+ for (let [n, i] of t)
+ n !== i &&
+ ((i.range.start = V(Math.min(n.range.start, i.range.start))),
+ (i.range.end = V(Math.max(n.range.end, i.range.end))));
+ for (let [n, i] of e.body.blocks)
+ for (let {
+ lvalue: {identifier: r},
+ } of i.instructions)
+ if (r.scope != null) {
+ let a = t.get(r.scope);
+ a != null && (r.scope = a);
+ }
+ }
+ function At(e, t, n) {
+ t.visitBlock(e.body, n);
+ }
+ var Qt = class {
+ visitID(t, n) {}
+ visitParam(t, n) {}
+ visitLValue(t, n, i) {}
+ visitPlace(t, n, i) {}
+ visitReactiveFunctionValue(t, n, i, r) {}
+ visitValue(t, n, i) {
+ this.traverseValue(t, n, i);
+ }
+ traverseValue(t, n, i) {
+ switch (n.kind) {
+ case 'OptionalExpression': {
+ this.visitValue(t, n.value, i);
+ break;
+ }
+ case 'LogicalExpression': {
+ this.visitValue(t, n.left, i), this.visitValue(t, n.right, i);
+ break;
+ }
+ case 'ConditionalExpression': {
+ this.visitValue(t, n.test, i),
+ this.visitValue(t, n.consequent, i),
+ this.visitValue(t, n.alternate, i);
+ break;
+ }
+ case 'SequenceExpression': {
+ for (let r of n.instructions) this.visitInstruction(r, i);
+ this.visitValue(n.id, n.value, i);
+ break;
+ }
+ default:
+ for (let r of Ot(n)) this.visitPlace(t, r, i);
+ }
+ }
+ visitInstruction(t, n) {
+ this.traverseInstruction(t, n);
+ }
+ traverseInstruction(t, n) {
+ this.visitID(t.id, n);
+ for (let i of rn(t)) this.visitLValue(t.id, i, n);
+ this.visitValue(t.id, t.value, n);
+ }
+ visitTerminal(t, n) {
+ this.traverseTerminal(t, n);
+ }
+ traverseTerminal(t, n) {
+ let {terminal: i} = t;
+ switch ((i.id !== null && this.visitID(i.id, n), i.kind)) {
+ case 'break':
+ case 'continue':
+ break;
+ case 'return': {
+ this.visitPlace(i.id, i.value, n);
+ break;
+ }
+ case 'throw': {
+ this.visitPlace(i.id, i.value, n);
+ break;
+ }
+ case 'for': {
+ this.visitValue(i.id, i.init, n),
+ this.visitValue(i.id, i.test, n),
+ this.visitBlock(i.loop, n),
+ i.update !== null && this.visitValue(i.id, i.update, n);
+ break;
+ }
+ case 'for-of': {
+ this.visitValue(i.id, i.init, n),
+ this.visitValue(i.id, i.test, n),
+ this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'for-in': {
+ this.visitValue(i.id, i.init, n), this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'do-while': {
+ this.visitBlock(i.loop, n), this.visitValue(i.id, i.test, n);
+ break;
+ }
+ case 'while': {
+ this.visitValue(i.id, i.test, n), this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'if': {
+ this.visitPlace(i.id, i.test, n),
+ this.visitBlock(i.consequent, n),
+ i.alternate !== null && this.visitBlock(i.alternate, n);
+ break;
+ }
+ case 'switch': {
+ this.visitPlace(i.id, i.test, n);
+ for (let r of i.cases)
+ r.test !== null && this.visitPlace(i.id, r.test, n),
+ r.block !== void 0 && this.visitBlock(r.block, n);
+ break;
+ }
+ case 'label': {
+ this.visitBlock(i.block, n);
+ break;
+ }
+ case 'try': {
+ this.visitBlock(i.block, n), this.visitBlock(i.handler, n);
+ break;
+ }
+ default:
+ Me(i, `Unexpected terminal kind \`${i.kind}\``);
+ }
+ }
+ visitScope(t, n) {
+ this.traverseScope(t, n);
+ }
+ traverseScope(t, n) {
+ this.visitBlock(t.instructions, n);
+ }
+ visitPrunedScope(t, n) {
+ this.traversePrunedScope(t, n);
+ }
+ traversePrunedScope(t, n) {
+ this.visitBlock(t.instructions, n);
+ }
+ visitBlock(t, n) {
+ this.traverseBlock(t, n);
+ }
+ traverseBlock(t, n) {
+ for (let i of t)
+ switch (i.kind) {
+ case 'instruction': {
+ this.visitInstruction(i.instruction, n);
+ break;
+ }
+ case 'scope': {
+ this.visitScope(i, n);
+ break;
+ }
+ case 'pruned-scope': {
+ this.visitPrunedScope(i, n);
+ break;
+ }
+ case 'terminal': {
+ this.visitTerminal(i, n);
+ break;
+ }
+ default:
+ Me(i, `Unexpected instruction kind \`${i.kind}\``);
+ }
+ }
+ visitHirFunction(t, n) {
+ for (let i of t.params) {
+ let r = i.kind === 'Identifier' ? i : i.place;
+ this.visitParam(r, n);
+ }
+ for (let [, i] of t.body.blocks) {
+ for (let r of i.instructions)
+ this.visitInstruction(r, n),
+ (r.value.kind === 'FunctionExpression' ||
+ r.value.kind === 'ObjectMethod') &&
+ this.visitHirFunction(r.value.loweredFunc.func, n);
+ for (let r of Gt(i.terminal)) this.visitPlace(i.terminal.id, r, n);
+ }
+ }
+ },
+ Ei = class extends Qt {
+ traverseBlock(t, n) {
+ let i = null;
+ for (let r = 0; r < t.length; r++) {
+ let a = t[r],
+ o;
+ switch (a.kind) {
+ case 'instruction': {
+ o = this.transformInstruction(a.instruction, n);
+ break;
+ }
+ case 'scope': {
+ o = this.transformScope(a, n);
+ break;
+ }
+ case 'pruned-scope': {
+ o = this.transformPrunedScope(a, n);
+ break;
+ }
+ case 'terminal': {
+ o = this.transformTerminal(a, n);
+ break;
+ }
+ default:
+ Me(a, `Unexpected instruction kind \`${a.kind}\``);
+ }
+ switch (o.kind) {
+ case 'keep': {
+ i !== null && i.push(a);
+ break;
+ }
+ case 'remove': {
+ i === null && (i = t.slice(0, r));
+ break;
+ }
+ case 'replace': {
+ i ?? (i = t.slice(0, r)), i.push(o.value);
+ break;
+ }
+ case 'replace-many': {
+ i ?? (i = t.slice(0, r)), i.push(...o.value);
+ break;
+ }
+ }
+ }
+ i !== null && ((t.length = 0), t.push(...i));
+ }
+ transformInstruction(t, n) {
+ return this.visitInstruction(t, n), {kind: 'keep'};
+ }
+ transformTerminal(t, n) {
+ return this.visitTerminal(t, n), {kind: 'keep'};
+ }
+ transformScope(t, n) {
+ return this.visitScope(t, n), {kind: 'keep'};
+ }
+ transformPrunedScope(t, n) {
+ return this.visitPrunedScope(t, n), {kind: 'keep'};
+ }
+ transformValue(t, n, i) {
+ return this.visitValue(t, n, i), {kind: 'keep'};
+ }
+ transformReactiveFunctionValue(t, n, i, r) {
+ return this.visitReactiveFunctionValue(t, n, i, r), {kind: 'keep'};
+ }
+ traverseValue(t, n, i) {
+ switch (n.kind) {
+ case 'OptionalExpression': {
+ let r = this.transformValue(t, n.value, i);
+ r.kind === 'replace' && (n.value = r.value);
+ break;
+ }
+ case 'LogicalExpression': {
+ let r = this.transformValue(t, n.left, i);
+ r.kind === 'replace' && (n.left = r.value);
+ let a = this.transformValue(t, n.right, i);
+ a.kind === 'replace' && (n.right = a.value);
+ break;
+ }
+ case 'ConditionalExpression': {
+ let r = this.transformValue(t, n.test, i);
+ r.kind === 'replace' && (n.test = r.value);
+ let a = this.transformValue(t, n.consequent, i);
+ a.kind === 'replace' && (n.consequent = a.value);
+ let o = this.transformValue(t, n.alternate, i);
+ o.kind === 'replace' && (n.alternate = o.value);
+ break;
+ }
+ case 'SequenceExpression': {
+ for (let a of n.instructions) this.visitInstruction(a, i);
+ let r = this.transformValue(n.id, n.value, i);
+ r.kind === 'replace' && (n.value = r.value);
+ break;
+ }
+ default:
+ for (let r of Ot(n)) this.visitPlace(t, r, i);
+ }
+ }
+ traverseInstruction(t, n) {
+ this.visitID(t.id, n);
+ for (let r of rn(t)) this.visitLValue(t.id, r, n);
+ let i = this.transformValue(t.id, t.value, n);
+ i.kind === 'replace' && (t.value = i.value);
+ }
+ traverseTerminal(t, n) {
+ let {terminal: i} = t;
+ switch ((i.id !== null && this.visitID(i.id, n), i.kind)) {
+ case 'break':
+ case 'continue':
+ break;
+ case 'return': {
+ this.visitPlace(i.id, i.value, n);
+ break;
+ }
+ case 'throw': {
+ this.visitPlace(i.id, i.value, n);
+ break;
+ }
+ case 'for': {
+ let r = this.transformValue(i.id, i.init, n);
+ r.kind === 'replace' && (i.init = r.value);
+ let a = this.transformValue(i.id, i.test, n);
+ if (
+ (a.kind === 'replace' && (i.test = a.value), i.update !== null)
+ ) {
+ let o = this.transformValue(i.id, i.update, n);
+ o.kind === 'replace' && (i.update = o.value);
+ }
+ this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'for-of': {
+ let r = this.transformValue(i.id, i.init, n);
+ r.kind === 'replace' && (i.init = r.value);
+ let a = this.transformValue(i.id, i.test, n);
+ a.kind === 'replace' && (i.test = a.value),
+ this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'for-in': {
+ let r = this.transformValue(i.id, i.init, n);
+ r.kind === 'replace' && (i.init = r.value),
+ this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'do-while': {
+ this.visitBlock(i.loop, n);
+ let r = this.transformValue(i.id, i.test, n);
+ r.kind === 'replace' && (i.test = r.value);
+ break;
+ }
+ case 'while': {
+ let r = this.transformValue(i.id, i.test, n);
+ r.kind === 'replace' && (i.test = r.value),
+ this.visitBlock(i.loop, n);
+ break;
+ }
+ case 'if': {
+ this.visitPlace(i.id, i.test, n),
+ this.visitBlock(i.consequent, n),
+ i.alternate !== null && this.visitBlock(i.alternate, n);
+ break;
+ }
+ case 'switch': {
+ this.visitPlace(i.id, i.test, n);
+ for (let r of i.cases)
+ r.test !== null && this.visitPlace(i.id, r.test, n),
+ r.block !== void 0 && this.visitBlock(r.block, n);
+ break;
+ }
+ case 'label': {
+ this.visitBlock(i.block, n);
+ break;
+ }
+ case 'try': {
+ this.visitBlock(i.block, n),
+ i.handlerBinding !== null &&
+ this.visitPlace(i.id, i.handlerBinding, n),
+ this.visitBlock(i.handler, n);
+ break;
+ }
+ default:
+ Me(i, `Unexpected terminal kind \`${i.kind}\``);
+ }
+ }
+ };
+ function* Hn(e) {
+ switch (e.kind) {
+ case 'OptionalExpression': {
+ yield* Hn(e.value);
+ break;
+ }
+ case 'LogicalExpression': {
+ yield* Hn(e.left), yield* Hn(e.right);
+ break;
+ }
+ case 'SequenceExpression': {
+ for (let t of e.instructions) yield* Hn(t.value);
+ yield* Hn(e.value);
+ break;
+ }
+ case 'ConditionalExpression': {
+ yield* Hn(e.test), yield* Hn(e.consequent), yield* Hn(e.alternate);
+ break;
+ }
+ default:
+ yield* Ot(e);
+ }
+ }
+ function C4(e) {
+ let t = new Set();
+ At(e, new gv(), t), At(e, new vv(), t);
+ }
+ var gv = class extends Qt {
+ visitScope(t, n) {
+ this.traverseScope(t, n), n.add(t.scope.id);
+ }
+ },
+ vv = class extends Qt {
+ constructor() {
+ super(...arguments), (this.activeScopes = new Set());
+ }
+ visitPlace(t, n, i) {
+ let r = Km(t, n);
+ r !== null &&
+ i.has(r.id) &&
+ !this.activeScopes.has(r.id) &&
+ D.invariant(!1, {
+ reason:
+ 'Encountered an instruction that should be part of a scope, but where that scope has already completed',
+ description: `Instruction [${t}] is part of scope @${r.id}, but that scope has already completed`,
+ details: [{kind: 'error', loc: n.loc, message: null}],
+ suggestions: null,
+ });
+ }
+ visitScope(t, n) {
+ this.activeScopes.add(t.scope.id),
+ this.traverseScope(t, n),
+ this.activeScopes.delete(t.scope.id);
+ }
+ };
+ function D4(e) {
+ At(e, new A4(), new Set());
+ }
+ var A4 = class extends Qt {
+ visitTerminal(t, n) {
+ t.label != null && n.add(t.label.id);
+ let i = t.terminal;
+ (i.kind === 'break' || i.kind === 'continue') &&
+ D.invariant(n.has(i.target), {
+ reason: 'Unexpected break to invalid label',
+ description: null,
+ details: [{kind: 'error', loc: t.terminal.loc, message: null}],
+ });
+ }
+ },
+ Ya,
+ An,
+ Qp,
+ cr;
+ function $m(e) {
+ let t = new M4(e.body),
+ i = new hv(t).traverseBlock(t.block(e.body.entry));
+ return {
+ loc: e.loc,
+ id: e.id,
+ nameHint: e.nameHint,
+ params: e.params,
+ generator: e.generator,
+ async: e.async,
+ body: i,
+ env: e.env,
+ directives: e.directives,
+ };
+ }
+ var hv = class {
+ constructor(t) {
+ this.cx = t;
+ }
+ traverseBlock(t) {
+ let n = [];
+ return this.visitBlock(t, n), n;
+ }
+ visitBlock(t, n) {
+ var i;
+ D.invariant(!this.cx.emitted.has(t.id), {
+ reason: `Cannot emit the same block twice: bb${t.id}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ this.cx.emitted.add(t.id);
+ for (let o of t.instructions)
+ n.push({kind: 'instruction', instruction: o});
+ let r = t.terminal,
+ a = [];
+ switch (r.kind) {
+ case 'return': {
+ n.push({
+ kind: 'terminal',
+ terminal: {kind: 'return', loc: r.loc, value: r.value, id: r.id},
+ label: null,
+ });
+ break;
+ }
+ case 'throw': {
+ n.push({
+ kind: 'terminal',
+ terminal: {kind: 'throw', loc: r.loc, value: r.value, id: r.id},
+ label: null,
+ });
+ break;
+ }
+ case 'if': {
+ let o =
+ this.cx.reachable(r.fallthrough) &&
+ !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null,
+ s = r.alternate !== r.fallthrough ? r.alternate : null;
+ if (o !== null) {
+ let u = this.cx.schedule(o, 'if');
+ a.push(u);
+ }
+ let l = null;
+ this.cx.isScheduled(r.consequent)
+ ? D.invariant(!1, {
+ reason:
+ "Unexpected 'if' where the consequent is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ })
+ : (l = this.traverseBlock(this.cx.ir.blocks.get(r.consequent)));
+ let d = null;
+ s !== null &&
+ (this.cx.isScheduled(s)
+ ? D.invariant(!1, {
+ reason:
+ "Unexpected 'if' where the alternate is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ })
+ : (d = this.traverseBlock(this.cx.ir.blocks.get(s)))),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'if',
+ loc: r.loc,
+ test: r.test,
+ consequent: l ?? this.emptyBlock(),
+ alternate: d,
+ id: r.id,
+ },
+ label: o == null ? null : {id: o, implicit: !1},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'switch': {
+ let o =
+ this.cx.reachable(r.fallthrough) &&
+ !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null;
+ if (o !== null) {
+ let l = this.cx.schedule(o, 'switch');
+ a.push(l);
+ }
+ let s = [];
+ [...r.cases].reverse().forEach((l, d) => {
+ let u = l.test,
+ p;
+ if (this.cx.isScheduled(l.block)) {
+ D.invariant(l.block === r.fallthrough, {
+ reason:
+ "Unexpected 'switch' where a case is already scheduled and block is not the fallthrough",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ });
+ return;
+ } else {
+ p = this.traverseBlock(this.cx.ir.blocks.get(l.block));
+ let y = this.cx.schedule(l.block, 'case');
+ a.push(y);
+ }
+ s.push({test: u, block: p});
+ }),
+ s.reverse(),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'switch',
+ loc: r.loc,
+ test: r.test,
+ cases: s,
+ id: r.id,
+ },
+ label: o == null ? null : {id: o, implicit: !1},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'do-while': {
+ let o = this.cx.isScheduled(r.fallthrough) ? null : r.fallthrough,
+ s =
+ !this.cx.isScheduled(r.loop) && r.loop !== r.fallthrough
+ ? r.loop
+ : null,
+ l = this.cx.scheduleLoop(r.fallthrough, r.test, r.loop);
+ a.push(l);
+ let d;
+ s
+ ? (d = this.traverseBlock(this.cx.ir.blocks.get(s)))
+ : D.invariant(!1, {
+ reason:
+ "Unexpected 'do-while' where the loop is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ });
+ let u = this.visitValueBlock(r.test, r.loc).value;
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'do-while',
+ loc: r.loc,
+ test: u,
+ loop: d,
+ id: r.id,
+ },
+ label: o == null ? null : {id: o, implicit: !1},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'while': {
+ let o =
+ this.cx.reachable(r.fallthrough) &&
+ !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null,
+ s =
+ !this.cx.isScheduled(r.loop) && r.loop !== r.fallthrough
+ ? r.loop
+ : null,
+ l = this.cx.scheduleLoop(r.fallthrough, r.test, r.loop);
+ a.push(l);
+ let d = this.visitValueBlock(r.test, r.loc).value,
+ u;
+ s
+ ? (u = this.traverseBlock(this.cx.ir.blocks.get(s)))
+ : D.invariant(!1, {
+ reason:
+ "Unexpected 'while' where the loop is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ }),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'while',
+ loc: r.loc,
+ test: d,
+ loop: u,
+ id: r.id,
+ },
+ label: o == null ? null : {id: o, implicit: !1},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'for': {
+ let o =
+ !this.cx.isScheduled(r.loop) && r.loop !== r.fallthrough
+ ? r.loop
+ : null,
+ s = this.cx.isScheduled(r.fallthrough) ? null : r.fallthrough,
+ l = this.cx.scheduleLoop(
+ r.fallthrough,
+ (i = r.update) !== null && i !== void 0 ? i : r.test,
+ r.loop
+ );
+ a.push(l);
+ let d = this.visitValueBlock(r.init, r.loc),
+ u = this.cx.ir.blocks.get(d.block),
+ p = d.value;
+ if (p.kind === 'SequenceExpression') {
+ let S = u.instructions.at(-1);
+ p.instructions.push(S),
+ (p.value = {kind: 'Primitive', value: void 0, loc: r.loc});
+ } else
+ p = {
+ kind: 'SequenceExpression',
+ instructions: [u.instructions.at(-1)],
+ id: r.id,
+ loc: r.loc,
+ value: {kind: 'Primitive', value: void 0, loc: r.loc},
+ };
+ let y = this.visitValueBlock(r.test, r.loc).value,
+ m =
+ r.update !== null
+ ? this.visitValueBlock(r.update, r.loc).value
+ : null,
+ g;
+ o
+ ? (g = this.traverseBlock(this.cx.ir.blocks.get(o)))
+ : D.invariant(!1, {
+ reason:
+ "Unexpected 'for' where the loop is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ }),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'for',
+ loc: r.loc,
+ init: p,
+ test: y,
+ update: m,
+ loop: g,
+ id: r.id,
+ },
+ label: s == null ? null : {id: s, implicit: !1},
+ }),
+ s !== null && this.visitBlock(this.cx.ir.blocks.get(s), n);
+ break;
+ }
+ case 'for-of': {
+ let o =
+ !this.cx.isScheduled(r.loop) && r.loop !== r.fallthrough
+ ? r.loop
+ : null,
+ s = this.cx.isScheduled(r.fallthrough) ? null : r.fallthrough,
+ l = this.cx.scheduleLoop(r.fallthrough, r.init, r.loop);
+ a.push(l);
+ let d = this.visitValueBlock(r.init, r.loc),
+ u = this.cx.ir.blocks.get(d.block),
+ p = d.value;
+ if (p.kind === 'SequenceExpression') {
+ let _ = u.instructions.at(-1);
+ p.instructions.push(_),
+ (p.value = {kind: 'Primitive', value: void 0, loc: r.loc});
+ } else
+ p = {
+ kind: 'SequenceExpression',
+ instructions: [u.instructions.at(-1)],
+ id: r.id,
+ loc: r.loc,
+ value: {kind: 'Primitive', value: void 0, loc: r.loc},
+ };
+ let y = this.visitValueBlock(r.test, r.loc),
+ m = this.cx.ir.blocks.get(y.block),
+ g = y.value;
+ if (g.kind === 'SequenceExpression') {
+ let _ = m.instructions.at(-1);
+ g.instructions.push(_),
+ (g.value = {kind: 'Primitive', value: void 0, loc: r.loc});
+ } else
+ g = {
+ kind: 'SequenceExpression',
+ instructions: [m.instructions.at(-1)],
+ id: r.id,
+ loc: r.loc,
+ value: {kind: 'Primitive', value: void 0, loc: r.loc},
+ };
+ let S;
+ o
+ ? (S = this.traverseBlock(this.cx.ir.blocks.get(o)))
+ : D.invariant(!1, {
+ reason:
+ "Unexpected 'for-of' where the loop is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ }),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'for-of',
+ loc: r.loc,
+ init: p,
+ test: g,
+ loop: S,
+ id: r.id,
+ },
+ label: s == null ? null : {id: s, implicit: !1},
+ }),
+ s !== null && this.visitBlock(this.cx.ir.blocks.get(s), n);
+ break;
+ }
+ case 'for-in': {
+ let o =
+ !this.cx.isScheduled(r.loop) && r.loop !== r.fallthrough
+ ? r.loop
+ : null,
+ s = this.cx.isScheduled(r.fallthrough) ? null : r.fallthrough,
+ l = this.cx.scheduleLoop(r.fallthrough, r.init, r.loop);
+ a.push(l);
+ let d = this.visitValueBlock(r.init, r.loc),
+ u = this.cx.ir.blocks.get(d.block),
+ p = d.value;
+ if (p.kind === 'SequenceExpression') {
+ let m = u.instructions.at(-1);
+ p.instructions.push(m),
+ (p.value = {kind: 'Primitive', value: void 0, loc: r.loc});
+ } else
+ p = {
+ kind: 'SequenceExpression',
+ instructions: [u.instructions.at(-1)],
+ id: r.id,
+ loc: r.loc,
+ value: {kind: 'Primitive', value: void 0, loc: r.loc},
+ };
+ let y;
+ o
+ ? (y = this.traverseBlock(this.cx.ir.blocks.get(o)))
+ : D.invariant(!1, {
+ reason:
+ "Unexpected 'for-in' where the loop is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ }),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'for-in',
+ loc: r.loc,
+ init: p,
+ loop: y,
+ id: r.id,
+ },
+ label: s == null ? null : {id: s, implicit: !1},
+ }),
+ s !== null && this.visitBlock(this.cx.ir.blocks.get(s), n);
+ break;
+ }
+ case 'branch': {
+ let o = null;
+ if (this.cx.isScheduled(r.consequent)) {
+ let l = this.visitBreak(r.consequent, r.id, r.loc);
+ l !== null && (o = [l]);
+ } else o = this.traverseBlock(this.cx.ir.blocks.get(r.consequent));
+ let s = null;
+ this.cx.isScheduled(r.alternate)
+ ? D.invariant(!1, {
+ reason:
+ "Unexpected 'branch' where the alternate is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ })
+ : (s = this.traverseBlock(this.cx.ir.blocks.get(r.alternate))),
+ n.push({
+ kind: 'terminal',
+ terminal: {
+ kind: 'if',
+ loc: r.loc,
+ test: r.test,
+ consequent: o ?? this.emptyBlock(),
+ alternate: s,
+ id: r.id,
+ },
+ label: null,
+ });
+ break;
+ }
+ case 'label': {
+ let o =
+ this.cx.reachable(r.fallthrough) &&
+ !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null;
+ if (o !== null) {
+ let l = this.cx.schedule(o, 'if');
+ a.push(l);
+ }
+ let s;
+ this.cx.isScheduled(r.block)
+ ? D.invariant(!1, {
+ reason:
+ "Unexpected 'label' where the block is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ })
+ : (s = this.traverseBlock(this.cx.ir.blocks.get(r.block))),
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ terminal: {kind: 'label', loc: r.loc, block: s, id: r.id},
+ label: o == null ? null : {id: o, implicit: !1},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'sequence':
+ case 'optional':
+ case 'ternary':
+ case 'logical': {
+ let o =
+ r.fallthrough !== null && !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null;
+ if (o !== null) {
+ let d = this.cx.schedule(o, 'if');
+ a.push(d);
+ }
+ let {place: s, value: l} = this.visitValueBlockTerminal(r);
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'instruction',
+ instruction: {id: r.id, lvalue: s, value: l, loc: r.loc},
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'goto': {
+ switch (r.variant) {
+ case St.Break: {
+ let o = this.visitBreak(r.block, r.id, r.loc);
+ o !== null && n.push(o);
+ break;
+ }
+ case St.Continue: {
+ let o = this.visitContinue(r.block, r.id, r.loc);
+ o !== null && n.push(o);
+ break;
+ }
+ case St.Try:
+ break;
+ default:
+ Me(r.variant, `Unexpected goto variant \`${r.variant}\``);
+ }
+ break;
+ }
+ case 'maybe-throw': {
+ this.cx.isScheduled(r.continuation) ||
+ this.visitBlock(this.cx.ir.blocks.get(r.continuation), n);
+ break;
+ }
+ case 'try': {
+ let o =
+ this.cx.reachable(r.fallthrough) &&
+ !this.cx.isScheduled(r.fallthrough)
+ ? r.fallthrough
+ : null;
+ if (o !== null) {
+ let d = this.cx.schedule(o, 'if');
+ a.push(d);
+ }
+ this.cx.scheduleCatchHandler(r.handler);
+ let s = this.traverseBlock(this.cx.ir.blocks.get(r.block)),
+ l = this.traverseBlock(this.cx.ir.blocks.get(r.handler));
+ this.cx.unscheduleAll(a),
+ n.push({
+ kind: 'terminal',
+ label: o == null ? null : {id: o, implicit: !1},
+ terminal: {
+ kind: 'try',
+ loc: r.loc,
+ block: s,
+ handlerBinding: r.handlerBinding,
+ handler: l,
+ id: r.id,
+ },
+ }),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'pruned-scope':
+ case 'scope': {
+ let o = this.cx.isScheduled(r.fallthrough) ? null : r.fallthrough;
+ if (o !== null) {
+ let l = this.cx.schedule(o, 'if');
+ a.push(l), this.cx.scopeFallthroughs.add(o);
+ }
+ let s;
+ this.cx.isScheduled(r.block)
+ ? D.invariant(!1, {
+ reason:
+ "Unexpected 'scope' where the block is already scheduled",
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ })
+ : (s = this.traverseBlock(this.cx.ir.blocks.get(r.block))),
+ this.cx.unscheduleAll(a),
+ n.push({kind: r.kind, instructions: s, scope: r.scope}),
+ o !== null && this.visitBlock(this.cx.ir.blocks.get(o), n);
+ break;
+ }
+ case 'unreachable':
+ break;
+ case 'unsupported':
+ D.invariant(!1, {
+ reason: 'Unexpected unsupported terminal',
+ description: null,
+ details: [{kind: 'error', loc: r.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(r, 'Unexpected terminal');
+ }
+ }
+ visitValueBlock(t, n) {
+ let i = this.cx.ir.blocks.get(t);
+ if (i.terminal.kind === 'branch') {
+ if (i.instructions.length === 0)
+ return {
+ block: i.id,
+ place: i.terminal.test,
+ value: {
+ kind: 'LoadLocal',
+ place: i.terminal.test,
+ loc: i.terminal.test.loc,
+ },
+ id: i.terminal.id,
+ };
+ if (i.instructions.length === 1) {
+ let a = i.instructions[0];
+ return (
+ D.invariant(
+ a.lvalue.identifier.id === i.terminal.test.identifier.id,
+ {
+ reason:
+ 'Expected branch block to end in an instruction that sets the test value',
+ description: null,
+ details: [{kind: 'error', loc: a.lvalue.loc, message: null}],
+ suggestions: null,
+ }
+ ),
+ {block: i.id, place: a.lvalue, value: a.value, id: a.id}
+ );
+ } else {
+ let a = i.instructions.at(-1),
+ o = {
+ kind: 'SequenceExpression',
+ instructions: i.instructions.slice(0, -1),
+ id: a.id,
+ value: a.value,
+ loc: n,
+ };
+ return {
+ block: i.id,
+ place: i.terminal.test,
+ value: o,
+ id: i.terminal.id,
+ };
+ }
+ } else if (i.terminal.kind === 'goto')
+ if (i.instructions.length === 0)
+ D.invariant(!1, {
+ reason:
+ 'Expected goto value block to have at least one instruction',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ else if (i.instructions.length === 1) {
+ let a = i.instructions[0],
+ o = a.lvalue,
+ s = a.value;
+ return (
+ s.kind === 'StoreLocal' &&
+ s.lvalue.place.identifier.name === null &&
+ ((o = s.lvalue.place),
+ (s = {kind: 'LoadLocal', place: s.value, loc: s.value.loc})),
+ {block: i.id, place: o, value: s, id: a.id}
+ );
+ } else {
+ let a = i.instructions.at(-1),
+ o = a.lvalue,
+ s = a.value;
+ s.kind === 'StoreLocal' &&
+ s.lvalue.place.identifier.name === null &&
+ ((o = s.lvalue.place),
+ (s = {kind: 'LoadLocal', place: s.value, loc: s.value.loc}));
+ let l = {
+ kind: 'SequenceExpression',
+ instructions: i.instructions.slice(0, -1),
+ id: a.id,
+ value: s,
+ loc: n,
+ };
+ return {block: i.id, place: o, value: l, id: a.id};
+ }
+ else {
+ let r = this.visitValueBlockTerminal(i.terminal),
+ a = this.visitValueBlock(r.fallthrough, n),
+ o = {
+ kind: 'SequenceExpression',
+ instructions: [
+ ...i.instructions,
+ {id: r.id, loc: n, lvalue: r.place, value: r.value},
+ ],
+ id: a.id,
+ value: a.value,
+ loc: n,
+ };
+ return {block: r.fallthrough, value: o, place: a.place, id: a.id};
+ }
+ }
+ visitValueBlockTerminal(t) {
+ switch (t.kind) {
+ case 'sequence': {
+ let n = this.visitValueBlock(t.block, t.loc);
+ return {
+ value: n.value,
+ place: n.place,
+ fallthrough: t.fallthrough,
+ id: t.id,
+ };
+ }
+ case 'optional': {
+ let n = this.visitValueBlock(t.test, t.loc),
+ i = this.cx.ir.blocks.get(n.block);
+ i.terminal.kind !== 'branch' &&
+ D.throwTodo({
+ reason: `Unexpected terminal kind \`${i.terminal.kind}\` for optional test block`,
+ description: null,
+ loc: i.terminal.loc,
+ suggestions: null,
+ });
+ let r = this.visitValueBlock(i.terminal.consequent, t.loc),
+ a = {
+ kind: 'SequenceExpression',
+ instructions: [
+ {
+ id: n.id,
+ loc: i.terminal.loc,
+ lvalue: n.place,
+ value: n.value,
+ },
+ ],
+ id: r.id,
+ value: r.value,
+ loc: t.loc,
+ };
+ return {
+ place: Object.assign({}, r.place),
+ value: {
+ kind: 'OptionalExpression',
+ optional: t.optional,
+ value: a,
+ id: t.id,
+ loc: t.loc,
+ },
+ fallthrough: t.fallthrough,
+ id: t.id,
+ };
+ }
+ case 'logical': {
+ let n = this.visitValueBlock(t.test, t.loc),
+ i = this.cx.ir.blocks.get(n.block);
+ i.terminal.kind !== 'branch' &&
+ D.throwTodo({
+ reason: `Unexpected terminal kind \`${i.terminal.kind}\` for logical test block`,
+ description: null,
+ loc: i.terminal.loc,
+ suggestions: null,
+ });
+ let r = this.visitValueBlock(i.terminal.consequent, t.loc),
+ a = {
+ kind: 'SequenceExpression',
+ instructions: [
+ {id: n.id, loc: t.loc, lvalue: n.place, value: n.value},
+ ],
+ id: r.id,
+ value: r.value,
+ loc: t.loc,
+ },
+ o = this.visitValueBlock(i.terminal.alternate, t.loc),
+ s = {
+ kind: 'LogicalExpression',
+ operator: t.operator,
+ left: a,
+ right: o.value,
+ loc: t.loc,
+ };
+ return {
+ place: Object.assign({}, r.place),
+ value: s,
+ fallthrough: t.fallthrough,
+ id: t.id,
+ };
+ }
+ case 'ternary': {
+ let n = this.visitValueBlock(t.test, t.loc),
+ i = this.cx.ir.blocks.get(n.block);
+ i.terminal.kind !== 'branch' &&
+ D.throwTodo({
+ reason: `Unexpected terminal kind \`${i.terminal.kind}\` for ternary test block`,
+ description: null,
+ loc: i.terminal.loc,
+ suggestions: null,
+ });
+ let r = this.visitValueBlock(i.terminal.consequent, t.loc),
+ a = this.visitValueBlock(i.terminal.alternate, t.loc),
+ o = {
+ kind: 'ConditionalExpression',
+ test: n.value,
+ consequent: r.value,
+ alternate: a.value,
+ loc: t.loc,
+ };
+ return {
+ place: Object.assign({}, r.place),
+ value: o,
+ fallthrough: t.fallthrough,
+ id: t.id,
+ };
+ }
+ case 'maybe-throw':
+ D.throwTodo({
+ reason:
+ 'Support value blocks (conditional, logical, optional chaining, etc) within a try/catch statement',
+ description: null,
+ loc: t.loc,
+ suggestions: null,
+ });
+ case 'label':
+ D.throwTodo({
+ reason:
+ 'Support labeled statements combined with value blocks (conditional, logical, optional chaining, etc)',
+ description: null,
+ loc: t.loc,
+ suggestions: null,
+ });
+ default:
+ D.throwTodo({
+ reason: `Support \`${t.kind}\` as a value block terminal (conditional, logical, optional chaining, etc)`,
+ description: null,
+ loc: t.loc,
+ suggestions: null,
+ });
+ }
+ }
+ emptyBlock() {
+ return [];
+ }
+ visitBreak(t, n, i) {
+ let r = this.cx.getBreakTarget(t);
+ return (
+ r === null &&
+ D.invariant(!1, {
+ reason: 'Expected a break target',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ this.cx.scopeFallthroughs.has(r.block)
+ ? (D.invariant(r.type === 'implicit', {
+ reason:
+ 'Expected reactive scope to implicitly break to fallthrough',
+ description: null,
+ details: [{kind: 'error', loc: i, message: null}],
+ }),
+ null)
+ : {
+ kind: 'terminal',
+ terminal: {
+ kind: 'break',
+ loc: i,
+ target: r.block,
+ id: n,
+ targetKind: r.type,
+ },
+ label: null,
+ }
+ );
+ }
+ visitContinue(t, n, i) {
+ let r = this.cx.getContinueTarget(t);
+ return (
+ D.invariant(r !== null, {
+ reason: `Expected continue target to be scheduled for bb${t}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ {
+ kind: 'terminal',
+ terminal: {
+ kind: 'continue',
+ loc: i,
+ target: r.block,
+ id: n,
+ targetKind: r.type,
+ },
+ label: null,
+ }
+ );
+ }
+ },
+ M4 = class {
+ constructor(t) {
+ Ya.set(this, 0),
+ (this.emitted = new Set()),
+ (this.scopeFallthroughs = new Set()),
+ An.set(this, new Set()),
+ Qp.set(this, new Set()),
+ cr.set(this, []),
+ (this.ir = t);
+ }
+ block(t) {
+ return this.ir.blocks.get(t);
+ }
+ scheduleCatchHandler(t) {
+ j(this, Qp, 'f').add(t);
+ }
+ reachable(t) {
+ return this.ir.blocks.get(t).terminal.kind !== 'unreachable';
+ }
+ schedule(t, n) {
+ var i, r;
+ let a = (at(this, Ya, ((r = j(this, Ya, 'f')), (i = r++), r), 'f'), i);
+ return (
+ D.invariant(!j(this, An, 'f').has(t), {
+ reason: `Break block is already scheduled: bb${t}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ j(this, An, 'f').add(t),
+ j(this, cr, 'f').push({block: t, id: a, type: n}),
+ a
+ );
+ }
+ scheduleLoop(t, n, i) {
+ var r, a;
+ let o = (at(this, Ya, ((a = j(this, Ya, 'f')), (r = a++), a), 'f'), r),
+ s = !j(this, An, 'f').has(t);
+ j(this, An, 'f').add(t),
+ D.invariant(!j(this, An, 'f').has(n), {
+ reason: `Continue block is already scheduled: bb${n}`,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ j(this, An, 'f').add(n);
+ let l = !1;
+ return (
+ i !== null &&
+ ((l = !j(this, An, 'f').has(i)), j(this, An, 'f').add(i)),
+ j(this, cr, 'f').push({
+ block: t,
+ ownsBlock: s,
+ id: o,
+ type: 'loop',
+ continueBlock: n,
+ loopBlock: i,
+ ownsLoop: l,
+ }),
+ o
+ );
+ }
+ unschedule(t) {
+ let n = j(this, cr, 'f').pop();
+ D.invariant(n !== void 0 && n.id === t, {
+ reason: 'Can only unschedule the last target',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ (n.type !== 'loop' || n.ownsBlock !== null) &&
+ j(this, An, 'f').delete(n.block),
+ n.type === 'loop' &&
+ (j(this, An, 'f').delete(n.continueBlock),
+ n.ownsLoop &&
+ n.loopBlock !== null &&
+ j(this, An, 'f').delete(n.loopBlock));
+ }
+ unscheduleAll(t) {
+ for (let n = t.length - 1; n >= 0; n--) this.unschedule(t[n]);
+ }
+ isScheduled(t) {
+ return j(this, An, 'f').has(t) || j(this, Qp, 'f').has(t);
+ }
+ getBreakTarget(t) {
+ let n = !1;
+ for (let i = j(this, cr, 'f').length - 1; i >= 0; i--) {
+ let r = j(this, cr, 'f')[i];
+ if (r.block === t) {
+ let a;
+ return (
+ r.type === 'loop'
+ ? (a = n ? 'labeled' : 'unlabeled')
+ : i === j(this, cr, 'f').length - 1
+ ? (a = 'implicit')
+ : (a = 'labeled'),
+ {block: r.block, type: a}
+ );
+ }
+ n || (n = r.type === 'loop');
+ }
+ D.invariant(!1, {
+ reason: 'Expected a break target',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ }
+ getContinueTarget(t) {
+ let n = !1;
+ for (let i = j(this, cr, 'f').length - 1; i >= 0; i--) {
+ let r = j(this, cr, 'f')[i];
+ if (r.type == 'loop' && r.continueBlock === t) {
+ let a;
+ return (
+ n
+ ? (a = 'labeled')
+ : i === j(this, cr, 'f').length - 1
+ ? (a = 'implicit')
+ : (a = 'unlabeled'),
+ {block: r.block, type: a}
+ );
+ }
+ n || (n = r.type === 'loop');
+ }
+ return null;
+ }
+ debugBreakTargets() {
+ return j(this, cr, 'f').map((t) => Object.assign({}, t));
+ }
+ };
+ (Ya = new WeakMap()),
+ (An = new WeakMap()),
+ (Qp = new WeakMap()),
+ (cr = new WeakMap());
+ var po;
+ (function (e) {
+ (e[(e.PushHookGuard = 0)] = 'PushHookGuard'),
+ (e[(e.PopHookGuard = 1)] = 'PopHookGuard'),
+ (e[(e.AllowHook = 2)] = 'AllowHook'),
+ (e[(e.DisallowHook = 3)] = 'DisallowHook');
+ })(po || (po = {}));
+ var _a;
+ (function (e) {
+ (e.Transitive = 'Transitive'), (e.Shallow = 'Shallow');
+ })(_a || (_a = {}));
+ var ku = {level: _a.Shallow, properties: null},
+ N4 = {level: _a.Transitive, properties: null},
+ ao = {level: _a.Transitive, properties: new Map([['*', ku]])};
+ ao.properties.set('enum', ao);
+ function R4(e) {
+ var t;
+ let n = new Map([
+ ...Array.from(L4.entries()),
+ ...((t = e.env.config.customMacros) !== null && t !== void 0
+ ? t
+ : []
+ ).map((a) => [a, N4]),
+ ]),
+ i = z4(e, n);
+ return B4(e, i, n);
+ }
+ var L4 = new Map([
+ ['fbt', ao],
+ ['fbt:param', ku],
+ ['fbt:enum', ao],
+ ['fbt:plural', ku],
+ ['fbs', ao],
+ ['fbs:param', ku],
+ ['fbs:enum', ao],
+ ['fbs:plural', ku],
+ ]),
+ F4 = new Set(['fbt:param', 'fbs:param']);
+ function z4(e, t) {
+ var n;
+ let i = new Map();
+ for (let r of e.body.blocks.values())
+ for (let a of r.instructions) {
+ let {lvalue: o, value: s} = a;
+ switch (s.kind) {
+ case 'Primitive': {
+ if (typeof s.value == 'string') {
+ let l = t.get(s.value);
+ l != null && i.set(o.identifier.id, l);
+ }
+ break;
+ }
+ case 'LoadGlobal': {
+ let l = t.get(s.binding.name);
+ l != null && i.set(o.identifier.id, l);
+ break;
+ }
+ case 'PropertyLoad': {
+ if (typeof s.property == 'string') {
+ let l = i.get(s.object.identifier.id);
+ if (l != null) {
+ let d =
+ l.properties != null
+ ? (n = l.properties.get(s.property)) !== null &&
+ n !== void 0
+ ? n
+ : l.properties.get('*')
+ : null,
+ u = d ?? l;
+ i.set(o.identifier.id, u);
+ }
+ }
+ break;
+ }
+ }
+ }
+ return i;
+ }
+ function B4(e, t, n) {
+ var i;
+ let r = new Set(t.keys());
+ for (let a of Array.from(e.body.blocks.values()).reverse()) {
+ for (let o = a.instructions.length - 1; o >= 0; o--) {
+ let s = a.instructions[o],
+ {lvalue: l, value: d} = s;
+ switch (d.kind) {
+ case 'DeclareContext':
+ case 'DeclareLocal':
+ case 'Destructure':
+ case 'LoadContext':
+ case 'LoadLocal':
+ case 'PostfixUpdate':
+ case 'PrefixUpdate':
+ case 'StoreContext':
+ case 'StoreLocal':
+ break;
+ case 'CallExpression':
+ case 'MethodCall': {
+ let u = l.identifier.scope;
+ if (u == null) continue;
+ let p = d.kind === 'CallExpression' ? d.callee : d.property,
+ y =
+ (i = t.get(p.identifier.id)) !== null && i !== void 0
+ ? i
+ : t.get(l.identifier.id);
+ y != null && Fg(y, u, l, d, r, t);
+ break;
+ }
+ case 'JsxExpression': {
+ let u = l.identifier.scope;
+ if (u == null) continue;
+ let p;
+ d.tag.kind === 'Identifier'
+ ? (p = t.get(d.tag.identifier.id))
+ : (p = n.get(d.tag.name)),
+ p ?? (p = t.get(l.identifier.id)),
+ p != null && Fg(p, u, l, d, r, t);
+ break;
+ }
+ default: {
+ let u = l.identifier.scope;
+ if (u == null) continue;
+ let p = t.get(l.identifier.id);
+ p != null && Fg(p, u, l, d, r, t);
+ break;
+ }
+ }
+ }
+ for (let o of a.phis) {
+ let s = o.place.identifier.scope;
+ if (s == null) continue;
+ let l = t.get(o.place.identifier.id);
+ if (!(l == null || l.level === _a.Shallow)) {
+ r.add(o.place.identifier.id);
+ for (let d of o.operands.values())
+ (d.identifier.scope = s),
+ rP(s.range, d.identifier.mutableRange),
+ t.set(d.identifier.id, l),
+ r.add(d.identifier.id);
+ }
+ }
+ }
+ return r;
+ }
+ function rP(e, t) {
+ t.start !== 0 && (e.start = V(Math.min(e.start, t.start)));
+ }
+ function Fg(e, t, n, i, r, a) {
+ r.add(n.identifier.id);
+ for (let o of Ot(i))
+ e.level === _a.Transitive &&
+ ((o.identifier.scope = t),
+ rP(t.range, o.identifier.mutableRange),
+ a.set(o.identifier.id, e)),
+ r.add(o.identifier.id);
+ }
+ var em,
+ tm,
+ iP = 'react.memo_cache_sentinel',
+ aP = 'react.early_return_sentinel';
+ function U4(e, {uniqueIdentifiers: t, fbtOperands: n}) {
+ var i, r, a;
+ let o = new Cm(
+ e.env,
+ (i = e.id) !== null && i !== void 0 ? i : '[[ anonymous ]]',
+ t,
+ n,
+ null
+ ),
+ s = null;
+ if (
+ e.env.config.enableResetCacheOnSourceFileChanges &&
+ e.env.code !== null
+ ) {
+ let g = SF.createHmac('sha256', e.env.code).digest('hex');
+ s = {cacheIndex: o.nextCacheIndex, hash: g};
+ }
+ let l = jm(o, e);
+ if (l.isErr()) return l;
+ let d = l.unwrap(),
+ u = e.env.config.enableEmitHookGuards;
+ u != null &&
+ e.env.isInferredMemoEnabled &&
+ (d.body = $.blockStatement([
+ cP(
+ u,
+ e.env.programContext,
+ d.body.body,
+ po.PushHookGuard,
+ po.PopHookGuard
+ ),
+ ]));
+ let p = d.memoSlotsUsed;
+ if (p !== 0) {
+ let g = [],
+ S = e.env.programContext.addMemoCacheImport().name;
+ if (
+ (g.push(
+ $.variableDeclaration('const', [
+ $.variableDeclarator(
+ $.identifier(o.synthesizeName('$')),
+ $.callExpression($.identifier(S), [$.numericLiteral(p)])
+ ),
+ ])
+ ),
+ s !== null)
+ ) {
+ let _ = o.synthesizeName('$i');
+ g.push(
+ $.ifStatement(
+ $.binaryExpression(
+ '!==',
+ $.memberExpression(
+ $.identifier(o.synthesizeName('$')),
+ $.numericLiteral(s.cacheIndex),
+ !0
+ ),
+ $.stringLiteral(s.hash)
+ ),
+ $.blockStatement([
+ $.forStatement(
+ $.variableDeclaration('let', [
+ $.variableDeclarator($.identifier(_), $.numericLiteral(0)),
+ ]),
+ $.binaryExpression('<', $.identifier(_), $.numericLiteral(p)),
+ $.assignmentExpression(
+ '+=',
+ $.identifier(_),
+ $.numericLiteral(1)
+ ),
+ $.blockStatement([
+ $.expressionStatement(
+ $.assignmentExpression(
+ '=',
+ $.memberExpression(
+ $.identifier(o.synthesizeName('$')),
+ $.identifier(_),
+ !0
+ ),
+ $.callExpression(
+ $.memberExpression(
+ $.identifier('Symbol'),
+ $.identifier('for')
+ ),
+ [$.stringLiteral(iP)]
+ )
+ )
+ ),
+ ])
+ ),
+ $.expressionStatement(
+ $.assignmentExpression(
+ '=',
+ $.memberExpression(
+ $.identifier(o.synthesizeName('$')),
+ $.numericLiteral(s.cacheIndex),
+ !0
+ ),
+ $.stringLiteral(s.hash)
+ )
+ ),
+ ])
+ )
+ );
+ }
+ d.body.body.unshift(...g);
+ }
+ let y = e.env.config.enableEmitInstrumentForget;
+ if (y != null && e.id != null && e.env.isInferredMemoEnabled) {
+ let g =
+ y.gating != null
+ ? $.identifier(
+ e.env.programContext.addImportSpecifier(y.gating).name
+ )
+ : null,
+ S = y.globalGating != null ? $.identifier(y.globalGating) : null;
+ if (y.globalGating != null) {
+ let M = e.env.programContext.assertGlobalBinding(y.globalGating);
+ if (M.isErr()) return M;
+ }
+ let _;
+ g != null && S != null
+ ? (_ = $.logicalExpression('&&', S, g))
+ : g != null
+ ? (_ = g)
+ : (D.invariant(S != null, {
+ reason:
+ 'Bad config not caught! Expected at least one of gating or globalGating',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ (_ = S));
+ let O = e.env.programContext.addImportSpecifier(y.fn).name,
+ P = $.ifStatement(
+ _,
+ $.expressionStatement(
+ $.callExpression($.identifier(O), [
+ $.stringLiteral(e.id),
+ $.stringLiteral(
+ (r = e.env.filename) !== null && r !== void 0 ? r : ''
+ ),
+ ])
+ )
+ );
+ d.body.body.unshift(P);
+ }
+ let m = [];
+ for (let {fn: g, type: S} of o.env.getOutlinedFunctions()) {
+ let _ = $m(g);
+ Mm(_), Am(_), Mh(_);
+ let O = hP(_),
+ P = jm(
+ new Cm(
+ o.env,
+ (a = _.id) !== null && a !== void 0 ? a : '[[ anonymous ]]',
+ O,
+ o.fbtOperands
+ ),
+ _
+ );
+ if (P.isErr()) return P;
+ m.push({fn: P.unwrap(), type: S});
+ }
+ return (d.outlined = m), l;
+ }
+ function jm(e, t) {
+ for (let o of t.params) {
+ let s = o.kind === 'Identifier' ? o : o.place;
+ e.temp.set(s.identifier.declarationId, null), e.declare(s.identifier);
+ }
+ let n = t.params.map((o) => Z4(o)),
+ i = Mn(e, t.body);
+ i.directives = t.directives.map((o) => $.directive($.directiveLiteral(o)));
+ let r = i.body;
+ if (r.length !== 0) {
+ let o = r[r.length - 1];
+ o.type === 'ReturnStatement' && o.argument == null && r.pop();
+ }
+ if (e.errors.hasAnyErrors()) return gr(e.errors);
+ let a = new bv(t.env);
+ return (
+ At(t, a, void 0),
+ zn({
+ type: 'CodegenFunction',
+ loc: t.loc,
+ id: t.id !== null ? $.identifier(t.id) : null,
+ nameHint: t.nameHint,
+ params: n,
+ body: i,
+ generator: t.generator,
+ async: t.async,
+ memoSlotsUsed: e.nextCacheIndex,
+ memoBlocks: a.memoBlocks,
+ memoValues: a.memoValues,
+ prunedMemoBlocks: a.prunedMemoBlocks,
+ prunedMemoValues: a.prunedMemoValues,
+ outlined: [],
+ hasFireRewrite: t.env.hasFireRewrite,
+ hasInferredEffect: t.env.hasInferredEffect,
+ inferredEffectLocations: t.env.inferredEffectLocations,
+ })
+ );
+ }
+ var bv = class extends Qt {
+ constructor(t) {
+ super(),
+ (this.memoBlocks = 0),
+ (this.memoValues = 0),
+ (this.prunedMemoBlocks = 0),
+ (this.prunedMemoValues = 0),
+ (this.env = t);
+ }
+ visitScope(t, n) {
+ (this.memoBlocks += 1),
+ (this.memoValues += t.scope.declarations.size),
+ this.traverseScope(t, n);
+ }
+ visitPrunedScope(t, n) {
+ (this.prunedMemoBlocks += 1),
+ (this.prunedMemoValues += t.scope.declarations.size),
+ this.traversePrunedScope(t, n);
+ }
+ };
+ function Z4(e) {
+ return e.kind === 'Identifier'
+ ? hr(e.identifier)
+ : $.restElement(hr(e.place.identifier));
+ }
+ var Cm = class {
+ constructor(t, n, i, r, a = null) {
+ em.set(this, 0),
+ tm.set(this, new Set()),
+ (this.errors = new D()),
+ (this.objectMethods = new Map()),
+ (this.synthesizedNames = new Map()),
+ (this.env = t),
+ (this.fnName = n),
+ (this.uniqueIdentifiers = i),
+ (this.fbtOperands = r),
+ (this.temp = a !== null ? new Map(a) : new Map());
+ }
+ get nextCacheIndex() {
+ var t, n;
+ return at(this, em, ((n = j(this, em, 'f')), (t = n++), n), 'f'), t;
+ }
+ declare(t) {
+ j(this, tm, 'f').add(t.declarationId);
+ }
+ hasDeclared(t) {
+ return j(this, tm, 'f').has(t.declarationId);
+ }
+ synthesizeName(t) {
+ let n = this.synthesizedNames.get(t);
+ if (n !== void 0) return n;
+ let i = uo(t).value,
+ r = 0;
+ for (; this.uniqueIdentifiers.has(i); ) i = uo(`${t}${r++}`).value;
+ return this.uniqueIdentifiers.add(i), this.synthesizedNames.set(t, i), i;
+ }
+ };
+ (em = new WeakMap()), (tm = new WeakMap());
+ function Mn(e, t) {
+ let n = new Map(e.temp),
+ i = Dh(e, t);
+ for (let [r, a] of e.temp)
+ n.has(r) &&
+ D.invariant(n.get(r) === a, {
+ reason: 'Expected temporary value to be unchanged',
+ description: null,
+ suggestions: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ });
+ return (e.temp = n), i;
+ }
+ function Dh(e, t) {
+ let n = [];
+ for (let i of t)
+ switch (i.kind) {
+ case 'instruction': {
+ let r = V4(e, i.instruction);
+ r !== null && n.push(r);
+ break;
+ }
+ case 'pruned-scope': {
+ let r = Dh(e, i.instructions);
+ n.push(...r.body);
+ break;
+ }
+ case 'scope': {
+ let r = new Map(e.temp);
+ q4(e, n, i.scope, i.instructions), (e.temp = r);
+ break;
+ }
+ case 'terminal': {
+ let r = K4(e, i.terminal);
+ if (r === null) break;
+ if (i.label !== null && !i.label.implicit) {
+ let a =
+ r.type === 'BlockStatement' && r.body.length === 1
+ ? r.body[0]
+ : r;
+ n.push($.labeledStatement($.identifier(kv(i.label.id)), a));
+ } else r.type === 'BlockStatement' ? n.push(...r.body) : n.push(r);
+ break;
+ }
+ default:
+ Me(i, `Unexpected item kind \`${i.kind}\``);
+ }
+ return $.blockStatement(n);
+ }
+ function WE(e, t) {
+ if (e.env.config.enableEmitFreeze != null && e.env.isInferredMemoEnabled) {
+ let n = e.env.programContext.addImportSpecifier(
+ e.env.config.enableEmitFreeze
+ ).name;
+ return (
+ e.env.programContext.assertGlobalBinding(qE, e.env.scope).unwrap(),
+ $.conditionalExpression(
+ $.identifier(qE),
+ $.callExpression($.identifier(n), [t, $.stringLiteral(e.fnName)]),
+ t
+ )
+ );
+ } else return t;
+ }
+ function q4(e, t, n, i) {
+ let r = [],
+ a = [],
+ o = [],
+ s = [],
+ l = [],
+ d = [];
+ for (let _ of [...n.dependencies].sort(T6)) {
+ let O = e.nextCacheIndex;
+ l.push(H4(_));
+ let P = $.binaryExpression(
+ '!==',
+ $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(O),
+ !0
+ ),
+ GE(e, _)
+ );
+ if (e.env.config.enableChangeVariableCodegen) {
+ let M = $.identifier(e.synthesizeName(`c_${O}`));
+ t.push($.variableDeclaration('const', [$.variableDeclarator(M, P)])),
+ s.push(M);
+ } else s.push(P);
+ r.push(
+ $.expressionStatement(
+ $.assignmentExpression(
+ '=',
+ $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(O),
+ !0
+ ),
+ GE(e, _)
+ )
+ )
+ );
+ }
+ let u = null;
+ for (let [, {identifier: _}] of [...n.declarations].sort(([, O], [, P]) =>
+ E6(O, P)
+ )) {
+ let O = e.nextCacheIndex;
+ u === null && (u = O),
+ D.invariant(_.name != null, {
+ reason: 'Expected scope declaration identifier to be named',
+ description: `Declaration \`${un(_)}\` is unnamed in scope @${n.id}`,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ let P = hr(_);
+ d.push(P.name),
+ e.hasDeclared(_) ||
+ t.push($.variableDeclaration('let', [$.variableDeclarator(P)])),
+ o.push({name: P, index: O, value: WE(e, P)}),
+ e.declare(_);
+ }
+ for (let _ of n.reassignments) {
+ let O = e.nextCacheIndex;
+ u === null && (u = O);
+ let P = hr(_);
+ d.push(P.name), o.push({name: P, index: O, value: WE(e, P)});
+ }
+ let p = s.reduce(
+ (_, O) => (_ == null ? O : $.logicalExpression('||', _, O)),
+ null
+ );
+ p === null &&
+ (D.invariant(u !== null, {
+ reason: 'Expected scope to have at least one declaration',
+ description: `Scope '@${n.id}' has no declarations`,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ (p = $.binaryExpression(
+ '===',
+ $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(u),
+ !0
+ ),
+ $.callExpression(
+ $.memberExpression($.identifier('Symbol'), $.identifier('for')),
+ [$.stringLiteral(iP)]
+ )
+ ))),
+ e.env.config.disableMemoizationForDebugging &&
+ (D.invariant(e.env.config.enableChangeDetectionForDebugging == null, {
+ reason:
+ 'Expected to not have both change detection enabled and memoization disabled',
+ description: 'Incompatible config options',
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ (p = $.logicalExpression('||', p, $.booleanLiteral(!0))));
+ let y = Mn(e, i),
+ m,
+ g = e.env.config.enableChangeDetectionForDebugging;
+ if (g != null && s.length > 0) {
+ let _ =
+ typeof n.loc == 'symbol'
+ ? 'unknown location'
+ : `(${n.loc.start.line}:${n.loc.end.line})`,
+ O = e.env.programContext.addImportSpecifier(g).name,
+ P = [],
+ M = [],
+ w = [];
+ for (let {name: A, index: q, value: ae} of o) {
+ let le = e.synthesizeName(`old$${A.name}`),
+ G = $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(q),
+ !0
+ );
+ r.push($.expressionStatement($.assignmentExpression('=', G, ae))),
+ P.push(
+ $.variableDeclaration('let', [
+ $.variableDeclarator($.identifier(le), G),
+ ])
+ ),
+ M.push(
+ $.expressionStatement(
+ $.callExpression($.identifier(O), [
+ $.identifier(le),
+ $.cloneNode(A, !0),
+ $.stringLiteral(A.name),
+ $.stringLiteral(e.fnName),
+ $.stringLiteral('cached'),
+ $.stringLiteral(_),
+ ])
+ )
+ ),
+ w.push(
+ $.expressionStatement(
+ $.callExpression($.identifier(O), [
+ $.cloneNode(G, !0),
+ $.cloneNode(A, !0),
+ $.stringLiteral(A.name),
+ $.stringLiteral(e.fnName),
+ $.stringLiteral('recomputed'),
+ $.stringLiteral(_),
+ ])
+ )
+ ),
+ w.push($.expressionStatement($.assignmentExpression('=', A, G)));
+ }
+ let I = e.synthesizeName('condition'),
+ U = $.cloneNode(y, !0);
+ m = $.blockStatement([
+ ...y.body,
+ $.variableDeclaration('let', [
+ $.variableDeclarator($.identifier(I), p),
+ ]),
+ $.ifStatement(
+ $.unaryExpression('!', $.identifier(I)),
+ $.blockStatement([...P, ...M])
+ ),
+ ...r,
+ $.ifStatement($.identifier(I), $.blockStatement([...U.body, ...w])),
+ ]);
+ } else {
+ for (let {name: _, index: O, value: P} of o)
+ r.push(
+ $.expressionStatement(
+ $.assignmentExpression(
+ '=',
+ $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(O),
+ !0
+ ),
+ P
+ )
+ )
+ ),
+ a.push(
+ $.expressionStatement(
+ $.assignmentExpression(
+ '=',
+ _,
+ $.memberExpression(
+ $.identifier(e.synthesizeName('$')),
+ $.numericLiteral(O),
+ !0
+ )
+ )
+ )
+ );
+ y.body.push(...r), (m = $.ifStatement(p, y, $.blockStatement(a)));
+ }
+ e.env.config.enableMemoizationComments &&
+ (l.length
+ ? ($.addComment(m, 'leading', ` check if ${zg(l, 'or')} changed`, !0),
+ $.addComment(m, 'leading', ` "useMemo" for ${zg(d, 'and')}:`, !0))
+ : ($.addComment(m, 'leading', ' cache value with no dependencies', !0),
+ $.addComment(m, 'leading', ` "useMemo" for ${zg(d, 'and')}:`, !0)),
+ y.body.length > 0 &&
+ $.addComment(y.body[0], 'leading', ' Inputs changed, recompute', !0),
+ a.length > 0 &&
+ $.addComment(
+ a[0],
+ 'leading',
+ ' Inputs did not change, use cached value',
+ !0
+ )),
+ t.push(m);
+ let S = n.earlyReturnValue;
+ if (S !== null) {
+ D.invariant(S.value.name !== null && S.value.name.kind === 'named', {
+ reason:
+ 'Expected early return value to be promoted to a named variable',
+ description: null,
+ details: [{kind: 'error', loc: S.loc, message: null}],
+ suggestions: null,
+ });
+ let _ = S.value.name.value;
+ t.push(
+ $.ifStatement(
+ $.binaryExpression(
+ '!==',
+ $.identifier(_),
+ $.callExpression(
+ $.memberExpression($.identifier('Symbol'), $.identifier('for')),
+ [$.stringLiteral(aP)]
+ )
+ ),
+ $.blockStatement([$.returnStatement($.identifier(_))])
+ )
+ );
+ }
+ }
+ function K4(e, t) {
+ switch (t.kind) {
+ case 'break':
+ return t.targetKind === 'implicit'
+ ? null
+ : y6(
+ t.loc,
+ t.targetKind === 'labeled' ? $.identifier(kv(t.target)) : null
+ );
+ case 'continue':
+ return t.targetKind === 'implicit'
+ ? null
+ : g6(
+ t.loc,
+ t.targetKind === 'labeled' ? $.identifier(kv(t.target)) : null
+ );
+ case 'for':
+ return t6(
+ t.loc,
+ J4(e, t.init),
+ wn(e, t.test),
+ t.update !== null ? wn(e, t.update) : null,
+ Mn(e, t.loop)
+ );
+ case 'for-in': {
+ D.invariant(t.init.kind === 'SequenceExpression', {
+ reason: 'Expected a sequence expression init for for..in',
+ description: `Got \`${t.init.kind}\` expression instead`,
+ details: [{kind: 'error', loc: t.init.loc, message: null}],
+ suggestions: null,
+ }),
+ t.init.instructions.length !== 2 &&
+ D.throwTodo({
+ reason: 'Support non-trivial for..in inits',
+ description: null,
+ loc: t.init.loc,
+ suggestions: null,
+ });
+ let n = t.init.instructions[0],
+ i = t.init.instructions[1],
+ r;
+ switch (i.value.kind) {
+ case 'StoreLocal': {
+ r = Fn(e, i.value.lvalue.place);
+ break;
+ }
+ case 'Destructure': {
+ r = Fn(e, i.value.lvalue.pattern);
+ break;
+ }
+ case 'StoreContext':
+ D.throwTodo({
+ reason: 'Support non-trivial for..in inits',
+ description: null,
+ loc: t.init.loc,
+ suggestions: null,
+ });
+ default:
+ D.invariant(!1, {
+ reason:
+ 'Expected a StoreLocal or Destructure to be assigned to the collection',
+ description: `Found ${i.value.kind}`,
+ details: [{kind: 'error', loc: i.value.loc, message: null}],
+ suggestions: null,
+ });
+ }
+ let a;
+ switch (i.value.lvalue.kind) {
+ case Q.Const:
+ a = 'const';
+ break;
+ case Q.Let:
+ a = 'let';
+ break;
+ case Q.Reassign:
+ D.invariant(!1, {
+ reason:
+ 'Destructure should never be Reassign as it would be an Object/ArrayPattern',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ suggestions: null,
+ });
+ case Q.Catch:
+ case Q.HoistedConst:
+ case Q.HoistedLet:
+ case Q.HoistedFunction:
+ case Q.Function:
+ D.invariant(!1, {
+ reason: `Unexpected ${i.value.lvalue.kind} variable in for..in collection`,
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(
+ i.value.lvalue.kind,
+ `Unhandled lvalue kind: ${i.value.lvalue.kind}`
+ );
+ }
+ return r6(
+ t.loc,
+ Ru(i.value.loc, a, [$.variableDeclarator(r, null)]),
+ wn(e, n.value),
+ Mn(e, t.loop)
+ );
+ }
+ case 'for-of': {
+ D.invariant(
+ t.init.kind === 'SequenceExpression' &&
+ t.init.instructions.length === 1 &&
+ t.init.instructions[0].value.kind === 'GetIterator',
+ {
+ reason:
+ 'Expected a single-expression sequence expression init for for..of',
+ description: `Got \`${t.init.kind}\` expression instead`,
+ details: [{kind: 'error', loc: t.init.loc, message: null}],
+ suggestions: null,
+ }
+ );
+ let n = t.init.instructions[0].value;
+ D.invariant(t.test.kind === 'SequenceExpression', {
+ reason: 'Expected a sequence expression test for for..of',
+ description: `Got \`${t.init.kind}\` expression instead`,
+ details: [{kind: 'error', loc: t.test.loc, message: null}],
+ suggestions: null,
+ }),
+ t.test.instructions.length !== 2 &&
+ D.throwTodo({
+ reason: 'Support non-trivial for..of inits',
+ description: null,
+ loc: t.init.loc,
+ suggestions: null,
+ });
+ let i = t.test.instructions[1],
+ r;
+ switch (i.value.kind) {
+ case 'StoreLocal': {
+ r = Fn(e, i.value.lvalue.place);
+ break;
+ }
+ case 'Destructure': {
+ r = Fn(e, i.value.lvalue.pattern);
+ break;
+ }
+ case 'StoreContext':
+ D.throwTodo({
+ reason: 'Support non-trivial for..of inits',
+ description: null,
+ loc: t.init.loc,
+ suggestions: null,
+ });
+ default:
+ D.invariant(!1, {
+ reason:
+ 'Expected a StoreLocal or Destructure to be assigned to the collection',
+ description: `Found ${i.value.kind}`,
+ details: [{kind: 'error', loc: i.value.loc, message: null}],
+ suggestions: null,
+ });
+ }
+ let a;
+ switch (i.value.lvalue.kind) {
+ case Q.Const:
+ a = 'const';
+ break;
+ case Q.Let:
+ a = 'let';
+ break;
+ case Q.Reassign:
+ case Q.Catch:
+ case Q.HoistedConst:
+ case Q.HoistedLet:
+ case Q.HoistedFunction:
+ case Q.Function:
+ D.invariant(!1, {
+ reason: `Unexpected ${i.value.lvalue.kind} variable in for..of collection`,
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(
+ i.value.lvalue.kind,
+ `Unhandled lvalue kind: ${i.value.lvalue.kind}`
+ );
+ }
+ return n6(
+ t.loc,
+ Ru(i.value.loc, a, [$.variableDeclarator(r, null)]),
+ wn(e, n),
+ Mn(e, t.loop)
+ );
+ }
+ case 'if': {
+ let n = vt(e, t.test),
+ i = Mn(e, t.consequent),
+ r = null;
+ if (t.alternate !== null) {
+ let a = Mn(e, t.alternate);
+ a.body.length !== 0 && (r = a);
+ }
+ return e6(t.loc, n, i, r);
+ }
+ case 'return': {
+ let n = vt(e, t.value);
+ return n.type === 'Identifier' && n.name === 'undefined'
+ ? $.returnStatement()
+ : $.returnStatement(n);
+ }
+ case 'switch':
+ return Q4(
+ t.loc,
+ vt(e, t.test),
+ t.cases.map((n) => {
+ let i = n.test !== null ? vt(e, n.test) : null,
+ r = Mn(e, n.block);
+ return $.switchCase(i, r.body.length === 0 ? [] : [r]);
+ })
+ );
+ case 'throw':
+ return p6(t.loc, vt(e, t.value));
+ case 'do-while': {
+ let n = wn(e, t.test);
+ return Y4(t.loc, n, Mn(e, t.loop));
+ }
+ case 'while': {
+ let n = wn(e, t.test);
+ return X4(t.loc, n, Mn(e, t.loop));
+ }
+ case 'label':
+ return Mn(e, t.block);
+ case 'try': {
+ let n = null;
+ return (
+ t.handlerBinding !== null &&
+ ((n = hr(t.handlerBinding.identifier)),
+ e.temp.set(t.handlerBinding.identifier.declarationId, null)),
+ m6(t.loc, Mn(e, t.block), $.catchClause(n, Mn(e, t.handler)))
+ );
+ }
+ default:
+ Me(t, `Unexpected terminal kind \`${t.kind}\``);
+ }
+ }
+ function V4(e, t) {
+ if (
+ t.value.kind === 'StoreLocal' ||
+ t.value.kind === 'StoreContext' ||
+ t.value.kind === 'Destructure' ||
+ t.value.kind === 'DeclareLocal' ||
+ t.value.kind === 'DeclareContext'
+ ) {
+ let n = t.value.lvalue.kind,
+ i,
+ r;
+ if (t.value.kind === 'StoreLocal')
+ (n = e.hasDeclared(t.value.lvalue.place.identifier) ? Q.Reassign : n),
+ (i = t.value.lvalue.place),
+ (r = vt(e, t.value.value));
+ else if (t.value.kind === 'StoreContext')
+ (i = t.value.lvalue.place), (r = vt(e, t.value.value));
+ else if (
+ t.value.kind === 'DeclareLocal' ||
+ t.value.kind === 'DeclareContext'
+ ) {
+ if (e.hasDeclared(t.value.lvalue.place.identifier)) return null;
+ (n = t.value.lvalue.kind), (i = t.value.lvalue.place), (r = null);
+ } else {
+ i = t.value.lvalue.pattern;
+ let a = !1,
+ o = !1;
+ for (let s of kr(i)) {
+ n !== Q.Reassign &&
+ s.identifier.name === null &&
+ e.temp.set(s.identifier.declarationId, null);
+ let l = e.hasDeclared(s.identifier);
+ a || (a = l), o || (o = !l);
+ }
+ a && o
+ ? D.invariant(!1, {
+ reason:
+ 'Encountered a destructuring operation where some identifiers are already declared (reassignments) but others are not (declarations)',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ })
+ : a && (n = Q.Reassign),
+ (r = vt(e, t.value.value));
+ }
+ switch (n) {
+ case Q.Const:
+ return (
+ D.invariant(t.lvalue === null, {
+ reason: 'Const declaration cannot be referenced as an expression',
+ description: null,
+ details: [
+ {kind: 'error', loc: t.value.loc, message: `this is ${n}`},
+ ],
+ suggestions: null,
+ }),
+ Ru(t.loc, 'const', [$.variableDeclarator(Fn(e, i), r)])
+ );
+ case Q.Function: {
+ D.invariant(t.lvalue === null, {
+ reason:
+ 'Function declaration cannot be referenced as an expression',
+ description: null,
+ details: [
+ {kind: 'error', loc: t.value.loc, message: `this is ${n}`},
+ ],
+ suggestions: null,
+ });
+ let a = Fn(e, i);
+ return (
+ D.invariant(a.type === 'Identifier', {
+ reason: 'Expected an identifier as a function declaration lvalue',
+ description: null,
+ details: [{kind: 'error', loc: t.value.loc, message: null}],
+ suggestions: null,
+ }),
+ D.invariant(r?.type === 'FunctionExpression', {
+ reason: 'Expected a function as a function declaration value',
+ description: `Got ${r == null ? String(r) : r.type} at ${Vm(t)}`,
+ details: [{kind: 'error', loc: t.value.loc, message: null}],
+ suggestions: null,
+ }),
+ G4(t.loc, a, r.params, r.body, r.generator, r.async)
+ );
+ }
+ case Q.Let:
+ return (
+ D.invariant(t.lvalue === null, {
+ reason: 'Const declaration cannot be referenced as an expression',
+ description: null,
+ details: [
+ {kind: 'error', loc: t.value.loc, message: 'this is const'},
+ ],
+ suggestions: null,
+ }),
+ Ru(t.loc, 'let', [$.variableDeclarator(Fn(e, i), r)])
+ );
+ case Q.Reassign: {
+ D.invariant(r !== null, {
+ reason: 'Expected a value for reassignment',
+ description: null,
+ details: [{kind: 'error', loc: t.value.loc, message: null}],
+ suggestions: null,
+ });
+ let a = $.assignmentExpression('=', Fn(e, i), r);
+ if (t.lvalue !== null) {
+ if (t.value.kind !== 'StoreContext')
+ return e.temp.set(t.lvalue.identifier.declarationId, a), null;
+ {
+ let o = YE(e, t, a);
+ return o.type === 'EmptyStatement' ? null : o;
+ }
+ } else return oP(t.loc, a);
+ }
+ case Q.Catch:
+ return $.emptyStatement();
+ case Q.HoistedLet:
+ case Q.HoistedConst:
+ case Q.HoistedFunction:
+ D.invariant(!1, {
+ reason: `Expected ${n} to have been pruned in PruneHoistedContexts`,
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(n, `Unexpected instruction kind \`${n}\``);
+ }
+ } else {
+ if (t.value.kind === 'StartMemoize' || t.value.kind === 'FinishMemoize')
+ return null;
+ if (t.value.kind === 'Debugger') return $.debuggerStatement();
+ if (t.value.kind === 'ObjectMethod')
+ return (
+ D.invariant(t.lvalue, {
+ reason: 'Expected object methods to have a temp lvalue',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ e.objectMethods.set(t.lvalue.identifier.id, t.value),
+ null
+ );
+ {
+ let n = uP(e, t.value),
+ i = YE(e, t, n);
+ return i.type === 'EmptyStatement' ? null : i;
+ }
+ }
+ }
+ function J4(e, t) {
+ if (t.kind === 'SequenceExpression') {
+ let n = Mn(
+ e,
+ t.instructions.map((a) => ({kind: 'instruction', instruction: a}))
+ ).body,
+ i = [],
+ r = 'const';
+ return (
+ n.forEach((a) => {
+ var o;
+ let s;
+ a.type === 'ExpressionStatement' &&
+ a.expression.type === 'AssignmentExpression' &&
+ a.expression.operator === '=' &&
+ a.expression.left.type === 'Identifier' &&
+ ((o = s = i.at(-1)) === null || o === void 0 ? void 0 : o.id.type) ===
+ 'Identifier' &&
+ s?.id.name === a.expression.left.name &&
+ s?.init == null
+ ? (s.init = a.expression.right)
+ : (D.invariant(
+ a.type === 'VariableDeclaration' &&
+ (a.kind === 'let' || a.kind === 'const'),
+ {
+ reason: 'Expected a variable declaration',
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ description: `Got ${a.type}`,
+ suggestions: null,
+ }
+ ),
+ a.kind === 'let' && (r = 'let'),
+ i.push(...a.declarations));
+ }),
+ D.invariant(i.length > 0, {
+ reason: 'Expected a variable declaration',
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ description: null,
+ suggestions: null,
+ }),
+ $.variableDeclaration(r, i)
+ );
+ } else return wn(e, t);
+ }
+ function H4(e) {
+ let n = hr(e.identifier).name;
+ if (e.path !== null) for (let i of e.path) n += `.${i.property}`;
+ return n;
+ }
+ function zg(e, t) {
+ if (e.length === 2) return e.join(` ${t} `);
+ if (e.length <= 1) return e.join('');
+ let n = [];
+ for (let i = 0; i < e.length; i++) {
+ let r = e[i];
+ i < e.length - 2
+ ? n.push(`${r}, `)
+ : i === e.length - 2
+ ? n.push(`${r}, ${t} `)
+ : n.push(r);
+ }
+ return n.join('');
+ }
+ function GE(e, t) {
+ let n = hr(t.identifier);
+ if (t.path.length !== 0) {
+ let i = t.path.some((r) => r.optional);
+ for (let r of t.path) {
+ let a =
+ typeof r.property == 'string'
+ ? $.identifier(r.property)
+ : $.numericLiteral(r.property),
+ o = typeof r.property != 'string';
+ i
+ ? (n = $.optionalMemberExpression(n, a, o, r.optional))
+ : (n = $.memberExpression(n, a, o));
+ }
+ }
+ return n;
+ }
+ function Zt(e) {
+ return (t, ...n) => {
+ let i = e(...n);
+ return t != null && t != F && (i.loc = t), i;
+ };
+ }
+ var W4 = Zt($.binaryExpression),
+ oP = Zt($.expressionStatement),
+ Ru = Zt($.variableDeclaration),
+ G4 = Zt($.functionDeclaration),
+ X4 = Zt($.whileStatement),
+ Y4 = Zt($.doWhileStatement),
+ Q4 = Zt($.switchStatement),
+ e6 = Zt($.ifStatement),
+ t6 = Zt($.forStatement),
+ n6 = Zt($.forOfStatement),
+ r6 = Zt($.forInStatement),
+ i6 = Zt($.taggedTemplateExpression),
+ a6 = Zt($.logicalExpression),
+ o6 = Zt($.sequenceExpression),
+ s6 = Zt($.conditionalExpression),
+ l6 = Zt($.templateLiteral),
+ sP = Zt($.jsxNamespacedName),
+ c6 = Zt($.jsxElement),
+ u6 = Zt($.jsxAttribute),
+ ba = Zt($.jsxIdentifier),
+ Lu = Zt($.jsxExpressionContainer),
+ lP = Zt($.jsxText),
+ d6 = Zt($.jsxClosingElement),
+ f6 = Zt($.jsxOpeningElement),
+ Ah = Zt($.stringLiteral),
+ p6 = Zt($.throwStatement),
+ m6 = Zt($.tryStatement),
+ y6 = Zt($.breakStatement),
+ g6 = Zt($.continueStatement);
+ function cP(e, t, n, i, r) {
+ let a = t.addImportSpecifier(e).name;
+ function o(s) {
+ return $.expressionStatement(
+ $.callExpression($.identifier(a), [$.numericLiteral(s)])
+ );
+ }
+ return $.tryStatement(
+ $.blockStatement([o(i), ...n]),
+ null,
+ $.blockStatement([o(r)])
+ );
+ }
+ function XE(e, t, n, i, r) {
+ let a = $.callExpression(t, n);
+ i != null && i != F && (a.loc = i);
+ let o = e.config.enableEmitHookGuards;
+ if (o != null && r && e.isInferredMemoEnabled) {
+ let s = $.functionExpression(
+ null,
+ [],
+ $.blockStatement([
+ cP(
+ o,
+ e.programContext,
+ [$.returnStatement(a)],
+ po.AllowHook,
+ po.DisallowHook
+ ),
+ ])
+ );
+ return $.callExpression(s, []);
+ } else return a;
+ }
+ function kv(e) {
+ return `bb${e}`;
+ }
+ function YE(e, t, n) {
+ if ($.isStatement(n)) return n;
+ if (t.lvalue === null) return $.expressionStatement(Dm(n));
+ if (t.lvalue.identifier.name === null)
+ return (
+ e.temp.set(t.lvalue.identifier.declarationId, n), $.emptyStatement()
+ );
+ {
+ let i = Dm(n);
+ return e.hasDeclared(t.lvalue.identifier)
+ ? oP(t.loc, $.assignmentExpression('=', hr(t.lvalue.identifier), i))
+ : Ru(t.loc, 'const', [
+ $.variableDeclarator(hr(t.lvalue.identifier), i),
+ ]);
+ }
+ }
+ function Dm(e) {
+ return e.type === 'JSXText' ? Ah(e.loc, e.value) : e;
+ }
+ function wn(e, t) {
+ let n = uP(e, t);
+ return Dm(n);
+ }
+ function uP(e, t) {
+ var n, i, r, a, o, s, l;
+ let d;
+ switch (t.kind) {
+ case 'ArrayExpression': {
+ let u = t.elements.map((p) =>
+ p.kind === 'Identifier'
+ ? vt(e, p)
+ : p.kind === 'Spread'
+ ? $.spreadElement(vt(e, p.place))
+ : null
+ );
+ d = $.arrayExpression(u);
+ break;
+ }
+ case 'BinaryExpression': {
+ let u = vt(e, t.left),
+ p = vt(e, t.right);
+ d = W4(t.loc, t.operator, u, p);
+ break;
+ }
+ case 'UnaryExpression': {
+ d = $.unaryExpression(t.operator, vt(e, t.value));
+ break;
+ }
+ case 'Primitive': {
+ d = _6(e, t.loc, t.value);
+ break;
+ }
+ case 'CallExpression': {
+ if (e.env.config.enableForest) {
+ let m = vt(e, t.callee),
+ g = t.args.map((S) => Dp(e, S));
+ (d = $.callExpression(m, g)),
+ t.typeArguments != null &&
+ (d.typeArguments = $.typeParameterInstantiation(t.typeArguments));
+ break;
+ }
+ let u = Qn(e.env, t.callee.identifier) != null,
+ p = vt(e, t.callee),
+ y = t.args.map((m) => Dp(e, m));
+ d = XE(e.env, p, y, t.loc, u);
+ break;
+ }
+ case 'OptionalExpression': {
+ let u = wn(e, t.value);
+ switch (u.type) {
+ case 'OptionalCallExpression':
+ case 'CallExpression': {
+ D.invariant($.isExpression(u.callee), {
+ reason: 'v8 intrinsics are validated during lowering',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (n = u.callee.loc) !== null && n !== void 0 ? n : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ (d = $.optionalCallExpression(u.callee, u.arguments, t.optional));
+ break;
+ }
+ case 'OptionalMemberExpression':
+ case 'MemberExpression': {
+ let p = u.property;
+ D.invariant($.isExpression(p), {
+ reason: 'Private names are validated during lowering',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = p.loc) !== null && i !== void 0 ? i : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ (d = $.optionalMemberExpression(
+ u.object,
+ p,
+ u.computed,
+ t.optional
+ ));
+ break;
+ }
+ default:
+ D.invariant(!1, {
+ reason:
+ 'Expected an optional value to resolve to a call expression or member expression',
+ description: `Got a \`${u.type}\``,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ });
+ }
+ break;
+ }
+ case 'MethodCall': {
+ let u = Qn(e.env, t.property.identifier) != null,
+ p = vt(e, t.property);
+ D.invariant(
+ $.isMemberExpression(p) || $.isOptionalMemberExpression(p),
+ {
+ reason:
+ '[Codegen] Internal error: MethodCall::property must be an unpromoted + unmemoized MemberExpression',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (r = p.loc) !== null && r !== void 0 ? r : null,
+ message: `Got: '${p.type}'`,
+ },
+ ],
+ suggestions: null,
+ }
+ ),
+ D.invariant($.isNodesEquivalent(p.object, vt(e, t.receiver)), {
+ reason:
+ '[Codegen] Internal error: Forget should always generate MethodCall::property as a MemberExpression of MethodCall::receiver',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (a = p.loc) !== null && a !== void 0 ? a : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let y = t.args.map((m) => Dp(e, m));
+ d = XE(e.env, p, y, t.loc, u);
+ break;
+ }
+ case 'NewExpression': {
+ let u = vt(e, t.callee),
+ p = t.args.map((y) => Dp(e, y));
+ d = $.newExpression(u, p);
+ break;
+ }
+ case 'ObjectExpression': {
+ let u = [];
+ for (let p of t.properties)
+ if (p.kind === 'ObjectProperty') {
+ let y = fP(e, p.key);
+ switch (p.type) {
+ case 'property': {
+ let m = vt(e, p.place);
+ u.push(
+ $.objectProperty(
+ y,
+ m,
+ p.key.kind === 'computed',
+ y.type === 'Identifier' &&
+ m.type === 'Identifier' &&
+ m.name === y.name
+ )
+ );
+ break;
+ }
+ case 'method': {
+ let m = e.objectMethods.get(p.place.identifier.id);
+ D.invariant(m, {
+ reason: 'Expected ObjectMethod instruction',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ let g = m.loweredFunc,
+ S = $m(g.func);
+ Mm(S), Am(S);
+ let _ = jm(
+ new Cm(
+ e.env,
+ (o = S.id) !== null && o !== void 0
+ ? o
+ : '[[ anonymous ]]',
+ e.uniqueIdentifiers,
+ e.fbtOperands,
+ e.temp
+ ),
+ S
+ ).unwrap(),
+ O = $.objectMethod('method', y, _.params, _.body, !1);
+ (O.async = _.async), (O.generator = _.generator), u.push(O);
+ break;
+ }
+ default:
+ Me(p.type, `Unexpected property type: ${p.type}`);
+ }
+ } else u.push($.spreadElement(vt(e, p.place)));
+ d = $.objectExpression(u);
+ break;
+ }
+ case 'JSXText': {
+ d = lP(t.loc, t.value);
+ break;
+ }
+ case 'JsxExpression': {
+ let u = [];
+ for (let g of t.props) u.push(h6(e, g));
+ let p =
+ t.tag.kind === 'Identifier'
+ ? vt(e, t.tag)
+ : $.stringLiteral(t.tag.name),
+ y;
+ if (p.type === 'Identifier') y = ba(t.tag.loc, p.name);
+ else if (p.type === 'MemberExpression') y = dP(p);
+ else if (
+ (D.invariant(p.type === 'StringLiteral', {
+ reason: `Expected JSX tag to be an identifier or string, got \`${p.type}\``,
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (s = p.loc) !== null && s !== void 0 ? s : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ }),
+ p.value.indexOf(':') >= 0)
+ ) {
+ let [g, S] = p.value.split(':', 2);
+ y = sP(t.tag.loc, ba(t.tag.loc, g), ba(t.tag.loc, S));
+ } else y = ba(t.loc, p.value);
+ let m;
+ p.type === 'StringLiteral' && F4.has(p.value)
+ ? (D.invariant(t.children != null, {
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ reason: 'Expected fbt element to have children',
+ suggestions: null,
+ description: null,
+ }),
+ (m = t.children.map((g) => k6(e, g))))
+ : (m = t.children !== null ? t.children.map((g) => QE(e, g)) : []),
+ (d = c6(
+ t.loc,
+ f6(t.openingLoc, y, u, t.children === null),
+ t.children !== null ? d6(t.closingLoc, y) : null,
+ m,
+ t.children === null
+ ));
+ break;
+ }
+ case 'JsxFragment': {
+ d = $.jsxFragment(
+ $.jsxOpeningFragment(),
+ $.jsxClosingFragment(),
+ t.children.map((u) => QE(e, u))
+ );
+ break;
+ }
+ case 'UnsupportedNode': {
+ let u = t.node;
+ if (!$.isExpression(u)) return u;
+ d = u;
+ break;
+ }
+ case 'PropertyStore':
+ case 'PropertyLoad':
+ case 'PropertyDelete': {
+ let u;
+ typeof t.property == 'string'
+ ? (u = $.memberExpression(vt(e, t.object), $.identifier(t.property)))
+ : (u = $.memberExpression(
+ vt(e, t.object),
+ $.numericLiteral(t.property),
+ !0
+ )),
+ t.kind === 'PropertyStore'
+ ? (d = $.assignmentExpression('=', u, vt(e, t.value)))
+ : t.kind === 'PropertyLoad'
+ ? (d = u)
+ : (d = $.unaryExpression('delete', u));
+ break;
+ }
+ case 'ComputedStore': {
+ d = $.assignmentExpression(
+ '=',
+ $.memberExpression(vt(e, t.object), vt(e, t.property), !0),
+ vt(e, t.value)
+ );
+ break;
+ }
+ case 'ComputedLoad': {
+ let u = vt(e, t.object),
+ p = vt(e, t.property);
+ d = $.memberExpression(u, p, !0);
+ break;
+ }
+ case 'ComputedDelete': {
+ d = $.unaryExpression(
+ 'delete',
+ $.memberExpression(vt(e, t.object), vt(e, t.property), !0)
+ );
+ break;
+ }
+ case 'LoadLocal':
+ case 'LoadContext': {
+ d = vt(e, t.place);
+ break;
+ }
+ case 'FunctionExpression': {
+ let u = t.loweredFunc.func,
+ p = $m(u);
+ Mm(p), Am(p), Mh(p);
+ let y = jm(
+ new Cm(
+ e.env,
+ (l = p.id) !== null && l !== void 0 ? l : '[[ anonymous ]]',
+ e.uniqueIdentifiers,
+ e.fbtOperands,
+ e.temp
+ ),
+ p
+ ).unwrap();
+ if (t.type === 'ArrowFunctionExpression') {
+ let m = y.body;
+ if (m.body.length === 1 && u.directives.length == 0) {
+ let g = m.body[0];
+ g.type === 'ReturnStatement' &&
+ g.argument != null &&
+ (m = g.argument);
+ }
+ d = $.arrowFunctionExpression(y.params, m, y.async);
+ } else
+ d = $.functionExpression(
+ t.name != null ? $.identifier(t.name) : null,
+ y.params,
+ y.body,
+ y.generator,
+ y.async
+ );
+ if (
+ e.env.config.enableNameAnonymousFunctions &&
+ t.name == null &&
+ t.nameHint != null
+ ) {
+ let m = t.nameHint;
+ d = $.memberExpression(
+ $.objectExpression([$.objectProperty($.stringLiteral(m), d)]),
+ $.stringLiteral(m),
+ !0,
+ !1
+ );
+ }
+ break;
+ }
+ case 'TaggedTemplateExpression': {
+ d = i6(
+ t.loc,
+ vt(e, t.tag),
+ $.templateLiteral([$.templateElement(t.value)], [])
+ );
+ break;
+ }
+ case 'TypeCastExpression': {
+ $.isTSType(t.typeAnnotation)
+ ? t.typeAnnotationKind === 'satisfies'
+ ? (d = $.tsSatisfiesExpression(vt(e, t.value), t.typeAnnotation))
+ : (d = $.tsAsExpression(vt(e, t.value), t.typeAnnotation))
+ : (d = $.typeCastExpression(
+ vt(e, t.value),
+ $.typeAnnotation(t.typeAnnotation)
+ ));
+ break;
+ }
+ case 'LogicalExpression': {
+ d = a6(t.loc, t.operator, wn(e, t.left), wn(e, t.right));
+ break;
+ }
+ case 'ConditionalExpression': {
+ d = s6(t.loc, wn(e, t.test), wn(e, t.consequent), wn(e, t.alternate));
+ break;
+ }
+ case 'SequenceExpression': {
+ let p = Dh(
+ e,
+ t.instructions.map((y) => ({kind: 'instruction', instruction: y}))
+ ).body.map((y) => {
+ var m, g;
+ if (y.type === 'ExpressionStatement') return y.expression;
+ if ($.isVariableDeclaration(y)) {
+ let S = y.declarations[0];
+ return (
+ e.errors.push({
+ reason: `(CodegenReactiveFunction::codegenInstructionValue) Cannot declare variables in a value block, tried to declare '${S.id.name}'`,
+ category: K.Todo,
+ loc: (m = S.loc) !== null && m !== void 0 ? m : null,
+ suggestions: null,
+ }),
+ $.stringLiteral(`TODO handle ${S.id}`)
+ );
+ } else
+ return (
+ e.errors.push({
+ reason: `(CodegenReactiveFunction::codegenInstructionValue) Handle conversion of ${y.type} to expression`,
+ category: K.Todo,
+ loc: (g = y.loc) !== null && g !== void 0 ? g : null,
+ suggestions: null,
+ }),
+ $.stringLiteral(`TODO handle ${y.type}`)
+ );
+ });
+ p.length === 0
+ ? (d = wn(e, t.value))
+ : (d = o6(t.loc, [...p, wn(e, t.value)]));
+ break;
+ }
+ case 'TemplateLiteral': {
+ d = l6(
+ t.loc,
+ t.quasis.map((u) => $.templateElement(u)),
+ t.subexprs.map((u) => vt(e, u))
+ );
+ break;
+ }
+ case 'LoadGlobal': {
+ d = $.identifier(t.binding.name);
+ break;
+ }
+ case 'RegExpLiteral': {
+ d = $.regExpLiteral(t.pattern, t.flags);
+ break;
+ }
+ case 'MetaProperty': {
+ d = $.metaProperty($.identifier(t.meta), $.identifier(t.property));
+ break;
+ }
+ case 'Await': {
+ d = $.awaitExpression(vt(e, t.value));
+ break;
+ }
+ case 'GetIterator': {
+ d = vt(e, t.collection);
+ break;
+ }
+ case 'IteratorNext': {
+ d = vt(e, t.iterator);
+ break;
+ }
+ case 'NextPropertyOf': {
+ d = vt(e, t.value);
+ break;
+ }
+ case 'PostfixUpdate': {
+ d = $.updateExpression(t.operation, vt(e, t.lvalue), !1);
+ break;
+ }
+ case 'PrefixUpdate': {
+ d = $.updateExpression(t.operation, vt(e, t.lvalue), !0);
+ break;
+ }
+ case 'StoreLocal': {
+ D.invariant(t.lvalue.kind === Q.Reassign, {
+ reason: 'Unexpected StoreLocal in codegenInstructionValue',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ }),
+ (d = $.assignmentExpression(
+ '=',
+ Fn(e, t.lvalue.place),
+ vt(e, t.value)
+ ));
+ break;
+ }
+ case 'StoreGlobal': {
+ d = $.assignmentExpression('=', $.identifier(t.name), vt(e, t.value));
+ break;
+ }
+ case 'StartMemoize':
+ case 'FinishMemoize':
+ case 'Debugger':
+ case 'DeclareLocal':
+ case 'DeclareContext':
+ case 'Destructure':
+ case 'ObjectMethod':
+ case 'StoreContext':
+ D.invariant(!1, {
+ reason: `Unexpected ${t.kind} in codegenInstructionValue`,
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(t, `Unexpected instruction value kind \`${t.kind}\``);
+ }
+ return t.loc != null && t.loc != F && (d.loc = t.loc), d;
+ }
+ var v6 =
+ /[\u{0000}-\u{001F}\u{007F}\u{0080}-\u{FFFF}\u{010000}-\u{10FFFF}]|"|\\/u;
+ function h6(e, t) {
+ switch (t.kind) {
+ case 'JsxAttribute': {
+ let n;
+ if (t.name.indexOf(':') === -1) n = ba(t.place.loc, t.name);
+ else {
+ let [a, o] = t.name.split(':', 2);
+ n = sP(t.place.loc, ba(t.place.loc, a), ba(t.place.loc, o));
+ }
+ let i = vt(e, t.place),
+ r;
+ switch (i.type) {
+ case 'StringLiteral': {
+ (r = i),
+ v6.test(r.value) &&
+ !e.fbtOperands.has(t.place.identifier.id) &&
+ (r = Lu(r.loc, r));
+ break;
+ }
+ default: {
+ r = Lu(t.place.loc, i);
+ break;
+ }
+ }
+ return u6(t.place.loc, n, r);
+ }
+ case 'JsxSpreadAttribute':
+ return $.jsxSpreadAttribute(vt(e, t.argument));
+ default:
+ Me(t, `Unexpected attribute kind \`${t.kind}\``);
+ }
+ }
+ var b6 = /[<>&{}]/;
+ function QE(e, t) {
+ let n = Ym(e, t);
+ switch (n.type) {
+ case 'JSXText':
+ return b6.test(n.value)
+ ? Lu(t.loc, Ah(t.loc, n.value))
+ : lP(t.loc, n.value);
+ case 'JSXElement':
+ case 'JSXFragment':
+ return n;
+ default:
+ return Lu(t.loc, n);
+ }
+ }
+ function k6(e, t) {
+ let n = Ym(e, t);
+ switch (n.type) {
+ case 'JSXText':
+ case 'JSXElement':
+ return n;
+ default:
+ return Lu(t.loc, n);
+ }
+ }
+ function dP(e) {
+ var t, n;
+ D.invariant(e.property.type === 'Identifier', {
+ reason: 'Expected JSX member expression property to be a string',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (t = e.loc) !== null && t !== void 0 ? t : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let i = $.jsxIdentifier(e.property.name);
+ if (e.object.type === 'Identifier')
+ return $.jsxMemberExpression($.jsxIdentifier(e.object.name), i);
+ {
+ D.invariant(e.object.type === 'MemberExpression', {
+ reason:
+ 'Expected JSX member expression to be an identifier or nested member expression',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (n = e.object.loc) !== null && n !== void 0 ? n : null,
+ message: null,
+ },
+ ],
+ suggestions: null,
+ });
+ let r = dP(e.object);
+ return $.jsxMemberExpression(r, i);
+ }
+ }
+ function fP(e, t) {
+ switch (t.kind) {
+ case 'string':
+ return $.stringLiteral(t.name);
+ case 'identifier':
+ return $.identifier(t.name);
+ case 'computed': {
+ let n = Ym(e, t.name);
+ return (
+ D.invariant($.isExpression(n), {
+ reason: 'Expected object property key to be an expression',
+ description: null,
+ details: [{kind: 'error', loc: t.name.loc, message: null}],
+ suggestions: null,
+ }),
+ n
+ );
+ }
+ case 'number':
+ return $.numericLiteral(t.name);
+ }
+ }
+ function S6(e, t) {
+ if (!t.items.every((i) => i.kind !== 'Hole')) {
+ let i = $.arrayPattern([]);
+ for (let r of t.items)
+ r.kind === 'Hole' ? i.elements.push(null) : i.elements.push(Fn(e, r));
+ return i;
+ } else
+ return $.arrayPattern(
+ t.items.map((i) => (i.kind === 'Hole' ? null : Fn(e, i)))
+ );
+ }
+ function Fn(e, t) {
+ switch (t.kind) {
+ case 'ArrayPattern':
+ return S6(e, t);
+ case 'ObjectPattern':
+ return $.objectPattern(
+ t.properties.map((n) => {
+ if (n.kind === 'ObjectProperty') {
+ let i = fP(e, n.key),
+ r = Fn(e, n.place);
+ return $.objectProperty(
+ i,
+ r,
+ n.key.kind === 'computed',
+ i.type === 'Identifier' &&
+ r.type === 'Identifier' &&
+ r.name === i.name
+ );
+ } else return $.restElement(Fn(e, n.place));
+ })
+ );
+ case 'Spread':
+ return $.restElement(Fn(e, t.place));
+ case 'Identifier':
+ return hr(t.identifier);
+ default:
+ Me(t, `Unexpected pattern kind \`${t.kind}\``);
+ }
+ }
+ function _6(e, t, n) {
+ if (typeof n == 'number')
+ return n < 0
+ ? $.unaryExpression('-', $.numericLiteral(-n), !1)
+ : $.numericLiteral(n);
+ if (typeof n == 'boolean') return $.booleanLiteral(n);
+ if (typeof n == 'string') return Ah(t, n);
+ if (n === null) return $.nullLiteral();
+ if (n === void 0) return $.identifier('undefined');
+ Me(n, 'Unexpected primitive value kind');
+ }
+ function Dp(e, t) {
+ return t.kind === 'Identifier' ? vt(e, t) : $.spreadElement(vt(e, t.place));
+ }
+ function vt(e, t) {
+ let n = Ym(e, t);
+ return Dm(n);
+ }
+ function Ym(e, t) {
+ let n = e.temp.get(t.identifier.declarationId);
+ if (n != null) return n;
+ D.invariant(t.identifier.name !== null || n !== void 0, {
+ reason: '[Codegen] No value found for temporary',
+ description: `Value for '${_e(t)}' was not set in the codegen context`,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ });
+ let i = hr(t.identifier);
+ return (i.loc = t.loc), i;
+ }
+ function hr(e) {
+ return (
+ D.invariant(e.name !== null && e.name.kind === 'named', {
+ reason:
+ 'Expected temporaries to be promoted to named identifiers in an earlier pass',
+ details: [{kind: 'error', loc: F, message: null}],
+ description: `identifier ${e.id} is unnamed`,
+ suggestions: null,
+ }),
+ $.identifier(e.name.value)
+ );
+ }
+ function T6(e, t) {
+ var n, i;
+ D.invariant(
+ ((n = e.identifier.name) === null || n === void 0 ? void 0 : n.kind) ===
+ 'named' &&
+ ((i = t.identifier.name) === null || i === void 0 ? void 0 : i.kind) ===
+ 'named',
+ {
+ reason: '[Codegen] Expected named identifier for dependency',
+ description: null,
+ details: [{kind: 'error', loc: e.identifier.loc, message: null}],
+ }
+ );
+ let r = [
+ e.identifier.name.value,
+ ...e.path.map((o) => `${o.optional ? '?' : ''}${o.property}`),
+ ].join('.'),
+ a = [
+ t.identifier.name.value,
+ ...t.path.map((o) => `${o.optional ? '?' : ''}${o.property}`),
+ ].join('.');
+ return r < a ? -1 : r > a ? 1 : 0;
+ }
+ function E6(e, t) {
+ var n, i;
+ D.invariant(
+ ((n = e.identifier.name) === null || n === void 0 ? void 0 : n.kind) ===
+ 'named' &&
+ ((i = t.identifier.name) === null || i === void 0 ? void 0 : i.kind) ===
+ 'named',
+ {
+ reason: '[Codegen] Expected named identifier for declaration',
+ description: null,
+ details: [{kind: 'error', loc: e.identifier.loc, message: null}],
+ }
+ );
+ let r = e.identifier.name.value,
+ a = t.identifier.name.value;
+ return r < a ? -1 : r > a ? 1 : 0;
+ }
+ function I6(e) {
+ let t = new P6(e.env);
+ for (let n of e.params) {
+ let i = n.kind === 'Identifier' ? n : n.place;
+ t.declared.add(i.identifier.declarationId);
+ }
+ At(e, new x6(), t);
+ }
+ var P6 = class {
+ constructor(t) {
+ (this.declared = new Set()), (this.env = t);
+ }
+ },
+ x6 = class extends Ei {
+ visitScope(t, n) {
+ for (let [, i] of t.scope.declarations)
+ n.declared.add(i.identifier.declarationId);
+ this.traverseScope(t, n);
+ }
+ transformInstruction(t, n) {
+ if ((this.visitInstruction(t, n), t.value.kind === 'Destructure')) {
+ let i = w6(n, t, t.value);
+ if (i)
+ return {
+ kind: 'replace-many',
+ value: i.map((r) => ({kind: 'instruction', instruction: r})),
+ };
+ }
+ return {kind: 'keep'};
+ }
+ };
+ function w6(e, t, n) {
+ let i = new Set(),
+ r = !1;
+ for (let s of kr(n.lvalue.pattern)) {
+ let l = e.declared.has(s.identifier.declarationId);
+ l && i.add(s.identifier.id), r || (r = !l);
+ }
+ if (i.size === 0 || !r) return null;
+ let a = [],
+ o = new Map();
+ fI(n.lvalue.pattern, (s) => {
+ if (!i.has(s.identifier.id)) return s;
+ let l = RB(e.env, s);
+ return $n(l.identifier), o.set(s, l), l;
+ }),
+ a.push(t);
+ for (let [s, l] of o)
+ a.push({
+ id: t.id,
+ lvalue: null,
+ value: {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Reassign, place: s},
+ value: l,
+ type: null,
+ loc: n.loc,
+ },
+ loc: t.loc,
+ });
+ return a;
+ }
+ function O6(e) {
+ let t = new Sv();
+ At(e, t, void 0), At(e, new $6(t.lastUsage), null);
+ }
+ var Sv = class extends Qt {
+ constructor() {
+ super(...arguments), (this.lastUsage = new Map());
+ }
+ visitPlace(t, n, i) {
+ let r = this.lastUsage.get(n.identifier.declarationId),
+ a = r !== void 0 ? V(Math.max(r, t)) : t;
+ this.lastUsage.set(n.identifier.declarationId, a);
+ }
+ },
+ $6 = class extends Ei {
+ constructor(t) {
+ super(), (this.temporaries = new Map()), (this.lastUsage = t);
+ }
+ transformScope(t, n) {
+ return (
+ this.visitScope(t, t.scope.dependencies),
+ n !== null && _v(n, t.scope.dependencies)
+ ? {kind: 'replace-many', value: t.instructions}
+ : {kind: 'keep'}
+ );
+ }
+ visitBlock(t, n) {
+ var i;
+ this.traverseBlock(t, n);
+ let r = null,
+ a = [];
+ function o() {
+ D.invariant(r !== null, {
+ reason:
+ 'MergeConsecutiveScopes: expected current scope to be non-null if reset()',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ r.to > r.from + 1 && a.push(r),
+ (r = null);
+ }
+ for (let d = 0; d < t.length; d++) {
+ let u = t[d];
+ switch (u.kind) {
+ case 'terminal': {
+ r !== null && o();
+ break;
+ }
+ case 'pruned-scope': {
+ r !== null && o();
+ break;
+ }
+ case 'instruction': {
+ switch (u.instruction.value.kind) {
+ case 'BinaryExpression':
+ case 'ComputedLoad':
+ case 'JSXText':
+ case 'LoadGlobal':
+ case 'LoadLocal':
+ case 'Primitive':
+ case 'PropertyLoad':
+ case 'TemplateLiteral':
+ case 'UnaryExpression': {
+ r !== null &&
+ u.instruction.lvalue !== null &&
+ (r.lvalues.add(
+ u.instruction.lvalue.identifier.declarationId
+ ),
+ u.instruction.value.kind === 'LoadLocal' &&
+ this.temporaries.set(
+ u.instruction.lvalue.identifier.declarationId,
+ u.instruction.value.place.identifier.declarationId
+ ));
+ break;
+ }
+ case 'StoreLocal': {
+ if (r !== null)
+ if (u.instruction.value.lvalue.kind === Q.Const) {
+ for (let p of rn(u.instruction))
+ r.lvalues.add(p.identifier.declarationId);
+ this.temporaries.set(
+ u.instruction.value.lvalue.place.identifier
+ .declarationId,
+ (i = this.temporaries.get(
+ u.instruction.value.value.identifier.declarationId
+ )) !== null && i !== void 0
+ ? i
+ : u.instruction.value.value.identifier.declarationId
+ );
+ } else o();
+ break;
+ }
+ default:
+ r !== null && o();
+ }
+ break;
+ }
+ case 'scope': {
+ if (
+ r !== null &&
+ D6(r.block, u, this.temporaries) &&
+ C6(u.scope, r.lvalues, this.lastUsage)
+ ) {
+ r.block.scope.range.end = V(
+ Math.max(r.block.scope.range.end, u.scope.range.end)
+ );
+ for (let [p, y] of u.scope.declarations)
+ r.block.scope.declarations.set(p, y);
+ j6(r.block.scope, this.lastUsage),
+ (r.to = d + 1),
+ r.lvalues.clear(),
+ e0(u) || o();
+ } else
+ r !== null && o(),
+ e0(u) &&
+ (r = {block: u, from: d, to: d + 1, lvalues: new Set()});
+ break;
+ }
+ default:
+ Me(u, `Unexpected instruction kind \`${u.kind}\``);
+ }
+ }
+ if ((r !== null && o(), a.length))
+ for (let d of a) Mu(d.block.scope) + ` from=${d.from} to=${d.to}`;
+ if (a.length === 0) return;
+ let s = [],
+ l = 0;
+ for (let d of a) {
+ l < d.from && (s.push(...t.slice(l, d.from)), (l = d.from));
+ let u = t[d.from];
+ for (
+ D.invariant(u.kind === 'scope', {
+ reason:
+ 'MergeConsecutiveScopes: Expected scope starting index to be a scope',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ s.push(u),
+ l++;
+ l < d.to;
+
+ ) {
+ let p = t[l++];
+ p.kind === 'scope'
+ ? (u.instructions.push(...p.instructions),
+ u.scope.merged.add(p.scope.id))
+ : u.instructions.push(p);
+ }
+ }
+ for (; l < t.length; ) s.push(t[l++]);
+ (t.length = 0), t.push(...s);
+ }
+ };
+ function j6(e, t) {
+ for (let [n, i] of e.declarations)
+ t.get(i.identifier.declarationId) < e.range.end &&
+ e.declarations.delete(n);
+ }
+ function C6(e, t, n) {
+ for (let i of t) if (n.get(i) >= e.range.end) return !1;
+ return !0;
+ }
+ function D6(e, t, n) {
+ return e.scope.reassignments.size !== 0 || t.scope.reassignments.size !== 0
+ ? !1
+ : _v(e.scope.dependencies, t.scope.dependencies) ||
+ _v(
+ new Set(
+ [...e.scope.declarations.values()].map((i) => ({
+ identifier: i.identifier,
+ reactive: !0,
+ path: [],
+ }))
+ ),
+ t.scope.dependencies
+ ) ||
+ (t.scope.dependencies.size !== 0 &&
+ [...t.scope.dependencies].every(
+ (i) =>
+ i.path.length === 0 &&
+ pP(i.identifier.type) &&
+ Cu(
+ e.scope.declarations.values(),
+ (r) =>
+ r.identifier.declarationId === i.identifier.declarationId ||
+ r.identifier.declarationId ===
+ n.get(i.identifier.declarationId)
+ )
+ ))
+ ? !0
+ : (`${Mu(e.scope)}${[...e.scope.declarations.values()].map(
+ (i) => i.identifier.declarationId
+ )}`,
+ `${Mu(t.scope)}${[...t.scope.dependencies].map((i) => {
+ var r;
+ return `${i.identifier.declarationId} ${
+ (r = n.get(i.identifier.declarationId)) !== null && r !== void 0
+ ? r
+ : i.identifier.declarationId
+ }`;
+ })}`,
+ !1);
+ }
+ function pP(e) {
+ switch (e.kind) {
+ case 'Object': {
+ switch (e.shapeId) {
+ case Ht:
+ case Jm:
+ case Ih:
+ case Ph:
+ return !0;
+ }
+ break;
+ }
+ case 'Function':
+ return !0;
+ }
+ return !1;
+ }
+ function _v(e, t) {
+ if (e.size !== t.size) return !1;
+ for (let n of e) {
+ let i = !1;
+ for (let r of t)
+ if (
+ n.identifier.declarationId === r.identifier.declarationId &&
+ Y0(n.path, r.path)
+ ) {
+ i = !0;
+ break;
+ }
+ if (!i) return !1;
+ }
+ return !0;
+ }
+ function e0(e) {
+ return e.scope.dependencies.size === 0
+ ? !0
+ : [...e.scope.declarations].some(([, t]) => pP(t.identifier.type));
+ }
+ var nm,
+ ur,
+ Su,
+ Tv = class extends Qt {
+ visitScope(t, n) {
+ for (let i of t.scope.dependencies) {
+ let {identifier: r} = i;
+ r.name == null && yr(r, n);
+ }
+ for (let [, i] of t.scope.declarations)
+ i.identifier.name == null && yr(i.identifier, n);
+ this.traverseScope(t, n);
+ }
+ visitPrunedScope(t, n) {
+ var i;
+ for (let [, r] of t.scope.declarations)
+ r.identifier.name == null &&
+ ((i = n.pruned.get(r.identifier.declarationId)) === null ||
+ i === void 0
+ ? void 0
+ : i.usedOutsideScope) === !0 &&
+ yr(r.identifier, n);
+ this.traversePrunedScope(t, n);
+ }
+ visitParam(t, n) {
+ t.identifier.name === null && yr(t.identifier, n);
+ }
+ visitValue(t, n, i) {
+ this.traverseValue(t, n, i),
+ (n.kind === 'FunctionExpression' || n.kind === 'ObjectMethod') &&
+ this.visitHirFunction(n.loweredFunc.func, i);
+ }
+ visitReactiveFunctionValue(t, n, i, r) {
+ for (let a of i.params) {
+ let o = a.kind === 'Identifier' ? a : a.place;
+ o.identifier.name === null && yr(o.identifier, r);
+ }
+ At(i, this, r);
+ }
+ },
+ Ev = class extends Qt {
+ visitPlace(t, n, i) {
+ n.identifier.name === null &&
+ i.promoted.has(n.identifier.declarationId) &&
+ yr(n.identifier, i);
+ }
+ visitLValue(t, n, i) {
+ this.visitPlace(t, n, i);
+ }
+ traverseScopeIdentifiers(t, n) {
+ for (let [, i] of t.declarations)
+ i.identifier.name === null &&
+ n.promoted.has(i.identifier.declarationId) &&
+ yr(i.identifier, n);
+ for (let i of t.dependencies)
+ i.identifier.name === null &&
+ n.promoted.has(i.identifier.declarationId) &&
+ yr(i.identifier, n);
+ for (let i of t.reassignments)
+ i.name === null && n.promoted.has(i.declarationId) && yr(i, n);
+ }
+ visitScope(t, n) {
+ this.traverseScope(t, n), this.traverseScopeIdentifiers(t.scope, n);
+ }
+ visitPrunedScope(t, n) {
+ this.traversePrunedScope(t, n),
+ this.traverseScopeIdentifiers(t.scope, n);
+ }
+ visitReactiveFunctionValue(t, n, i, r) {
+ At(i, this, r);
+ }
+ },
+ Iv = class extends Qt {
+ constructor() {
+ super(...arguments), (this.activeScopes = []);
+ }
+ visitPlace(t, n, i) {
+ if (
+ this.activeScopes.length !== 0 &&
+ i.pruned.has(n.identifier.declarationId)
+ ) {
+ let r = i.pruned.get(n.identifier.declarationId);
+ r.activeScopes.indexOf(this.activeScopes.at(-1)) === -1 &&
+ (r.usedOutsideScope = !0);
+ }
+ }
+ visitValue(t, n, i) {
+ this.traverseValue(t, n, i),
+ n.kind === 'JsxExpression' &&
+ n.tag.kind === 'Identifier' &&
+ i.tags.add(n.tag.identifier.declarationId);
+ }
+ visitPrunedScope(t, n) {
+ for (let [i, r] of t.scope.declarations)
+ n.pruned.set(r.identifier.declarationId, {
+ activeScopes: [...this.activeScopes],
+ usedOutsideScope: !1,
+ });
+ this.visitBlock(t.instructions, n);
+ }
+ visitScope(t, n) {
+ this.activeScopes.push(t.scope.id),
+ this.traverseScope(t, n),
+ this.activeScopes.pop();
+ }
+ },
+ Pv = class extends Qt {
+ constructor(t, n) {
+ super(),
+ nm.set(this, void 0),
+ ur.set(this, new Set()),
+ Su.set(this, new Set()),
+ n.forEach((i) => {
+ switch (i.kind) {
+ case 'Identifier':
+ j(this, ur, 'f').add(i.identifier.id);
+ break;
+ case 'Spread':
+ j(this, ur, 'f').add(i.place.identifier.id);
+ break;
+ }
+ }),
+ at(this, nm, t, 'f');
+ }
+ visitPlace(t, n, i) {
+ let r = i.get(n.identifier.id);
+ if (r) {
+ let [a, o] = r;
+ o &&
+ a.name === null &&
+ !j(this, ur, 'f').has(a.id) &&
+ yr(a, j(this, nm, 'f'));
+ }
+ }
+ visitInstruction(t, n) {
+ for (let i of yo(t.value))
+ D.invariant(i.identifier.name != null, {
+ reason:
+ 'PromoteInterposedTemporaries: Assignment targets not expected to be temporaries',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ });
+ switch (t.value.kind) {
+ case 'CallExpression':
+ case 'MethodCall':
+ case 'Await':
+ case 'PropertyStore':
+ case 'PropertyDelete':
+ case 'ComputedStore':
+ case 'ComputedDelete':
+ case 'PostfixUpdate':
+ case 'PrefixUpdate':
+ case 'StoreLocal':
+ case 'StoreContext':
+ case 'StoreGlobal':
+ case 'Destructure': {
+ let i = !1;
+ if (
+ ((t.value.kind === 'StoreContext' ||
+ t.value.kind === 'StoreLocal') &&
+ (t.value.lvalue.kind === 'Const' ||
+ t.value.lvalue.kind === 'HoistedConst') &&
+ (j(this, ur, 'f').add(t.value.lvalue.place.identifier.id),
+ (i = !0)),
+ t.value.kind === 'Destructure' &&
+ (t.value.lvalue.kind === 'Const' ||
+ t.value.lvalue.kind === 'HoistedConst') &&
+ ([...kr(t.value.lvalue.pattern)].forEach((r) =>
+ j(this, ur, 'f').add(r.identifier.id)
+ ),
+ (i = !0)),
+ t.value.kind === 'MethodCall' &&
+ j(this, ur, 'f').add(t.value.property.identifier.id),
+ super.visitInstruction(t, n),
+ !i && (t.lvalue == null || t.lvalue.identifier.name != null))
+ )
+ for (let [r, [a, o]] of n.entries()) n.set(r, [a, !0]);
+ t.lvalue &&
+ t.lvalue.identifier.name === null &&
+ n.set(t.lvalue.identifier.id, [t.lvalue.identifier, !1]);
+ break;
+ }
+ case 'DeclareContext':
+ case 'DeclareLocal': {
+ (t.value.lvalue.kind === 'Const' ||
+ t.value.lvalue.kind === 'HoistedConst') &&
+ j(this, ur, 'f').add(t.value.lvalue.place.identifier.id),
+ super.visitInstruction(t, n);
+ break;
+ }
+ case 'LoadContext':
+ case 'LoadLocal': {
+ t.lvalue &&
+ t.lvalue.identifier.name === null &&
+ (j(this, ur, 'f').has(t.value.place.identifier.id) &&
+ j(this, ur, 'f').add(t.lvalue.identifier.id),
+ n.set(t.lvalue.identifier.id, [t.lvalue.identifier, !1])),
+ super.visitInstruction(t, n);
+ break;
+ }
+ case 'PropertyLoad':
+ case 'ComputedLoad': {
+ t.lvalue &&
+ (j(this, Su, 'f').has(t.value.object.identifier.id) &&
+ (j(this, Su, 'f').add(t.lvalue.identifier.id),
+ j(this, ur, 'f').add(t.lvalue.identifier.id)),
+ t.lvalue.identifier.name === null &&
+ n.set(t.lvalue.identifier.id, [t.lvalue.identifier, !1])),
+ super.visitInstruction(t, n);
+ break;
+ }
+ case 'LoadGlobal': {
+ t.lvalue && j(this, Su, 'f').add(t.lvalue.identifier.id),
+ super.visitInstruction(t, n);
+ break;
+ }
+ default:
+ super.visitInstruction(t, n);
+ }
+ }
+ };
+ (nm = new WeakMap()), (ur = new WeakMap()), (Su = new WeakMap());
+ function A6(e) {
+ let t = {tags: new Set(), promoted: new Set(), pruned: new Map()};
+ At(e, new Iv(), t);
+ for (let n of e.params) {
+ let i = n.kind === 'Identifier' ? n : n.place;
+ i.identifier.name === null && yr(i.identifier, t);
+ }
+ At(e, new Tv(), t),
+ At(e, new Pv(t, e.params), new Map()),
+ At(e, new Ev(), t);
+ }
+ function yr(e, t) {
+ D.invariant(e.name === null, {
+ reason:
+ 'promoteTemporary: Expected to be called only for temporary variables',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ }),
+ t.tags.has(e.declarationId) ? G0(e) : $n(e),
+ t.promoted.add(e.declarationId);
+ }
+ function M6(e) {
+ At(e, new N6(e.env), {withinReactiveScope: !1, earlyReturnValue: null});
+ }
+ var N6 = class extends Ei {
+ constructor(t) {
+ super(), (this.env = t);
+ }
+ visitScope(t, n) {
+ if (t.scope.earlyReturnValue !== null) return;
+ let i = {withinReactiveScope: !0, earlyReturnValue: n.earlyReturnValue};
+ this.traverseScope(t, i);
+ let r = i.earlyReturnValue;
+ if (r !== null)
+ if (n.withinReactiveScope) n.earlyReturnValue = r;
+ else {
+ (t.scope.earlyReturnValue = r),
+ t.scope.declarations.set(r.value.id, {
+ identifier: r.value,
+ scope: t.scope,
+ });
+ let a = t.instructions,
+ o = r.loc,
+ s = _t(this.env, o),
+ l = _t(this.env, o),
+ d = _t(this.env, o),
+ u = _t(this.env, o);
+ t.instructions = [
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: o,
+ lvalue: Object.assign({}, l),
+ value: {
+ kind: 'LoadGlobal',
+ binding: {kind: 'Global', name: 'Symbol'},
+ loc: o,
+ },
+ },
+ },
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: o,
+ lvalue: Object.assign({}, d),
+ value: {
+ kind: 'PropertyLoad',
+ object: Object.assign({}, l),
+ property: 'for',
+ loc: o,
+ },
+ },
+ },
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: o,
+ lvalue: Object.assign({}, u),
+ value: {kind: 'Primitive', value: aP, loc: o},
+ },
+ },
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: o,
+ lvalue: Object.assign({}, s),
+ value: {
+ kind: 'MethodCall',
+ receiver: l,
+ property: d,
+ args: [u],
+ loc: o,
+ },
+ },
+ },
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: o,
+ lvalue: null,
+ value: {
+ kind: 'StoreLocal',
+ loc: o,
+ type: null,
+ lvalue: {
+ kind: Q.Let,
+ place: {
+ kind: 'Identifier',
+ effect: x.ConditionallyMutate,
+ loc: o,
+ reactive: !0,
+ identifier: r.value,
+ },
+ },
+ value: Object.assign({}, s),
+ },
+ },
+ },
+ {
+ kind: 'terminal',
+ label: {id: r.label, implicit: !1},
+ terminal: {kind: 'label', id: V(0), loc: F, block: a},
+ },
+ ];
+ }
+ }
+ transformTerminal(t, n) {
+ if (n.withinReactiveScope && t.terminal.kind === 'return') {
+ let i = t.terminal.value.loc,
+ r;
+ if (n.earlyReturnValue !== null) r = n.earlyReturnValue;
+ else {
+ let a = _t(this.env, i).identifier;
+ $n(a), (r = {label: this.env.nextBlockId, loc: i, value: a});
+ }
+ return (
+ (n.earlyReturnValue = r),
+ {
+ kind: 'replace-many',
+ value: [
+ {
+ kind: 'instruction',
+ instruction: {
+ id: V(0),
+ loc: i,
+ lvalue: null,
+ value: {
+ kind: 'StoreLocal',
+ loc: i,
+ type: null,
+ lvalue: {
+ kind: Q.Reassign,
+ place: {
+ kind: 'Identifier',
+ identifier: r.value,
+ effect: x.Capture,
+ loc: i,
+ reactive: !0,
+ },
+ },
+ value: t.terminal.value,
+ },
+ },
+ },
+ {
+ kind: 'terminal',
+ label: null,
+ terminal: {
+ kind: 'break',
+ id: V(0),
+ loc: i,
+ targetKind: 'labeled',
+ target: r.label,
+ },
+ },
+ ],
+ }
+ );
+ }
+ return this.traverseTerminal(t, n), {kind: 'keep'};
+ }
+ },
+ Gi,
+ Ni;
+ function mo() {
+ return mP;
+ }
+ var xv = class e {
+ constructor(t, n = mP) {
+ Gi.set(this, void 0),
+ Ni.set(this, void 0),
+ at(this, Gi, t, 'f'),
+ at(this, Ni, n, 'f');
+ }
+ push(t) {
+ return new e(t, this);
+ }
+ pop() {
+ return j(this, Ni, 'f');
+ }
+ find(t) {
+ return t(j(this, Gi, 'f')) ? !0 : j(this, Ni, 'f').find(t);
+ }
+ contains(t) {
+ return (
+ t === j(this, Gi, 'f') ||
+ (j(this, Ni, 'f') !== null && j(this, Ni, 'f').contains(t))
+ );
+ }
+ each(t) {
+ t(j(this, Gi, 'f')), j(this, Ni, 'f').each(t);
+ }
+ get value() {
+ return j(this, Gi, 'f');
+ }
+ print(t) {
+ return t(j(this, Gi, 'f')) + j(this, Ni, 'f').print(t);
+ }
+ };
+ (Gi = new WeakMap()), (Ni = new WeakMap());
+ var wv = class {
+ push(t) {
+ return new xv(t, this);
+ }
+ pop() {
+ return this;
+ }
+ find(t) {
+ return !1;
+ }
+ contains(t) {
+ return !1;
+ }
+ each(t) {}
+ get value() {
+ return null;
+ }
+ print(t) {
+ return '';
+ }
+ },
+ mP = new wv();
+ function Mh(e) {
+ At(e, new R6(), {activeScopes: mo(), uninitialized: new Map()});
+ }
+ var R6 = class extends Ei {
+ visitScope(t, n) {
+ n.activeScopes = n.activeScopes.push(
+ new Set(t.scope.declarations.keys())
+ );
+ for (let i of t.scope.declarations.values())
+ n.uninitialized.set(i.identifier.id, {kind: 'unknown-kind'});
+ this.traverseScope(t, n), n.activeScopes.pop();
+ for (let i of t.scope.declarations.values())
+ n.uninitialized.delete(i.identifier.id);
+ }
+ visitPlace(t, n, i) {
+ let r = i.uninitialized.get(n.identifier.id);
+ r?.kind === 'func' &&
+ r.definition !== n &&
+ D.throwTodo({
+ reason: '[PruneHoistedContexts] Rewrite hoisted function references',
+ loc: n.loc,
+ });
+ }
+ transformInstruction(t, n) {
+ if (t.value.kind === 'DeclareContext') {
+ let i = H0(t.value.lvalue.kind);
+ if (i != null)
+ return (
+ i === Q.Function &&
+ n.uninitialized.has(t.value.lvalue.place.identifier.id) &&
+ n.uninitialized.set(t.value.lvalue.place.identifier.id, {
+ kind: 'func',
+ definition: null,
+ }),
+ {kind: 'remove'}
+ );
+ }
+ if (
+ t.value.kind === 'StoreContext' &&
+ t.value.lvalue.kind !== Q.Reassign
+ ) {
+ let i = t.value.lvalue.place.identifier.id;
+ if (n.activeScopes.find((a) => a.has(i)))
+ if (t.value.lvalue.kind === Q.Let || t.value.lvalue.kind === Q.Const)
+ t.value.lvalue.kind = Q.Reassign;
+ else if (t.value.lvalue.kind === Q.Function) {
+ let a = n.uninitialized.get(i);
+ a != null &&
+ (D.invariant(a.kind === 'func', {
+ reason: '[PruneHoistedContexts] Unexpected hoisted function',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ }),
+ (a.definition = t.value.lvalue.place),
+ n.uninitialized.delete(i));
+ } else
+ D.throwTodo({
+ reason: '[PruneHoistedContexts] Unexpected kind',
+ description: `(${t.value.lvalue.kind})`,
+ loc: t.loc,
+ });
+ }
+ return this.visitInstruction(t, n), {kind: 'keep'};
+ }
+ };
+ function L6(e) {
+ var t;
+ switch (e.kind) {
+ case 'Apply':
+ return [
+ e.kind,
+ e.receiver.identifier.id,
+ e.function.identifier.id,
+ e.mutatesFunction,
+ e.args
+ .map((n) =>
+ n.kind === 'Hole'
+ ? ''
+ : n.kind === 'Identifier'
+ ? n.identifier.id
+ : `...${n.place.identifier.id}`
+ )
+ .join(','),
+ e.into.identifier.id,
+ ].join(':');
+ case 'CreateFrom':
+ case 'ImmutableCapture':
+ case 'Assign':
+ case 'Alias':
+ case 'Capture':
+ case 'MaybeAlias':
+ return [e.kind, e.from.identifier.id, e.into.identifier.id].join(':');
+ case 'Create':
+ return [e.kind, e.into.identifier.id, e.value, e.reason].join(':');
+ case 'Freeze':
+ return [e.kind, e.value.identifier.id, e.reason].join(':');
+ case 'Impure':
+ case 'Render':
+ return [e.kind, e.place.identifier.id].join(':');
+ case 'MutateFrozen':
+ case 'MutateGlobal':
+ return [
+ e.kind,
+ e.place.identifier.id,
+ e.error.severity,
+ e.error.reason,
+ e.error.description,
+ wB((t = e.error.primaryLocation()) !== null && t !== void 0 ? t : F),
+ ].join(':');
+ case 'Mutate':
+ case 'MutateConditionally':
+ case 'MutateTransitive':
+ case 'MutateTransitiveConditionally':
+ return [e.kind, e.value.identifier.id].join(':');
+ case 'CreateFunction':
+ return [
+ e.kind,
+ e.into.identifier.id,
+ e.function.loweredFunc.func.returns.identifier.id,
+ e.captures.map((n) => n.identifier.id).join(','),
+ ].join(':');
+ }
+ }
+ var Qa, kn, nn;
+ function yP(e, {isFunctionExpression: t} = {isFunctionExpression: !1}) {
+ let n = Ov.empty(e.env, t),
+ i = new Map();
+ for (let u of e.context) {
+ let p = {kind: 'ObjectExpression', properties: [], loc: u.loc};
+ n.initialize(p, {kind: z.Context, reason: new Set([qe.Other])}),
+ n.define(u, p);
+ }
+ let r = t
+ ? {kind: z.Mutable, reason: new Set([qe.Other])}
+ : {kind: z.Frozen, reason: new Set([qe.ReactiveFunctionArgument])};
+ if (e.fnType === 'Component') {
+ D.invariant(e.params.length <= 2, {
+ reason:
+ 'Expected React component to have not more than two parameters: one for props and for ref',
+ description: null,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ suggestions: null,
+ });
+ let [u, p] = e.params;
+ if ((u != null && t0(u, n, r), p != null)) {
+ let y = p.kind === 'Identifier' ? p : p.place,
+ m = {kind: 'ObjectExpression', properties: [], loc: y.loc};
+ n.initialize(m, {kind: z.Mutable, reason: new Set([qe.Other])}),
+ n.define(y, m);
+ }
+ } else for (let u of e.params) t0(u, n, r);
+ let a = new Map();
+ function o(u, p) {
+ var y;
+ let m = a.get(u);
+ if (m != null)
+ (p = (y = m.merge(p)) !== null && y !== void 0 ? y : m), a.set(u, p);
+ else {
+ let g = i.get(u),
+ S = g != null ? g.merge(p) : p;
+ S != null && a.set(u, S);
+ }
+ }
+ o(e.body.entry, n);
+ let s = F6(e),
+ l = new z6(t, e, s, B6(e)),
+ d = 0;
+ for (; a.size !== 0; ) {
+ d++,
+ d > 100 &&
+ D.invariant(!1, {
+ reason: '[InferMutationAliasingEffects] Potential infinite loop',
+ description:
+ 'A value, temporary place, or effect was not cached properly',
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ });
+ for (let [u, p] of e.body.blocks) {
+ let y = a.get(u);
+ if ((a.delete(u), y == null)) continue;
+ i.set(u, y);
+ let m = y.clone();
+ U6(l, m, p);
+ for (let g of go(p.terminal)) o(g, m);
+ }
+ }
+ return zn(void 0);
+ }
+ function F6(e) {
+ let t = new Map();
+ function n(i) {
+ t.has(i.identifier.declarationId) &&
+ t.get(i.identifier.declarationId) == null &&
+ t.set(i.identifier.declarationId, i);
+ }
+ for (let i of e.body.blocks.values()) {
+ for (let r of i.instructions)
+ if (r.value.kind === 'DeclareContext') {
+ let a = r.value.lvalue.kind;
+ (a == Q.HoistedConst ||
+ a == Q.HoistedFunction ||
+ a == Q.HoistedLet) &&
+ t.set(r.value.lvalue.place.identifier.declarationId, null);
+ } else for (let a of Ot(r.value)) n(a);
+ for (let r of Gt(i.terminal)) n(r);
+ }
+ return t;
+ }
+ var z6 = class {
+ constructor(t, n, i, r) {
+ (this.internedEffects = new Map()),
+ (this.instructionSignatureCache = new Map()),
+ (this.effectInstructionValueCache = new Map()),
+ (this.applySignatureCache = new Map()),
+ (this.catchHandlers = new Map()),
+ (this.functionSignatureCache = new Map()),
+ (this.isFuctionExpression = t),
+ (this.fn = n),
+ (this.hoistedContextDeclarations = i),
+ (this.nonMutatingSpreads = r);
+ }
+ cacheApplySignature(t, n, i) {
+ let r = Xn(this.applySignatureCache, t, new Map());
+ return dr(r, n, i);
+ }
+ internEffect(t) {
+ let n = L6(t),
+ i = this.internedEffects.get(n);
+ return i == null && (this.internedEffects.set(n, t), (i = t)), i;
+ }
+ };
+ function B6(e) {
+ let t = new Set();
+ if (e.fnType === 'Component') {
+ let [r] = e.params;
+ r != null && r.kind === 'Identifier' && t.add(r.identifier.id);
+ } else
+ for (let r of e.params) r.kind === 'Identifier' && t.add(r.identifier.id);
+ let n = new Map();
+ for (let r of e.body.blocks.values()) {
+ if (n.size !== 0)
+ for (let a of r.phis)
+ for (let o of a.operands.values()) {
+ let s = n.get(o.identifier.id);
+ s != null && n.delete(s);
+ }
+ for (let a of r.instructions) {
+ let {lvalue: o, value: s} = a;
+ switch (s.kind) {
+ case 'Destructure': {
+ if (
+ !t.has(s.value.identifier.id) ||
+ !(s.lvalue.kind === Q.Let || s.lvalue.kind === Q.Const) ||
+ s.lvalue.pattern.kind !== 'ObjectPattern'
+ )
+ continue;
+ for (let l of s.lvalue.pattern.properties)
+ l.kind === 'Spread' &&
+ n.set(l.place.identifier.id, l.place.identifier.id);
+ break;
+ }
+ case 'LoadLocal': {
+ let l = n.get(s.place.identifier.id);
+ l != null && n.set(o.identifier.id, l);
+ break;
+ }
+ case 'StoreLocal': {
+ let l = n.get(s.value.identifier.id);
+ l != null &&
+ (n.set(o.identifier.id, l),
+ n.set(s.lvalue.place.identifier.id, l));
+ break;
+ }
+ case 'JsxFragment':
+ case 'JsxExpression':
+ break;
+ case 'PropertyLoad':
+ break;
+ case 'CallExpression':
+ case 'MethodCall': {
+ let l = s.kind === 'CallExpression' ? s.callee : s.property;
+ if (Qn(e.env, l.identifier) != null)
+ hh(o.identifier) || t.add(o.identifier.id);
+ else if (n.size !== 0)
+ for (let d of Ot(s)) {
+ let u = n.get(d.identifier.id);
+ u != null && n.delete(u);
+ }
+ break;
+ }
+ default:
+ if (n.size !== 0)
+ for (let l of Ot(s)) {
+ let d = n.get(l.identifier.id);
+ d != null && n.delete(d);
+ }
+ }
+ }
+ }
+ let i = new Set();
+ for (let [r, a] of n) r === a && i.add(r);
+ return i;
+ }
+ function t0(e, t, n) {
+ let i = e.kind === 'Identifier' ? e : e.place,
+ r = {kind: 'Primitive', loc: i.loc, value: void 0};
+ t.initialize(r, n), t.define(i, r);
+ }
+ function U6(e, t, n) {
+ for (let r of n.phis) t.inferPhi(r);
+ for (let r of n.instructions) {
+ let a = e.instructionSignatureCache.get(r);
+ a == null &&
+ ((a = q6(e, t.env, r)), e.instructionSignatureCache.set(r, a));
+ let o = Z6(e, t, a, r);
+ r.effects = o;
+ }
+ let i = n.terminal;
+ if (i.kind === 'try' && i.handlerBinding != null)
+ e.catchHandlers.set(i.handler, i.handlerBinding);
+ else if (i.kind === 'maybe-throw') {
+ let r = e.catchHandlers.get(i.handler);
+ if (r != null) {
+ D.invariant(t.kind(r) != null, {
+ reason:
+ 'Expected catch binding to be intialized with a DeclareLocal Catch instruction',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ });
+ let a = [];
+ for (let o of n.instructions)
+ if (
+ o.value.kind === 'CallExpression' ||
+ o.value.kind === 'MethodCall'
+ ) {
+ t.appendAlias(r, o.lvalue);
+ let s = t.kind(o.lvalue).kind;
+ (s === z.Mutable || s == z.Context) &&
+ a.push(e.internEffect({kind: 'Alias', from: o.lvalue, into: r}));
+ }
+ i.effects = a.length !== 0 ? a : null;
+ }
+ } else
+ i.kind === 'return' &&
+ (e.isFuctionExpression ||
+ (i.effects = [
+ e.internEffect({
+ kind: 'Freeze',
+ value: i.value,
+ reason: qe.JsxCaptured,
+ }),
+ ]));
+ }
+ function Z6(e, t, n, i) {
+ var r, a;
+ let o = [];
+ if (
+ i.value.kind === 'FunctionExpression' ||
+ i.value.kind === 'ObjectMethod'
+ ) {
+ let l =
+ (r = i.value.loweredFunc.func.aliasingEffects) !== null &&
+ r !== void 0
+ ? r
+ : [],
+ d = new Set(
+ i.value.loweredFunc.func.context.map((u) => u.identifier.id)
+ );
+ for (let u of l)
+ if (u.kind === 'Mutate' || u.kind === 'MutateTransitive') {
+ if (!d.has(u.value.identifier.id)) continue;
+ let p = t.kind(u.value);
+ switch (p.kind) {
+ case z.Frozen: {
+ let y = gP({kind: p.kind, reason: p.reason}),
+ m =
+ u.value.identifier.name !== null &&
+ u.value.identifier.name.kind === 'named'
+ ? `\`${u.value.identifier.name.value}\``
+ : 'value',
+ g = Tt.create({
+ category: K.Immutability,
+ reason: 'This value cannot be modified',
+ description: y,
+ }).withDetails({
+ kind: 'error',
+ loc: u.value.loc,
+ message: `${m} cannot be modified`,
+ });
+ u.kind === 'Mutate' &&
+ ((a = u.reason) === null || a === void 0 ? void 0 : a.kind) ===
+ 'AssignCurrentProperty' &&
+ g.withDetails({
+ kind: 'hint',
+ message:
+ 'Hint: If this value is a Ref (value returned by `useRef()`), rename the variable to end in "Ref".',
+ }),
+ o.push({kind: 'MutateFrozen', place: u.value, error: g});
+ }
+ }
+ }
+ }
+ let s = new Set();
+ for (let l of n.effects) vn(e, t, l, s, o);
+ return (
+ (t.isDefined(i.lvalue) && t.kind(i.lvalue)) ||
+ D.invariant(!1, {
+ reason: 'Expected instruction lvalue to be initialized',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ }),
+ o.length !== 0 ? o : null
+ );
+ }
+ function vn(e, t, n, i, r) {
+ var a, o, s, l, d;
+ let u = e.internEffect(n);
+ switch (u.kind) {
+ case 'Freeze': {
+ t.freeze(u.value, u.reason) && r.push(u);
+ break;
+ }
+ case 'Create': {
+ D.invariant(!i.has(u.into.identifier.id), {
+ reason: 'Cannot re-initialize variable within an instruction',
+ description: `Re-initialized ${_e(u.into)} in ${Si(u)}`,
+ details: [{kind: 'error', loc: u.into.loc, message: null}],
+ }),
+ i.add(u.into.identifier.id);
+ let p = e.effectInstructionValueCache.get(u);
+ p == null &&
+ ((p = {kind: 'ObjectExpression', properties: [], loc: u.into.loc}),
+ e.effectInstructionValueCache.set(u, p)),
+ t.initialize(p, {kind: u.value, reason: new Set([u.reason])}),
+ t.define(u.into, p),
+ r.push(u);
+ break;
+ }
+ case 'ImmutableCapture': {
+ switch (t.kind(u.from).kind) {
+ case z.Global:
+ case z.Primitive:
+ break;
+ default:
+ r.push(u);
+ }
+ break;
+ }
+ case 'CreateFrom': {
+ D.invariant(!i.has(u.into.identifier.id), {
+ reason: 'Cannot re-initialize variable within an instruction',
+ description: `Re-initialized ${_e(u.into)} in ${Si(u)}`,
+ details: [{kind: 'error', loc: u.into.loc, message: null}],
+ }),
+ i.add(u.into.identifier.id);
+ let p = t.kind(u.from),
+ y = e.effectInstructionValueCache.get(u);
+ switch (
+ (y == null &&
+ ((y = {kind: 'ObjectExpression', properties: [], loc: u.into.loc}),
+ e.effectInstructionValueCache.set(u, y)),
+ t.initialize(y, {kind: p.kind, reason: new Set(p.reason)}),
+ t.define(u.into, y),
+ p.kind)
+ ) {
+ case z.Primitive:
+ case z.Global: {
+ r.push({
+ kind: 'Create',
+ value: p.kind,
+ into: u.into,
+ reason:
+ (a = [...p.reason][0]) !== null && a !== void 0 ? a : qe.Other,
+ });
+ break;
+ }
+ case z.Frozen: {
+ r.push({
+ kind: 'Create',
+ value: p.kind,
+ into: u.into,
+ reason:
+ (o = [...p.reason][0]) !== null && o !== void 0 ? o : qe.Other,
+ }),
+ vn(
+ e,
+ t,
+ {kind: 'ImmutableCapture', from: u.from, into: u.into},
+ i,
+ r
+ );
+ break;
+ }
+ default:
+ r.push(u);
+ }
+ break;
+ }
+ case 'CreateFunction': {
+ D.invariant(!i.has(u.into.identifier.id), {
+ reason: 'Cannot re-initialize variable within an instruction',
+ description: `Re-initialized ${_e(u.into)} in ${Si(u)}`,
+ details: [{kind: 'error', loc: u.into.loc, message: null}],
+ }),
+ i.add(u.into.identifier.id),
+ r.push(u);
+ let p = u.captures.some((S) => {
+ switch (t.kind(S).kind) {
+ case z.Context:
+ case z.Mutable:
+ return !0;
+ default:
+ return !1;
+ }
+ }),
+ y =
+ (s = u.function.loweredFunc.func.aliasingEffects) === null ||
+ s === void 0
+ ? void 0
+ : s.some(
+ (S) =>
+ S.kind === 'MutateFrozen' ||
+ S.kind === 'MutateGlobal' ||
+ S.kind === 'Impure'
+ ),
+ m = u.function.loweredFunc.func.context.some((S) => hh(S.identifier)),
+ g = p || y || m;
+ for (let S of u.function.loweredFunc.func.context) {
+ if (S.effect !== x.Capture) continue;
+ let _ = t.kind(S).kind;
+ (_ === z.Primitive || _ == z.Frozen || _ == z.Global) &&
+ (S.effect = x.Read);
+ }
+ t.initialize(u.function, {
+ kind: g ? z.Mutable : z.Frozen,
+ reason: new Set([]),
+ }),
+ t.define(u.into, u.function);
+ for (let S of u.captures)
+ vn(e, t, {kind: 'Capture', from: S, into: u.into}, i, r);
+ break;
+ }
+ case 'MaybeAlias':
+ case 'Alias':
+ case 'Capture': {
+ D.invariant(
+ u.kind === 'Capture' ||
+ u.kind === 'MaybeAlias' ||
+ i.has(u.into.identifier.id),
+ {
+ reason:
+ 'Expected destination to already be initialized within this instruction',
+ description: `Destination ${_e(
+ u.into
+ )} is not initialized in this instruction for effect ${Si(u)}`,
+ details: [{kind: 'error', loc: u.into.loc, message: null}],
+ }
+ );
+ let p = t.kind(u.into).kind,
+ y = null;
+ switch (p) {
+ case z.Context: {
+ y = 'context';
+ break;
+ }
+ case z.Mutable:
+ case z.MaybeFrozen: {
+ y = 'mutable';
+ break;
+ }
+ }
+ let m = t.kind(u.from).kind,
+ g = null;
+ switch (m) {
+ case z.Context: {
+ g = 'context';
+ break;
+ }
+ case z.Global:
+ case z.Primitive:
+ break;
+ case z.Frozen: {
+ g = 'frozen';
+ break;
+ }
+ default: {
+ g = 'mutable';
+ break;
+ }
+ }
+ g === 'frozen'
+ ? vn(
+ e,
+ t,
+ {kind: 'ImmutableCapture', from: u.from, into: u.into},
+ i,
+ r
+ )
+ : (g === 'mutable' && y === 'mutable') || u.kind === 'MaybeAlias'
+ ? r.push(u)
+ : ((g === 'context' && y != null) ||
+ (g === 'mutable' && y === 'context')) &&
+ vn(e, t, {kind: 'MaybeAlias', from: u.from, into: u.into}, i, r);
+ break;
+ }
+ case 'Assign': {
+ D.invariant(!i.has(u.into.identifier.id), {
+ reason: 'Cannot re-initialize variable within an instruction',
+ description: `Re-initialized ${_e(u.into)} in ${Si(u)}`,
+ details: [{kind: 'error', loc: u.into.loc, message: null}],
+ }),
+ i.add(u.into.identifier.id);
+ let p = t.kind(u.from),
+ y = p.kind;
+ switch (y) {
+ case z.Frozen: {
+ vn(
+ e,
+ t,
+ {kind: 'ImmutableCapture', from: u.from, into: u.into},
+ i,
+ r
+ );
+ let m = e.effectInstructionValueCache.get(u);
+ m == null &&
+ ((m = {kind: 'Primitive', value: void 0, loc: u.from.loc}),
+ e.effectInstructionValueCache.set(u, m)),
+ t.initialize(m, {kind: y, reason: new Set(p.reason)}),
+ t.define(u.into, m);
+ break;
+ }
+ case z.Global:
+ case z.Primitive: {
+ let m = e.effectInstructionValueCache.get(u);
+ m == null &&
+ ((m = {kind: 'Primitive', value: void 0, loc: u.from.loc}),
+ e.effectInstructionValueCache.set(u, m)),
+ t.initialize(m, {kind: y, reason: new Set(p.reason)}),
+ t.define(u.into, m);
+ break;
+ }
+ default: {
+ t.assign(u.into, u.from), r.push(u);
+ break;
+ }
+ }
+ break;
+ }
+ case 'Apply': {
+ let p = t.values(u.function);
+ if (
+ p.length === 1 &&
+ p[0].kind === 'FunctionExpression' &&
+ p[0].loweredFunc.func.aliasingEffects != null
+ ) {
+ let m = p[0],
+ g = e.functionSignatureCache.get(m);
+ g == null && ((g = J6(t.env, m)), e.functionSignatureCache.set(m, g));
+ let S = e.cacheApplySignature(g, u, () =>
+ r0(
+ t.env,
+ g,
+ u.into,
+ u.receiver,
+ u.args,
+ m.loweredFunc.func.context,
+ u.loc
+ )
+ );
+ if (S != null) {
+ vn(
+ e,
+ t,
+ {kind: 'MutateTransitiveConditionally', value: u.function},
+ i,
+ r
+ );
+ for (let _ of S) vn(e, t, _, i, r);
+ break;
+ }
+ }
+ let y = null;
+ if (
+ ((l = u.signature) === null || l === void 0 ? void 0 : l.aliasing) !=
+ null
+ ) {
+ let m = u.signature.aliasing;
+ y = e.cacheApplySignature(u.signature.aliasing, u, () =>
+ r0(t.env, m, u.into, u.receiver, u.args, [], u.loc)
+ );
+ }
+ if (y != null) for (let m of y) vn(e, t, m, i, r);
+ else if (u.signature != null) {
+ let m = K6(t, u.signature, u.into, u.receiver, u.args, u.loc);
+ for (let g of m) vn(e, t, g, i, r);
+ } else {
+ vn(
+ e,
+ t,
+ {kind: 'Create', into: u.into, value: z.Mutable, reason: qe.Other},
+ i,
+ r
+ );
+ for (let m of [u.receiver, u.function, ...u.args]) {
+ if (m.kind === 'Hole') continue;
+ let g = m.kind === 'Identifier' ? m : m.place;
+ (g !== u.function || u.mutatesFunction) &&
+ vn(e, t, {kind: 'MutateTransitiveConditionally', value: g}, i, r);
+ let S = m.kind === 'Spread' ? Qm(g) : null;
+ S && vn(e, t, S, i, r),
+ vn(e, t, {kind: 'MaybeAlias', from: g, into: u.into}, i, r);
+ for (let _ of [u.receiver, u.function, ...u.args]) {
+ if (_.kind === 'Hole') continue;
+ let O = _.kind === 'Identifier' ? _ : _.place;
+ O !== m && vn(e, t, {kind: 'Capture', from: g, into: O}, i, r);
+ }
+ }
+ }
+ break;
+ }
+ case 'Mutate':
+ case 'MutateConditionally':
+ case 'MutateTransitive':
+ case 'MutateTransitiveConditionally': {
+ let p = t.mutate(u.kind, u.value);
+ if (p === 'mutate') r.push(u);
+ else if (p !== 'mutate-ref') {
+ if (
+ p !== 'none' &&
+ (u.kind === 'Mutate' || u.kind === 'MutateTransitive')
+ ) {
+ let y = t.kind(u.value);
+ if (
+ p === 'mutate-frozen' &&
+ e.hoistedContextDeclarations.has(u.value.identifier.declarationId)
+ ) {
+ let m =
+ u.value.identifier.name !== null &&
+ u.value.identifier.name.kind === 'named'
+ ? `\`${u.value.identifier.name.value}\``
+ : null,
+ g = e.hoistedContextDeclarations.get(
+ u.value.identifier.declarationId
+ ),
+ S = Tt.create({
+ category: K.Immutability,
+ reason: 'Cannot access variable before it is declared',
+ description: `${
+ m ?? 'This variable'
+ } is accessed before it is declared, which prevents the earlier access from updating when this value changes over time`,
+ });
+ g != null &&
+ g.loc != u.value.loc &&
+ S.withDetails({
+ kind: 'error',
+ loc: g.loc,
+ message: `${m ?? 'variable'} accessed before it is declared`,
+ }),
+ S.withDetails({
+ kind: 'error',
+ loc: u.value.loc,
+ message: `${m ?? 'variable'} is declared here`,
+ }),
+ vn(
+ e,
+ t,
+ {kind: 'MutateFrozen', place: u.value, error: S},
+ i,
+ r
+ );
+ } else {
+ let m = gP({kind: y.kind, reason: y.reason}),
+ g =
+ u.value.identifier.name !== null &&
+ u.value.identifier.name.kind === 'named'
+ ? `\`${u.value.identifier.name.value}\``
+ : 'value',
+ S = Tt.create({
+ category: K.Immutability,
+ reason: 'This value cannot be modified',
+ description: m,
+ }).withDetails({
+ kind: 'error',
+ loc: u.value.loc,
+ message: `${g} cannot be modified`,
+ });
+ u.kind === 'Mutate' &&
+ ((d = u.reason) === null || d === void 0 ? void 0 : d.kind) ===
+ 'AssignCurrentProperty' &&
+ S.withDetails({
+ kind: 'hint',
+ message:
+ 'Hint: If this value is a Ref (value returned by `useRef()`), rename the variable to end in "Ref".',
+ }),
+ vn(
+ e,
+ t,
+ {
+ kind: y.kind === z.Frozen ? 'MutateFrozen' : 'MutateGlobal',
+ place: u.value,
+ error: S,
+ },
+ i,
+ r
+ );
+ }
+ }
+ }
+ break;
+ }
+ case 'Impure':
+ case 'Render':
+ case 'MutateFrozen':
+ case 'MutateGlobal': {
+ r.push(u);
+ break;
+ }
+ default:
+ Me(u, `Unexpected effect kind '${u.kind}'`);
+ }
+ }
+ var Ov = class e {
+ constructor(t, n, i, r) {
+ Qa.set(this, void 0),
+ kn.set(this, void 0),
+ nn.set(this, void 0),
+ (this.env = t),
+ at(this, Qa, n, 'f'),
+ at(this, kn, i, 'f'),
+ at(this, nn, r, 'f');
+ }
+ static empty(t, n) {
+ return new e(t, n, new Map(), new Map());
+ }
+ get isFunctionExpression() {
+ return j(this, Qa, 'f');
+ }
+ initialize(t, n) {
+ D.invariant(t.kind !== 'LoadLocal', {
+ reason:
+ '[InferMutationAliasingEffects] Expected all top-level identifiers to be defined as variables, not values',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ }),
+ j(this, kn, 'f').set(t, n);
+ }
+ values(t) {
+ let n = j(this, nn, 'f').get(t.identifier.id);
+ return (
+ D.invariant(n != null, {
+ reason:
+ '[InferMutationAliasingEffects] Expected value kind to be initialized',
+ description: `${_e(t)}`,
+ details: [
+ {kind: 'error', loc: t.loc, message: 'this is uninitialized'},
+ ],
+ suggestions: null,
+ }),
+ Array.from(n)
+ );
+ }
+ kind(t) {
+ let n = j(this, nn, 'f').get(t.identifier.id);
+ D.invariant(n != null, {
+ reason:
+ '[InferMutationAliasingEffects] Expected value kind to be initialized',
+ description: `${_e(t)}`,
+ details: [
+ {kind: 'error', loc: t.loc, message: 'this is uninitialized'},
+ ],
+ suggestions: null,
+ });
+ let i = null;
+ for (let r of n) {
+ let a = j(this, kn, 'f').get(r);
+ i = i !== null ? n0(i, a) : a;
+ }
+ return (
+ D.invariant(i !== null, {
+ reason: '[InferMutationAliasingEffects] Expected at least one value',
+ description: `No value found at \`${_e(t)}\``,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ suggestions: null,
+ }),
+ i
+ );
+ }
+ assign(t, n) {
+ let i = j(this, nn, 'f').get(n.identifier.id);
+ D.invariant(i != null, {
+ reason:
+ '[InferMutationAliasingEffects] Expected value for identifier to be initialized',
+ description: `${un(n.identifier)}`,
+ details: [
+ {
+ kind: 'error',
+ loc: n.loc,
+ message: 'Expected value for identifier to be initialized',
+ },
+ ],
+ suggestions: null,
+ }),
+ j(this, nn, 'f').set(t.identifier.id, new Set(i));
+ }
+ appendAlias(t, n) {
+ let i = j(this, nn, 'f').get(n.identifier.id);
+ D.invariant(i != null, {
+ reason:
+ '[InferMutationAliasingEffects] Expected value for identifier to be initialized',
+ description: `${un(n.identifier)}`,
+ details: [
+ {
+ kind: 'error',
+ loc: n.loc,
+ message: 'Expected value for identifier to be initialized',
+ },
+ ],
+ suggestions: null,
+ });
+ let r = this.values(t);
+ j(this, nn, 'f').set(t.identifier.id, new Set([...r, ...i]));
+ }
+ define(t, n) {
+ D.invariant(j(this, kn, 'f').has(n), {
+ reason:
+ '[InferMutationAliasingEffects] Expected value to be initialized',
+ description: ki(n),
+ details: [
+ {
+ kind: 'error',
+ loc: n.loc,
+ message: 'Expected value for identifier to be initialized',
+ },
+ ],
+ suggestions: null,
+ }),
+ j(this, nn, 'f').set(t.identifier.id, new Set([n]));
+ }
+ isDefined(t) {
+ return j(this, nn, 'f').has(t.identifier.id);
+ }
+ freeze(t, n) {
+ let i = this.kind(t);
+ switch (i.kind) {
+ case z.Context:
+ case z.Mutable:
+ case z.MaybeFrozen: {
+ let r = this.values(t);
+ for (let a of r) this.freezeValue(a, n);
+ return !0;
+ }
+ case z.Frozen:
+ case z.Global:
+ case z.Primitive:
+ return !1;
+ default:
+ Me(i.kind, `Unexpected value kind '${i.kind}'`);
+ }
+ }
+ freezeValue(t, n) {
+ if (
+ (j(this, kn, 'f').set(t, {kind: z.Frozen, reason: new Set([n])}),
+ t.kind === 'FunctionExpression' &&
+ (this.env.config.enablePreserveExistingMemoizationGuarantees ||
+ this.env.config.enableTransitivelyFreezeFunctionExpressions))
+ )
+ for (let i of t.loweredFunc.func.context) this.freeze(i, n);
+ }
+ mutate(t, n) {
+ if (hh(n.identifier)) return 'mutate-ref';
+ let i = this.kind(n).kind;
+ switch (t) {
+ case 'MutateConditionally':
+ case 'MutateTransitiveConditionally':
+ switch (i) {
+ case z.Mutable:
+ case z.Context:
+ return 'mutate';
+ default:
+ return 'none';
+ }
+ case 'Mutate':
+ case 'MutateTransitive':
+ switch (i) {
+ case z.Mutable:
+ case z.Context:
+ return 'mutate';
+ case z.Primitive:
+ return 'none';
+ case z.Frozen:
+ return 'mutate-frozen';
+ case z.Global:
+ return 'mutate-global';
+ case z.MaybeFrozen:
+ return 'mutate-frozen';
+ default:
+ Me(i, `Unexpected kind ${i}`);
+ }
+ default:
+ Me(t, `Unexpected mutation variant ${t}`);
+ }
+ }
+ merge(t) {
+ let n = null,
+ i = null;
+ for (let [r, a] of j(this, kn, 'f')) {
+ let o = j(t, kn, 'f').get(r);
+ if (o !== void 0) {
+ let s = n0(a, o);
+ s !== a && ((n = n ?? new Map(j(this, kn, 'f'))), n.set(r, s));
+ }
+ }
+ for (let [r, a] of j(t, kn, 'f'))
+ j(this, kn, 'f').has(r) ||
+ ((n = n ?? new Map(j(this, kn, 'f'))), n.set(r, a));
+ for (let [r, a] of j(this, nn, 'f')) {
+ let o = j(t, nn, 'f').get(r);
+ if (o !== void 0) {
+ let s = null;
+ for (let l of o) a.has(l) || ((s = s ?? new Set(a)), s.add(l));
+ s !== null && ((i = i ?? new Map(j(this, nn, 'f'))), i.set(r, s));
+ }
+ }
+ for (let [r, a] of j(t, nn, 'f'))
+ j(this, nn, 'f').has(r) ||
+ ((i = i ?? new Map(j(this, nn, 'f'))), i.set(r, new Set(a)));
+ return i === null && n === null
+ ? null
+ : new e(
+ this.env,
+ j(this, Qa, 'f'),
+ n ?? new Map(j(this, kn, 'f')),
+ i ?? new Map(j(this, nn, 'f'))
+ );
+ }
+ clone() {
+ return new e(
+ this.env,
+ j(this, Qa, 'f'),
+ new Map(j(this, kn, 'f')),
+ new Map(j(this, nn, 'f'))
+ );
+ }
+ debug() {
+ let t = {values: {}, variables: {}},
+ n = new Map();
+ function i(r) {
+ let a = n.get(r);
+ return a == null && ((a = n.size), n.set(r, a)), a;
+ }
+ for (let [r, a] of j(this, kn, 'f')) {
+ let o = i(r);
+ t.values[o] = {abstract: this.debugAbstractValue(a), value: ki(r)};
+ }
+ for (let [r, a] of j(this, nn, 'f')) t.variables[`$${r}`] = [...a].map(i);
+ return t;
+ }
+ debugAbstractValue(t) {
+ return {kind: t.kind, reason: [...t.reason]};
+ }
+ inferPhi(t) {
+ let n = new Set();
+ for (let [i, r] of t.operands) {
+ let a = j(this, nn, 'f').get(r.identifier.id);
+ if (a !== void 0) for (let o of a) n.add(o);
+ }
+ n.size > 0 && j(this, nn, 'f').set(t.place.identifier.id, n);
+ }
+ };
+ (Qa = new WeakMap()), (kn = new WeakMap()), (nn = new WeakMap());
+ function n0(e, t) {
+ let n = W6(e.kind, t.kind);
+ if (n === e.kind && n === t.kind && Bz(e.reason, t.reason)) return e;
+ let i = new Set(e.reason);
+ for (let r of t.reason) i.add(r);
+ return {kind: n, reason: i};
+ }
+ function Qm(e) {
+ return eI(e.identifier) || nI(e.identifier) || tI(e.identifier)
+ ? null
+ : {kind: 'MutateTransitiveConditionally', value: e};
+ }
+ function q6(e, t, n) {
+ let {lvalue: i, value: r} = n,
+ a = [];
+ switch (r.kind) {
+ case 'ArrayExpression': {
+ a.push({kind: 'Create', into: i, value: z.Mutable, reason: qe.Other});
+ for (let o of r.elements)
+ if (o.kind === 'Identifier')
+ a.push({kind: 'Capture', from: o, into: i});
+ else if (o.kind === 'Spread') {
+ let s = Qm(o.place);
+ s != null && a.push(s),
+ a.push({kind: 'Capture', from: o.place, into: i});
+ } else continue;
+ break;
+ }
+ case 'ObjectExpression': {
+ a.push({kind: 'Create', into: i, value: z.Mutable, reason: qe.Other});
+ for (let o of r.properties)
+ o.kind === 'ObjectProperty'
+ ? a.push({kind: 'Capture', from: o.place, into: i})
+ : a.push({kind: 'Capture', from: o.place, into: i});
+ break;
+ }
+ case 'Await': {
+ a.push({kind: 'Create', into: i, value: z.Mutable, reason: qe.Other}),
+ a.push({kind: 'MutateTransitiveConditionally', value: r.value}),
+ a.push({kind: 'Capture', from: r.value, into: i});
+ break;
+ }
+ case 'NewExpression':
+ case 'CallExpression':
+ case 'MethodCall': {
+ let o, s, l;
+ r.kind === 'NewExpression'
+ ? ((o = r.callee), (s = r.callee), (l = !1))
+ : r.kind === 'CallExpression'
+ ? ((o = r.callee), (s = r.callee), (l = !0))
+ : r.kind === 'MethodCall'
+ ? ((o = r.property), (s = r.receiver), (l = !1))
+ : Me(r, `Unexpected value kind '${r.kind}'`);
+ let d = Ui(t, o.identifier.type);
+ a.push({
+ kind: 'Apply',
+ receiver: s,
+ function: o,
+ mutatesFunction: l,
+ args: r.args,
+ into: i,
+ signature: d,
+ loc: r.loc,
+ });
+ break;
+ }
+ case 'PropertyDelete':
+ case 'ComputedDelete': {
+ a.push({kind: 'Create', into: i, value: z.Primitive, reason: qe.Other}),
+ a.push({kind: 'Mutate', value: r.object});
+ break;
+ }
+ case 'PropertyLoad':
+ case 'ComputedLoad': {
+ km(i.identifier)
+ ? a.push({
+ kind: 'Create',
+ into: i,
+ value: z.Primitive,
+ reason: qe.Other,
+ })
+ : a.push({kind: 'CreateFrom', from: r.object, into: i});
+ break;
+ }
+ case 'PropertyStore':
+ case 'ComputedStore': {
+ let o =
+ r.kind === 'PropertyStore' &&
+ r.property === 'current' &&
+ r.object.identifier.type.kind === 'Type'
+ ? {kind: 'AssignCurrentProperty'}
+ : null;
+ a.push({kind: 'Mutate', value: r.object, reason: o}),
+ a.push({kind: 'Capture', from: r.value, into: r.object}),
+ a.push({
+ kind: 'Create',
+ into: i,
+ value: z.Primitive,
+ reason: qe.Other,
+ });
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ a.push({
+ kind: 'CreateFunction',
+ into: i,
+ function: r,
+ captures: r.loweredFunc.func.context.filter(
+ (o) => o.effect === x.Capture
+ ),
+ });
+ break;
+ }
+ case 'GetIterator': {
+ a.push({kind: 'Create', into: i, value: z.Mutable, reason: qe.Other}),
+ eI(r.collection.identifier) ||
+ tI(r.collection.identifier) ||
+ nI(r.collection.identifier)
+ ? a.push({kind: 'Capture', from: r.collection, into: i})
+ : (a.push({kind: 'Alias', from: r.collection, into: i}),
+ a.push({
+ kind: 'MutateTransitiveConditionally',
+ value: r.collection,
+ }));
+ break;
+ }
+ case 'IteratorNext': {
+ a.push({kind: 'MutateConditionally', value: r.iterator}),
+ a.push({kind: 'CreateFrom', from: r.collection, into: i});
+ break;
+ }
+ case 'NextPropertyOf': {
+ a.push({kind: 'Create', into: i, value: z.Primitive, reason: qe.Other});
+ break;
+ }
+ case 'JsxExpression':
+ case 'JsxFragment': {
+ a.push({
+ kind: 'Create',
+ into: i,
+ value: z.Frozen,
+ reason: qe.JsxCaptured,
+ });
+ for (let o of Ot(r))
+ a.push({kind: 'Freeze', value: o, reason: qe.JsxCaptured}),
+ a.push({kind: 'Capture', from: o, into: i});
+ if (r.kind === 'JsxExpression') {
+ if (
+ (r.tag.kind === 'Identifier' &&
+ a.push({kind: 'Render', place: r.tag}),
+ r.children != null)
+ )
+ for (let o of r.children) a.push({kind: 'Render', place: o});
+ for (let o of r.props)
+ o.kind === 'JsxAttribute' &&
+ o.place.identifier.type.kind === 'Function' &&
+ (nv(o.place.identifier.type.return) ||
+ (o.place.identifier.type.return.kind === 'Phi' &&
+ o.place.identifier.type.return.operands.some((s) =>
+ nv(s)
+ ))) &&
+ a.push({kind: 'Render', place: o.place});
+ }
+ break;
+ }
+ case 'DeclareLocal': {
+ a.push({
+ kind: 'Create',
+ into: r.lvalue.place,
+ value: z.Primitive,
+ reason: qe.Other,
+ }),
+ a.push({
+ kind: 'Create',
+ into: i,
+ value: z.Primitive,
+ reason: qe.Other,
+ });
+ break;
+ }
+ case 'Destructure': {
+ for (let o of DB(r.lvalue.pattern)) {
+ let s = o.kind === 'Identifier' ? o : o.place;
+ km(s.identifier)
+ ? a.push({
+ kind: 'Create',
+ into: s,
+ value: z.Primitive,
+ reason: qe.Other,
+ })
+ : o.kind === 'Identifier'
+ ? a.push({kind: 'CreateFrom', from: r.value, into: s})
+ : (a.push({
+ kind: 'Create',
+ into: s,
+ reason: qe.Other,
+ value: e.nonMutatingSpreads.has(s.identifier.id)
+ ? z.Frozen
+ : z.Mutable,
+ }),
+ a.push({kind: 'Capture', from: r.value, into: s}));
+ }
+ a.push({kind: 'Assign', from: r.value, into: i});
+ break;
+ }
+ case 'LoadContext': {
+ a.push({kind: 'CreateFrom', from: r.place, into: i});
+ break;
+ }
+ case 'DeclareContext': {
+ let o = r.lvalue.kind;
+ !e.hoistedContextDeclarations.has(
+ r.lvalue.place.identifier.declarationId
+ ) ||
+ o === Q.HoistedConst ||
+ o === Q.HoistedFunction ||
+ o === Q.HoistedLet
+ ? a.push({
+ kind: 'Create',
+ into: r.lvalue.place,
+ value: z.Mutable,
+ reason: qe.Other,
+ })
+ : a.push({kind: 'Mutate', value: r.lvalue.place}),
+ a.push({
+ kind: 'Create',
+ into: i,
+ value: z.Primitive,
+ reason: qe.Other,
+ });
+ break;
+ }
+ case 'StoreContext': {
+ r.lvalue.kind === Q.Reassign ||
+ e.hoistedContextDeclarations.has(
+ r.lvalue.place.identifier.declarationId
+ )
+ ? a.push({kind: 'Mutate', value: r.lvalue.place})
+ : a.push({
+ kind: 'Create',
+ into: r.lvalue.place,
+ value: z.Mutable,
+ reason: qe.Other,
+ }),
+ a.push({kind: 'Capture', from: r.value, into: r.lvalue.place}),
+ a.push({kind: 'Assign', from: r.value, into: i});
+ break;
+ }
+ case 'LoadLocal': {
+ a.push({kind: 'Assign', from: r.place, into: i});
+ break;
+ }
+ case 'StoreLocal': {
+ a.push({kind: 'Assign', from: r.value, into: r.lvalue.place}),
+ a.push({kind: 'Assign', from: r.value, into: i});
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ a.push({kind: 'Create', into: i, value: z.Primitive, reason: qe.Other}),
+ a.push({
+ kind: 'Create',
+ into: r.lvalue,
+ value: z.Primitive,
+ reason: qe.Other,
+ });
+ break;
+ }
+ case 'StoreGlobal': {
+ let o = `\`${r.name}\``;
+ a.push({
+ kind: 'MutateGlobal',
+ place: r.value,
+ error: Tt.create({
+ category: K.Globals,
+ reason:
+ 'Cannot reassign variables declared outside of the component/hook',
+ description: `Variable ${o} is declared outside of the component/hook. Reassigning this value during render is a form of side effect, which can cause unpredictable behavior depending on when the component happens to re-render. If this variable is used in rendering, use useState instead. Otherwise, consider updating it in an effect. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)`,
+ }).withDetails({
+ kind: 'error',
+ loc: n.loc,
+ message: `${o} cannot be reassigned`,
+ }),
+ }),
+ a.push({kind: 'Assign', from: r.value, into: i});
+ break;
+ }
+ case 'TypeCastExpression': {
+ a.push({kind: 'Assign', from: r.value, into: i});
+ break;
+ }
+ case 'LoadGlobal': {
+ a.push({kind: 'Create', into: i, value: z.Global, reason: qe.Global});
+ break;
+ }
+ case 'StartMemoize':
+ case 'FinishMemoize': {
+ if (t.config.enablePreserveExistingMemoizationGuarantees)
+ for (let o of Ot(r))
+ a.push({kind: 'Freeze', value: o, reason: qe.HookCaptured});
+ a.push({kind: 'Create', into: i, value: z.Primitive, reason: qe.Other});
+ break;
+ }
+ case 'TaggedTemplateExpression':
+ case 'BinaryExpression':
+ case 'Debugger':
+ case 'JSXText':
+ case 'MetaProperty':
+ case 'Primitive':
+ case 'RegExpLiteral':
+ case 'TemplateLiteral':
+ case 'UnaryExpression':
+ case 'UnsupportedNode': {
+ a.push({kind: 'Create', into: i, value: z.Primitive, reason: qe.Other});
+ break;
+ }
+ }
+ return {effects: a};
+ }
+ function K6(e, t, n, i, r, a) {
+ var o, s;
+ let l = (o = t.returnValueReason) !== null && o !== void 0 ? o : qe.Other,
+ d = [];
+ if (
+ (d.push({kind: 'Create', into: n, value: t.returnValueKind, reason: l}),
+ t.impure &&
+ e.env.config.validateNoImpureFunctionsInRender &&
+ d.push({
+ kind: 'Impure',
+ place: i,
+ error: Tt.create({
+ category: K.Purity,
+ reason: 'Cannot call impure function during render',
+ description:
+ (t.canonicalName != null
+ ? `\`${t.canonicalName}\` is an impure function. `
+ : '') +
+ 'Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent)',
+ }).withDetails({
+ kind: 'error',
+ loc: a,
+ message: 'Cannot call impure function',
+ }),
+ }),
+ t.knownIncompatible != null && e.env.isInferredMemoEnabled)
+ ) {
+ let m = new D();
+ throw (
+ (m.pushDiagnostic(
+ Tt.create({
+ category: K.IncompatibleLibrary,
+ reason: 'Use of incompatible library',
+ description: [
+ 'This API returns functions which cannot be memoized without leading to stale UI. To prevent this, by default React Compiler will skip memoizing this component/hook. However, you may see issues if values from this API are passed to other components/hooks that are memoized',
+ ].join(''),
+ }).withDetails({
+ kind: 'error',
+ loc: i.loc,
+ message: t.knownIncompatible,
+ })
+ ),
+ m)
+ );
+ }
+ let u = [],
+ p = [];
+ function y(m, g) {
+ switch (g) {
+ case x.Store: {
+ d.push({kind: 'Mutate', value: m}), u.push(m);
+ break;
+ }
+ case x.Capture: {
+ p.push(m);
+ break;
+ }
+ case x.ConditionallyMutate: {
+ d.push({kind: 'MutateTransitiveConditionally', value: m});
+ break;
+ }
+ case x.ConditionallyMutateIterator: {
+ let S = Qm(m);
+ S != null && d.push(S), d.push({kind: 'Capture', from: m, into: n});
+ break;
+ }
+ case x.Freeze: {
+ d.push({kind: 'Freeze', value: m, reason: l});
+ break;
+ }
+ case x.Mutate: {
+ d.push({kind: 'MutateTransitive', value: m});
+ break;
+ }
+ case x.Read: {
+ d.push({kind: 'ImmutableCapture', from: m, into: n});
+ break;
+ }
+ }
+ }
+ if (t.mutableOnlyIfOperandsAreMutable && V6(e, r)) {
+ d.push({kind: 'Alias', from: i, into: n});
+ for (let m of r) {
+ if (m.kind === 'Hole') continue;
+ let g = m.kind === 'Identifier' ? m : m.place;
+ d.push({kind: 'ImmutableCapture', from: g, into: n});
+ }
+ return d;
+ }
+ t.calleeEffect !== x.Capture && d.push({kind: 'Alias', from: i, into: n}),
+ y(i, t.calleeEffect);
+ for (let m = 0; m < r.length; m++) {
+ let g = r[m];
+ if (g.kind === 'Hole') continue;
+ let S = g.kind === 'Identifier' ? g : g.place,
+ _ =
+ g.kind === 'Identifier' && m < t.positionalParams.length
+ ? t.positionalParams[m]
+ : (s = t.restParam) !== null && s !== void 0
+ ? s
+ : x.ConditionallyMutate,
+ O = H6(_, g);
+ y(S, O);
+ }
+ if (p.length !== 0)
+ if (u.length === 0)
+ for (let m of p) d.push({kind: 'Alias', from: m, into: n});
+ else
+ for (let m of p)
+ for (let g of u) d.push({kind: 'Capture', from: m, into: g});
+ return d;
+ }
+ function V6(e, t) {
+ for (let n of t) {
+ if (n.kind === 'Hole') continue;
+ if (n.kind === 'Identifier' && n.identifier.type.kind === 'Function') {
+ let o = e.env.getFunctionSignature(n.identifier.type);
+ if (o != null)
+ return (
+ !o.positionalParams.some(i0) &&
+ (o.restParam == null || !i0(o.restParam))
+ );
+ }
+ let i = n.kind === 'Identifier' ? n : n.place;
+ switch (e.kind(i).kind) {
+ case z.Primitive:
+ case z.Frozen:
+ break;
+ default:
+ return !1;
+ }
+ let a = e.values(i);
+ for (let o of a)
+ if (
+ o.kind === 'FunctionExpression' &&
+ o.loweredFunc.func.params.some((s) => {
+ let d = (s.kind === 'Identifier' ? s : s.place).identifier
+ .mutableRange;
+ return d.end > d.start + 1;
+ })
+ )
+ return !1;
+ }
+ return !0;
+ }
+ function r0(e, t, n, i, r, a = [], o) {
+ var s, l, d, u, p, y, m;
+ if (
+ t.params.length > r.length ||
+ (r.length > t.params.length && t.rest == null)
+ )
+ return null;
+ let g = new Set(),
+ S = new Map();
+ S.set(t.receiver, [i]), S.set(t.returns, [n]);
+ let _ = t.params;
+ for (let P = 0; P < r.length; P++) {
+ let M = r[P];
+ if (M.kind !== 'Hole')
+ if (_ == null || P >= _.length || M.kind === 'Spread') {
+ if (t.rest == null) return null;
+ let w = M.kind === 'Identifier' ? M : M.place;
+ dr(S, t.rest, () => []).push(w),
+ M.kind === 'Spread' &&
+ Qm(M.place) != null &&
+ g.add(M.place.identifier.id);
+ } else {
+ let w = _[P];
+ S.set(w, [M]);
+ }
+ }
+ for (let P of a) S.set(P.identifier.id, [P]);
+ let O = [];
+ for (let P of t.temporaries) {
+ let M = _t(e, i.loc);
+ S.set(P.identifier.id, [M]);
+ }
+ for (let P of t.effects)
+ switch (P.kind) {
+ case 'MaybeAlias':
+ case 'Assign':
+ case 'ImmutableCapture':
+ case 'Alias':
+ case 'CreateFrom':
+ case 'Capture': {
+ let M =
+ (s = S.get(P.from.identifier.id)) !== null && s !== void 0
+ ? s
+ : [],
+ w =
+ (l = S.get(P.into.identifier.id)) !== null && l !== void 0
+ ? l
+ : [];
+ for (let I of M)
+ for (let U of w) O.push({kind: P.kind, from: I, into: U});
+ break;
+ }
+ case 'Impure':
+ case 'MutateFrozen':
+ case 'MutateGlobal': {
+ let M =
+ (d = S.get(P.place.identifier.id)) !== null && d !== void 0
+ ? d
+ : [];
+ for (let w of M) O.push({kind: P.kind, place: w, error: P.error});
+ break;
+ }
+ case 'Render': {
+ let M =
+ (u = S.get(P.place.identifier.id)) !== null && u !== void 0
+ ? u
+ : [];
+ for (let w of M) O.push({kind: P.kind, place: w});
+ break;
+ }
+ case 'Mutate':
+ case 'MutateTransitive':
+ case 'MutateTransitiveConditionally':
+ case 'MutateConditionally': {
+ let M =
+ (p = S.get(P.value.identifier.id)) !== null && p !== void 0
+ ? p
+ : [];
+ for (let w of M) O.push({kind: P.kind, value: w});
+ break;
+ }
+ case 'Freeze': {
+ let M =
+ (y = S.get(P.value.identifier.id)) !== null && y !== void 0
+ ? y
+ : [];
+ for (let w of M)
+ g.has(w.identifier.id) &&
+ D.throwTodo({
+ reason: 'Support spread syntax for hook arguments',
+ loc: w.loc,
+ }),
+ O.push({kind: 'Freeze', value: w, reason: P.reason});
+ break;
+ }
+ case 'Create': {
+ let M =
+ (m = S.get(P.into.identifier.id)) !== null && m !== void 0 ? m : [];
+ for (let w of M)
+ O.push({kind: 'Create', into: w, value: P.value, reason: P.reason});
+ break;
+ }
+ case 'Apply': {
+ let M = S.get(P.receiver.identifier.id);
+ if (M == null || M.length !== 1) return null;
+ let w = S.get(P.function.identifier.id);
+ if (w == null || w.length !== 1) return null;
+ let I = S.get(P.into.identifier.id);
+ if (I == null || I.length !== 1) return null;
+ let U = [];
+ for (let A of P.args)
+ if (A.kind === 'Hole') U.push(A);
+ else if (A.kind === 'Identifier') {
+ let q = S.get(A.identifier.id);
+ if (q == null || q.length !== 1) return null;
+ U.push(q[0]);
+ } else {
+ let q = S.get(A.place.identifier.id);
+ if (q == null || q.length !== 1) return null;
+ U.push({kind: 'Spread', place: q[0]});
+ }
+ O.push({
+ kind: 'Apply',
+ mutatesFunction: P.mutatesFunction,
+ receiver: M[0],
+ args: U,
+ function: w[0],
+ into: I[0],
+ signature: P.signature,
+ loc: o,
+ });
+ break;
+ }
+ case 'CreateFunction':
+ D.throwTodo({
+ reason: 'Support CreateFrom effects in signatures',
+ loc: i.loc,
+ });
+ default:
+ Me(P, `Unexpected effect kind '${P.kind}'`);
+ }
+ return O;
+ }
+ function J6(e, t) {
+ var n;
+ let i = null,
+ r = [];
+ for (let a of t.loweredFunc.func.params)
+ a.kind === 'Identifier'
+ ? r.push(a.identifier.id)
+ : (i = a.place.identifier.id);
+ return {
+ receiver: yh(0),
+ params: r,
+ rest: i ?? _t(e, t.loc).identifier.id,
+ returns: t.loweredFunc.func.returns.identifier.id,
+ effects:
+ (n = t.loweredFunc.func.aliasingEffects) !== null && n !== void 0
+ ? n
+ : [],
+ temporaries: [],
+ };
+ }
+ function gP(e) {
+ return e.reason.has(qe.Global)
+ ? 'Modifying a variable defined outside a component or hook is not allowed. Consider using an effect'
+ : e.reason.has(qe.JsxCaptured)
+ ? 'Modifying a value used previously in JSX is not allowed. Consider moving the modification before the JSX'
+ : e.reason.has(qe.Context)
+ ? "Modifying a value returned from 'useContext()' is not allowed."
+ : e.reason.has(qe.KnownReturnSignature)
+ ? 'Modifying a value returned from a function whose return value should not be mutated'
+ : e.reason.has(qe.ReactiveFunctionArgument)
+ ? 'Modifying component props or hook arguments is not allowed. Consider using a local variable instead'
+ : e.reason.has(qe.State)
+ ? "Modifying a value returned from 'useState()', which should not be modified directly. Use the setter function to update instead"
+ : e.reason.has(qe.ReducerState)
+ ? "Modifying a value returned from 'useReducer()', which should not be modified directly. Use the dispatch function to update instead"
+ : e.reason.has(qe.Effect)
+ ? 'Modifying a value used previously in an effect function or as an effect dependency is not allowed. Consider moving the modification before calling useEffect()'
+ : e.reason.has(qe.HookCaptured)
+ ? 'Modifying a value previously passed as an argument to a hook is not allowed. Consider moving the modification before calling the hook'
+ : e.reason.has(qe.HookReturn)
+ ? 'Modifying a value returned from a hook is not allowed. Consider moving the modification into the hook where the value is constructed'
+ : 'This modifies a variable that React considers immutable';
+ }
+ function H6(e, t) {
+ return e != null
+ ? t.kind === 'Identifier' || e === x.Mutate || e === x.ConditionallyMutate
+ ? e
+ : (e === x.Freeze &&
+ D.throwTodo({
+ reason: 'Support spread syntax for hook arguments',
+ loc: t.place.loc,
+ }),
+ x.ConditionallyMutateIterator)
+ : x.ConditionallyMutate;
+ }
+ function Ui(e, t) {
+ return t.kind !== 'Function' ? null : e.getFunctionSignature(t);
+ }
+ function i0(e) {
+ switch (e) {
+ case x.Store:
+ case x.ConditionallyMutate:
+ case x.ConditionallyMutateIterator:
+ case x.Mutate:
+ return !0;
+ case x.Unknown:
+ D.invariant(!1, {
+ reason: 'Unexpected unknown effect',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ });
+ case x.Read:
+ case x.Capture:
+ case x.Freeze:
+ return !1;
+ default:
+ Me(e, `Unexpected effect \`${e}\``);
+ }
+ }
+ function W6(e, t) {
+ return e === t
+ ? e
+ : e === z.MaybeFrozen || t === z.MaybeFrozen
+ ? z.MaybeFrozen
+ : e === z.Mutable || t === z.Mutable
+ ? e === z.Frozen || t === z.Frozen
+ ? z.MaybeFrozen
+ : e === z.Context || t === z.Context
+ ? z.Context
+ : z.Mutable
+ : e === z.Context || t === z.Context
+ ? e === z.Frozen || t === z.Frozen
+ ? z.MaybeFrozen
+ : z.Context
+ : e === z.Frozen || t === z.Frozen
+ ? z.Frozen
+ : e === z.Global || t === z.Global
+ ? z.Global
+ : (D.invariant(e === z.Primitive && t == z.Primitive, {
+ reason: 'Unexpected value kind in mergeValues()',
+ description: `Found kinds ${e} and ${t}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ z.Primitive);
+ }
+ function G6(e) {
+ let t = new $v(e.env);
+ for (let i of e.params)
+ i.kind === 'Identifier'
+ ? t.declare(i.identifier.declarationId)
+ : t.declare(i.place.identifier.declarationId);
+ At(e, new jv(e.env, t), []);
+ let n = Y6(t);
+ At(e, new Cv(), n);
+ }
+ var rt;
+ (function (e) {
+ (e.Memoized = 'Memoized'),
+ (e.Conditional = 'Conditional'),
+ (e.Unmemoized = 'Unmemoized'),
+ (e.Never = 'Never');
+ })(rt || (rt = {}));
+ function X6(e, t) {
+ return e === rt.Memoized || t === rt.Memoized
+ ? rt.Memoized
+ : e === rt.Conditional || t === rt.Conditional
+ ? rt.Conditional
+ : e === rt.Unmemoized || t === rt.Unmemoized
+ ? rt.Unmemoized
+ : rt.Never;
+ }
+ var $v = class {
+ constructor(t) {
+ (this.definitions = new Map()),
+ (this.identifiers = new Map()),
+ (this.scopes = new Map()),
+ (this.escapingValues = new Set()),
+ (this.env = t);
+ }
+ declare(t) {
+ this.identifiers.set(t, {
+ level: rt.Never,
+ memoized: !1,
+ dependencies: new Set(),
+ scopes: new Set(),
+ seen: !1,
+ });
+ }
+ visitOperand(t, n, i) {
+ let r = Km(t, n);
+ if (r !== null) {
+ let a = this.scopes.get(r.id);
+ a === void 0 &&
+ ((a = {
+ dependencies: [...r.dependencies].map(
+ (s) => s.identifier.declarationId
+ ),
+ seen: !1,
+ }),
+ this.scopes.set(r.id, a));
+ let o = this.identifiers.get(i);
+ D.invariant(o !== void 0, {
+ reason: 'Expected identifier to be initialized',
+ description: `[${t}] operand=${_e(
+ n
+ )} for identifier declaration ${i}`,
+ details: [{kind: 'error', loc: n.loc, message: null}],
+ suggestions: null,
+ }),
+ o.scopes.add(r.id);
+ }
+ }
+ };
+ function Y6(e) {
+ let t = new Set();
+ function n(r, a = !1) {
+ let o = e.identifiers.get(r);
+ if (
+ (D.invariant(o !== void 0, {
+ reason: `Expected a node for all identifiers, none found for \`${r}\``,
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ o.seen)
+ )
+ return o.memoized;
+ (o.seen = !0), (o.memoized = !1);
+ let s = !1;
+ for (let l of o.dependencies) {
+ let d = n(l);
+ s || (s = d);
+ }
+ if (
+ o.level === rt.Memoized ||
+ (o.level === rt.Conditional && (s || a)) ||
+ (o.level === rt.Unmemoized && a)
+ ) {
+ (o.memoized = !0), t.add(r);
+ for (let l of o.scopes) i(l);
+ }
+ return o.memoized;
+ }
+ function i(r) {
+ let a = e.scopes.get(r);
+ if (
+ (D.invariant(a !== void 0, {
+ reason: 'Expected a node for all scopes',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ !a.seen)
+ ) {
+ a.seen = !0;
+ for (let o of a.dependencies) n(o, !0);
+ }
+ }
+ for (let r of e.escapingValues) n(r);
+ return t;
+ }
+ function Q6(e) {
+ let t = [];
+ switch (e.kind) {
+ case 'ArrayPattern': {
+ for (let n of e.items)
+ n.kind === 'Identifier'
+ ? t.push({place: n, level: rt.Conditional})
+ : n.kind === 'Spread' &&
+ t.push({place: n.place, level: rt.Memoized});
+ break;
+ }
+ case 'ObjectPattern': {
+ for (let n of e.properties)
+ n.kind === 'ObjectProperty'
+ ? t.push({place: n.place, level: rt.Conditional})
+ : t.push({place: n.place, level: rt.Memoized});
+ break;
+ }
+ default:
+ Me(e, `Unexpected pattern kind \`${e.kind}\``);
+ }
+ return t;
+ }
+ var jv = class extends Qt {
+ constructor(t, n) {
+ super(),
+ (this.env = t),
+ (this.state = n),
+ (this.options = {
+ memoizeJsxElements: !this.env.config.enableForest,
+ forceMemoizePrimitives:
+ this.env.config.enableForest ||
+ this.env.config.enablePreserveExistingMemoizationGuarantees,
+ });
+ }
+ computeMemoizationInputs(t, n) {
+ let i = this.env,
+ r = this.options;
+ switch (t.kind) {
+ case 'ConditionalExpression':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [
+ ...this.computeMemoizationInputs(t.consequent, null).rvalues,
+ ...this.computeMemoizationInputs(t.alternate, null).rvalues,
+ ],
+ };
+ case 'LogicalExpression':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [
+ ...this.computeMemoizationInputs(t.left, null).rvalues,
+ ...this.computeMemoizationInputs(t.right, null).rvalues,
+ ],
+ };
+ case 'SequenceExpression': {
+ for (let a of t.instructions)
+ this.visitValueForMemoization(a.id, a.value, a.lvalue);
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: this.computeMemoizationInputs(t.value, null).rvalues,
+ };
+ }
+ case 'JsxExpression': {
+ let a = [];
+ t.tag.kind === 'Identifier' && a.push(t.tag);
+ for (let s of t.props)
+ s.kind === 'JsxAttribute' ? a.push(s.place) : a.push(s.argument);
+ if (t.children !== null) for (let s of t.children) a.push(s);
+ let o = r.memoizeJsxElements ? rt.Memoized : rt.Unmemoized;
+ return {
+ lvalues: n !== null ? [{place: n, level: o}] : [],
+ rvalues: a,
+ };
+ }
+ case 'JsxFragment': {
+ let a = r.memoizeJsxElements ? rt.Memoized : rt.Unmemoized;
+ return {
+ lvalues: n !== null ? [{place: n, level: a}] : [],
+ rvalues: t.children,
+ };
+ }
+ case 'NextPropertyOf':
+ case 'StartMemoize':
+ case 'FinishMemoize':
+ case 'Debugger':
+ case 'ComputedDelete':
+ case 'PropertyDelete':
+ case 'LoadGlobal':
+ case 'MetaProperty':
+ case 'TemplateLiteral':
+ case 'Primitive':
+ case 'JSXText':
+ case 'BinaryExpression':
+ case 'UnaryExpression': {
+ if (r.forceMemoizePrimitives) {
+ let o = rt.Conditional;
+ return {
+ lvalues: n !== null ? [{place: n, level: o}] : [],
+ rvalues: [...Hn(t)],
+ };
+ }
+ let a = rt.Never;
+ return {
+ lvalues: n !== null ? [{place: n, level: a}] : [],
+ rvalues: [],
+ };
+ }
+ case 'Await':
+ case 'TypeCastExpression':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [t.value],
+ };
+ case 'IteratorNext':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [t.iterator, t.collection],
+ };
+ case 'GetIterator':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [t.collection],
+ };
+ case 'LoadLocal':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [t.place],
+ };
+ case 'LoadContext':
+ return {
+ lvalues: n !== null ? [{place: n, level: rt.Conditional}] : [],
+ rvalues: [t.place],
+ };
+ case 'DeclareContext': {
+ let a = [{place: t.lvalue.place, level: rt.Memoized}];
+ return (
+ n !== null && a.push({place: n, level: rt.Unmemoized}),
+ {lvalues: a, rvalues: []}
+ );
+ }
+ case 'DeclareLocal': {
+ let a = [{place: t.lvalue.place, level: rt.Unmemoized}];
+ return (
+ n !== null && a.push({place: n, level: rt.Unmemoized}),
+ {lvalues: a, rvalues: []}
+ );
+ }
+ case 'PrefixUpdate':
+ case 'PostfixUpdate': {
+ let a = [{place: t.lvalue, level: rt.Conditional}];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'StoreLocal': {
+ let a = [{place: t.lvalue.place, level: rt.Conditional}];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'StoreContext': {
+ let a = [{place: t.lvalue.place, level: rt.Memoized}];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'StoreGlobal': {
+ let a = [];
+ return (
+ n !== null && a.push({place: n, level: rt.Unmemoized}),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'Destructure': {
+ let a = [];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ a.push(...Q6(t.lvalue.pattern)),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'ComputedLoad':
+ case 'PropertyLoad': {
+ let a = rt.Conditional;
+ return {
+ lvalues: n !== null ? [{place: n, level: a}] : [],
+ rvalues: [t.object],
+ };
+ }
+ case 'ComputedStore': {
+ let a = [{place: t.object, level: rt.Conditional}];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ {lvalues: a, rvalues: [t.value]}
+ );
+ }
+ case 'OptionalExpression': {
+ let a = [];
+ return (
+ n !== null && a.push({place: n, level: rt.Conditional}),
+ {
+ lvalues: a,
+ rvalues: [
+ ...this.computeMemoizationInputs(t.value, null).rvalues,
+ ],
+ }
+ );
+ }
+ case 'TaggedTemplateExpression': {
+ let a = Ui(i, t.tag.identifier.type),
+ o = [];
+ if (
+ (n !== null && o.push({place: n, level: rt.Memoized}),
+ a?.noAlias === !0)
+ )
+ return {lvalues: o, rvalues: []};
+ let s = [...Hn(t)];
+ return (
+ o.push(
+ ...s
+ .filter((l) => Op(l.effect, l.loc))
+ .map((l) => ({place: l, level: rt.Memoized}))
+ ),
+ {lvalues: o, rvalues: s}
+ );
+ }
+ case 'CallExpression': {
+ let a = Ui(i, t.callee.identifier.type),
+ o = [];
+ if (
+ (n !== null && o.push({place: n, level: rt.Memoized}),
+ a?.noAlias === !0)
+ )
+ return {lvalues: o, rvalues: []};
+ let s = [...Hn(t)];
+ return (
+ o.push(
+ ...s
+ .filter((l) => Op(l.effect, l.loc))
+ .map((l) => ({place: l, level: rt.Memoized}))
+ ),
+ {lvalues: o, rvalues: s}
+ );
+ }
+ case 'MethodCall': {
+ let a = Ui(i, t.property.identifier.type),
+ o = [];
+ if (
+ (n !== null && o.push({place: n, level: rt.Memoized}),
+ a?.noAlias === !0)
+ )
+ return {lvalues: o, rvalues: []};
+ let s = [...Hn(t)];
+ return (
+ o.push(
+ ...s
+ .filter((l) => Op(l.effect, l.loc))
+ .map((l) => ({place: l, level: rt.Memoized}))
+ ),
+ {lvalues: o, rvalues: s}
+ );
+ }
+ case 'RegExpLiteral':
+ case 'ObjectMethod':
+ case 'FunctionExpression':
+ case 'ArrayExpression':
+ case 'NewExpression':
+ case 'ObjectExpression':
+ case 'PropertyStore': {
+ let a = [...Hn(t)],
+ o = a
+ .filter((s) => Op(s.effect, s.loc))
+ .map((s) => ({place: s, level: rt.Memoized}));
+ return (
+ n !== null && o.push({place: n, level: rt.Memoized}),
+ {lvalues: o, rvalues: a}
+ );
+ }
+ case 'UnsupportedNode': {
+ let a = [];
+ return (
+ n !== null && a.push({place: n, level: rt.Never}),
+ {lvalues: a, rvalues: []}
+ );
+ }
+ default:
+ Me(t, `Unexpected value kind \`${t.kind}\``);
+ }
+ }
+ visitValueForMemoization(t, n, i) {
+ var r, a, o;
+ let s = this.state,
+ l = this.computeMemoizationInputs(n, i);
+ for (let d of l.rvalues) {
+ let u =
+ (r = s.definitions.get(d.identifier.declarationId)) !== null &&
+ r !== void 0
+ ? r
+ : d.identifier.declarationId;
+ s.visitOperand(t, d, u);
+ }
+ for (let {place: d, level: u} of l.lvalues) {
+ let p =
+ (a = s.definitions.get(d.identifier.declarationId)) !== null &&
+ a !== void 0
+ ? a
+ : d.identifier.declarationId,
+ y = s.identifiers.get(p);
+ y === void 0 &&
+ ((y = {
+ level: rt.Never,
+ memoized: !1,
+ dependencies: new Set(),
+ scopes: new Set(),
+ seen: !1,
+ }),
+ s.identifiers.set(p, y)),
+ (y.level = X6(y.level, u));
+ for (let m of l.rvalues) {
+ let g =
+ (o = s.definitions.get(m.identifier.declarationId)) !== null &&
+ o !== void 0
+ ? o
+ : m.identifier.declarationId;
+ g !== p && y.dependencies.add(g);
+ }
+ s.visitOperand(t, d, p);
+ }
+ if (n.kind === 'LoadLocal' && i !== null)
+ s.definitions.set(
+ i.identifier.declarationId,
+ n.place.identifier.declarationId
+ );
+ else if (n.kind === 'CallExpression' || n.kind === 'MethodCall') {
+ let d = n.kind === 'CallExpression' ? n.callee : n.property;
+ if (Qn(s.env, d.identifier) != null) {
+ let u = Ui(this.env, d.identifier.type);
+ if (u && u.noAlias === !0) return;
+ for (let p of n.args) {
+ let y = p.kind === 'Spread' ? p.place : p;
+ s.escapingValues.add(y.identifier.declarationId);
+ }
+ }
+ }
+ }
+ visitInstruction(t, n) {
+ this.visitValueForMemoization(t.id, t.value, t.lvalue);
+ }
+ visitTerminal(t, n) {
+ if ((this.traverseTerminal(t, n), t.terminal.kind === 'return')) {
+ this.state.escapingValues.add(
+ t.terminal.value.identifier.declarationId
+ );
+ let i = this.state.identifiers.get(
+ t.terminal.value.identifier.declarationId
+ );
+ D.invariant(i !== void 0, {
+ reason: 'Expected identifier to be initialized',
+ description: null,
+ details: [{kind: 'error', loc: t.terminal.loc, message: null}],
+ suggestions: null,
+ });
+ for (let r of n) i.scopes.add(r.id);
+ }
+ }
+ visitScope(t, n) {
+ for (let i of t.scope.reassignments) {
+ let r = this.state.identifiers.get(i.declarationId);
+ D.invariant(r !== void 0, {
+ reason: 'Expected identifier to be initialized',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ suggestions: null,
+ });
+ for (let a of n) r.scopes.add(a.id);
+ r.scopes.add(t.scope.id);
+ }
+ this.traverseScope(t, [...n, t.scope]);
+ }
+ },
+ Cv = class extends Ei {
+ constructor() {
+ super(...arguments),
+ (this.prunedScopes = new Set()),
+ (this.reassignments = new Map());
+ }
+ transformScope(t, n) {
+ return (
+ this.visitScope(t, n),
+ (t.scope.declarations.size === 0 &&
+ t.scope.reassignments.size === 0) ||
+ t.scope.earlyReturnValue !== null
+ ? {kind: 'keep'}
+ : Array.from(t.scope.declarations.values()).some((r) =>
+ n.has(r.identifier.declarationId)
+ ) ||
+ Array.from(t.scope.reassignments).some((r) =>
+ n.has(r.declarationId)
+ )
+ ? {kind: 'keep'}
+ : (this.prunedScopes.add(t.scope.id),
+ {kind: 'replace-many', value: t.instructions})
+ );
+ }
+ transformInstruction(t, n) {
+ var i;
+ this.traverseInstruction(t, n);
+ let r = t.value;
+ if (r.kind === 'StoreLocal' && r.lvalue.kind === 'Reassign')
+ Xn(
+ this.reassignments,
+ r.lvalue.place.identifier.declarationId,
+ new Set()
+ ).add(r.value.identifier);
+ else if (
+ r.kind === 'LoadLocal' &&
+ r.place.identifier.scope != null &&
+ t.lvalue != null &&
+ t.lvalue.identifier.scope == null
+ )
+ Xn(
+ this.reassignments,
+ t.lvalue.identifier.declarationId,
+ new Set()
+ ).add(r.place.identifier);
+ else if (r.kind === 'FinishMemoize') {
+ let a;
+ r.decl.identifier.scope == null
+ ? (a =
+ (i = this.reassignments.get(
+ r.decl.identifier.declarationId
+ )) !== null && i !== void 0
+ ? i
+ : [r.decl.identifier])
+ : (a = [r.decl.identifier]),
+ [...a].every(
+ (o) => o.scope == null || this.prunedScopes.has(o.scope.id)
+ ) && (r.pruned = !0);
+ }
+ return {kind: 'keep'};
+ }
+ },
+ e2 = class extends Qt {
+ visitLValue(t, n, i) {
+ this.visitPlace(t, n, i);
+ }
+ visitPlace(t, n, i) {
+ n.reactive && i.add(n.identifier.id);
+ }
+ visitPrunedScope(t, n) {
+ this.traversePrunedScope(t, n);
+ for (let [i, r] of t.scope.declarations)
+ !km(r.identifier) && !t2(r.identifier, n) && n.add(i);
+ }
+ };
+ function t2(e, t) {
+ return Yn(e) && !t.has(e.id);
+ }
+ function n2(e) {
+ let t = new e2(),
+ n = new Set();
+ return At(e, t, n), n;
+ }
+ function r2(e) {
+ let t = n2(e);
+ At(e, new i2(), t);
+ }
+ var i2 = class extends Qt {
+ visitInstruction(t, n) {
+ this.traverseInstruction(t, n);
+ let {lvalue: i, value: r} = t;
+ switch (r.kind) {
+ case 'LoadLocal': {
+ i !== null && n.has(r.place.identifier.id) && n.add(i.identifier.id);
+ break;
+ }
+ case 'StoreLocal': {
+ n.has(r.value.identifier.id) &&
+ (n.add(r.lvalue.place.identifier.id),
+ i !== null && n.add(i.identifier.id));
+ break;
+ }
+ case 'Destructure': {
+ if (n.has(r.value.identifier.id)) {
+ for (let a of kr(r.lvalue.pattern))
+ Sm(a.identifier) || n.add(a.identifier.id);
+ i !== null && n.add(i.identifier.id);
+ }
+ break;
+ }
+ case 'PropertyLoad': {
+ i !== null &&
+ n.has(r.object.identifier.id) &&
+ !Sm(i.identifier) &&
+ n.add(i.identifier.id);
+ break;
+ }
+ case 'ComputedLoad': {
+ i !== null &&
+ (n.has(r.object.identifier.id) ||
+ n.has(r.property.identifier.id)) &&
+ n.add(i.identifier.id);
+ break;
+ }
+ }
+ }
+ visitScope(t, n) {
+ this.traverseScope(t, n);
+ for (let i of t.scope.dependencies)
+ n.has(i.identifier.id) || t.scope.dependencies.delete(i);
+ if (t.scope.dependencies.size !== 0) {
+ for (let [, i] of t.scope.declarations) n.add(i.identifier.id);
+ for (let i of t.scope.reassignments) n.add(i.id);
+ }
+ }
+ };
+ function Am(e) {
+ let t = new Map();
+ At(e, new a2(), t);
+ for (let [, n] of t) n.lvalue = null;
+ }
+ var a2 = class extends Qt {
+ visitPlace(t, n, i) {
+ i.delete(n.identifier.declarationId);
+ }
+ visitInstruction(t, n) {
+ this.traverseInstruction(t, n),
+ t.lvalue !== null &&
+ t.lvalue.identifier.name === null &&
+ n.set(t.lvalue.identifier.declarationId, t);
+ }
+ };
+ function Mm(e) {
+ let t = new Set();
+ At(e, new o2(), t);
+ }
+ var o2 = class extends Ei {
+ transformTerminal(t, n) {
+ this.traverseTerminal(t, n);
+ let {terminal: i} = t;
+ (i.kind === 'break' || i.kind === 'continue') &&
+ i.targetKind === 'labeled' &&
+ n.add(i.target);
+ let r = t.label !== null && n.has(t.label.id);
+ if (t.terminal.kind === 'label' && !r) {
+ let a = [...t.terminal.block],
+ o = a.at(-1);
+ return (
+ o !== void 0 &&
+ o.kind === 'terminal' &&
+ o.terminal.kind === 'break' &&
+ o.terminal.target === null &&
+ a.pop(),
+ {kind: 'replace-many', value: a}
+ );
+ } else
+ return !r && t.label != null && (t.label.implicit = !0), {kind: 'keep'};
+ }
+ };
+ function s2(e) {
+ At(e, new l2(), {hasReturnStatement: !1});
+ }
+ var l2 = class extends Ei {
+ visitTerminal(t, n) {
+ this.traverseTerminal(t, n),
+ t.terminal.kind === 'return' && (n.hasReturnStatement = !0);
+ }
+ transformScope(t, n) {
+ let i = {hasReturnStatement: !1};
+ return (
+ this.visitScope(t, i),
+ !i.hasReturnStatement &&
+ t.scope.reassignments.size === 0 &&
+ (t.scope.declarations.size === 0 || !c2(t))
+ ? {
+ kind: 'replace',
+ value: {
+ kind: 'pruned-scope',
+ scope: t.scope,
+ instructions: t.instructions,
+ },
+ }
+ : {kind: 'keep'}
+ );
+ }
+ };
+ function c2(e) {
+ for (let t of e.scope.declarations.values())
+ if (t.scope.id === e.scope.id) return !0;
+ return !1;
+ }
+ function u2(e) {
+ let t = new Set();
+ return At(e, new d2(), t), t;
+ }
+ var d2 = class extends Qt {
+ visitValue(t, n, i) {
+ this.traverseValue(t, n, i),
+ n.kind === 'FunctionExpression' || n.kind === 'ObjectMethod'
+ ? this.visitHirFunction(n.loweredFunc.func, i)
+ : n.kind === 'LoadGlobal' && i.add(n.binding.name);
+ }
+ visitReactiveFunctionValue(t, n, i, r) {
+ At(i, this, r);
+ }
+ },
+ Dv,
+ rm,
+ ka,
+ im,
+ am,
+ vP;
+ function hP(e) {
+ let t = u2(e),
+ n = new Av(t, e.env.programContext);
+ return bP(e, new f2(), n), new Set([...n.names, ...t]);
+ }
+ function bP(e, t, n) {
+ n.enter(() => {
+ for (let i of e.params)
+ i.kind === 'Identifier'
+ ? n.visit(i.identifier)
+ : n.visit(i.place.identifier);
+ At(e, t, n);
+ });
+ }
+ var f2 = class extends Qt {
+ visitParam(t, n) {
+ n.visit(t.identifier);
+ }
+ visitLValue(t, n, i) {
+ i.visit(n.identifier);
+ }
+ visitPlace(t, n, i) {
+ i.visit(n.identifier);
+ }
+ visitBlock(t, n) {
+ n.enter(() => {
+ this.traverseBlock(t, n);
+ });
+ }
+ visitPrunedScope(t, n) {
+ this.traverseBlock(t.instructions, n);
+ }
+ visitScope(t, n) {
+ for (let [i, r] of t.scope.declarations) n.visit(r.identifier);
+ this.traverseScope(t, n);
+ }
+ visitValue(t, n, i) {
+ this.traverseValue(t, n, i),
+ (n.kind === 'FunctionExpression' || n.kind === 'ObjectMethod') &&
+ this.visitHirFunction(n.loweredFunc.func, i);
+ }
+ visitReactiveFunctionValue(t, n, i, r) {
+ bP(i, this, r);
+ }
+ },
+ Av = class {
+ constructor(t, n) {
+ Dv.add(this),
+ rm.set(this, new Map()),
+ ka.set(this, [new Map()]),
+ im.set(this, void 0),
+ am.set(this, void 0),
+ (this.names = new Set()),
+ at(this, im, t, 'f'),
+ at(this, am, n, 'f');
+ }
+ visit(t) {
+ let n = t.name;
+ if (n === null) return;
+ let i = j(this, rm, 'f').get(t.declarationId);
+ if (i !== void 0) {
+ t.name = i;
+ return;
+ }
+ let r = n.value,
+ a = 0;
+ for (
+ pE(n.value) ? (r = `t${a++}`) : mE(n.value) && (r = `T${a++}`);
+ j(this, Dv, 'm', vP).call(this, r) !== null ||
+ j(this, im, 'f').has(r);
+
+ )
+ pE(n.value)
+ ? (r = `t${a++}`)
+ : mE(n.value)
+ ? (r = `T${a++}`)
+ : (r = `${n.value}$${a++}`);
+ j(this, am, 'f').addNewReference(r);
+ let o = uo(r);
+ (t.name = o),
+ j(this, rm, 'f').set(t.declarationId, o),
+ j(this, ka, 'f').at(-1).set(o.value, t.declarationId),
+ this.names.add(o.value);
+ }
+ enter(t) {
+ let n = new Map();
+ j(this, ka, 'f').push(n), t();
+ let i = j(this, ka, 'f').pop();
+ D.invariant(i === n, {
+ reason: 'Mismatch push/pop calls',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ }
+ };
+ (rm = new WeakMap()),
+ (ka = new WeakMap()),
+ (im = new WeakMap()),
+ (am = new WeakMap()),
+ (Dv = new WeakSet()),
+ (vP = function (t) {
+ for (let n = j(this, ka, 'f').length - 1; n >= 0; n--) {
+ let r = j(this, ka, 'f')[n].get(t);
+ if (r !== void 0) return r;
+ }
+ return null;
+ });
+ function p2(e) {
+ let t = new Set();
+ At(e, new Mv(), t);
+ let n = new Map();
+ for (let i of t) n.set(i, Zi(n.size));
+ At(e, new Nv(), n);
+ }
+ var Mv = class extends Qt {
+ visitScope(t, n) {
+ let {earlyReturnValue: i} = t.scope;
+ i != null && n.add(i.label), this.traverseScope(t, n);
+ }
+ visitTerminal(t, n) {
+ t.label != null && (t.label.implicit || n.add(t.label.id)),
+ this.traverseTerminal(t, n);
+ }
+ },
+ Nv = class extends Qt {
+ visitScope(t, n) {
+ let {earlyReturnValue: i} = t.scope;
+ if (i != null) {
+ let r = Xn(n, i.label, n.size);
+ i.label = Zi(r);
+ }
+ this.traverseScope(t, n);
+ }
+ visitTerminal(t, n) {
+ if (t.label != null) {
+ let r = Xn(n, t.label.id, n.size);
+ t.label.id = Zi(r);
+ }
+ let i = t.terminal;
+ if (i.kind === 'break' || i.kind === 'continue') {
+ let r = Xn(n, i.target, n.size);
+ i.target = Zi(r);
+ }
+ this.traverseTerminal(t, n);
+ }
+ };
+ function kP(e, {isFunctionExpression: t}) {
+ var n, i, r, a, o, s, l;
+ let d = [],
+ u = new Rv(),
+ p = new Map(),
+ y = [],
+ m = [],
+ g = 0,
+ S = new D();
+ for (let w of [...e.params, ...e.context, e.returns]) {
+ let I = w.kind === 'Identifier' ? w : w.place;
+ u.create(I, {kind: 'Object'});
+ }
+ let _ = new Set();
+ for (let w of e.body.blocks.values()) {
+ for (let U of w.phis) {
+ u.create(U.place, {kind: 'Phi'});
+ for (let [A, q] of U.operands)
+ _.has(A)
+ ? u.assign(g++, q, U.place)
+ : dr(p, A, () => []).push({from: q, into: U.place, index: g++});
+ }
+ _.add(w.id);
+ for (let U of w.instructions)
+ if (U.effects != null)
+ for (let A of U.effects)
+ A.kind === 'Create'
+ ? u.create(A.into, {kind: 'Object'})
+ : A.kind === 'CreateFunction'
+ ? u.create(A.into, {
+ kind: 'Function',
+ function: A.function.loweredFunc.func,
+ })
+ : A.kind === 'CreateFrom'
+ ? u.createFrom(g++, A.from, A.into)
+ : A.kind === 'Assign'
+ ? (u.nodes.has(A.into.identifier) ||
+ u.create(A.into, {kind: 'Object'}),
+ u.assign(g++, A.from, A.into))
+ : A.kind === 'Alias'
+ ? u.assign(g++, A.from, A.into)
+ : A.kind === 'MaybeAlias'
+ ? u.maybeAlias(g++, A.from, A.into)
+ : A.kind === 'Capture'
+ ? u.capture(g++, A.from, A.into)
+ : A.kind === 'MutateTransitive' ||
+ A.kind === 'MutateTransitiveConditionally'
+ ? y.push({
+ index: g++,
+ id: U.id,
+ transitive: !0,
+ kind:
+ A.kind === 'MutateTransitive'
+ ? Jn.Definite
+ : Jn.Conditional,
+ reason: null,
+ place: A.value,
+ })
+ : A.kind === 'Mutate' || A.kind === 'MutateConditionally'
+ ? y.push({
+ index: g++,
+ id: U.id,
+ transitive: !1,
+ kind: A.kind === 'Mutate' ? Jn.Definite : Jn.Conditional,
+ reason:
+ A.kind === 'Mutate' &&
+ (n = A.reason) !== null &&
+ n !== void 0
+ ? n
+ : null,
+ place: A.value,
+ })
+ : A.kind === 'MutateFrozen' ||
+ A.kind === 'MutateGlobal' ||
+ A.kind === 'Impure'
+ ? (S.pushDiagnostic(A.error), d.push(A))
+ : A.kind === 'Render' &&
+ (m.push({index: g++, place: A.place}), d.push(A));
+ let I = p.get(w.id);
+ if (I != null)
+ for (let {from: U, into: A, index: q} of I) u.assign(q, U, A);
+ if (
+ (w.terminal.kind === 'return' &&
+ u.assign(g++, w.terminal.value, e.returns),
+ (w.terminal.kind === 'maybe-throw' || w.terminal.kind === 'return') &&
+ w.terminal.effects != null)
+ )
+ for (let U of w.terminal.effects)
+ U.kind === 'Alias'
+ ? u.assign(g++, U.from, U.into)
+ : D.invariant(U.kind === 'Freeze', {
+ reason: `Unexpected '${U.kind}' effect for MaybeThrow terminal`,
+ description: null,
+ details: [{kind: 'error', loc: w.terminal.loc, message: null}],
+ });
+ }
+ for (let w of y)
+ u.mutate(
+ w.index,
+ w.place.identifier,
+ V(w.id + 1),
+ w.transitive,
+ w.kind,
+ w.place.loc,
+ w.reason,
+ S
+ );
+ for (let w of m) u.render(w.index, w.place.identifier, S);
+ for (let w of [...e.context, ...e.params]) {
+ let I = w.kind === 'Identifier' ? w : w.place,
+ U = u.nodes.get(I.identifier);
+ if (U == null) continue;
+ let A = !1;
+ U.local != null &&
+ (U.local.kind === Jn.Conditional
+ ? ((A = !0),
+ d.push({
+ kind: 'MutateConditionally',
+ value: Object.assign(Object.assign({}, I), {loc: U.local.loc}),
+ }))
+ : U.local.kind === Jn.Definite &&
+ ((A = !0),
+ d.push({
+ kind: 'Mutate',
+ value: Object.assign(Object.assign({}, I), {loc: U.local.loc}),
+ reason: U.mutationReason,
+ }))),
+ U.transitive != null &&
+ (U.transitive.kind === Jn.Conditional
+ ? ((A = !0),
+ d.push({
+ kind: 'MutateTransitiveConditionally',
+ value: Object.assign(Object.assign({}, I), {
+ loc: U.transitive.loc,
+ }),
+ }))
+ : U.transitive.kind === Jn.Definite &&
+ ((A = !0),
+ d.push({
+ kind: 'MutateTransitive',
+ value: Object.assign(Object.assign({}, I), {
+ loc: U.transitive.loc,
+ }),
+ }))),
+ A && (I.effect = x.Capture);
+ }
+ for (let w of e.body.blocks.values()) {
+ for (let I of w.phis) {
+ I.place.effect = x.Store;
+ let U =
+ I.place.identifier.mutableRange.end >
+ ((r =
+ (i = w.instructions.at(0)) === null || i === void 0
+ ? void 0
+ : i.id) !== null && r !== void 0
+ ? r
+ : w.terminal.id);
+ for (let A of I.operands.values()) A.effect = U ? x.Capture : x.Read;
+ if (U && I.place.identifier.mutableRange.start === 0) {
+ let A =
+ (o =
+ (a = w.instructions.at(0)) === null || a === void 0
+ ? void 0
+ : a.id) !== null && o !== void 0
+ ? o
+ : w.terminal.id;
+ I.place.identifier.mutableRange.start = V(A - 1);
+ }
+ }
+ for (let I of w.instructions) {
+ for (let A of rn(I))
+ (A.effect = x.ConditionallyMutate),
+ A.identifier.mutableRange.start === 0 &&
+ (A.identifier.mutableRange.start = I.id),
+ A.identifier.mutableRange.end === 0 &&
+ (A.identifier.mutableRange.end = V(
+ Math.max(I.id + 1, A.identifier.mutableRange.end)
+ ));
+ for (let A of Ot(I.value)) A.effect = x.Read;
+ if (I.effects == null) continue;
+ let U = new Map();
+ for (let A of I.effects)
+ switch (A.kind) {
+ case 'Assign':
+ case 'Alias':
+ case 'Capture':
+ case 'CreateFrom':
+ case 'MaybeAlias': {
+ A.into.identifier.mutableRange.end > I.id
+ ? (U.set(A.from.identifier.id, x.Capture),
+ U.set(A.into.identifier.id, x.Store))
+ : (U.set(A.from.identifier.id, x.Read),
+ U.set(A.into.identifier.id, x.Store));
+ break;
+ }
+ case 'CreateFunction':
+ case 'Create':
+ break;
+ case 'Mutate': {
+ U.set(A.value.identifier.id, x.Store);
+ break;
+ }
+ case 'Apply':
+ D.invariant(!1, {
+ reason:
+ '[AnalyzeFunctions] Expected Apply effects to be replaced with more precise effects',
+ description: null,
+ details: [{kind: 'error', loc: A.function.loc, message: null}],
+ });
+ case 'MutateTransitive':
+ case 'MutateConditionally':
+ case 'MutateTransitiveConditionally': {
+ U.set(A.value.identifier.id, x.ConditionallyMutate);
+ break;
+ }
+ case 'Freeze': {
+ U.set(A.value.identifier.id, x.Freeze);
+ break;
+ }
+ case 'ImmutableCapture':
+ break;
+ case 'Impure':
+ case 'Render':
+ case 'MutateFrozen':
+ case 'MutateGlobal':
+ break;
+ default:
+ Me(A, `Unexpected effect kind ${A.kind}`);
+ }
+ for (let A of rn(I)) {
+ let q =
+ (s = U.get(A.identifier.id)) !== null && s !== void 0
+ ? s
+ : x.ConditionallyMutate;
+ A.effect = q;
+ }
+ for (let A of Ot(I.value)) {
+ A.identifier.mutableRange.end > I.id &&
+ A.identifier.mutableRange.start === 0 &&
+ (A.identifier.mutableRange.start = I.id);
+ let q =
+ (l = U.get(A.identifier.id)) !== null && l !== void 0 ? l : x.Read;
+ A.effect = q;
+ }
+ I.value.kind === 'StoreContext' &&
+ I.value.value.identifier.mutableRange.end <= I.id &&
+ (I.value.value.identifier.mutableRange.end = V(I.id + 1));
+ }
+ if (w.terminal.kind === 'return')
+ w.terminal.value.effect = t ? x.Read : x.Freeze;
+ else for (let I of Gt(w.terminal)) I.effect = x.Read;
+ }
+ let O = e.returns.identifier;
+ d.push({
+ kind: 'Create',
+ into: e.returns,
+ value: km(O) ? z.Primitive : nv(O.type) ? z.Frozen : z.Mutable,
+ reason: qe.KnownReturnSignature,
+ });
+ let P = [],
+ M = new D();
+ for (let w of [...e.params, ...e.context, e.returns]) {
+ let I = w.kind === 'Identifier' ? w : w.place;
+ P.push(I);
+ }
+ for (let w of P) {
+ let I = g++;
+ u.mutate(I, w.identifier, null, !0, Jn.Conditional, w.loc, null, M);
+ for (let U of P) {
+ if (
+ U.identifier.id === w.identifier.id ||
+ U.identifier.id === e.returns.identifier.id
+ )
+ continue;
+ let A = u.nodes.get(U.identifier);
+ D.invariant(A != null, {
+ reason:
+ 'Expected a node to exist for all parameters and context variables',
+ description: null,
+ details: [{kind: 'error', loc: w.loc, message: null}],
+ }),
+ A.lastMutated === I &&
+ (w.identifier.id === e.returns.identifier.id
+ ? d.push({kind: 'Alias', from: U, into: w})
+ : d.push({kind: 'Capture', from: U, into: w}));
+ }
+ }
+ return S.hasAnyErrors() && !t ? gr(S) : zn(d);
+ }
+ function a0(e, t) {
+ var n;
+ for (let i of (n = t.aliasingEffects) !== null && n !== void 0 ? n : [])
+ switch (i.kind) {
+ case 'Impure':
+ case 'MutateFrozen':
+ case 'MutateGlobal': {
+ e.pushDiagnostic(i.error);
+ break;
+ }
+ }
+ }
+ var Jn;
+ (function (e) {
+ (e[(e.None = 0)] = 'None'),
+ (e[(e.Conditional = 1)] = 'Conditional'),
+ (e[(e.Definite = 2)] = 'Definite');
+ })(Jn || (Jn = {}));
+ var Rv = class {
+ constructor() {
+ this.nodes = new Map();
+ }
+ create(t, n) {
+ this.nodes.set(t.identifier, {
+ id: t.identifier,
+ createdFrom: new Map(),
+ captures: new Map(),
+ aliases: new Map(),
+ maybeAliases: new Map(),
+ edges: [],
+ transitive: null,
+ local: null,
+ lastMutated: 0,
+ mutationReason: null,
+ value: n,
+ });
+ }
+ createFrom(t, n, i) {
+ this.create(i, {kind: 'Object'});
+ let r = this.nodes.get(n.identifier),
+ a = this.nodes.get(i.identifier);
+ r == null ||
+ a == null ||
+ (r.edges.push({index: t, node: i.identifier, kind: 'alias'}),
+ a.createdFrom.has(n.identifier) || a.createdFrom.set(n.identifier, t));
+ }
+ capture(t, n, i) {
+ let r = this.nodes.get(n.identifier),
+ a = this.nodes.get(i.identifier);
+ r == null ||
+ a == null ||
+ (r.edges.push({index: t, node: i.identifier, kind: 'capture'}),
+ a.captures.has(n.identifier) || a.captures.set(n.identifier, t));
+ }
+ assign(t, n, i) {
+ let r = this.nodes.get(n.identifier),
+ a = this.nodes.get(i.identifier);
+ r == null ||
+ a == null ||
+ (r.edges.push({index: t, node: i.identifier, kind: 'alias'}),
+ a.aliases.has(n.identifier) || a.aliases.set(n.identifier, t));
+ }
+ maybeAlias(t, n, i) {
+ let r = this.nodes.get(n.identifier),
+ a = this.nodes.get(i.identifier);
+ r == null ||
+ a == null ||
+ (r.edges.push({index: t, node: i.identifier, kind: 'maybeAlias'}),
+ a.maybeAliases.has(n.identifier) ||
+ a.maybeAliases.set(n.identifier, t));
+ }
+ render(t, n, i) {
+ let r = new Set(),
+ a = [n];
+ for (; a.length !== 0; ) {
+ let o = a.pop();
+ if (r.has(o)) continue;
+ r.add(o);
+ let s = this.nodes.get(o);
+ if (!(s == null || s.transitive != null || s.local != null)) {
+ s.value.kind === 'Function' && a0(i, s.value.function);
+ for (let [l, d] of s.createdFrom) d >= t || a.push(l);
+ for (let [l, d] of s.aliases) d >= t || a.push(l);
+ for (let [l, d] of s.captures) d >= t || a.push(l);
+ }
+ }
+ }
+ mutate(t, n, i, r, a, o, s, l) {
+ var d;
+ let u = new Map(),
+ p = [{place: n, transitive: r, direction: 'backwards', kind: a}];
+ for (; p.length !== 0; ) {
+ let {place: y, transitive: m, direction: g, kind: S} = p.pop(),
+ _ = u.get(y);
+ if (_ != null && _ >= S) continue;
+ u.set(y, S);
+ let O = this.nodes.get(y);
+ if (O != null) {
+ ((d = O.mutationReason) !== null && d !== void 0) ||
+ (O.mutationReason = s),
+ (O.lastMutated = Math.max(O.lastMutated, t)),
+ i != null &&
+ (O.id.mutableRange.end = V(Math.max(O.id.mutableRange.end, i))),
+ O.value.kind === 'Function' &&
+ O.transitive == null &&
+ O.local == null &&
+ a0(l, O.value.function),
+ m
+ ? (O.transitive == null || O.transitive.kind < S) &&
+ (O.transitive = {kind: S, loc: o})
+ : (O.local == null || O.local.kind < S) &&
+ (O.local = {kind: S, loc: o});
+ for (let P of O.edges) {
+ if (P.index >= t) break;
+ p.push({
+ place: P.node,
+ transitive: m,
+ direction: 'forwards',
+ kind: P.kind === 'maybeAlias' ? Jn.Conditional : S,
+ });
+ }
+ for (let [P, M] of O.createdFrom)
+ M >= t ||
+ p.push({
+ place: P,
+ transitive: !0,
+ direction: 'backwards',
+ kind: S,
+ });
+ if (g === 'backwards' || O.value.kind !== 'Phi') {
+ for (let [P, M] of O.aliases)
+ M >= t ||
+ p.push({
+ place: P,
+ transitive: m,
+ direction: 'backwards',
+ kind: S,
+ });
+ for (let [P, M] of O.maybeAliases)
+ M >= t ||
+ p.push({
+ place: P,
+ transitive: m,
+ direction: 'backwards',
+ kind: Jn.Conditional,
+ });
+ }
+ if (m)
+ for (let [P, M] of O.captures)
+ M >= t ||
+ p.push({
+ place: P,
+ transitive: m,
+ direction: 'backwards',
+ kind: S,
+ });
+ }
+ }
+ }
+ };
+ function SP(e) {
+ for (let [t, n] of e.body.blocks)
+ for (let i of n.instructions)
+ switch (i.value.kind) {
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ m2(i.value.loweredFunc.func);
+ for (let r of i.value.loweredFunc.func.context)
+ (r.identifier.mutableRange = {start: V(0), end: V(0)}),
+ (r.identifier.scope = null);
+ break;
+ }
+ }
+ }
+ function m2(e) {
+ var t, n;
+ SP(e), yP(e, {isFunctionExpression: !0}), Xm(e);
+ let i = kP(e, {isFunctionExpression: !0}).unwrap();
+ QI(e), JI(e), (e.aliasingEffects = i);
+ let r = new Set();
+ for (let a of i)
+ switch (a.kind) {
+ case 'Assign':
+ case 'Alias':
+ case 'Capture':
+ case 'CreateFrom':
+ case 'MaybeAlias': {
+ r.add(a.from.identifier.id);
+ break;
+ }
+ case 'Apply':
+ D.invariant(!1, {
+ reason:
+ '[AnalyzeFunctions] Expected Apply effects to be replaced with more precise effects',
+ description: null,
+ details: [{kind: 'error', loc: a.function.loc, message: null}],
+ });
+ case 'Mutate':
+ case 'MutateConditionally':
+ case 'MutateTransitive':
+ case 'MutateTransitiveConditionally': {
+ r.add(a.value.identifier.id);
+ break;
+ }
+ case 'Impure':
+ case 'Render':
+ case 'MutateFrozen':
+ case 'MutateGlobal':
+ case 'CreateFunction':
+ case 'Create':
+ case 'Freeze':
+ case 'ImmutableCapture':
+ break;
+ default:
+ Me(a, `Unexpected effect kind ${a.kind}`);
+ }
+ for (let a of e.context)
+ r.has(a.identifier.id) || a.effect === x.Capture
+ ? (a.effect = x.Capture)
+ : (a.effect = x.Read);
+ (n =
+ (t = e.env.logger) === null || t === void 0 ? void 0 : t.debugLogIRs) ===
+ null ||
+ n === void 0 ||
+ n.call(t, {kind: 'hir', name: 'AnalyseFunction (inner)', value: e});
+ }
+ function _P(e, t, n) {
+ var i;
+ switch (e.kind) {
+ case 'LoadGlobal':
+ return {
+ root: {kind: 'Global', identifierName: e.binding.name},
+ path: [],
+ };
+ case 'PropertyLoad': {
+ let r = t.get(e.object.identifier.id);
+ if (r != null)
+ return {
+ root: r.root,
+ path: [...r.path, {property: e.property, optional: n}],
+ };
+ break;
+ }
+ case 'LoadLocal':
+ case 'LoadContext': {
+ let r = t.get(e.place.identifier.id);
+ if (r != null) return r;
+ if (
+ e.place.identifier.name != null &&
+ e.place.identifier.name.kind === 'named'
+ )
+ return {
+ root: {kind: 'NamedLocal', value: Object.assign({}, e.place)},
+ path: [],
+ };
+ break;
+ }
+ case 'StoreLocal': {
+ let r = e.lvalue.place.identifier,
+ a = e.value.identifier.id,
+ o = t.get(a);
+ if (
+ o != null &&
+ ((i = r.name) === null || i === void 0 ? void 0 : i.kind) !== 'named'
+ )
+ return t.set(r.id, o), o;
+ break;
+ }
+ }
+ return null;
+ }
+ function y2(e, t, n) {
+ let {value: i, lvalue: r} = e;
+ switch (i.kind) {
+ case 'FunctionExpression': {
+ n.functions.set(e.lvalue.identifier.id, e);
+ break;
+ }
+ case 'LoadGlobal': {
+ let o = t.getGlobalDeclaration(i.binding, i.loc),
+ s = o !== null ? Au(t, o) : null,
+ l = e.lvalue.identifier.id;
+ s === 'useMemo' || s === 'useCallback'
+ ? n.manualMemos.set(l, {kind: s, loadInstr: e})
+ : i.binding.name === 'React' && n.react.add(l);
+ break;
+ }
+ case 'PropertyLoad': {
+ if (n.react.has(i.object.identifier.id)) {
+ let o = i.property;
+ (o === 'useMemo' || o === 'useCallback') &&
+ n.manualMemos.set(e.lvalue.identifier.id, {kind: o, loadInstr: e});
+ }
+ break;
+ }
+ case 'ArrayExpression': {
+ i.elements.every((o) => o.kind === 'Identifier') &&
+ n.maybeDepsLists.set(e.lvalue.identifier.id, i.elements);
+ break;
+ }
+ }
+ let a = _P(i, n.maybeDeps, n.optionals.has(r.identifier.id));
+ a != null && n.maybeDeps.set(r.identifier.id, a);
+ }
+ function g2(e, t, n, i, r) {
+ return [
+ {
+ id: V(0),
+ lvalue: _t(t, e.loc),
+ value: {kind: 'StartMemoize', manualMemoId: r, deps: n, loc: e.loc},
+ effects: null,
+ loc: e.loc,
+ },
+ {
+ id: V(0),
+ lvalue: _t(t, e.loc),
+ value: {
+ kind: 'FinishMemoize',
+ manualMemoId: r,
+ decl: Object.assign({}, i),
+ loc: e.loc,
+ },
+ effects: null,
+ loc: e.loc,
+ },
+ ];
+ }
+ function v2(e, t, n) {
+ return n === 'useMemo'
+ ? {kind: 'CallExpression', callee: e, args: [], loc: t}
+ : {
+ kind: 'LoadLocal',
+ place: {
+ kind: 'Identifier',
+ identifier: e.identifier,
+ effect: x.Unknown,
+ reactive: !1,
+ loc: t,
+ },
+ loc: t,
+ };
+ }
+ function h2(e, t, n, i) {
+ let [r, a] = e.value.args;
+ if (r == null)
+ return (
+ i.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason: `Expected a callback function to be passed to ${t}`,
+ description: `Expected a callback function to be passed to ${t}`,
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: e.value.loc,
+ message: `Expected a callback function to be passed to ${t}`,
+ })
+ ),
+ {fnPlace: null, depsList: null}
+ );
+ if (r.kind === 'Spread' || a?.kind === 'Spread')
+ return (
+ i.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason: `Unexpected spread argument to ${t}`,
+ description: `Unexpected spread argument to ${t}`,
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: e.value.loc,
+ message: `Unexpected spread argument to ${t}`,
+ })
+ ),
+ {fnPlace: null, depsList: null}
+ );
+ let o = null;
+ if (a != null) {
+ let s = n.maybeDepsLists.get(a.identifier.id);
+ if (s == null)
+ return (
+ i.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason: `Expected the dependency list for ${t} to be an array literal`,
+ description: `Expected the dependency list for ${t} to be an array literal`,
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: a.loc,
+ message: `Expected the dependency list for ${t} to be an array literal`,
+ })
+ ),
+ {fnPlace: r, depsList: null}
+ );
+ o = [];
+ for (let l of s) {
+ let d = n.maybeDeps.get(l.identifier.id);
+ d == null
+ ? i.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason:
+ 'Expected the dependency list to be an array of simple expressions (e.g. `x`, `x.y.z`, `x?.y?.z`)',
+ description:
+ 'Expected the dependency list to be an array of simple expressions (e.g. `x`, `x.y.z`, `x?.y?.z`)',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: l.loc,
+ message:
+ 'Expected the dependency list to be an array of simple expressions (e.g. `x`, `x.y.z`, `x?.y?.z`)',
+ })
+ )
+ : o.push(d);
+ }
+ }
+ return {fnPlace: r, depsList: o};
+ }
+ function b2(e) {
+ let t = new D(),
+ n =
+ e.env.config.validatePreserveExistingMemoizationGuarantees ||
+ e.env.config.validateNoSetStateInRender ||
+ e.env.config.enablePreserveExistingMemoizationGuarantees,
+ i = k2(e),
+ r = {
+ functions: new Map(),
+ manualMemos: new Map(),
+ react: new Set(),
+ maybeDeps: new Map(),
+ maybeDepsLists: new Map(),
+ optionals: i,
+ },
+ a = 0,
+ o = new Map();
+ for (let [s, l] of e.body.blocks)
+ for (let d = 0; d < l.instructions.length; d++) {
+ let u = l.instructions[d];
+ if (
+ u.value.kind === 'CallExpression' ||
+ u.value.kind === 'MethodCall'
+ ) {
+ let p =
+ u.value.kind === 'CallExpression'
+ ? u.value.callee.identifier.id
+ : u.value.property.identifier.id,
+ y = r.manualMemos.get(p);
+ if (y != null) {
+ let {fnPlace: m, depsList: g} = h2(u, y.kind, r, t);
+ if (m == null) continue;
+ if (((u.value = v2(m, u.value.loc, y.kind)), n)) {
+ if (!r.functions.has(m.identifier.id)) {
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason:
+ 'Expected the first argument to be an inline function expression',
+ description:
+ 'Expected the first argument to be an inline function expression',
+ suggestions: [],
+ }).withDetails({
+ kind: 'error',
+ loc: m.loc,
+ message:
+ 'Expected the first argument to be an inline function expression',
+ })
+ );
+ continue;
+ }
+ let S =
+ y.kind === 'useMemo'
+ ? u.lvalue
+ : {
+ kind: 'Identifier',
+ identifier: m.identifier,
+ effect: x.Unknown,
+ reactive: !1,
+ loc: m.loc,
+ },
+ [_, O] = g2(m, e.env, g, S, a++);
+ o.set(y.loadInstr.id, _), o.set(u.id, O);
+ }
+ }
+ } else y2(u, e.env, r);
+ }
+ if (o.size > 0) {
+ let s = !1;
+ for (let [l, d] of e.body.blocks) {
+ let u = null;
+ for (let p = 0; p < d.instructions.length; p++) {
+ let y = d.instructions[p],
+ m = o.get(y.id);
+ m != null
+ ? ((u = u ?? d.instructions.slice(0, p)), u.push(y), u.push(m))
+ : u?.push(y);
+ }
+ u !== null && ((d.instructions = u), (s = !0));
+ }
+ s && fr(e.body);
+ }
+ return t.asResult();
+ }
+ function k2(e) {
+ let t = new Set();
+ for (let [, n] of e.body.blocks)
+ if (n.terminal.kind === 'optional' && n.terminal.optional) {
+ let i = n.terminal,
+ r = e.body.blocks.get(n.terminal.test);
+ e: for (;;) {
+ let a = r.terminal;
+ switch (a.kind) {
+ case 'branch': {
+ if (a.fallthrough === i.fallthrough) {
+ let s = e.body.blocks.get(a.consequent).instructions.at(-1);
+ s !== void 0 &&
+ s.value.kind === 'StoreLocal' &&
+ t.add(s.value.value.identifier.id);
+ break e;
+ } else r = e.body.blocks.get(a.fallthrough);
+ break;
+ }
+ case 'optional':
+ case 'logical':
+ case 'sequence':
+ case 'ternary': {
+ r = e.body.blocks.get(a.fallthrough);
+ break;
+ }
+ default:
+ D.invariant(!1, {
+ reason: 'Unexpected terminal in optional',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: a.loc,
+ message: `Unexpected ${a.kind} in optional`,
+ },
+ ],
+ });
+ }
+ }
+ }
+ return t;
+ }
+ var Lv = class {
+ constructor(t) {
+ (this.map = new Map()), (this.env = t);
+ }
+ handleInstruction(t) {
+ let {value: n, lvalue: i} = t;
+ switch (n.kind) {
+ case 'CallExpression':
+ case 'MethodCall': {
+ bB(this.env, t) &&
+ (Sm(i.identifier)
+ ? this.map.set(i.identifier.id, {isStable: !0})
+ : this.map.set(i.identifier.id, {isStable: !1}));
+ break;
+ }
+ case 'Destructure':
+ case 'PropertyLoad': {
+ let r =
+ n.kind === 'Destructure'
+ ? n.value.identifier.id
+ : n.object.identifier.id;
+ if (this.map.get(r))
+ for (let o of rn(t))
+ hB(o.identifier)
+ ? this.map.set(o.identifier.id, {isStable: !1})
+ : Sm(o.identifier) &&
+ this.map.set(o.identifier.id, {isStable: !0});
+ break;
+ }
+ case 'StoreLocal': {
+ let r = this.map.get(n.value.identifier.id);
+ r &&
+ (this.map.set(i.identifier.id, r),
+ this.map.set(n.lvalue.place.identifier.id, r));
+ break;
+ }
+ case 'LoadLocal': {
+ let r = this.map.get(n.place.identifier.id);
+ r && this.map.set(i.identifier.id, r);
+ break;
+ }
+ }
+ }
+ isStable(t) {
+ let n = this.map.get(t);
+ return n != null ? n.isStable : !1;
+ }
+ };
+ function S2(e) {
+ let t = new Fv(WI(e)),
+ n = new Lv(e.env);
+ for (let s of e.params) {
+ let l = s.kind === 'Identifier' ? s : s.place;
+ t.markReactive(l);
+ }
+ let i = zI(e, {includeThrowsAsExitNode: !1}),
+ r = new Map();
+ function a(s) {
+ let l = r.get(s);
+ l === void 0 && ((l = _2(e, i, s)), r.set(s, l));
+ for (let d of l) {
+ let u = e.body.blocks.get(d);
+ switch (u.terminal.kind) {
+ case 'if':
+ case 'branch': {
+ if (t.isReactive(u.terminal.test)) return !0;
+ break;
+ }
+ case 'switch': {
+ if (t.isReactive(u.terminal.test)) return !0;
+ for (let p of u.terminal.cases)
+ if (p.test !== null && t.isReactive(p.test)) return !0;
+ break;
+ }
+ }
+ }
+ return !1;
+ }
+ do
+ for (let [, s] of e.body.blocks) {
+ let l = a(s.id);
+ for (let d of s.phis) {
+ if (t.isReactive(d.place)) continue;
+ let u = !1;
+ for (let [, p] of d.operands)
+ if (t.isReactive(p)) {
+ u = !0;
+ break;
+ }
+ if (u) t.markReactive(d.place);
+ else
+ for (let [p] of d.operands)
+ if (a(p)) {
+ t.markReactive(d.place);
+ break;
+ }
+ }
+ for (let d of s.instructions) {
+ n.handleInstruction(d);
+ let {value: u} = d,
+ p = !1;
+ for (let y of Ot(u)) {
+ let m = t.isReactive(y);
+ p || (p = m);
+ }
+ if (
+ (((u.kind === 'CallExpression' &&
+ (Qn(e.env, u.callee.identifier) != null ||
+ rv(u.callee.identifier))) ||
+ (u.kind === 'MethodCall' &&
+ (Qn(e.env, u.property.identifier) != null ||
+ rv(u.property.identifier)))) &&
+ (p = !0),
+ p)
+ )
+ for (let y of rn(d))
+ n.isStable(y.identifier.id) || t.markReactive(y);
+ if (p || l)
+ for (let y of Ot(u))
+ switch (y.effect) {
+ case x.Capture:
+ case x.Store:
+ case x.ConditionallyMutate:
+ case x.ConditionallyMutateIterator:
+ case x.Mutate: {
+ ta(d, y) && t.markReactive(y);
+ break;
+ }
+ case x.Freeze:
+ case x.Read:
+ break;
+ case x.Unknown:
+ D.invariant(!1, {
+ reason: 'Unexpected unknown effect',
+ description: null,
+ details: [{kind: 'error', loc: y.loc, message: null}],
+ suggestions: null,
+ });
+ default:
+ Me(y.effect, `Unexpected effect kind \`${y.effect}\``);
+ }
+ }
+ for (let d of Gt(s.terminal)) t.isReactive(d);
+ }
+ while (t.snapshot());
+ function o(s, l) {
+ for (let [, d] of s.body.blocks) {
+ for (let u of d.instructions) {
+ if (!l) for (let p of sn(u)) t.isReactive(p);
+ (u.value.kind === 'ObjectMethod' ||
+ u.value.kind === 'FunctionExpression') &&
+ o(u.value.loweredFunc.func, !1);
+ }
+ if (!l) for (let u of Gt(d.terminal)) t.isReactive(u);
+ }
+ }
+ o(e, !0);
+ }
+ function _2(e, t, n) {
+ let i = new Set(),
+ r = new Set(),
+ a = T2(e, t, n);
+ for (let o of [...a, n]) {
+ if (i.has(o)) continue;
+ i.add(o);
+ let s = e.body.blocks.get(o);
+ for (let l of s.preds) a.has(l) || r.add(l);
+ }
+ return r;
+ }
+ function T2(e, t, n) {
+ var i;
+ let r = new Set(),
+ a = new Set(),
+ o = [n];
+ for (; o.length; ) {
+ let s = o.shift();
+ if (a.has(s)) continue;
+ a.add(s);
+ let l = e.body.blocks.get(s);
+ for (let d of l.preds) {
+ let u = (i = t.get(d)) !== null && i !== void 0 ? i : d;
+ (u === n || r.has(u)) && r.add(d), o.push(d);
+ }
+ }
+ return r;
+ }
+ var Fv = class {
+ constructor(t) {
+ (this.hasChanges = !1),
+ (this.reactive = new Set()),
+ (this.aliasedIdentifiers = t);
+ }
+ isReactive(t) {
+ var n;
+ let i =
+ (n = this.aliasedIdentifiers.find(t.identifier)) !== null &&
+ n !== void 0
+ ? n
+ : t.identifier,
+ r = this.reactive.has(i.id);
+ return r && (t.reactive = !0), r;
+ }
+ markReactive(t) {
+ var n;
+ t.reactive = !0;
+ let i =
+ (n = this.aliasedIdentifiers.find(t.identifier)) !== null &&
+ n !== void 0
+ ? n
+ : t.identifier;
+ this.reactive.has(i.id) ||
+ ((this.hasChanges = !0), this.reactive.add(i.id));
+ }
+ snapshot() {
+ let t = this.hasChanges;
+ return (this.hasChanges = !1), t;
+ }
+ };
+ function E2(e) {
+ let t = new Map(),
+ n = new Set(),
+ i = Array.from(e.body.blocks.values());
+ e: for (let r of i)
+ if (J0(r.kind))
+ for (let a = 0; a < r.instructions.length; a++) {
+ let o = r.instructions[a];
+ switch (o.value.kind) {
+ case 'FunctionExpression': {
+ o.lvalue.identifier.name === null &&
+ t.set(o.lvalue.identifier.id, o.value);
+ break;
+ }
+ case 'CallExpression': {
+ if (o.value.args.length !== 0) continue;
+ let s = t.get(o.value.callee.identifier.id);
+ if (
+ s === void 0 ||
+ s.loweredFunc.func.params.length > 0 ||
+ s.loweredFunc.func.async ||
+ s.loweredFunc.func.generator
+ )
+ continue;
+ n.add(o.value.callee.identifier.id);
+ let l = e.env.nextBlockId,
+ d = {
+ id: l,
+ instructions: r.instructions.slice(a + 1),
+ kind: r.kind,
+ phis: new Set(),
+ preds: new Set(),
+ terminal: r.terminal,
+ };
+ if (
+ (e.body.blocks.set(l, d),
+ (r.instructions.length = a),
+ I2(s.loweredFunc.func))
+ ) {
+ r.terminal = {
+ kind: 'goto',
+ block: s.loweredFunc.func.body.entry,
+ id: r.terminal.id,
+ loc: r.terminal.loc,
+ variant: St.Break,
+ };
+ for (let u of s.loweredFunc.func.body.blocks.values())
+ u.terminal.kind === 'return' &&
+ (u.instructions.push({
+ id: V(0),
+ loc: u.terminal.loc,
+ lvalue: o.lvalue,
+ value: {
+ kind: 'LoadLocal',
+ loc: u.terminal.loc,
+ place: u.terminal.value,
+ },
+ effects: null,
+ }),
+ (u.terminal = {
+ kind: 'goto',
+ block: l,
+ id: u.terminal.id,
+ loc: u.terminal.loc,
+ variant: St.Break,
+ }));
+ for (let [u, p] of s.loweredFunc.func.body.blocks)
+ p.preds.clear(), e.body.blocks.set(u, p);
+ } else {
+ let u = {
+ block: s.loweredFunc.func.body.entry,
+ id: V(0),
+ kind: 'label',
+ fallthrough: l,
+ loc: r.terminal.loc,
+ };
+ r.terminal = u;
+ let p = o.lvalue;
+ x2(e.env, r, p), p.identifier.name == null && $n(p.identifier);
+ for (let [y, m] of s.loweredFunc.func.body.blocks)
+ m.preds.clear(), P2(e.env, m, l, p), e.body.blocks.set(y, m);
+ }
+ i.push(d);
+ continue e;
+ }
+ default:
+ for (let s of Ot(o.value)) t.delete(s.identifier.id);
+ }
+ }
+ if (n.size !== 0) {
+ for (let r of e.body.blocks.values())
+ ra(r.instructions, (a) => !n.has(a.lvalue.identifier.id));
+ Pa(e.body), fr(e.body), xa(e.body), Hu(e);
+ }
+ }
+ function I2(e) {
+ let t = !1,
+ n = 0;
+ for (let [, i] of e.body.blocks)
+ (i.terminal.kind === 'return' || i.terminal.kind === 'throw') &&
+ (t || (t = i.terminal.kind === 'return'), n++);
+ return n === 1 && t;
+ }
+ function P2(e, t, n, i) {
+ let {terminal: r} = t;
+ r.kind === 'return' &&
+ (t.instructions.push({
+ id: V(0),
+ loc: r.loc,
+ lvalue: _t(e, r.loc),
+ value: {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Reassign, place: Object.assign({}, i)},
+ value: r.value,
+ type: null,
+ loc: r.loc,
+ },
+ effects: null,
+ }),
+ (t.terminal = {
+ kind: 'goto',
+ block: n,
+ id: V(0),
+ variant: St.Break,
+ loc: t.terminal.loc,
+ }));
+ }
+ function x2(e, t, n) {
+ t.instructions.push({
+ id: V(0),
+ loc: F,
+ lvalue: _t(e, n.loc),
+ value: {
+ kind: 'DeclareLocal',
+ lvalue: {place: n, kind: Q.Let},
+ type: null,
+ loc: n.loc,
+ },
+ effects: null,
+ });
+ }
+ function w2(e, t, n) {
+ let i = new Fu(),
+ r = new Set();
+ if (e.fnType === 'Component' || e.fnType === 'Hook')
+ for (let a of e.params) a.kind === 'Identifier' && r.add(a.identifier.id);
+ return Nh(e, {
+ temporaries: t,
+ knownImmutableIdentifiers: r,
+ hoistableFromOptionals: n,
+ registry: i,
+ nestedFnImmutableContext: null,
+ assumedInvokedFns: e.env.config.enableTreatFunctionDepsAsConditional
+ ? new Set()
+ : Rh(e),
+ });
+ }
+ function O2(e, t, n) {
+ let i = e.value.loweredFunc.func,
+ r = {
+ temporaries: t,
+ knownImmutableIdentifiers: new Set(),
+ hoistableFromOptionals: n,
+ registry: new Fu(),
+ nestedFnImmutableContext: null,
+ assumedInvokedFns: i.env.config.enableTreatFunctionDepsAsConditional
+ ? new Set()
+ : Rh(i),
+ },
+ a = new Set(
+ i.context
+ .filter((o) => om(o.identifier, e.id, r))
+ .map((o) => o.identifier.id)
+ );
+ return (r.nestedFnImmutableContext = a), Nh(i, r);
+ }
+ function Nh(e, t) {
+ let n = C2(e, t);
+ return D2(e, n, t.registry), n;
+ }
+ function $2(e, t) {
+ let n = new Map();
+ for (let [i, r] of e.body.blocks)
+ r.terminal.kind === 'scope' &&
+ n.set(r.terminal.scope.id, t.get(r.terminal.block));
+ return n;
+ }
+ var Fu = class e {
+ constructor() {
+ this.roots = new Map();
+ }
+ getOrCreateIdentifier(t, n) {
+ let i = this.roots.get(t.id);
+ return (
+ i === void 0
+ ? ((i = {
+ root: t.id,
+ properties: new Map(),
+ optionalProperties: new Map(),
+ fullPath: {identifier: t, reactive: n, path: []},
+ hasOptional: !1,
+ parent: null,
+ }),
+ this.roots.set(t.id, i))
+ : D.invariant(n === i.fullPath.reactive, {
+ reason:
+ '[HoistablePropertyLoads] Found inconsistencies in `reactive` flag when deduping identifier reads within the same scope',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ }),
+ i
+ );
+ }
+ static getOrCreatePropertyEntry(t, n) {
+ let i = n.optional ? t.optionalProperties : t.properties,
+ r = i.get(n.property);
+ return (
+ r == null &&
+ ((r = {
+ properties: new Map(),
+ optionalProperties: new Map(),
+ parent: t,
+ fullPath: {
+ identifier: t.fullPath.identifier,
+ reactive: t.fullPath.reactive,
+ path: t.fullPath.path.concat(n),
+ },
+ hasOptional: t.hasOptional || n.optional,
+ }),
+ i.set(n.property, r)),
+ r
+ );
+ }
+ getOrCreateProperty(t) {
+ let n = this.getOrCreateIdentifier(t.identifier, t.reactive);
+ if (t.path.length === 0) return n;
+ for (let i = 0; i < t.path.length - 1; i++)
+ n = e.getOrCreatePropertyEntry(n, t.path[i]);
+ return e.getOrCreatePropertyEntry(n, t.path.at(-1));
+ }
+ };
+ function j2(e, t) {
+ var n, i, r;
+ let a = null;
+ return (
+ e.kind === 'PropertyLoad'
+ ? (a =
+ (n = t.temporaries.get(e.object.identifier.id)) !== null &&
+ n !== void 0
+ ? n
+ : {
+ identifier: e.object.identifier,
+ reactive: e.object.reactive,
+ path: [],
+ })
+ : e.kind === 'Destructure'
+ ? (a =
+ (i = t.temporaries.get(e.value.identifier.id)) !== null &&
+ i !== void 0
+ ? i
+ : null)
+ : e.kind === 'ComputedLoad' &&
+ (a =
+ (r = t.temporaries.get(e.object.identifier.id)) !== null &&
+ r !== void 0
+ ? r
+ : null),
+ a != null ? t.registry.getOrCreateProperty(a) : null
+ );
+ }
+ function om(e, t, n) {
+ return n.nestedFnImmutableContext != null
+ ? n.nestedFnImmutableContext.has(e.id)
+ : !(
+ e.mutableRange.end > e.mutableRange.start + 1 &&
+ e.scope != null &&
+ HI({id: t}, e.scope.range)
+ ) || n.knownImmutableIdentifiers.has(e.id);
+ }
+ function C2(e, t) {
+ var n;
+ let i = new Set();
+ if (
+ e.fnType === 'Component' &&
+ e.params.length > 0 &&
+ e.params[0].kind === 'Identifier'
+ ) {
+ let a = e.params[0].identifier;
+ i.add(t.registry.getOrCreateIdentifier(a, !0));
+ }
+ let r = new Map();
+ for (let [a, o] of e.body.blocks) {
+ let s = new Set(i),
+ l = t.hoistableFromOptionals.get(o.id);
+ l != null && s.add(t.registry.getOrCreateProperty(l));
+ for (let d of o.instructions) {
+ let u = j2(d.value, t);
+ if (
+ (u != null && om(u.fullPath.identifier, d.id, t) && s.add(u),
+ d.value.kind === 'FunctionExpression')
+ ) {
+ let p = d.value.loweredFunc;
+ if (t.assumedInvokedFns.has(p)) {
+ let y = Nh(
+ p.func,
+ Object.assign(Object.assign({}, t), {
+ nestedFnImmutableContext:
+ (n = t.nestedFnImmutableContext) !== null && n !== void 0
+ ? n
+ : new Set(
+ p.func.context
+ .filter((g) => om(g.identifier, d.id, t))
+ .map((g) => g.identifier.id)
+ ),
+ })
+ ),
+ m = na(y.get(p.func.body.entry));
+ for (let g of m.assumedNonNullObjects) s.add(g);
+ }
+ } else if (
+ e.env.config.enablePreserveExistingMemoizationGuarantees &&
+ d.value.kind === 'StartMemoize' &&
+ d.value.deps != null
+ ) {
+ for (let p of d.value.deps)
+ if (p.root.kind === 'NamedLocal') {
+ if (!om(p.root.value.identifier, d.id, t)) continue;
+ for (let y = 0; y < p.path.length && !p.path[y].optional; y++) {
+ let g = t.registry.getOrCreateProperty({
+ identifier: p.root.value.identifier,
+ path: p.path.slice(0, y),
+ reactive: p.root.value.reactive,
+ });
+ s.add(g);
+ }
+ }
+ }
+ }
+ r.set(o.id, {block: o, assumedNonNullObjects: s});
+ }
+ return r;
+ }
+ function D2(e, t, n) {
+ let i = new Map(),
+ r = new Set();
+ for (let [u, p] of e.body.blocks) {
+ for (let y of p.preds) Xn(i, y, new Set()).add(u);
+ (p.terminal.kind === 'throw' || p.terminal.kind === 'return') && r.add(u);
+ }
+ function a(u, p, y) {
+ var m;
+ if (y.has(u)) return !1;
+ y.set(u, 'active');
+ let g = t.get(u);
+ g == null &&
+ D.invariant(!1, {
+ reason: `Bad node ${u}, kind: ${p}`,
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let S = Array.from(
+ p === 'backward'
+ ? (m = i.get(u)) !== null && m !== void 0
+ ? m
+ : []
+ : g.block.preds
+ ),
+ _ = !1;
+ for (let w of S)
+ if (!y.has(w)) {
+ let I = a(w, p, y);
+ _ || (_ = I);
+ }
+ let O = zz(
+ Array.from(S)
+ .filter((w) => y.get(w) === 'done')
+ .map((w) => na(t.get(w)).assumedNonNullObjects)
+ ),
+ P = na(t.get(u)).assumedNonNullObjects,
+ M = Fz(P, O);
+ return (
+ A2(M, n),
+ (na(t.get(u)).assumedNonNullObjects = M),
+ y.set(u, 'done'),
+ _ || (_ = !Lz(P, M)),
+ _
+ );
+ }
+ let o = new Map(),
+ s = [...e.body.blocks];
+ s.reverse();
+ let l,
+ d = 0;
+ do {
+ D.invariant(d++ < 100, {
+ reason:
+ '[CollectHoistablePropertyLoads] fixed point iteration did not terminate after 100 loops',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ (l = !1);
+ for (let [u] of e.body.blocks) {
+ let p = a(u, 'forward', o);
+ l || (l = p);
+ }
+ o.clear();
+ for (let [u] of s) {
+ let p = a(u, 'backward', o);
+ l || (l = p);
+ }
+ o.clear();
+ } while (l);
+ }
+ function na(e, t) {
+ return (
+ D.invariant(e != null, {
+ reason: 'Unexpected null',
+ description: t != null ? `(from ${t})` : null,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ e
+ );
+ }
+ function A2(e, t) {
+ let n = Uz(e, (r) => r.hasOptional);
+ if (n.size === 0) return;
+ let i;
+ do {
+ i = !1;
+ for (let r of n) {
+ let {identifier: a, path: o, reactive: s} = r.fullPath,
+ l = t.getOrCreateIdentifier(a, s);
+ for (let d = 0; d < o.length; d++) {
+ let u = o[d],
+ p =
+ u.optional && e.has(l) ? {property: u.property, optional: !1} : u;
+ l = Fu.getOrCreatePropertyEntry(l, p);
+ }
+ l !== r && ((i = !0), n.delete(r), n.add(l), e.delete(r), e.add(l));
+ }
+ } while (i);
+ }
+ function Rh(e, t = new Map()) {
+ var n;
+ let i = new Set();
+ for (let r of e.body.blocks.values())
+ for (let {lvalue: a, value: o} of r.instructions)
+ if (o.kind === 'FunctionExpression')
+ t.set(a.identifier.id, {fn: o.loweredFunc, mayInvoke: new Set()});
+ else if (o.kind === 'StoreLocal') {
+ let s = o.lvalue.place.identifier,
+ l = t.get(o.value.identifier.id);
+ l != null && t.set(s.id, l);
+ } else if (o.kind === 'LoadLocal') {
+ let s = t.get(o.place.identifier.id);
+ s != null && t.set(a.identifier.id, s);
+ }
+ for (let r of e.body.blocks.values()) {
+ for (let {lvalue: a, value: o} of r.instructions)
+ if (o.kind === 'CallExpression') {
+ let s = o.callee,
+ l = Qn(e.env, s.identifier),
+ d = t.get(s.identifier.id);
+ if (d != null) i.add(d.fn);
+ else if (l != null) {
+ for (let u of o.args)
+ if (u.kind === 'Identifier') {
+ let p = t.get(u.identifier.id);
+ p != null && i.add(p.fn);
+ }
+ }
+ } else if (o.kind === 'JsxExpression') {
+ for (let s of o.props) {
+ if (s.kind === 'JsxSpreadAttribute') continue;
+ let l = t.get(s.place.identifier.id);
+ l != null && i.add(l.fn);
+ }
+ for (let s of (n = o.children) !== null && n !== void 0 ? n : []) {
+ let l = t.get(s.identifier.id);
+ l != null && i.add(l.fn);
+ }
+ } else if (o.kind === 'FunctionExpression') {
+ let s = o.loweredFunc.func,
+ l = Rh(s, t),
+ d = t.get(a.identifier.id);
+ if (d != null) for (let u of l) d.mayInvoke.add(u);
+ }
+ if (r.terminal.kind === 'return') {
+ let a = t.get(r.terminal.value.identifier.id);
+ a != null && i.add(a.fn);
+ }
+ }
+ for (let [r, {fn: a, mayInvoke: o}] of t)
+ if (i.has(a)) for (let s of o) i.add(s);
+ return i;
+ }
+ function TP(e) {
+ let t = {
+ currFn: e,
+ blocks: e.body.blocks,
+ seenOptionals: new Set(),
+ processedInstrsInOptional: new Set(),
+ temporariesReadInOptional: new Map(),
+ hoistableObjects: new Map(),
+ };
+ return (
+ EP(e, t),
+ {
+ temporariesReadInOptional: t.temporariesReadInOptional,
+ processedInstrsInOptional: t.processedInstrsInOptional,
+ hoistableObjects: t.hoistableObjects,
+ }
+ );
+ }
+ function EP(e, t) {
+ for (let [n, i] of e.body.blocks) {
+ for (let r of i.instructions)
+ (r.value.kind === 'FunctionExpression' ||
+ r.value.kind === 'ObjectMethod') &&
+ EP(
+ r.value.loweredFunc.func,
+ Object.assign(Object.assign({}, t), {
+ currFn: r.value.loweredFunc.func,
+ blocks: r.value.loweredFunc.func.body.blocks,
+ })
+ );
+ i.terminal.kind === 'optional' &&
+ !t.seenOptionals.has(i.id) &&
+ IP(i, t, null);
+ }
+ }
+ function M2(e, t) {
+ let n = na(t.get(e.consequent));
+ if (
+ n.instructions.length === 2 &&
+ n.instructions[0].value.kind === 'PropertyLoad' &&
+ n.instructions[1].value.kind === 'StoreLocal'
+ ) {
+ let i = n.instructions[0],
+ r = n.instructions[1].value,
+ a = n.instructions[1];
+ if (
+ (D.invariant(i.value.object.identifier.id === e.test.identifier.id, {
+ reason:
+ '[OptionalChainDeps] Inconsistent optional chaining property load',
+ description: `Test=${un(e.test.identifier)} PropertyLoad base=${un(
+ i.value.object.identifier
+ )}`,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ }),
+ D.invariant(r.value.identifier.id === i.lvalue.identifier.id, {
+ reason: '[OptionalChainDeps] Unexpected storeLocal',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ }),
+ n.terminal.kind !== 'goto' || n.terminal.variant !== St.Break)
+ )
+ return null;
+ let o = na(t.get(e.alternate));
+ return (
+ D.invariant(
+ o.instructions.length === 2 &&
+ o.instructions[0].value.kind === 'Primitive' &&
+ o.instructions[1].value.kind === 'StoreLocal',
+ {
+ reason: 'Unexpected alternate structure',
+ description: null,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ }
+ ),
+ {
+ consequentId: r.lvalue.place.identifier.id,
+ property: i.value.property,
+ propertyId: i.lvalue.identifier.id,
+ storeLocalInstr: a,
+ consequentGoto: n.terminal.block,
+ }
+ );
+ }
+ return null;
+ }
+ function IP(e, t, n) {
+ t.seenOptionals.add(e.id);
+ let i = t.blocks.get(e.terminal.test),
+ r,
+ a;
+ if (i.terminal.kind === 'branch') {
+ if (
+ (D.invariant(e.terminal.optional, {
+ reason: '[OptionalChainDeps] Expect base case to be always optional',
+ description: null,
+ details: [{kind: 'error', loc: e.terminal.loc, message: null}],
+ }),
+ i.instructions.length === 0 ||
+ i.instructions[0].value.kind !== 'LoadLocal')
+ )
+ return null;
+ let l = [];
+ for (let d = 1; d < i.instructions.length; d++) {
+ let u = i.instructions[d].value,
+ p = i.instructions[d - 1];
+ if (
+ u.kind === 'PropertyLoad' &&
+ u.object.identifier.id === p.lvalue.identifier.id
+ )
+ l.push({property: u.property, optional: !1});
+ else return null;
+ }
+ D.invariant(
+ i.terminal.test.identifier.id ===
+ i.instructions.at(-1).lvalue.identifier.id,
+ {
+ reason: '[OptionalChainDeps] Unexpected test expression',
+ description: null,
+ details: [{kind: 'error', loc: i.terminal.loc, message: null}],
+ }
+ ),
+ (a = {
+ identifier: i.instructions[0].value.place.identifier,
+ reactive: i.instructions[0].value.place.reactive,
+ path: l,
+ }),
+ (r = i.terminal);
+ } else if (i.terminal.kind === 'optional') {
+ let l = t.blocks.get(i.terminal.fallthrough);
+ l.terminal.kind !== 'branch' &&
+ D.throwTodo({
+ reason: `Unexpected terminal kind \`${l.terminal.kind}\` for optional fallthrough block`,
+ loc: i.terminal.loc,
+ });
+ let d = IP(i, t, l.terminal.alternate);
+ if (d == null || l.terminal.test.identifier.id !== d) return null;
+ e.terminal.optional ||
+ t.hoistableObjects.set(e.id, na(t.temporariesReadInOptional.get(d))),
+ (a = na(t.temporariesReadInOptional.get(d))),
+ (r = l.terminal);
+ } else return null;
+ r.alternate === n &&
+ D.invariant(e.instructions.length === 0, {
+ reason:
+ '[OptionalChainDeps] Unexpected instructions an inner optional block. This indicates that the compiler may be incorrectly concatenating two unrelated optional chains',
+ description: null,
+ details: [{kind: 'error', loc: e.terminal.loc, message: null}],
+ });
+ let o = M2(r, t.blocks);
+ if (!o) return null;
+ D.invariant(o.consequentGoto === e.terminal.fallthrough, {
+ reason: '[OptionalChainDeps] Unexpected optional goto-fallthrough',
+ description: `${o.consequentGoto} != ${e.terminal.fallthrough}`,
+ details: [{kind: 'error', loc: e.terminal.loc, message: null}],
+ });
+ let s = {
+ identifier: a.identifier,
+ reactive: a.reactive,
+ path: [...a.path, {property: o.property, optional: e.terminal.optional}],
+ };
+ return (
+ t.processedInstrsInOptional.add(o.storeLocalInstr),
+ t.processedInstrsInOptional.add(r),
+ t.temporariesReadInOptional.set(o.consequentId, s),
+ t.temporariesReadInOptional.set(o.propertyId, s),
+ o.consequentId
+ );
+ }
+ var Fi,
+ sm,
+ _u,
+ zv,
+ PP,
+ zu = class {
+ constructor(t) {
+ var n;
+ sm.set(this, new Map()), _u.set(this, new Map());
+ for (let {path: i, identifier: r, reactive: a} of t) {
+ let o = j(Fi, Fi, 'm', zv).call(
+ Fi,
+ r,
+ a,
+ j(this, sm, 'f'),
+ i.length > 0 && i[0].optional ? 'Optional' : 'NonNull'
+ );
+ for (let s = 0; s < i.length; s++) {
+ let l =
+ (n = o.properties.get(i[s].property)) === null || n === void 0
+ ? void 0
+ : n.accessType,
+ d =
+ s + 1 < i.length && i[s + 1].optional ? 'Optional' : 'NonNull';
+ D.invariant(l == null || l === d, {
+ reason: 'Conflicting access types',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let u = o.properties.get(i[s].property);
+ u == null &&
+ ((u = {properties: new Map(), accessType: d}),
+ o.properties.set(i[s].property, u)),
+ (o = u);
+ }
+ }
+ }
+ addDependency(t) {
+ let {identifier: n, reactive: i, path: r} = t,
+ a = j(Fi, Fi, 'm', zv).call(
+ Fi,
+ n,
+ i,
+ j(this, _u, 'f'),
+ On.UnconditionalAccess
+ ),
+ o = j(this, sm, 'f').get(n);
+ for (let s of r) {
+ let l, d;
+ if (s.optional) {
+ o != null && (l = o?.properties.get(s.property));
+ let u;
+ o != null && o.accessType === 'NonNull'
+ ? (u = On.UnconditionalAccess)
+ : (u = On.OptionalAccess),
+ (d = o0(a, s.property, u));
+ } else if (o != null && o.accessType === 'NonNull')
+ (l = o.properties.get(s.property)),
+ (d = o0(a, s.property, On.UnconditionalAccess));
+ else break;
+ (a = d), (o = l);
+ }
+ a.accessType = xP(a.accessType, On.OptionalDependency);
+ }
+ deriveMinimalDependencies() {
+ let t = new Set();
+ for (let [n, i] of j(this, _u, 'f').entries())
+ wP(i, i.reactive, n, [], t);
+ return t;
+ }
+ printDeps(t) {
+ let n = [];
+ for (let [i, r] of j(this, _u, 'f').entries()) {
+ let a = OP(r, t).map((o) => `${un(i)}.${o}`);
+ n.push(a);
+ }
+ return n.flat().join(`
+`);
+ }
+ static debug(t) {
+ let n = ['tree() ['];
+ for (let [i, r] of t)
+ n.push(`${un(i)} (${r.accessType}):`),
+ j(this, Fi, 'm', PP).call(this, n, r, 1);
+ return (
+ n.push(']'),
+ n.length > 2
+ ? n.join(`
+`)
+ : n.join('')
+ );
+ }
+ };
+ (Fi = zu),
+ (sm = new WeakMap()),
+ (_u = new WeakMap()),
+ (zv = function (t, n, i, r) {
+ let a = i.get(t);
+ return (
+ a === void 0
+ ? ((a = {properties: new Map(), reactive: n, accessType: r}),
+ i.set(t, a))
+ : D.invariant(n === a.reactive, {
+ reason:
+ '[DeriveMinimalDependenciesHIR] Conflicting reactive root flag',
+ description: `Identifier ${un(t)}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ }),
+ a
+ );
+ }),
+ (PP = function e(t, n, i = 0) {
+ for (let [r, a] of n.properties)
+ t.push(`${' '.repeat(i)}.${r} (${a.accessType}):`),
+ j(this, Fi, 'm', e).call(this, t, a, i + 1);
+ });
+ var On;
+ (function (e) {
+ (e.OptionalAccess = 'OptionalAccess'),
+ (e.UnconditionalAccess = 'UnconditionalAccess'),
+ (e.OptionalDependency = 'OptionalDependency'),
+ (e.UnconditionalDependency = 'UnconditionalDependency');
+ })(On || (On = {}));
+ function Bv(e) {
+ return e === On.OptionalAccess || e === On.OptionalDependency;
+ }
+ function Nm(e) {
+ return e === On.OptionalDependency || e === On.UnconditionalDependency;
+ }
+ function xP(e, t) {
+ let n = !(Bv(e) && Bv(t)),
+ i = Nm(e) || Nm(t);
+ return n
+ ? i
+ ? On.UnconditionalDependency
+ : On.UnconditionalAccess
+ : i
+ ? On.OptionalDependency
+ : On.OptionalAccess;
+ }
+ function wP(e, t, n, i, r) {
+ if (Nm(e.accessType)) r.add({identifier: n, reactive: t, path: i});
+ else
+ for (let [a, o] of e.properties)
+ wP(o, t, n, [...i, {property: a, optional: Bv(o.accessType)}], r);
+ }
+ function OP(e, t) {
+ let n = [];
+ for (let [i, r] of e.properties) {
+ (t || Nm(r.accessType)) && n.push(`${i} (${r.accessType})`);
+ let a = OP(r, t);
+ n.push(...a.map((o) => `${i}.${o}`));
+ }
+ return n;
+ }
+ function o0(e, t, n) {
+ let i = e.properties.get(t);
+ return (
+ i == null
+ ? ((i = {properties: new Map(), accessType: n}), e.properties.set(t, i))
+ : (i.accessType = xP(i.accessType, n)),
+ i
+ );
+ }
+ var eo, ga, Rm, Bi, Ri, to, lm, cm, pa, um, $P;
+ function N2(e) {
+ let t = R2(e),
+ n = jP(e, t),
+ {
+ temporariesReadInOptional: i,
+ processedInstrsInOptional: r,
+ hoistableObjects: a,
+ } = TP(e),
+ o = $2(e, w2(e, n, a)),
+ s = F2(e, t, new Map([...n, ...i]), r);
+ for (let [l, d] of s) {
+ if (d.length === 0) continue;
+ let u = o.get(l.id);
+ D.invariant(u != null, {
+ reason:
+ '[PropagateScopeDependencies] Scope not found in tracked blocks',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let p = new zu([...u.assumedNonNullObjects].map((m) => m.fullPath));
+ for (let m of d) p.addDependency(Object.assign({}, m));
+ let y = p.deriveMinimalDependencies();
+ for (let m of y)
+ Cu(
+ l.dependencies,
+ (g) =>
+ g.identifier.declarationId === m.identifier.declarationId &&
+ Y0(g.path, m.path)
+ ) || l.dependencies.add(m);
+ }
+ }
+ function R2(e) {
+ let t = new Map(),
+ n = new Set(),
+ i = new _m(),
+ r = new Set();
+ function a(s) {
+ let l = t.get(s.identifier.declarationId);
+ l != null &&
+ !i.isScopeActive(l) &&
+ !n.has(l) &&
+ r.add(s.identifier.declarationId);
+ }
+ function o(s) {
+ let l = i.currentScope;
+ if (!(l == null || n.has(l)))
+ switch (s.value.kind) {
+ case 'LoadLocal':
+ case 'LoadContext':
+ case 'PropertyLoad': {
+ t.set(s.lvalue.identifier.declarationId, l);
+ break;
+ }
+ }
+ }
+ for (let [s, l] of e.body.blocks) {
+ i.recordScopes(l);
+ let d = i.blockInfos.get(s);
+ d?.kind === 'begin' && d.pruned && n.add(d.scope.id);
+ for (let u of l.instructions) {
+ for (let p of sn(u)) a(p);
+ o(u);
+ }
+ for (let u of Gt(l.terminal)) a(u);
+ }
+ return r;
+ }
+ function jP(e, t) {
+ let n = new Map();
+ return CP(e, t, n, null), n;
+ }
+ function L2(e, t) {
+ return e.kind === 'LoadContext'
+ ? e.place.identifier.scope != null &&
+ t >= e.place.identifier.scope.range.end
+ : !1;
+ }
+ function CP(e, t, n, i) {
+ for (let [r, a] of e.body.blocks)
+ for (let {value: o, lvalue: s, id: l} of a.instructions) {
+ let d = i != null ? i.instrId : l,
+ u = t.has(s.identifier.declarationId);
+ if (o.kind === 'PropertyLoad' && !u) {
+ if (i == null || n.has(o.object.identifier.id)) {
+ let p = DP(o.object, o.property, !1, n);
+ n.set(s.identifier.id, p);
+ }
+ } else
+ (o.kind === 'LoadLocal' || L2(o, d)) &&
+ s.identifier.name == null &&
+ o.place.identifier.name !== null &&
+ !u
+ ? (i == null ||
+ e.context.some(
+ (p) => p.identifier.id === o.place.identifier.id
+ )) &&
+ n.set(s.identifier.id, {
+ identifier: o.place.identifier,
+ reactive: o.place.reactive,
+ path: [],
+ })
+ : (o.kind === 'FunctionExpression' || o.kind === 'ObjectMethod') &&
+ CP(o.loweredFunc.func, t, n, i ?? {instrId: d});
+ }
+ }
+ function DP(e, t, n, i) {
+ let r = i.get(e.identifier.id),
+ a;
+ return (
+ r == null
+ ? (a = {
+ identifier: e.identifier,
+ reactive: e.reactive,
+ path: [{property: t, optional: n}],
+ })
+ : (a = {
+ identifier: r.identifier,
+ reactive: r.reactive,
+ path: [...r.path, {property: t, optional: n}],
+ }),
+ a
+ );
+ }
+ var Lm = class {
+ constructor(t, n, i) {
+ eo.add(this),
+ ga.set(this, new Map()),
+ Rm.set(this, new Map()),
+ Bi.set(this, mo()),
+ Ri.set(this, mo()),
+ (this.deps = new Map()),
+ to.set(this, void 0),
+ lm.set(this, void 0),
+ cm.set(this, void 0),
+ pa.set(this, null),
+ at(this, lm, t, 'f'),
+ at(this, to, n, 'f'),
+ at(this, cm, i, 'f');
+ }
+ enterScope(t) {
+ at(this, Ri, j(this, Ri, 'f').push([]), 'f'),
+ at(this, Bi, j(this, Bi, 'f').push(t), 'f');
+ }
+ exitScope(t, n) {
+ var i;
+ let r = j(this, Ri, 'f').value;
+ D.invariant(r != null, {
+ reason: '[PropagateScopeDeps]: Unexpected scope mismatch',
+ description: null,
+ details: [{kind: 'error', loc: t.loc, message: null}],
+ }),
+ at(this, Bi, j(this, Bi, 'f').pop(), 'f'),
+ at(this, Ri, j(this, Ri, 'f').pop(), 'f');
+ for (let a of r)
+ j(this, eo, 'm', um).call(this, a) &&
+ ((i = j(this, Ri, 'f').value) === null || i === void 0 || i.push(a));
+ n || this.deps.set(t, r);
+ }
+ isUsedOutsideDeclaringScope(t) {
+ return j(this, lm, 'f').has(t.identifier.declarationId);
+ }
+ declare(t, n) {
+ j(this, pa, 'f') == null &&
+ (j(this, ga, 'f').has(t.declarationId) ||
+ j(this, ga, 'f').set(t.declarationId, n),
+ j(this, Rm, 'f').set(t, n));
+ }
+ hasDeclared(t) {
+ return j(this, ga, 'f').has(t.declarationId);
+ }
+ get currentScope() {
+ return j(this, Bi, 'f');
+ }
+ visitOperand(t) {
+ var n;
+ this.visitDependency(
+ (n = j(this, to, 'f').get(t.identifier.id)) !== null && n !== void 0
+ ? n
+ : {identifier: t.identifier, reactive: t.reactive, path: []}
+ );
+ }
+ visitProperty(t, n, i) {
+ let r = DP(t, n, i, j(this, to, 'f'));
+ this.visitDependency(r);
+ }
+ visitDependency(t) {
+ var n;
+ let i = j(this, ga, 'f').get(t.identifier.declarationId);
+ i !== void 0 &&
+ i.scope.value !== null &&
+ i.scope.each((r) => {
+ !j(this, eo, 'm', $P).call(this, r) &&
+ !Cu(
+ r.declarations.values(),
+ (a) => a.identifier.declarationId === t.identifier.declarationId
+ ) &&
+ r.declarations.set(t.identifier.id, {
+ identifier: t.identifier,
+ scope: i.scope.value,
+ });
+ }),
+ Yn(t.identifier) &&
+ ((n = t.path.at(0)) === null || n === void 0
+ ? void 0
+ : n.property) === 'current' &&
+ (t = {identifier: t.identifier, reactive: t.reactive, path: []}),
+ j(this, eo, 'm', um).call(this, t) && j(this, Ri, 'f').value.push(t);
+ }
+ visitReassignment(t) {
+ let n = this.currentScope.value;
+ n != null &&
+ !Cu(
+ n.reassignments,
+ (i) => i.declarationId === t.identifier.declarationId
+ ) &&
+ j(this, eo, 'm', um).call(this, {
+ identifier: t.identifier,
+ reactive: t.reactive,
+ path: [],
+ }) &&
+ n.reassignments.add(t.identifier);
+ }
+ enterInnerFn(t, n) {
+ var i;
+ let r = j(this, pa, 'f');
+ at(
+ this,
+ pa,
+ (i = j(this, pa, 'f')) !== null && i !== void 0
+ ? i
+ : {outerInstrId: t.id},
+ 'f'
+ );
+ let a = n();
+ return at(this, pa, r, 'f'), a;
+ }
+ isDeferredDependency(t) {
+ return (
+ j(this, cm, 'f').has(t.value) ||
+ (t.kind === Bu.Instruction &&
+ j(this, to, 'f').has(t.value.lvalue.identifier.id))
+ );
+ }
+ };
+ (ga = new WeakMap()),
+ (Rm = new WeakMap()),
+ (Bi = new WeakMap()),
+ (Ri = new WeakMap()),
+ (to = new WeakMap()),
+ (lm = new WeakMap()),
+ (cm = new WeakMap()),
+ (pa = new WeakMap()),
+ (eo = new WeakSet()),
+ (um = function (t) {
+ var n;
+ if (fo(t.identifier) || cB(t.identifier)) return !1;
+ let i = t.identifier,
+ r =
+ (n = j(this, Rm, 'f').get(i)) !== null && n !== void 0
+ ? n
+ : j(this, ga, 'f').get(i.declarationId),
+ a = this.currentScope.value;
+ return a != null && r !== void 0 && r.id < a.range.start;
+ }),
+ ($P = function (t) {
+ return j(this, Bi, 'f') === null
+ ? !1
+ : j(this, Bi, 'f').find((n) => n === t);
+ });
+ var Bu;
+ (function (e) {
+ (e[(e.Instruction = 1)] = 'Instruction'),
+ (e[(e.Terminal = 2)] = 'Terminal');
+ })(Bu || (Bu = {}));
+ function AP(e, t) {
+ let {id: n, value: i, lvalue: r} = e;
+ if (
+ (t.declare(r.identifier, {id: n, scope: t.currentScope}),
+ !t.isDeferredDependency({kind: Bu.Instruction, value: e}))
+ )
+ if (i.kind === 'PropertyLoad') t.visitProperty(i.object, i.property, !1);
+ else if (i.kind === 'StoreLocal')
+ t.visitOperand(i.value),
+ i.lvalue.kind === Q.Reassign && t.visitReassignment(i.lvalue.place),
+ t.declare(i.lvalue.place.identifier, {id: n, scope: t.currentScope});
+ else if (i.kind === 'DeclareLocal' || i.kind === 'DeclareContext')
+ H0(i.lvalue.kind) === null &&
+ t.declare(i.lvalue.place.identifier, {id: n, scope: t.currentScope});
+ else if (i.kind === 'Destructure') {
+ t.visitOperand(i.value);
+ for (let a of kr(i.lvalue.pattern))
+ i.lvalue.kind === Q.Reassign && t.visitReassignment(a),
+ t.declare(a.identifier, {id: n, scope: t.currentScope});
+ } else if (i.kind === 'StoreContext') {
+ (!t.hasDeclared(i.lvalue.place.identifier) ||
+ i.lvalue.kind !== Q.Reassign) &&
+ t.declare(i.lvalue.place.identifier, {id: n, scope: t.currentScope});
+ for (let a of Ot(i)) t.visitOperand(a);
+ } else for (let a of Ot(i)) t.visitOperand(a);
+ }
+ function F2(e, t, n, i) {
+ let r = new Lm(t, n, i);
+ for (let s of e.params)
+ s.kind === 'Identifier'
+ ? r.declare(s.identifier, {id: V(0), scope: mo()})
+ : r.declare(s.place.identifier, {id: V(0), scope: mo()});
+ let a = new _m(),
+ o = (s) => {
+ for (let [l, d] of s.body.blocks) {
+ a.recordScopes(d);
+ let u = a.blockInfos.get(l);
+ u?.kind === 'begin'
+ ? r.enterScope(u.scope)
+ : u?.kind === 'end' && r.exitScope(u.scope, u.pruned);
+ for (let p of d.phis)
+ for (let y of p.operands) {
+ let m = n.get(y[1].identifier.id);
+ m && r.visitDependency(m);
+ }
+ for (let p of d.instructions)
+ if (
+ p.value.kind === 'FunctionExpression' ||
+ p.value.kind === 'ObjectMethod'
+ ) {
+ r.declare(p.lvalue.identifier, {id: p.id, scope: r.currentScope});
+ let y = p.value.loweredFunc.func;
+ r.enterInnerFn(p, () => {
+ o(y);
+ });
+ } else AP(p, r);
+ if (!r.isDeferredDependency({kind: Bu.Terminal, value: d.terminal}))
+ for (let p of Gt(d.terminal)) r.visitOperand(p);
+ }
+ };
+ return o(e), r.deps;
+ }
+ function z2(e, t) {
+ let n = new Im(t, {entryBlockKind: 'value'}),
+ i;
+ e.path.every((a) => !a.optional) ? (i = MP(e, t, n)) : (i = NP(e, n, null));
+ let r = n.terminate({kind: 'unsupported', loc: F, id: V(0)}, null);
+ return {
+ place: {
+ kind: 'Identifier',
+ identifier: i,
+ effect: x.Freeze,
+ reactive: e.reactive,
+ loc: F,
+ },
+ value: n.build(),
+ exitBlockId: r,
+ };
+ }
+ function MP(e, t, n) {
+ let i = e.identifier.loc,
+ r = Du(t.nextIdentifierId, i);
+ n.push({
+ lvalue: {
+ identifier: r,
+ kind: 'Identifier',
+ effect: x.Mutate,
+ reactive: e.reactive,
+ loc: i,
+ },
+ value: {
+ kind: 'LoadLocal',
+ place: {
+ identifier: e.identifier,
+ kind: 'Identifier',
+ effect: x.Freeze,
+ reactive: e.reactive,
+ loc: i,
+ },
+ loc: i,
+ },
+ id: V(1),
+ loc: i,
+ effects: null,
+ });
+ for (let a of e.path) {
+ let o = Du(t.nextIdentifierId, i);
+ n.push({
+ lvalue: {
+ identifier: o,
+ kind: 'Identifier',
+ effect: x.Mutate,
+ reactive: e.reactive,
+ loc: i,
+ },
+ value: {
+ kind: 'PropertyLoad',
+ object: {
+ identifier: r,
+ kind: 'Identifier',
+ effect: x.Freeze,
+ reactive: e.reactive,
+ loc: i,
+ },
+ property: a.property,
+ loc: i,
+ },
+ id: V(1),
+ loc: i,
+ effects: null,
+ }),
+ (r = o);
+ }
+ return r;
+ }
+ function NP(e, t, n) {
+ let i = t.environment,
+ r = {
+ kind: 'Identifier',
+ identifier: Du(i.nextIdentifierId, F),
+ effect: x.Mutate,
+ reactive: e.reactive,
+ loc: F,
+ },
+ a = t.reserve(t.currentBlockKind()),
+ o;
+ n != null
+ ? (o = n)
+ : (o = t.enter('value', () => {
+ let u = Fe(t, {kind: 'Primitive', value: void 0, loc: F});
+ return (
+ Fe(t, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, r)},
+ value: Object.assign({}, u),
+ type: null,
+ loc: F,
+ }),
+ {kind: 'goto', variant: St.Break, block: a.id, id: V(0), loc: F}
+ );
+ }));
+ let s = t.reserve('value'),
+ l = null,
+ d = t.enter('value', () => {
+ let u = Object.assign(Object.assign({}, e), {
+ path: e.path.slice(0, e.path.length - 1),
+ }),
+ p = e.path.findIndex((y) => y.optional);
+ return (
+ D.invariant(p !== -1, {
+ reason:
+ '[ScopeDependencyUtils] Internal invariant broken: expected optional path',
+ description: null,
+ details: [{kind: 'error', loc: e.identifier.loc, message: null}],
+ suggestions: null,
+ }),
+ p === e.path.length - 1 ? (l = MP(u, i, t)) : (l = NP(u, t, o)),
+ {
+ kind: 'branch',
+ test: {
+ identifier: l,
+ effect: x.Freeze,
+ kind: 'Identifier',
+ loc: F,
+ reactive: e.reactive,
+ },
+ consequent: s.id,
+ alternate: o,
+ id: V(0),
+ loc: F,
+ fallthrough: a.id,
+ }
+ );
+ });
+ return (
+ t.enterReserved(
+ s,
+ () => (
+ D.invariant(l !== null, {
+ reason: 'Satisfy type checker',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ Fe(t, {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, r)},
+ value: Fe(t, {
+ kind: 'PropertyLoad',
+ object: {
+ identifier: l,
+ kind: 'Identifier',
+ effect: x.Freeze,
+ reactive: e.reactive,
+ loc: F,
+ },
+ property: e.path.at(-1).property,
+ loc: F,
+ }),
+ type: null,
+ loc: F,
+ }),
+ {kind: 'goto', variant: St.Break, block: a.id, id: V(0), loc: F}
+ )
+ ),
+ t.terminateWithContinuation(
+ {
+ kind: 'optional',
+ optional: e.path.at(-1).optional,
+ test: d,
+ fallthrough: a.id,
+ id: V(0),
+ loc: F,
+ },
+ a
+ ),
+ r.identifier
+ );
+ }
+ function B2(e) {
+ var t, n;
+ let i = new Map(),
+ r = new Map();
+ for (let p of e.env.config.inferEffectDependencies)
+ dr(r, p.function.source, () => new Map()).set(
+ p.function.importSpecifierName,
+ p.autodepsIndex
+ );
+ let a = new Map(),
+ o = new Map(),
+ s = new Map(),
+ l = new Set(),
+ d = q2(e),
+ u = [];
+ for (let [, p] of e.body.blocks) {
+ if (p.terminal.kind === 'scope') {
+ let m = e.body.blocks.get(p.terminal.block);
+ m.instructions.length === 1 &&
+ m.terminal.kind === 'goto' &&
+ m.terminal.block === p.terminal.fallthrough &&
+ s.set(p.terminal.scope.id, p.terminal.scope.dependencies);
+ }
+ let y = [];
+ for (let m of p.instructions) {
+ let {value: g, lvalue: S} = m;
+ if (g.kind === 'FunctionExpression') i.set(S.identifier.id, m);
+ else if (g.kind === 'PropertyLoad') {
+ if (typeof g.property == 'string' && o.has(g.object.identifier.id)) {
+ let _ = o.get(g.object.identifier.id),
+ O = g.property,
+ P = _.get(O);
+ P != null && a.set(S.identifier.id, P);
+ }
+ } else if (g.kind === 'LoadGlobal') {
+ if ((l.add(S.identifier.id), g.binding.kind === 'ImportNamespace')) {
+ let _ = r.get(g.binding.module);
+ _ != null && o.set(S.identifier.id, _);
+ }
+ if (
+ g.binding.kind === 'ImportSpecifier' ||
+ g.binding.kind === 'ImportDefault'
+ ) {
+ let _ = r.get(g.binding.module);
+ if (_ != null) {
+ let O =
+ g.binding.kind === 'ImportSpecifier'
+ ? g.binding.imported
+ : VI,
+ P = _.get(O);
+ P != null && a.set(S.identifier.id, P);
+ }
+ }
+ } else if (g.kind === 'CallExpression' || g.kind === 'MethodCall') {
+ let _ = g.kind === 'CallExpression' ? g.callee : g.property,
+ O = g.args.findIndex(
+ (M) =>
+ M.kind === 'Identifier' &&
+ M.identifier.type.kind === 'Object' &&
+ M.identifier.type.shapeId === wI
+ ),
+ P = a.get(_.identifier.id);
+ if (
+ g.args.length > 0 &&
+ P != null &&
+ O === P &&
+ a.has(_.identifier.id) &&
+ g.args[0].kind === 'Identifier'
+ ) {
+ let M = [],
+ w = {kind: 'ArrayExpression', elements: M, loc: F},
+ I = _t(e.env, F);
+ I.effect = x.Read;
+ let U = i.get(g.args[0].identifier.id);
+ if (U != null) {
+ let A =
+ U.lvalue.identifier.scope != null
+ ? s.get(U.lvalue.identifier.scope.id)
+ : null,
+ q;
+ A != null ? (q = new Set(A)) : (q = V2(U));
+ let ae = [];
+ for (let G of q) {
+ if (
+ ((Yn(G.identifier) || vr(G.identifier)) &&
+ !d.has(G.identifier.id)) ||
+ gB(G.identifier) ||
+ vB(G.identifier)
+ )
+ continue;
+ let ve = U2(G),
+ {place: de, value: oe, exitBlockId: be} = z2(ve, e.env);
+ y.push({
+ kind: 'block',
+ location: m.id,
+ value: oe,
+ exitBlockId: be,
+ }),
+ M.push(de),
+ ae.push(ve);
+ }
+ let le = [];
+ for (let G of K2(ae, U.value)) typeof G != 'symbol' && le.push(G);
+ typeof g.loc != 'symbol' &&
+ ((t = e.env.logger) === null ||
+ t === void 0 ||
+ t.logEvent(e.env.filename, {
+ kind: 'AutoDepsDecorations',
+ fnLoc: g.loc,
+ decorations: le,
+ })),
+ y.push({
+ kind: 'instr',
+ location: m.id,
+ value: {
+ id: V(0),
+ loc: F,
+ lvalue: Object.assign(Object.assign({}, I), {
+ effect: x.Mutate,
+ }),
+ value: w,
+ effects: null,
+ },
+ }),
+ (g.args[O] = Object.assign(Object.assign({}, I), {
+ effect: x.Freeze,
+ })),
+ e.env.inferredEffectLocations.add(_.loc);
+ } else
+ l.has(g.args[0].identifier.id) &&
+ (y.push({
+ kind: 'instr',
+ location: m.id,
+ value: {
+ id: V(0),
+ loc: F,
+ lvalue: Object.assign(Object.assign({}, I), {
+ effect: x.Mutate,
+ }),
+ value: w,
+ effects: null,
+ },
+ }),
+ (g.args[O] = Object.assign(Object.assign({}, I), {
+ effect: x.Freeze,
+ })),
+ e.env.inferredEffectLocations.add(_.loc));
+ } else if (
+ g.args.length >= 2 &&
+ g.args.length - 1 === a.get(_.identifier.id) &&
+ g.args[0] != null &&
+ g.args[0].kind === 'Identifier'
+ ) {
+ let M = g.args[g.args.length - 2],
+ w = g.args[g.args.length - 1];
+ w.kind !== 'Spread' &&
+ M.kind !== 'Spread' &&
+ typeof w.loc != 'symbol' &&
+ typeof M.loc != 'symbol' &&
+ typeof g.loc != 'symbol' &&
+ ((n = e.env.logger) === null ||
+ n === void 0 ||
+ n.logEvent(e.env.filename, {
+ kind: 'AutoDepsEligible',
+ fnLoc: g.loc,
+ depArrayLoc: Object.assign(Object.assign({}, w.loc), {
+ start: M.loc.end,
+ end: w.loc.end,
+ }),
+ }));
+ }
+ }
+ }
+ Z2(p, y, u);
+ }
+ if (u.length > 0) {
+ for (let p of u) e.body.blocks.set(p.id, p);
+ Pa(e.body),
+ xa(e.body),
+ fr(e.body),
+ _h(e.body),
+ Xm(e),
+ (e.env.hasInferredEffect = !0);
+ }
+ }
+ function U2(e) {
+ let t = e.path.findIndex((n) => n.property === 'current');
+ return t === -1
+ ? e
+ : Object.assign(Object.assign({}, e), {path: e.path.slice(0, t)});
+ }
+ function Z2(e, t, n) {
+ if (t.length === 0) return;
+ let i = e.instructions,
+ r = Object.assign(Object.assign({}, e), {instructions: []});
+ n.push(r);
+ let a = 0;
+ for (let o of t) {
+ for (; i[a].id < o.location; )
+ D.invariant(i[a].id < i[a + 1].id, {
+ reason:
+ '[InferEffectDependencies] Internal invariant broken: expected block instructions to be sorted',
+ description: null,
+ details: [{kind: 'error', loc: i[a].loc, message: null}],
+ }),
+ r.instructions.push(i[a]),
+ a++;
+ if (
+ (D.invariant(i[a].id === o.location, {
+ reason:
+ '[InferEffectDependencies] Internal invariant broken: splice location not found',
+ description: null,
+ details: [{kind: 'error', loc: i[a].loc, message: null}],
+ }),
+ o.kind === 'instr')
+ )
+ r.instructions.push(o.value);
+ else if (o.kind === 'block') {
+ let {entry: s, blocks: l} = o.value,
+ d = l.get(s);
+ if ((r.instructions.push(...d.instructions), l.size > 1)) {
+ D.invariant(Ju(d.terminal) === o.exitBlockId, {
+ reason:
+ '[InferEffectDependencies] Internal invariant broken: expected entry block to have a fallthrough',
+ description: null,
+ details: [{kind: 'error', loc: d.terminal.loc, message: null}],
+ });
+ let u = r.terminal;
+ r.terminal = d.terminal;
+ for (let [p, y] of l)
+ p !== s &&
+ (p === o.exitBlockId && ((y.terminal = u), (r = y)), n.push(y));
+ }
+ }
+ }
+ r.instructions.push(...i.slice(a));
+ }
+ function q2(e) {
+ let t = new Set();
+ for (let [, n] of e.body.blocks) {
+ for (let i of n.instructions)
+ for (let r of sn(i)) r.reactive && t.add(r.identifier.id);
+ for (let i of Gt(n.terminal)) i.reactive && t.add(i.identifier.id);
+ }
+ return t;
+ }
+ function K2(e, t) {
+ let n = new Map(),
+ i = new Set(),
+ r = [];
+ for (let a of e) n.set(a.identifier.id, a);
+ for (let [, a] of t.loweredFunc.func.body.blocks)
+ for (let o of a.instructions) {
+ o.value.kind === 'LoadLocal' &&
+ n.has(o.value.place.identifier.id) &&
+ i.add(o.lvalue.identifier.id);
+ for (let s of sn(o)) i.has(s.identifier.id) && r.push(s.identifier.loc);
+ }
+ return r;
+ }
+ function V2(e) {
+ let t = e.value.loweredFunc.func,
+ n = jP(t, new Set()),
+ {
+ hoistableObjects: i,
+ processedInstrsInOptional: r,
+ temporariesReadInOptional: a,
+ } = TP(t),
+ s = O2(e, n, i).get(t.body.entry);
+ D.invariant(s != null, {
+ reason:
+ '[InferEffectDependencies] Internal invariant broken: missing entry block',
+ description: null,
+ details: [{kind: 'error', loc: e.loc, message: null}],
+ });
+ let l = J2(e, new Map([...n, ...a]), r),
+ d = new zu([...s.assumedNonNullObjects].map((u) => u.fullPath));
+ for (let u of l) d.addDependency(Object.assign({}, u));
+ return d.deriveMinimalDependencies();
+ }
+ function J2(e, t, n) {
+ let i = e.value.loweredFunc.func,
+ r = new Lm(new Set(), t, n);
+ for (let d of i.context) r.declare(d.identifier, {id: V(0), scope: mo()});
+ let a = {
+ id: Q0(0),
+ range: {start: e.id, end: V(e.id + 1)},
+ dependencies: new Set(),
+ reassignments: new Set(),
+ declarations: new Map(),
+ earlyReturnValue: null,
+ merged: new Set(),
+ loc: F,
+ };
+ r.enterScope(a), RP(i, r, t), r.exitScope(a, !1);
+ let o = r.deps.get(a);
+ D.invariant(o != null, {
+ reason:
+ '[InferEffectDependencies] Internal invariant broken: missing scope dependencies',
+ description: null,
+ details: [{kind: 'error', loc: i.loc, message: null}],
+ });
+ let s = new Set(i.context.map((d) => d.identifier.id)),
+ l = new Set();
+ for (let d of o) s.has(d.identifier.id) && l.add(d);
+ return l;
+ }
+ function RP(e, t, n) {
+ for (let [, i] of e.body.blocks) {
+ for (let r of i.phis)
+ for (let a of r.operands) {
+ let o = n.get(a[1].identifier.id);
+ o && t.visitDependency(o);
+ }
+ for (let r of i.instructions)
+ if (
+ r.value.kind === 'FunctionExpression' ||
+ r.value.kind === 'ObjectMethod'
+ ) {
+ t.declare(r.lvalue.identifier, {id: r.id, scope: t.currentScope});
+ let a = r.value.loweredFunc.func;
+ t.enterInnerFn(r, () => {
+ RP(a, t, n);
+ });
+ } else AP(r, t);
+ }
+ }
+ function H2(e) {
+ var t;
+ let n = new Map(),
+ i = W2(e);
+ for (let [, r] of e.body.blocks) G2(e.env, r, n, i);
+ D.invariant(n.size === 0, {
+ reason:
+ 'InstructionReordering: expected all reorderable nodes to have been emitted',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc:
+ (t = [...n.values()]
+ .map((r) => {
+ var a;
+ return (a = r.instruction) === null || a === void 0
+ ? void 0
+ : a.loc;
+ })
+ .filter((r) => r != null)[0]) !== null && t !== void 0
+ ? t
+ : F,
+ message: null,
+ },
+ ],
+ }),
+ fr(e.body);
+ }
+ var va;
+ (function (e) {
+ (e[(e.Read = 0)] = 'Read'), (e[(e.Write = 1)] = 'Write');
+ })(va || (va = {}));
+ function W2(e) {
+ let t = new Map(),
+ n = new Map();
+ function i(r, a, o) {
+ var s;
+ if (a.identifier.name !== null && a.identifier.name.kind === 'named') {
+ if (o === va.Write) {
+ let l = a.identifier.name.value,
+ d = n.get(l);
+ d === void 0 ? n.set(l, r) : n.set(l, V(Math.max(d, r)));
+ }
+ return;
+ } else if (o === va.Read) {
+ let l = (s = t.get(a.identifier.id)) !== null && s !== void 0 ? s : 0;
+ t.set(a.identifier.id, l + 1);
+ }
+ }
+ for (let [, r] of e.body.blocks) {
+ for (let a of r.instructions) {
+ for (let o of yo(a.value)) i(a.id, o, va.Read);
+ for (let o of rn(a)) i(a.id, o, va.Write);
+ }
+ for (let a of Gt(r.terminal)) i(r.terminal.id, a, va.Read);
+ }
+ return {
+ singleUseIdentifiers: new Set(
+ [...t].filter(([, r]) => r === 1).map(([r]) => r)
+ ),
+ lastAssignments: n,
+ };
+ }
+ function G2(e, t, n, i) {
+ var r, a;
+ let o = new Map(),
+ s = new Map(),
+ l = null;
+ for (let u of t.instructions) {
+ let {lvalue: p, value: y} = u,
+ m = X2(u, i),
+ g = dr(o, p.identifier.id, () => ({
+ instruction: u,
+ dependencies: new Set(),
+ reorderability: m,
+ depth: null,
+ }));
+ m === Ti.Nonreorderable &&
+ (l !== null && g.dependencies.add(l), (l = p.identifier.id));
+ for (let S of Ot(y)) {
+ let {name: _, id: O} = S.identifier;
+ if (_ !== null && _.kind === 'named') {
+ let P = s.get(_.value);
+ P !== void 0 && g.dependencies.add(P),
+ s.set(_.value, p.identifier.id);
+ } else (o.has(O) || n.has(O)) && g.dependencies.add(O);
+ }
+ for (let S of yo(y)) {
+ dr(o, S.identifier.id, () => ({
+ instruction: null,
+ dependencies: new Set(),
+ depth: null,
+ })).dependencies.add(p.identifier.id);
+ let O = S.identifier.name;
+ if (O !== null && O.kind === 'named') {
+ let P = s.get(O.value);
+ P !== void 0 && g.dependencies.add(P),
+ s.set(O.value, p.identifier.id);
+ }
+ }
+ }
+ let d = [];
+ if (sB(t.kind)) {
+ l !== null && no(e, o, n, d, l),
+ t.instructions.length !== 0 &&
+ no(e, o, n, d, t.instructions.at(-1).lvalue.identifier.id);
+ for (let u of Gt(t.terminal)) no(e, o, n, d, u.identifier.id);
+ for (let [u, p] of o)
+ p.instruction != null &&
+ (D.invariant(p.reorderability === Ti.Reorderable, {
+ reason: 'Expected all remaining instructions to be reorderable',
+ details: [
+ {
+ kind: 'error',
+ loc:
+ (a =
+ (r = p.instruction) === null || r === void 0
+ ? void 0
+ : r.loc) !== null && a !== void 0
+ ? a
+ : t.terminal.loc,
+ message: null,
+ },
+ ],
+ description:
+ p.instruction != null
+ ? `Instruction [${p.instruction.id}] was not emitted yet but is not reorderable`
+ : `Lvalue $${u} was not emitted yet but is not reorderable`,
+ }),
+ n.set(u, p));
+ } else {
+ for (let u of Gt(t.terminal)) no(e, o, n, d, u.identifier.id);
+ for (let u of Array.from(o.keys()).reverse()) {
+ let p = o.get(u);
+ p !== void 0 &&
+ (p.reorderability === Ti.Reorderable
+ ? n.set(u, p)
+ : no(e, o, n, d, u));
+ }
+ }
+ t.instructions = d;
+ }
+ function Uv(e, t, n) {
+ let i = t.get(n);
+ if (i == null) return 0;
+ if (i.depth != null) return i.depth;
+ i.depth = 0;
+ let r = i.reorderability === Ti.Reorderable ? 1 : 10;
+ for (let a of i.dependencies) r += Uv(e, t, a);
+ return (i.depth = r), r;
+ }
+ function no(e, t, n, i, r) {
+ var a;
+ let o = (a = t.get(r)) !== null && a !== void 0 ? a : n.get(r);
+ if (o == null) return;
+ t.delete(r), n.delete(r);
+ let s = [...o.dependencies];
+ s.sort((l, d) => {
+ let u = Uv(e, t, l);
+ return Uv(e, t, d) - u;
+ });
+ for (let l of s) no(e, t, n, i, l);
+ o.instruction !== null && i.push(o.instruction);
+ }
+ var Ti;
+ (function (e) {
+ (e[(e.Reorderable = 0)] = 'Reorderable'),
+ (e[(e.Nonreorderable = 1)] = 'Nonreorderable');
+ })(Ti || (Ti = {}));
+ function X2(e, t) {
+ switch (e.value.kind) {
+ case 'JsxExpression':
+ case 'JsxFragment':
+ case 'JSXText':
+ case 'LoadGlobal':
+ case 'Primitive':
+ case 'TemplateLiteral':
+ case 'BinaryExpression':
+ case 'UnaryExpression':
+ return Ti.Reorderable;
+ case 'LoadLocal': {
+ let n = e.value.place.identifier.name;
+ if (n !== null && n.kind === 'named') {
+ let i = t.lastAssignments.get(n.value);
+ if (
+ i !== void 0 &&
+ i < e.id &&
+ t.singleUseIdentifiers.has(e.lvalue.identifier.id)
+ )
+ return Ti.Reorderable;
+ }
+ return Ti.Nonreorderable;
+ }
+ default:
+ return Ti.Nonreorderable;
+ }
+ }
+ function LP(e) {
+ let t = new Map(),
+ n = new Sa();
+ for (let [, i] of e.body.blocks)
+ for (let r of i.instructions) {
+ let {lvalue: a, value: o} = r;
+ if (o.kind === 'MethodCall') {
+ let s = a.identifier.scope,
+ l = o.property.identifier.scope;
+ s !== null
+ ? l !== null
+ ? n.union([s, l])
+ : t.set(o.property.identifier.id, s)
+ : l !== null && t.set(o.property.identifier.id, null);
+ } else
+ (o.kind === 'FunctionExpression' || o.kind === 'ObjectMethod') &&
+ LP(o.loweredFunc.func);
+ }
+ n.forEach((i, r) => {
+ i !== r &&
+ ((r.range.start = V(Math.min(i.range.start, r.range.start))),
+ (r.range.end = V(Math.max(i.range.end, r.range.end))));
+ });
+ for (let [, i] of e.body.blocks)
+ for (let r of i.instructions) {
+ let a = t.get(r.lvalue.identifier.id);
+ if (a !== void 0) r.lvalue.identifier.scope = a;
+ else if (r.lvalue.identifier.scope !== null) {
+ let o = n.find(r.lvalue.identifier.scope);
+ o != null && (r.lvalue.identifier.scope = o);
+ }
+ }
+ }
+ function Y2(e) {
+ var t, n, i, r, a, o, s;
+ let l = [],
+ d = new Set(),
+ u = new Set(),
+ p = new Map(),
+ y = new Map();
+ function m(g, S, _) {
+ S.identifier.scope !== null && y.set(S, S.identifier.scope);
+ let O = Km(g, S);
+ O != null &&
+ (d.add(O),
+ _?.children.push({kind: 'scope', scope: O, id: g}),
+ !u.has(O) &&
+ (u.add(O),
+ _ != null &&
+ _.valueRange !== null &&
+ ((O.range.start = V(Math.min(_.valueRange.start, O.range.start))),
+ (O.range.end = V(Math.max(_.valueRange.end, O.range.end))))));
+ }
+ for (let [, g] of e.body.blocks) {
+ let S =
+ (n =
+ (t = g.instructions[0]) === null || t === void 0 ? void 0 : t.id) !==
+ null && n !== void 0
+ ? n
+ : g.terminal.id;
+ Rz(d, (I) => I.range.end > S);
+ let _ = l.at(-1);
+ if (_?.fallthrough === g.id) {
+ l.pop();
+ for (let I of d)
+ I.range.start = V(Math.min(I.range.start, _.range.start));
+ }
+ let {instructions: O, terminal: P} = g,
+ M = (i = p.get(g.id)) !== null && i !== void 0 ? i : null;
+ for (let I of O) {
+ for (let U of rn(I)) m(I.id, U, M);
+ for (let U of Ot(I.value)) m(I.id, U, M);
+ }
+ for (let I of Gt(P)) m(P.id, I, M);
+ let w = Ju(P);
+ if (w !== null && P.kind !== 'branch') {
+ let I = e.body.blocks.get(w),
+ U =
+ (a =
+ (r = I.instructions[0]) === null || r === void 0
+ ? void 0
+ : r.id) !== null && a !== void 0
+ ? a
+ : I.terminal.id;
+ for (let A of d)
+ A.range.end > P.id && (A.range.end = V(Math.max(A.range.end, U)));
+ l.push({fallthrough: w, range: {start: P.id, end: U}}),
+ D.invariant(!p.has(w), {
+ reason: 'Expect hir blocks to have unique fallthroughs',
+ description: null,
+ details: [{kind: 'error', loc: P.loc, message: null}],
+ }),
+ M != null && p.set(w, M);
+ } else if (P.kind === 'goto') {
+ let I = l.find((U) => U.fallthrough === P.block);
+ if (I != null && I !== l.at(-1)) {
+ let U = e.body.blocks.get(I.fallthrough),
+ A =
+ (s =
+ (o = U.instructions[0]) === null || o === void 0
+ ? void 0
+ : o.id) !== null && s !== void 0
+ ? s
+ : U.terminal.id;
+ for (let q of d)
+ q.range.end <= P.id ||
+ ((q.range.start = V(Math.min(I.range.start, q.range.start))),
+ (q.range.end = V(Math.max(A, q.range.end))));
+ }
+ }
+ pI(P, (I) => {
+ var U, A;
+ if (p.has(I)) return I;
+ let q = e.body.blocks.get(I);
+ if (!(q.kind === 'block' || q.kind === 'catch'))
+ if (
+ M == null ||
+ P.kind === 'ternary' ||
+ P.kind === 'logical' ||
+ P.kind === 'optional'
+ ) {
+ let ae;
+ if (M == null) {
+ D.invariant(w !== null, {
+ reason: 'Expected a fallthrough for value block',
+ description: null,
+ details: [{kind: 'error', loc: P.loc, message: null}],
+ });
+ let G = e.body.blocks.get(w),
+ ve =
+ (A =
+ (U = G.instructions[0]) === null || U === void 0
+ ? void 0
+ : U.id) !== null && A !== void 0
+ ? A
+ : G.terminal.id;
+ ae = {start: P.id, end: ve};
+ } else ae = M.valueRange;
+ let le = {kind: 'node', id: P.id, children: [], valueRange: ae};
+ M?.children.push(le), p.set(I, le);
+ } else p.set(I, M);
+ return I;
+ });
+ }
+ }
+ function Q2(e) {
+ let t = Array();
+ for (let [, n] of e.body.blocks) {
+ ra(t, (r) => r !== n.id);
+ let {terminal: i} = n;
+ switch (i.kind) {
+ case 'do-while':
+ case 'for':
+ case 'for-in':
+ case 'for-of':
+ case 'while': {
+ t.push(i.fallthrough);
+ break;
+ }
+ case 'scope': {
+ t.length !== 0 &&
+ (n.terminal = {
+ kind: 'pruned-scope',
+ block: i.block,
+ fallthrough: i.fallthrough,
+ id: i.id,
+ loc: i.loc,
+ scope: i.scope,
+ });
+ break;
+ }
+ case 'branch':
+ case 'goto':
+ case 'if':
+ case 'label':
+ case 'logical':
+ case 'maybe-throw':
+ case 'optional':
+ case 'pruned-scope':
+ case 'return':
+ case 'sequence':
+ case 'switch':
+ case 'ternary':
+ case 'throw':
+ case 'try':
+ case 'unreachable':
+ case 'unsupported':
+ break;
+ default:
+ Me(i, `Unexpected terminal kind \`${i.kind}\``);
+ }
+ }
+ }
+ function eZ(e) {
+ let t = [],
+ n = [];
+ for (let [, i] of e.body.blocks) {
+ ra(t, (r) => r.fallthrough !== i.id);
+ for (let r of i.instructions) {
+ let {value: a} = r;
+ switch (a.kind) {
+ case 'MethodCall':
+ case 'CallExpression': {
+ let o = a.kind === 'MethodCall' ? a.property : a.callee;
+ (Qn(e.env, o.identifier) != null || rv(o.identifier)) &&
+ (n.push(...t.map((s) => s.block)), (t.length = 0));
+ }
+ }
+ }
+ i.terminal.kind === 'scope' &&
+ t.push({block: i.id, fallthrough: i.terminal.fallthrough});
+ }
+ for (let i of n) {
+ let r = e.body.blocks.get(i),
+ a = r.terminal;
+ D.invariant(a.kind === 'scope', {
+ reason: 'Expected block to have a scope terminal',
+ description: `Expected block bb${r.id} to end in a scope terminal`,
+ details: [{kind: 'error', loc: a.loc, message: null}],
+ });
+ let o = e.body.blocks.get(a.block);
+ if (
+ o.instructions.length === 1 &&
+ o.terminal.kind === 'goto' &&
+ o.terminal.block === a.fallthrough
+ ) {
+ r.terminal = {
+ kind: 'label',
+ block: a.block,
+ fallthrough: a.fallthrough,
+ id: a.id,
+ loc: a.loc,
+ };
+ continue;
+ }
+ r.terminal = {
+ kind: 'pruned-scope',
+ block: a.block,
+ fallthrough: a.fallthrough,
+ id: a.id,
+ loc: a.loc,
+ scope: a.scope,
+ };
+ }
+ }
+ function tZ(e) {
+ At(e, new Zv(), !1);
+ }
+ var Zv = class extends Ei {
+ constructor() {
+ super(...arguments),
+ (this.alwaysInvalidatingValues = new Set()),
+ (this.unmemoizedValues = new Set());
+ }
+ transformInstruction(t, n) {
+ this.visitInstruction(t, n);
+ let {lvalue: i, value: r} = t;
+ switch (r.kind) {
+ case 'ArrayExpression':
+ case 'ObjectExpression':
+ case 'JsxExpression':
+ case 'JsxFragment':
+ case 'NewExpression': {
+ i !== null &&
+ (this.alwaysInvalidatingValues.add(i.identifier),
+ n || this.unmemoizedValues.add(i.identifier));
+ break;
+ }
+ case 'StoreLocal': {
+ this.alwaysInvalidatingValues.has(r.value.identifier) &&
+ this.alwaysInvalidatingValues.add(r.lvalue.place.identifier),
+ this.unmemoizedValues.has(r.value.identifier) &&
+ this.unmemoizedValues.add(r.lvalue.place.identifier);
+ break;
+ }
+ case 'LoadLocal': {
+ i !== null &&
+ this.alwaysInvalidatingValues.has(r.place.identifier) &&
+ this.alwaysInvalidatingValues.add(i.identifier),
+ i !== null &&
+ this.unmemoizedValues.has(r.place.identifier) &&
+ this.unmemoizedValues.add(i.identifier);
+ break;
+ }
+ }
+ return {kind: 'keep'};
+ }
+ transformScope(t, n) {
+ this.visitScope(t, !0);
+ for (let i of t.scope.dependencies)
+ if (this.unmemoizedValues.has(i.identifier)) {
+ for (let [r, a] of t.scope.declarations)
+ this.alwaysInvalidatingValues.has(a.identifier) &&
+ this.unmemoizedValues.add(a.identifier);
+ for (let r of t.scope.reassignments)
+ this.alwaysInvalidatingValues.has(r) &&
+ this.unmemoizedValues.add(r);
+ return {
+ kind: 'replace',
+ value: {
+ kind: 'pruned-scope',
+ scope: t.scope,
+ instructions: t.instructions,
+ },
+ };
+ }
+ return {kind: 'keep'};
+ }
+ },
+ nZ = class extends Qt {
+ constructor(t, n, i) {
+ super(),
+ (this.map = new Map()),
+ (this.aliases = n),
+ (this.paths = i),
+ (this.env = t);
+ }
+ join(t) {
+ function n(i, r) {
+ if (i === 'Update' || r === 'Update') return 'Update';
+ if (i === 'Create' || r === 'Create') return 'Create';
+ if (i === 'Unknown' || r === 'Unknown') return 'Unknown';
+ Me(r, `Unhandled variable kind ${r}`);
+ }
+ return t.reduce(n, 'Unknown');
+ }
+ isCreateOnlyHook(t) {
+ return vh(t) || Yn(t);
+ }
+ visitPlace(t, n, i) {
+ var r;
+ this.map.set(
+ n.identifier.id,
+ this.join([
+ i,
+ (r = this.map.get(n.identifier.id)) !== null && r !== void 0
+ ? r
+ : 'Unknown',
+ ])
+ );
+ }
+ visitBlock(t, n) {
+ super.visitBlock([...t].reverse(), n);
+ }
+ visitInstruction(t) {
+ let n = this.join(
+ [...rn(t)].map((a) => {
+ var o;
+ return (o = this.map.get(a.identifier.id)) !== null &&
+ o !== void 0
+ ? o
+ : 'Unknown';
+ })
+ ),
+ i = () => {
+ switch (t.value.kind) {
+ case 'CallExpression': {
+ this.visitPlace(t.id, t.value.callee, n);
+ break;
+ }
+ case 'MethodCall': {
+ this.visitPlace(t.id, t.value.property, n),
+ this.visitPlace(t.id, t.value.receiver, n);
+ break;
+ }
+ }
+ },
+ r = () => {
+ let a = null;
+ switch (t.value.kind) {
+ case 'CallExpression': {
+ a = t.value.callee.identifier;
+ break;
+ }
+ case 'MethodCall': {
+ a = t.value.property.identifier;
+ break;
+ }
+ }
+ return a != null && Qn(this.env, a) != null;
+ };
+ switch (t.value.kind) {
+ case 'CallExpression':
+ case 'MethodCall': {
+ t.lvalue && this.isCreateOnlyHook(t.lvalue.identifier)
+ ? ([...iv(t.value.args)].forEach((a) =>
+ this.visitPlace(t.id, a, 'Create')
+ ),
+ i())
+ : this.traverseInstruction(t, r() ? 'Update' : n);
+ break;
+ }
+ default:
+ this.traverseInstruction(t, n);
+ }
+ }
+ visitScope(t) {
+ let n = this.join(
+ [
+ ...t.scope.declarations.keys(),
+ ...[...t.scope.reassignments.values()].map((i) => i.id),
+ ].map((i) => {
+ var r;
+ return (r = this.map.get(i)) !== null && r !== void 0
+ ? r
+ : 'Unknown';
+ })
+ );
+ super.visitScope(t, n),
+ [...t.scope.dependencies].forEach((i) => {
+ var r;
+ let a =
+ (r = this.aliases.find(i.identifier.id)) !== null && r !== void 0
+ ? r
+ : i.identifier.id;
+ i.path.forEach((o) => {
+ var s;
+ a &&
+ (a =
+ (s = this.paths.get(a)) === null || s === void 0
+ ? void 0
+ : s.get(o.property));
+ }),
+ a &&
+ this.map.get(a) === 'Create' &&
+ t.scope.dependencies.delete(i);
+ });
+ }
+ visitTerminal(t, n) {
+ D.invariant(n !== 'Create', {
+ reason: "Visiting a terminal statement with state 'Create'",
+ description: null,
+ details: [{kind: 'error', loc: t.terminal.loc, message: null}],
+ }),
+ super.visitTerminal(t, n);
+ }
+ visitReactiveFunctionValue(t, n, i, r) {
+ At(i, this, r);
+ }
+ };
+ function rZ(e) {
+ let [t, n] = iZ(e);
+ At(e, new nZ(e.env, t, n), 'Update');
+ }
+ function qv(e, t, n, i) {
+ var r;
+ let a = (r = e.get(t)) !== null && r !== void 0 ? r : new Map();
+ a.set(n, i), e.set(t, a);
+ }
+ var Kv = class extends Qt {
+ constructor() {
+ super(...arguments),
+ (this.scopeIdentifiers = new Sa()),
+ (this.scopePaths = new Map());
+ }
+ visitInstruction(t) {
+ t.value.kind === 'StoreLocal' || t.value.kind === 'StoreContext'
+ ? this.scopeIdentifiers.union([
+ t.value.lvalue.place.identifier.id,
+ t.value.value.identifier.id,
+ ])
+ : t.value.kind === 'LoadLocal' || t.value.kind === 'LoadContext'
+ ? t.lvalue &&
+ this.scopeIdentifiers.union([
+ t.lvalue.identifier.id,
+ t.value.place.identifier.id,
+ ])
+ : t.value.kind === 'PropertyLoad'
+ ? t.lvalue &&
+ qv(
+ this.scopePaths,
+ t.value.object.identifier.id,
+ t.value.property,
+ t.lvalue.identifier.id
+ )
+ : t.value.kind === 'PropertyStore' &&
+ qv(
+ this.scopePaths,
+ t.value.object.identifier.id,
+ t.value.property,
+ t.value.value.identifier.id
+ );
+ }
+ };
+ function iZ(e) {
+ var t, n;
+ let i = new Kv();
+ At(e, i, null);
+ let r = i.scopeIdentifiers,
+ a = new Map();
+ for (let [o, s] of i.scopePaths)
+ for (let [l, d] of s)
+ qv(
+ a,
+ (t = r.find(o)) !== null && t !== void 0 ? t : o,
+ l,
+ (n = r.find(d)) !== null && n !== void 0 ? n : d
+ );
+ return [r, a];
+ }
+ function aZ(e) {
+ switch (e) {
+ case '+':
+ case '-':
+ case '/':
+ case '%':
+ case '*':
+ case '**':
+ case '&':
+ case '|':
+ case '>>':
+ case '<<':
+ case '^':
+ case '>':
+ case '<':
+ case '>=':
+ case '<=':
+ case '|>':
+ return !0;
+ default:
+ return !1;
+ }
+ }
+ function Lh(e) {
+ let t = new Jv(e.env);
+ for (let n of Vv(e)) t.unify(n.left, n.right);
+ FP(e, t);
+ }
+ function FP(e, t) {
+ for (let [i, r] of e.body.blocks) {
+ for (let a of r.phis)
+ a.place.identifier.type = t.get(a.place.identifier.type);
+ for (let a of r.instructions) {
+ for (let l of rn(a)) l.identifier.type = t.get(l.identifier.type);
+ for (let l of sn(a)) l.identifier.type = t.get(l.identifier.type);
+ let {lvalue: o, value: s} = a;
+ (o.identifier.type = t.get(o.identifier.type)),
+ (s.kind === 'FunctionExpression' || s.kind === 'ObjectMethod') &&
+ FP(s.loweredFunc.func, t);
+ }
+ }
+ let n = e.returns.identifier;
+ n.type = t.get(n.type);
+ }
+ function ht(e, t) {
+ return {left: e, right: t};
+ }
+ function* Vv(e) {
+ if (e.fnType === 'Component') {
+ let [i, r] = e.params;
+ i &&
+ i.kind === 'Identifier' &&
+ (yield ht(i.identifier.type, {kind: 'Object', shapeId: kI})),
+ r &&
+ r.kind === 'Identifier' &&
+ (yield ht(r.identifier.type, {kind: 'Object', shapeId: ia}));
+ }
+ let t = new Map(),
+ n = [];
+ for (let [i, r] of e.body.blocks) {
+ for (let o of r.phis)
+ yield ht(o.place.identifier.type, {
+ kind: 'Phi',
+ operands: [...o.operands.values()].map((s) => s.identifier.type),
+ });
+ for (let o of r.instructions) yield* sZ(e.env, t, o);
+ let a = r.terminal;
+ a.kind === 'return' && n.push(a.value.identifier.type);
+ }
+ n.length > 1
+ ? yield ht(e.returns.identifier.type, {kind: 'Phi', operands: n})
+ : n.length === 1 && (yield ht(e.returns.identifier.type, n[0]));
+ }
+ function oZ(e, t, n) {
+ var i;
+ ((i = n.name) === null || i === void 0 ? void 0 : i.kind) === 'named' &&
+ e.set(t, n.name.value);
+ }
+ function Ua(e, t) {
+ var n;
+ return (n = e.get(t)) !== null && n !== void 0 ? n : '';
+ }
+ function* sZ(e, t, n) {
+ let {lvalue: i, value: r} = n,
+ a = i.identifier.type;
+ switch (r.kind) {
+ case 'TemplateLiteral':
+ case 'JSXText':
+ case 'Primitive': {
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'UnaryExpression': {
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'LoadLocal': {
+ oZ(t, i.identifier.id, r.place.identifier),
+ yield ht(a, r.place.identifier.type);
+ break;
+ }
+ case 'DeclareContext':
+ case 'LoadContext':
+ break;
+ case 'StoreContext': {
+ r.lvalue.kind === Q.Const &&
+ (yield ht(r.lvalue.place.identifier.type, r.value.identifier.type));
+ break;
+ }
+ case 'StoreLocal': {
+ if (e.config.enableUseTypeAnnotations) {
+ yield ht(r.lvalue.place.identifier.type, r.value.identifier.type);
+ let o = r.type === null ? Gn() : Fp(r.type);
+ yield ht(o, r.lvalue.place.identifier.type), yield ht(a, o);
+ } else
+ yield ht(a, r.value.identifier.type),
+ yield ht(r.lvalue.place.identifier.type, r.value.identifier.type);
+ break;
+ }
+ case 'StoreGlobal': {
+ yield ht(a, r.value.identifier.type);
+ break;
+ }
+ case 'BinaryExpression': {
+ aZ(r.operator) &&
+ (yield ht(r.left.identifier.type, {kind: 'Primitive'}),
+ yield ht(r.right.identifier.type, {kind: 'Primitive'})),
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ yield ht(r.value.identifier.type, {kind: 'Primitive'}),
+ yield ht(r.lvalue.identifier.type, {kind: 'Primitive'}),
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'LoadGlobal': {
+ let o = e.getGlobalDeclaration(r.binding, r.loc);
+ o && (yield ht(a, o));
+ break;
+ }
+ case 'CallExpression': {
+ let o = Gn(),
+ s = null;
+ e.config.enableTreatSetIdentifiersAsStateSetters &&
+ Ua(t, r.callee.identifier.id).startsWith('set') &&
+ (s = _I),
+ yield ht(r.callee.identifier.type, {
+ kind: 'Function',
+ shapeId: s,
+ return: o,
+ isConstructor: !1,
+ }),
+ yield ht(a, o);
+ break;
+ }
+ case 'TaggedTemplateExpression': {
+ let o = Gn();
+ yield ht(r.tag.identifier.type, {
+ kind: 'Function',
+ shapeId: null,
+ return: o,
+ isConstructor: !1,
+ }),
+ yield ht(a, o);
+ break;
+ }
+ case 'ObjectExpression': {
+ for (let o of r.properties)
+ o.kind === 'ObjectProperty' &&
+ o.key.kind === 'computed' &&
+ (yield ht(o.key.name.identifier.type, {kind: 'Primitive'}));
+ yield ht(a, {kind: 'Object', shapeId: Jm});
+ break;
+ }
+ case 'ArrayExpression': {
+ yield ht(a, {kind: 'Object', shapeId: Ht});
+ break;
+ }
+ case 'PropertyLoad': {
+ yield ht(a, {
+ kind: 'Property',
+ objectType: r.object.identifier.type,
+ objectName: Ua(t, r.object.identifier.id),
+ propertyName: {kind: 'literal', value: r.property},
+ });
+ break;
+ }
+ case 'ComputedLoad': {
+ yield ht(a, {
+ kind: 'Property',
+ objectType: r.object.identifier.type,
+ objectName: Ua(t, r.object.identifier.id),
+ propertyName: {kind: 'computed', value: r.property.identifier.type},
+ });
+ break;
+ }
+ case 'MethodCall': {
+ let o = Gn();
+ yield ht(r.property.identifier.type, {
+ kind: 'Function',
+ return: o,
+ shapeId: null,
+ isConstructor: !1,
+ }),
+ yield ht(a, o);
+ break;
+ }
+ case 'Destructure': {
+ let o = r.lvalue.pattern;
+ if (o.kind === 'ArrayPattern')
+ for (let s = 0; s < o.items.length; s++) {
+ let l = o.items[s];
+ if (l.kind === 'Identifier') {
+ let d = String(s);
+ yield ht(l.identifier.type, {
+ kind: 'Property',
+ objectType: r.value.identifier.type,
+ objectName: Ua(t, r.value.identifier.id),
+ propertyName: {kind: 'literal', value: d},
+ });
+ } else if (l.kind === 'Spread')
+ yield ht(l.place.identifier.type, {kind: 'Object', shapeId: Ht});
+ else continue;
+ }
+ else
+ for (let s of o.properties)
+ s.kind === 'ObjectProperty' &&
+ (s.key.kind === 'identifier' || s.key.kind === 'string') &&
+ (yield ht(s.place.identifier.type, {
+ kind: 'Property',
+ objectType: r.value.identifier.type,
+ objectName: Ua(t, r.value.identifier.id),
+ propertyName: {kind: 'literal', value: s.key.name},
+ }));
+ break;
+ }
+ case 'TypeCastExpression': {
+ e.config.enableUseTypeAnnotations
+ ? (yield ht(r.type, r.value.identifier.type), yield ht(a, r.type))
+ : yield ht(a, r.value.identifier.type);
+ break;
+ }
+ case 'PropertyDelete':
+ case 'ComputedDelete': {
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'FunctionExpression': {
+ yield* Vv(r.loweredFunc.func),
+ yield ht(a, {
+ kind: 'Function',
+ shapeId: Ih,
+ return: r.loweredFunc.func.returns.identifier.type,
+ isConstructor: !1,
+ });
+ break;
+ }
+ case 'NextPropertyOf': {
+ yield ht(a, {kind: 'Primitive'});
+ break;
+ }
+ case 'ObjectMethod': {
+ yield* Vv(r.loweredFunc.func), yield ht(a, {kind: 'ObjectMethod'});
+ break;
+ }
+ case 'JsxExpression':
+ case 'JsxFragment': {
+ if (
+ e.config.enableTreatRefLikeIdentifiersAsRefs &&
+ r.kind === 'JsxExpression'
+ )
+ for (let o of r.props)
+ o.kind === 'JsxAttribute' &&
+ o.name === 'ref' &&
+ (yield ht(o.place.identifier.type, {
+ kind: 'Object',
+ shapeId: ia,
+ }));
+ yield ht(a, {kind: 'Object', shapeId: Ph});
+ break;
+ }
+ case 'NewExpression': {
+ let o = Gn();
+ yield ht(r.callee.identifier.type, {
+ kind: 'Function',
+ return: o,
+ shapeId: null,
+ isConstructor: !0,
+ }),
+ yield ht(a, o);
+ break;
+ }
+ case 'PropertyStore': {
+ yield ht(Gn(), {
+ kind: 'Property',
+ objectType: r.object.identifier.type,
+ objectName: Ua(t, r.object.identifier.id),
+ propertyName: {kind: 'literal', value: r.property},
+ });
+ break;
+ }
+ case 'DeclareLocal':
+ case 'RegExpLiteral':
+ case 'MetaProperty':
+ case 'ComputedStore':
+ case 'Await':
+ case 'GetIterator':
+ case 'IteratorNext':
+ case 'UnsupportedNode':
+ case 'Debugger':
+ case 'FinishMemoize':
+ case 'StartMemoize':
+ break;
+ default:
+ Me(r, `Unhandled instruction value kind: ${r.kind}`);
+ }
+ }
+ var Jv = class {
+ constructor(t) {
+ (this.substitutions = new Map()), (this.env = t);
+ }
+ unify(t, n) {
+ if (n.kind === 'Property') {
+ if (this.env.config.enableTreatRefLikeIdentifiersAsRefs && cZ(n)) {
+ this.unify(n.objectType, {kind: 'Object', shapeId: ia}),
+ this.unify(t, {kind: 'Object', shapeId: Pm});
+ return;
+ }
+ let i = this.get(n.objectType),
+ r =
+ n.propertyName.kind === 'literal'
+ ? this.env.getPropertyType(i, n.propertyName.value)
+ : this.env.getFallthroughPropertyType(i, n.propertyName.value);
+ r !== null && this.unify(t, r);
+ return;
+ }
+ if (!xu(t, n)) {
+ if (t.kind === 'Type') {
+ this.bindVariableTo(t, n);
+ return;
+ }
+ if (n.kind === 'Type') {
+ this.bindVariableTo(n, t);
+ return;
+ }
+ if (
+ n.kind === 'Function' &&
+ t.kind === 'Function' &&
+ t.isConstructor === n.isConstructor
+ ) {
+ this.unify(t.return, n.return);
+ return;
+ }
+ }
+ }
+ bindVariableTo(t, n) {
+ if (n.kind !== 'Poly') {
+ if (this.substitutions.has(t.id)) {
+ this.unify(this.substitutions.get(t.id), n);
+ return;
+ }
+ if (n.kind === 'Type' && this.substitutions.has(n.id)) {
+ this.unify(t, this.substitutions.get(n.id));
+ return;
+ }
+ if (n.kind === 'Phi') {
+ D.invariant(n.operands.length > 0, {
+ reason: 'there should be at least one operand',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ });
+ let i = null;
+ for (let r of n.operands) {
+ let a = this.get(r);
+ if (i === null) i = a;
+ else if (!xu(a, i)) {
+ let o = uZ(a, i);
+ if (o === null) {
+ i = null;
+ break;
+ } else i = o;
+ }
+ }
+ if (i !== null) {
+ this.unify(t, i);
+ return;
+ }
+ }
+ if (this.occursCheck(t, n)) {
+ let i = this.tryResolveType(t, n);
+ if (i !== null) {
+ this.substitutions.set(t.id, i);
+ return;
+ }
+ throw new Error('cycle detected');
+ }
+ this.substitutions.set(t.id, n);
+ }
+ }
+ tryResolveType(t, n) {
+ switch (n.kind) {
+ case 'Phi': {
+ let i = [];
+ for (let r of n.operands) {
+ if (r.kind === 'Type' && r.id === t.id) continue;
+ let a = this.tryResolveType(t, r);
+ if (a === null) return null;
+ i.push(a);
+ }
+ return {kind: 'Phi', operands: i};
+ }
+ case 'Type': {
+ let i = this.get(n);
+ if (i !== n) {
+ let r = this.tryResolveType(t, i);
+ return r !== null && this.substitutions.set(n.id, r), r;
+ }
+ return n;
+ }
+ case 'Property': {
+ let i = this.tryResolveType(t, this.get(n.objectType));
+ return i === null
+ ? null
+ : {
+ kind: 'Property',
+ objectName: n.objectName,
+ objectType: i,
+ propertyName: n.propertyName,
+ };
+ }
+ case 'Function': {
+ let i = this.tryResolveType(t, this.get(n.return));
+ return i === null
+ ? null
+ : {
+ kind: 'Function',
+ return: i,
+ shapeId: n.shapeId,
+ isConstructor: n.isConstructor,
+ };
+ }
+ case 'ObjectMethod':
+ case 'Object':
+ case 'Primitive':
+ case 'Poly':
+ return n;
+ default:
+ Me(n, `Unexpected type kind '${n.kind}'`);
+ }
+ }
+ occursCheck(t, n) {
+ return xu(t, n)
+ ? !0
+ : n.kind === 'Type' && this.substitutions.has(n.id)
+ ? this.occursCheck(t, this.substitutions.get(n.id))
+ : n.kind === 'Phi'
+ ? n.operands.some((i) => this.occursCheck(t, i))
+ : n.kind === 'Function'
+ ? this.occursCheck(t, n.return)
+ : !1;
+ }
+ get(t) {
+ return t.kind === 'Type' && this.substitutions.has(t.id)
+ ? this.get(this.substitutions.get(t.id))
+ : t.kind === 'Phi'
+ ? {kind: 'Phi', operands: t.operands.map((n) => this.get(n))}
+ : t.kind === 'Function'
+ ? {
+ kind: 'Function',
+ isConstructor: t.isConstructor,
+ shapeId: t.shapeId,
+ return: this.get(t.return),
+ }
+ : t;
+ }
+ },
+ lZ = /^(?:[a-zA-Z$_][a-zA-Z$_0-9]*)Ref$|^ref$/;
+ function cZ(e) {
+ return (
+ e.propertyName.kind === 'literal' &&
+ lZ.test(e.objectName) &&
+ e.propertyName.value === 'current'
+ );
+ }
+ function uZ(e, t) {
+ let n, i;
+ if (e.kind === 'Object' && e.shapeId === ea) (n = e), (i = t);
+ else if (t.kind === 'Object' && t.shapeId === ea) (n = t), (i = e);
+ else return null;
+ return i.kind === 'Primitive'
+ ? n
+ : i.kind === 'Object' && i.shapeId === Ht
+ ? i
+ : null;
+ }
+ function dZ(e) {
+ zP(e, new Map());
+ }
+ function zP(e, t) {
+ for (let [, n] of e.body.blocks)
+ for (let i of n.instructions) {
+ let {value: r} = i;
+ switch (r.kind) {
+ case 'DeclareContext':
+ case 'StoreContext': {
+ Za(t, r.lvalue.place, 'context');
+ break;
+ }
+ case 'LoadContext': {
+ Za(t, r.place, 'context');
+ break;
+ }
+ case 'StoreLocal':
+ case 'DeclareLocal': {
+ Za(t, r.lvalue.place, 'local');
+ break;
+ }
+ case 'LoadLocal': {
+ Za(t, r.place, 'local');
+ break;
+ }
+ case 'PostfixUpdate':
+ case 'PrefixUpdate': {
+ Za(t, r.lvalue, 'local');
+ break;
+ }
+ case 'Destructure': {
+ for (let a of kr(r.lvalue.pattern)) Za(t, a, 'destructure');
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ zP(r.loweredFunc.func, t);
+ break;
+ }
+ default:
+ for (let a of yo(r))
+ D.throwTodo({
+ reason:
+ 'ValidateContextVariableLValues: unhandled instruction variant',
+ loc: r.loc,
+ description: `Handle '${r.kind} lvalues`,
+ suggestions: null,
+ });
+ }
+ }
+ }
+ function Za(e, t, n) {
+ let i = e.get(t.identifier.id);
+ i !== void 0 &&
+ (i.kind === 'context') !== (n === 'context') &&
+ ((i.kind === 'destructure' || n === 'destructure') &&
+ D.throwTodo({
+ reason: 'Support destructuring of context variables',
+ loc: n === 'destructure' ? t.loc : i.place.loc,
+ description: null,
+ suggestions: null,
+ }),
+ D.invariant(!1, {
+ reason:
+ 'Expected all references to a variable to be consistently local or context references',
+ description: `Identifier ${_e(
+ t
+ )} is referenced as a ${n} variable, but was previously referenced as a ${
+ i.kind
+ } variable`,
+ suggestions: null,
+ details: [{kind: 'error', loc: t.loc, message: `this is ${i.kind}`}],
+ })),
+ e.set(t.identifier.id, {place: t, kind: n});
+ }
+ function BP(e) {
+ let t = new Set(),
+ n = zI(e, {includeThrowsAsExitNode: !1}),
+ i = n.exit,
+ r = e.body.entry;
+ for (; r !== null && r !== i; )
+ D.invariant(!t.has(r), {
+ reason:
+ 'Internal error: non-terminating loop in ComputeUnconditionalBlocks',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }),
+ t.add(r),
+ (r = n.get(r));
+ return t;
+ }
+ var ct;
+ (function (e) {
+ (e.Error = 'Error'),
+ (e.KnownHook = 'KnownHook'),
+ (e.PotentialHook = 'PotentialHook'),
+ (e.Global = 'Global'),
+ (e.Local = 'Local');
+ })(ct || (ct = {}));
+ function Ap(e, t) {
+ return e === ct.Error || t === ct.Error
+ ? ct.Error
+ : e === ct.KnownHook || t === ct.KnownHook
+ ? ct.KnownHook
+ : e === ct.PotentialHook || t === ct.PotentialHook
+ ? ct.PotentialHook
+ : e === ct.Global || t === ct.Global
+ ? ct.Global
+ : ct.Local;
+ }
+ function fZ(e) {
+ let t = BP(e),
+ n = new D(),
+ i = new Map();
+ function r(y, m) {
+ typeof y == 'symbol' ? n.pushErrorDetail(m) : i.set(y, m);
+ }
+ function a(y) {
+ p(y, ct.Error);
+ let m =
+ 'Hooks must always be called in a consistent order, and may not be called conditionally. See the Rules of Hooks (https://react.dev/warnings/invalid-hook-call-warning)',
+ g = typeof y.loc != 'symbol' ? i.get(y.loc) : void 0;
+ (g === void 0 || g.reason !== m) &&
+ r(
+ y.loc,
+ new Nn({
+ category: K.Hooks,
+ description: null,
+ reason: m,
+ loc: y.loc,
+ suggestions: null,
+ })
+ );
+ }
+ function o(y) {
+ (typeof y.loc != 'symbol' ? i.get(y.loc) : void 0) === void 0 &&
+ r(
+ y.loc,
+ new Nn({
+ category: K.Hooks,
+ description: null,
+ reason:
+ 'Hooks may not be referenced as normal values, they must be called. See https://react.dev/reference/rules/react-calls-components-and-hooks#never-pass-around-hooks-as-regular-values',
+ loc: y.loc,
+ suggestions: null,
+ })
+ );
+ }
+ function s(y) {
+ (typeof y.loc != 'symbol' ? i.get(y.loc) : void 0) === void 0 &&
+ r(
+ y.loc,
+ new Nn({
+ category: K.Hooks,
+ description: null,
+ reason:
+ 'Hooks must be the same function on every render, but this value may change over time to a different function. See https://react.dev/reference/rules/react-calls-components-and-hooks#dont-dynamically-use-hooks',
+ loc: y.loc,
+ suggestions: null,
+ })
+ );
+ }
+ let l = new Map();
+ function d(y) {
+ let m = l.get(y.identifier.id);
+ return y.identifier.name !== null && cn(y.identifier.name.value)
+ ? Ap(m ?? ct.Local, ct.PotentialHook)
+ : m ?? ct.Local;
+ }
+ function u(y) {
+ l.get(y.identifier.id) === ct.KnownHook && o(y);
+ }
+ function p(y, m) {
+ l.set(y.identifier.id, m);
+ }
+ for (let y of e.params) {
+ let m = y.kind === 'Identifier' ? y : y.place,
+ g = d(m);
+ p(m, g);
+ }
+ for (let [, y] of e.body.blocks) {
+ for (let m of y.phis) {
+ let g =
+ m.place.identifier.name !== null && cn(m.place.identifier.name.value)
+ ? ct.PotentialHook
+ : ct.Local;
+ for (let [, S] of m.operands) {
+ let _ = l.get(S.identifier.id);
+ _ !== void 0 && (g = Ap(g, _));
+ }
+ l.set(m.place.identifier.id, g);
+ }
+ for (let m of y.instructions)
+ switch (m.value.kind) {
+ case 'LoadGlobal': {
+ Qn(e.env, m.lvalue.identifier) != null
+ ? p(m.lvalue, ct.KnownHook)
+ : p(m.lvalue, ct.Global);
+ break;
+ }
+ case 'LoadContext':
+ case 'LoadLocal': {
+ u(m.value.place);
+ let g = d(m.value.place);
+ p(m.lvalue, g);
+ break;
+ }
+ case 'StoreLocal':
+ case 'StoreContext': {
+ u(m.value.value);
+ let g = Ap(d(m.value.value), d(m.value.lvalue.place));
+ p(m.value.lvalue.place, g), p(m.lvalue, g);
+ break;
+ }
+ case 'ComputedLoad': {
+ u(m.value.object);
+ let g = d(m.value.object);
+ p(m.lvalue, Ap(d(m.lvalue), g));
+ break;
+ }
+ case 'PropertyLoad': {
+ let g = d(m.value.object),
+ S = typeof m.value.property == 'string' && cn(m.value.property),
+ _;
+ switch (g) {
+ case ct.Error: {
+ _ = ct.Error;
+ break;
+ }
+ case ct.KnownHook: {
+ _ = S ? ct.KnownHook : ct.Local;
+ break;
+ }
+ case ct.PotentialHook: {
+ _ = ct.PotentialHook;
+ break;
+ }
+ case ct.Global: {
+ _ = S ? ct.KnownHook : ct.Global;
+ break;
+ }
+ case ct.Local: {
+ _ = S ? ct.PotentialHook : ct.Local;
+ break;
+ }
+ default:
+ Me(g, `Unexpected kind \`${g}\``);
+ }
+ p(m.lvalue, _);
+ break;
+ }
+ case 'CallExpression': {
+ let g = d(m.value.callee);
+ (g === ct.KnownHook || g === ct.PotentialHook) && !t.has(y.id)
+ ? a(m.value.callee)
+ : g === ct.PotentialHook && s(m.value.callee);
+ for (let _ of sn(m)) _ !== m.value.callee && u(_);
+ break;
+ }
+ case 'MethodCall': {
+ let g = d(m.value.property);
+ (g === ct.KnownHook || g === ct.PotentialHook) && !t.has(y.id)
+ ? a(m.value.property)
+ : g === ct.PotentialHook && s(m.value.property);
+ for (let _ of sn(m)) _ !== m.value.property && u(_);
+ break;
+ }
+ case 'Destructure': {
+ u(m.value.value);
+ let g = d(m.value.value);
+ for (let S of rn(m)) {
+ let _ = S.identifier.name !== null && cn(S.identifier.name.value),
+ O;
+ switch (g) {
+ case ct.Error: {
+ O = ct.Error;
+ break;
+ }
+ case ct.KnownHook: {
+ O = ct.KnownHook;
+ break;
+ }
+ case ct.PotentialHook: {
+ O = ct.PotentialHook;
+ break;
+ }
+ case ct.Global: {
+ O = _ ? ct.KnownHook : ct.Global;
+ break;
+ }
+ case ct.Local: {
+ O = _ ? ct.PotentialHook : ct.Local;
+ break;
+ }
+ default:
+ Me(g, `Unexpected kind \`${g}\``);
+ }
+ p(S, O);
+ }
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ UP(n, m.value.loweredFunc.func);
+ break;
+ }
+ default: {
+ for (let g of sn(m)) u(g);
+ for (let g of rn(m)) {
+ let S = d(g);
+ p(g, S);
+ }
+ }
+ }
+ for (let m of Gt(y.terminal)) u(m);
+ }
+ for (let [, y] of i) n.pushErrorDetail(y);
+ return n.asResult();
+ }
+ function UP(e, t) {
+ for (let [, n] of t.body.blocks)
+ for (let i of n.instructions)
+ switch (i.value.kind) {
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ UP(e, i.value.loweredFunc.func);
+ break;
+ }
+ case 'MethodCall':
+ case 'CallExpression': {
+ let r =
+ i.value.kind === 'CallExpression'
+ ? i.value.callee
+ : i.value.property,
+ a = Qn(t.env, r.identifier);
+ a != null &&
+ e.pushErrorDetail(
+ new Nn({
+ category: K.Hooks,
+ reason:
+ 'Hooks must be called at the top level in the body of a function component or custom hook, and may not be called within function expressions. See the Rules of Hooks (https://react.dev/warnings/invalid-hook-call-warning)',
+ loc: r.loc,
+ description: `Cannot call ${
+ a === 'Custom' ? 'hook' : a
+ } within a function expression`,
+ suggestions: null,
+ })
+ );
+ break;
+ }
+ }
+ }
+ function pZ(e) {
+ let t = new D();
+ return At(e, new mZ(), t), t.asResult();
+ }
+ var mZ = class extends Qt {
+ constructor() {
+ super(...arguments), (this.scopes = new Set());
+ }
+ visitScope(t, n) {
+ this.traverseScope(t, n);
+ let i = !0;
+ for (let r of t.scope.dependencies)
+ if (s0(r.identifier, this.scopes)) {
+ i = !1;
+ break;
+ }
+ if (i) {
+ this.scopes.add(t.scope.id);
+ for (let r of t.scope.merged) this.scopes.add(r);
+ }
+ }
+ visitInstruction(t, n) {
+ if (
+ (this.traverseInstruction(t, n),
+ t.value.kind === 'CallExpression' &&
+ yZ(t.value.callee.identifier) &&
+ t.value.args.length >= 2)
+ ) {
+ let i = t.value.args[1];
+ i.kind === 'Identifier' &&
+ (ta(t, i) || s0(i.identifier, this.scopes)) &&
+ n.push({
+ category: K.EffectDependencies,
+ reason:
+ 'React Compiler has skipped optimizing this component because the effect dependencies could not be memoized. Unmemoized effect dependencies can trigger an infinite loop or other unexpected behavior',
+ description: null,
+ loc: typeof t.loc != 'symbol' ? t.loc : null,
+ suggestions: null,
+ });
+ }
+ }
+ };
+ function s0(e, t) {
+ return e.scope != null && !t.has(e.scope.id);
+ }
+ function yZ(e) {
+ return Ku(e) || rI(e) || iI(e);
+ }
+ function gZ(e) {
+ var t;
+ let n = e.env.config,
+ i = new Set([
+ ...vo.keys(),
+ ...((t = n.validateNoCapitalizedCalls) !== null && t !== void 0
+ ? t
+ : []),
+ ]),
+ r = n.hookPattern != null ? new RegExp(n.hookPattern) : null,
+ a = (u) => i.has(u) || (r != null && r.test(u)),
+ o = new D(),
+ s = new Map(),
+ l = new Map(),
+ d =
+ 'Capitalized functions are reserved for components, which must be invoked with JSX. If this is a component, render it with JSX. Otherwise, ensure that it has no hook calls and rename it to begin with a lowercase letter. Alternatively, if you know for a fact that this function is not a component, you can allowlist it via the compiler config';
+ for (let [, u] of e.body.blocks)
+ for (let {lvalue: p, value: y} of u.instructions)
+ switch (y.kind) {
+ case 'LoadGlobal': {
+ y.binding.name != '' &&
+ /^[A-Z]/.test(y.binding.name) &&
+ y.binding.name.toUpperCase() !== y.binding.name &&
+ !a(y.binding.name) &&
+ s.set(p.identifier.id, y.binding.name);
+ break;
+ }
+ case 'CallExpression': {
+ let m = y.callee.identifier.id,
+ g = s.get(m);
+ g != null &&
+ D.throwInvalidReact({
+ category: K.CapitalizedCalls,
+ reason: d,
+ description: `${g} may be a component`,
+ loc: y.loc,
+ suggestions: null,
+ });
+ break;
+ }
+ case 'PropertyLoad': {
+ typeof y.property == 'string' &&
+ /^[A-Z]/.test(y.property) &&
+ l.set(p.identifier.id, y.property);
+ break;
+ }
+ case 'MethodCall': {
+ let m = y.property.identifier.id,
+ g = l.get(m);
+ g != null &&
+ o.push({
+ category: K.CapitalizedCalls,
+ reason: d,
+ description: `${g} may be a component`,
+ loc: y.loc,
+ suggestions: null,
+ });
+ break;
+ }
+ }
+ return o.asResult();
+ }
+ var Tu, Eu, ro;
+ function vZ(e) {
+ return (
+ D.invariant(e >= 0 && Number.isInteger(e), {
+ reason: 'Expected identifier id to be a non-negative integer',
+ description: null,
+ suggestions: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ e
+ );
+ }
+ var hZ = 0;
+ function Fh() {
+ return vZ(hZ++);
+ }
+ var Hv = class {
+ constructor() {
+ Tu.set(this, !1), Eu.set(this, new Map()), ro.set(this, new Map());
+ }
+ lookup(t) {
+ var n;
+ return (n = j(this, ro, 'f').get(t.identifier.id)) !== null &&
+ n !== void 0
+ ? n
+ : t;
+ }
+ define(t, n) {
+ j(this, ro, 'f').set(t.identifier.id, n);
+ }
+ resetChanged() {
+ at(this, Tu, !1, 'f');
+ }
+ hasChanged() {
+ return j(this, Tu, 'f');
+ }
+ get(t) {
+ var n, i;
+ let r =
+ (i =
+ (n = j(this, ro, 'f').get(t)) === null || n === void 0
+ ? void 0
+ : n.identifier.id) !== null && i !== void 0
+ ? i
+ : t;
+ return j(this, Eu, 'f').get(r);
+ }
+ set(t, n) {
+ var i, r;
+ let a =
+ (r =
+ (i = j(this, ro, 'f').get(t)) === null || i === void 0
+ ? void 0
+ : i.identifier.id) !== null && r !== void 0
+ ? r
+ : t,
+ o = j(this, Eu, 'f').get(a),
+ s = Yi(n, o ?? {kind: 'None'});
+ return (
+ !(o == null && s.kind === 'None') &&
+ (o == null || !Wv(o, s)) &&
+ at(this, Tu, !0, 'f'),
+ j(this, Eu, 'f').set(a, s),
+ this
+ );
+ }
+ };
+ (Tu = new WeakMap()), (Eu = new WeakMap()), (ro = new WeakMap());
+ function bZ(e) {
+ let t = new Hv();
+ return kZ(e, t), ZP(e, t).map((n) => {});
+ }
+ function kZ(e, t) {
+ for (let n of e.body.blocks.values())
+ for (let i of n.instructions) {
+ let {lvalue: r, value: a} = i;
+ switch (a.kind) {
+ case 'LoadLocal': {
+ let o = t.lookup(a.place);
+ o != null && t.define(r, o);
+ break;
+ }
+ case 'StoreLocal': {
+ let o = t.lookup(a.value);
+ o != null && (t.define(r, o), t.define(a.lvalue.place, o));
+ break;
+ }
+ case 'PropertyLoad': {
+ if (Yn(a.object.identifier) && a.property === 'current') continue;
+ let o = t.lookup(a.object);
+ o != null && t.define(r, o);
+ break;
+ }
+ }
+ }
+ }
+ function Hi(e) {
+ return fo(e.identifier)
+ ? {kind: 'RefValue'}
+ : Yn(e.identifier)
+ ? {kind: 'Ref', refId: Fh()}
+ : {kind: 'None'};
+ }
+ function Wv(e, t) {
+ if (e.kind !== t.kind) return !1;
+ switch (e.kind) {
+ case 'None':
+ return !0;
+ case 'Ref':
+ return !0;
+ case 'Nullable':
+ return !0;
+ case 'Guard':
+ return (
+ D.invariant(t.kind === 'Guard', {
+ reason: 'Expected ref value',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ e.refId === t.refId
+ );
+ case 'RefValue':
+ return (
+ D.invariant(t.kind === 'RefValue', {
+ reason: 'Expected ref value',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ e.loc == t.loc
+ );
+ case 'Structure':
+ return (
+ D.invariant(t.kind === 'Structure', {
+ reason: 'Expected structure',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ ((e.fn === null && t.fn === null) ||
+ (e.fn !== null &&
+ t.fn !== null &&
+ e.fn.readRefEffect === t.fn.readRefEffect &&
+ Wv(e.fn.returnType, t.fn.returnType))) &&
+ (e.value === t.value ||
+ (e.value !== null && t.value !== null && Wv(e.value, t.value)))
+ );
+ }
+ }
+ function Yi(...e) {
+ function t(n, i) {
+ if (n.kind === 'RefValue')
+ return i.kind === 'RefValue' && n.refId === i.refId
+ ? n
+ : {kind: 'RefValue'};
+ if (i.kind === 'RefValue') return i;
+ if (n.kind === 'Ref' || i.kind === 'Ref')
+ return n.kind === 'Ref' && i.kind === 'Ref' && n.refId === i.refId
+ ? n
+ : {kind: 'Ref', refId: Fh()};
+ {
+ D.invariant(n.kind === 'Structure' && i.kind === 'Structure', {
+ reason: 'Expected structure',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ });
+ let r =
+ n.fn === null
+ ? i.fn
+ : i.fn === null
+ ? n.fn
+ : {
+ readRefEffect: n.fn.readRefEffect || i.fn.readRefEffect,
+ returnType: Yi(n.fn.returnType, i.fn.returnType),
+ },
+ a =
+ n.value === null
+ ? i.value
+ : i.value === null
+ ? n.value
+ : t(n.value, i.value);
+ return {kind: 'Structure', fn: r, value: a};
+ }
+ }
+ return e.reduce(
+ (n, i) =>
+ n.kind === 'None'
+ ? i
+ : i.kind === 'None'
+ ? n
+ : n.kind === 'Guard'
+ ? i.kind === 'Guard' && n.refId === i.refId
+ ? n
+ : i.kind === 'Nullable' || i.kind === 'Guard'
+ ? {kind: 'None'}
+ : i
+ : i.kind === 'Guard'
+ ? n.kind === 'Nullable'
+ ? {kind: 'None'}
+ : i
+ : n.kind === 'Nullable'
+ ? i
+ : i.kind === 'Nullable'
+ ? n
+ : t(n, i),
+ {kind: 'None'}
+ );
+ }
+ function ZP(e, t) {
+ var n, i, r, a, o, s, l, d, u;
+ let p = [],
+ y;
+ for (let g of e.params) {
+ g.kind === 'Identifier' ? (y = g) : (y = g.place);
+ let S = Hi(y);
+ t.set(y.identifier.id, S);
+ }
+ let m = new Set();
+ for (let g of e.body.blocks.values())
+ for (let S of g.instructions) {
+ let {value: _} = S;
+ if (
+ (_.kind === 'JsxExpression' || _.kind === 'JsxFragment') &&
+ _.children != null
+ )
+ for (let O of _.children) m.add(O.identifier.id);
+ }
+ for (let g = 0; (g == 0 || t.hasChanged()) && g < 10; g++) {
+ t.resetChanged(), (p = []);
+ let S = [],
+ _ = new D();
+ for (let [, O] of e.body.blocks) {
+ ra(S, (P) => P.block !== O.id);
+ for (let P of O.phis)
+ t.set(
+ P.place.identifier.id,
+ Yi(
+ ...Array(...P.operands.values()).map((M) => {
+ var w;
+ return (w = t.get(M.identifier.id)) !== null && w !== void 0
+ ? w
+ : {kind: 'None'};
+ })
+ )
+ );
+ for (let P of O.instructions) {
+ switch (P.value.kind) {
+ case 'JsxExpression':
+ case 'JsxFragment': {
+ for (let M of Ot(P.value)) Ka(_, M, t);
+ break;
+ }
+ case 'ComputedLoad':
+ case 'PropertyLoad': {
+ P.value.kind === 'ComputedLoad' && Ka(_, P.value.property, t);
+ let M = t.get(P.value.object.identifier.id),
+ w = null;
+ M?.kind === 'Structure'
+ ? (w = M.value)
+ : M?.kind === 'Ref' &&
+ (w = {kind: 'RefValue', loc: P.loc, refId: M.refId}),
+ t.set(P.lvalue.identifier.id, w ?? Hi(P.lvalue));
+ break;
+ }
+ case 'TypeCastExpression': {
+ t.set(
+ P.lvalue.identifier.id,
+ (n = t.get(P.value.value.identifier.id)) !== null &&
+ n !== void 0
+ ? n
+ : Hi(P.lvalue)
+ );
+ break;
+ }
+ case 'LoadContext':
+ case 'LoadLocal': {
+ t.set(
+ P.lvalue.identifier.id,
+ (i = t.get(P.value.place.identifier.id)) !== null &&
+ i !== void 0
+ ? i
+ : Hi(P.lvalue)
+ );
+ break;
+ }
+ case 'StoreContext':
+ case 'StoreLocal': {
+ t.set(
+ P.value.lvalue.place.identifier.id,
+ (r = t.get(P.value.value.identifier.id)) !== null &&
+ r !== void 0
+ ? r
+ : Hi(P.value.lvalue.place)
+ ),
+ t.set(
+ P.lvalue.identifier.id,
+ (a = t.get(P.value.value.identifier.id)) !== null &&
+ a !== void 0
+ ? a
+ : Hi(P.lvalue)
+ );
+ break;
+ }
+ case 'Destructure': {
+ let M = t.get(P.value.value.identifier.id),
+ w = null;
+ M?.kind === 'Structure' && (w = M.value),
+ t.set(P.lvalue.identifier.id, w ?? Hi(P.lvalue));
+ for (let I of kr(P.value.lvalue.pattern))
+ t.set(I.identifier.id, w ?? Hi(I));
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ let M = {kind: 'None'},
+ w = !1,
+ I = ZP(P.value.loweredFunc.func, t);
+ I.isOk() ? (M = I.unwrap()) : I.isErr() && (w = !0),
+ t.set(P.lvalue.identifier.id, {
+ kind: 'Structure',
+ fn: {readRefEffect: w, returnType: M},
+ value: null,
+ });
+ break;
+ }
+ case 'MethodCall':
+ case 'CallExpression': {
+ let M =
+ P.value.kind === 'CallExpression'
+ ? P.value.callee
+ : P.value.property,
+ w = Au(e.env, M.identifier.type),
+ I = {kind: 'None'},
+ U = t.get(M.identifier.id),
+ A = !1;
+ if (
+ (U?.kind === 'Structure' &&
+ U.fn !== null &&
+ ((I = U.fn.returnType),
+ U.fn.readRefEffect &&
+ ((A = !0),
+ _.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: M.loc,
+ message: 'This function accesses a ref value',
+ })
+ ))),
+ !A)
+ ) {
+ let q = Yn(P.lvalue.identifier);
+ for (let ae of Ot(P.value))
+ q || (w != null && w !== 'useState' && w !== 'useReducer')
+ ? Ka(_, ae, t)
+ : m.has(P.lvalue.identifier.id)
+ ? qa(_, t, ae)
+ : SZ(_, t, ae, ae.loc);
+ }
+ t.set(P.lvalue.identifier.id, I);
+ break;
+ }
+ case 'ObjectExpression':
+ case 'ArrayExpression': {
+ let M = [];
+ for (let I of Ot(P.value))
+ Ka(_, I, t),
+ M.push(
+ (o = t.get(I.identifier.id)) !== null && o !== void 0
+ ? o
+ : {kind: 'None'}
+ );
+ let w = Yi(...M);
+ w.kind === 'None' || w.kind === 'Guard' || w.kind === 'Nullable'
+ ? t.set(P.lvalue.identifier.id, {kind: 'None'})
+ : t.set(P.lvalue.identifier.id, {
+ kind: 'Structure',
+ value: w,
+ fn: null,
+ });
+ break;
+ }
+ case 'PropertyDelete':
+ case 'PropertyStore':
+ case 'ComputedDelete':
+ case 'ComputedStore': {
+ let M = t.get(P.value.object.identifier.id),
+ w = null;
+ if (
+ (P.value.kind === 'PropertyStore' &&
+ M != null &&
+ M.kind === 'Ref' &&
+ (w = S.find((I) => I.ref === M.refId)),
+ w != null
+ ? ra(S, (I) => I !== w)
+ : _Z(_, t, P.value.object, P.loc),
+ (P.value.kind === 'ComputedDelete' ||
+ P.value.kind === 'ComputedStore') &&
+ qa(_, t, P.value.property),
+ P.value.kind === 'ComputedStore' ||
+ P.value.kind === 'PropertyStore')
+ ) {
+ Ka(_, P.value.value, t);
+ let I = t.get(P.value.value.identifier.id);
+ if (I != null && I.kind === 'Structure') {
+ let U = I;
+ M != null && (U = Yi(U, M)),
+ t.set(P.value.object.identifier.id, U);
+ }
+ }
+ break;
+ }
+ case 'StartMemoize':
+ case 'FinishMemoize':
+ break;
+ case 'LoadGlobal': {
+ P.value.binding.name === 'undefined' &&
+ t.set(P.lvalue.identifier.id, {kind: 'Nullable'});
+ break;
+ }
+ case 'Primitive': {
+ P.value.value == null &&
+ t.set(P.lvalue.identifier.id, {kind: 'Nullable'});
+ break;
+ }
+ case 'UnaryExpression': {
+ if (P.value.operator === '!') {
+ let M = t.get(P.value.value.identifier.id),
+ w =
+ M?.kind === 'RefValue' && M.refId != null ? M.refId : null;
+ if (w !== null) {
+ t.set(P.lvalue.identifier.id, {kind: 'Guard', refId: w}),
+ _.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ })
+ .withDetails({
+ kind: 'error',
+ loc: P.value.value.loc,
+ message: 'Cannot access ref value during render',
+ })
+ .withDetails({
+ kind: 'hint',
+ message:
+ 'To initialize a ref only once, check that the ref is null with the pattern `if (ref.current == null) { ref.current = ... }`',
+ })
+ );
+ break;
+ }
+ }
+ qa(_, t, P.value.value);
+ break;
+ }
+ case 'BinaryExpression': {
+ let M = t.get(P.value.left.identifier.id),
+ w = t.get(P.value.right.identifier.id),
+ I = !1,
+ U = null;
+ if (
+ (M?.kind === 'RefValue' && M.refId != null
+ ? (U = M.refId)
+ : w?.kind === 'RefValue' && w.refId != null && (U = w.refId),
+ (M?.kind === 'Nullable' || w?.kind === 'Nullable') && (I = !0),
+ U !== null && I)
+ )
+ t.set(P.lvalue.identifier.id, {kind: 'Guard', refId: U});
+ else for (let A of Ot(P.value)) qa(_, t, A);
+ break;
+ }
+ default: {
+ for (let M of Ot(P.value)) qa(_, t, M);
+ break;
+ }
+ }
+ for (let M of sn(P)) Bg(_, M, t);
+ Yn(P.lvalue.identifier) &&
+ ((s = t.get(P.lvalue.identifier.id)) === null || s === void 0
+ ? void 0
+ : s.kind) !== 'Ref' &&
+ t.set(
+ P.lvalue.identifier.id,
+ Yi(
+ (l = t.get(P.lvalue.identifier.id)) !== null && l !== void 0
+ ? l
+ : {kind: 'None'},
+ {kind: 'Ref', refId: Fh()}
+ )
+ ),
+ fo(P.lvalue.identifier) &&
+ ((d = t.get(P.lvalue.identifier.id)) === null || d === void 0
+ ? void 0
+ : d.kind) !== 'RefValue' &&
+ t.set(
+ P.lvalue.identifier.id,
+ Yi(
+ (u = t.get(P.lvalue.identifier.id)) !== null && u !== void 0
+ ? u
+ : {kind: 'None'},
+ {kind: 'RefValue', loc: P.loc}
+ )
+ );
+ }
+ if (O.terminal.kind === 'if') {
+ let P = t.get(O.terminal.test.identifier.id);
+ P?.kind === 'Guard' &&
+ S.find((M) => M.ref === P.refId) == null &&
+ S.push({block: O.terminal.fallthrough, ref: P.refId});
+ }
+ for (let P of Gt(O.terminal))
+ O.terminal.kind !== 'return'
+ ? (qa(_, t, P), O.terminal.kind !== 'if' && Bg(_, P, t))
+ : (Ka(_, P, t), Bg(_, P, t), p.push(t.get(P.identifier.id)));
+ }
+ if (_.hasAnyErrors()) return gr(_);
+ }
+ return (
+ D.invariant(!t.hasChanged(), {
+ reason: 'Ref type environment did not converge',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ }),
+ zn(Yi(...p.filter((g) => g !== void 0)))
+ );
+ }
+ function Wu(e) {
+ return e?.kind === 'Structure' && e.value !== null ? Wu(e.value) : e;
+ }
+ function Bg(e, t, n) {
+ var i;
+ ((i = n.get(t.identifier.id)) === null || i === void 0
+ ? void 0
+ : i.kind) === 'Guard' &&
+ e.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: t.loc,
+ message: 'Cannot access ref value during render',
+ })
+ );
+ }
+ function qa(e, t, n) {
+ var i;
+ let r = Wu(t.get(n.identifier.id));
+ (r?.kind === 'RefValue' ||
+ (r?.kind === 'Structure' &&
+ !((i = r.fn) === null || i === void 0) &&
+ i.readRefEffect)) &&
+ e.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: (r.kind === 'RefValue' && r.loc) || n.loc,
+ message: 'Cannot access ref value during render',
+ })
+ );
+ }
+ function SZ(e, t, n, i) {
+ var r;
+ let a = Wu(t.get(n.identifier.id));
+ (a?.kind === 'Ref' ||
+ a?.kind === 'RefValue' ||
+ (a?.kind === 'Structure' &&
+ !((r = a.fn) === null || r === void 0) &&
+ r.readRefEffect)) &&
+ e.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: (a.kind === 'RefValue' && a.loc) || i,
+ message:
+ 'Passing a ref to a function may read its value during render',
+ })
+ );
+ }
+ function _Z(e, t, n, i) {
+ let r = Wu(t.get(n.identifier.id));
+ (r?.kind === 'Ref' || r?.kind === 'RefValue') &&
+ e.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: (r.kind === 'RefValue' && r.loc) || i,
+ message: 'Cannot update ref during render',
+ })
+ );
+ }
+ function Ka(e, t, n) {
+ var i;
+ let r = Wu(n.get(t.identifier.id));
+ r?.kind === 'RefValue' &&
+ e.pushDiagnostic(
+ Tt.create({
+ category: K.Refs,
+ reason: 'Cannot access refs during render',
+ description: Ta,
+ }).withDetails({
+ kind: 'error',
+ loc: (i = r.loc) !== null && i !== void 0 ? i : t.loc,
+ message: 'Cannot access ref value during render',
+ })
+ );
+ }
+ var Ta =
+ 'React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the `current` property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef)';
+ function TZ(e) {
+ return qP(e, new Set());
+ }
+ function qP(e, t) {
+ let n = BP(e),
+ i = null,
+ r = new D();
+ for (let [, a] of e.body.blocks)
+ for (let o of a.instructions)
+ switch (o.value.kind) {
+ case 'LoadLocal': {
+ t.has(o.value.place.identifier.id) && t.add(o.lvalue.identifier.id);
+ break;
+ }
+ case 'StoreLocal': {
+ t.has(o.value.value.identifier.id) &&
+ (t.add(o.value.lvalue.place.identifier.id),
+ t.add(o.lvalue.identifier.id));
+ break;
+ }
+ case 'ObjectMethod':
+ case 'FunctionExpression': {
+ [...Ot(o.value)].some(
+ (s) => vr(s.identifier) || t.has(s.identifier.id)
+ ) &&
+ qP(o.value.loweredFunc.func, t).isErr() &&
+ t.add(o.lvalue.identifier.id);
+ break;
+ }
+ case 'StartMemoize': {
+ D.invariant(i === null, {
+ reason: 'Unexpected nested StartMemoize instructions',
+ description: null,
+ details: [{kind: 'error', loc: o.value.loc, message: null}],
+ }),
+ (i = o.value.manualMemoId);
+ break;
+ }
+ case 'FinishMemoize': {
+ D.invariant(i === o.value.manualMemoId, {
+ reason:
+ 'Expected FinishMemoize to align with previous StartMemoize instruction',
+ description: null,
+ details: [{kind: 'error', loc: o.value.loc, message: null}],
+ }),
+ (i = null);
+ break;
+ }
+ case 'CallExpression': {
+ let s = o.value.callee;
+ (vr(s.identifier) || t.has(s.identifier.id)) &&
+ (i !== null
+ ? r.pushDiagnostic(
+ Tt.create({
+ category: K.RenderSetState,
+ reason:
+ 'Calling setState from useMemo may trigger an infinite loop',
+ description:
+ 'Each time the memo callback is evaluated it will change state. This can cause a memoization dependency to change, running the memo function again and causing an infinite loop. Instead of setting state in useMemo(), prefer deriving the value during render. (https://react.dev/reference/react/useState)',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: s.loc,
+ message: 'Found setState() within useMemo()',
+ })
+ )
+ : n.has(a.id) &&
+ r.pushDiagnostic(
+ Tt.create({
+ category: K.RenderSetState,
+ reason:
+ 'Calling setState during render may trigger an infinite loop',
+ description:
+ 'Calling setState during render will trigger another render, and can lead to infinite loops. (https://react.dev/reference/react/useState)',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: s.loc,
+ message: 'Found setState() in render',
+ })
+ ));
+ break;
+ }
+ }
+ return r.asResult();
+ }
+ function EZ(e) {
+ let t = {errors: new D(), manualMemoState: null};
+ return At(e, new Gv(), t), t.errors.asResult();
+ }
+ function IZ(e) {
+ var t;
+ let n;
+ return (
+ ((t = e.identifier.name) === null || t === void 0 ? void 0 : t.kind) ===
+ 'named'
+ ? (n = e.identifier.name.value)
+ : (n = '[unnamed]'),
+ `${n}${e.path
+ .map((i) => `${i.optional ? '?.' : '.'}${i.property}`)
+ .join('')}`
+ );
+ }
+ var Rn;
+ (function (e) {
+ (e[(e.Ok = 0)] = 'Ok'),
+ (e[(e.RootDifference = 1)] = 'RootDifference'),
+ (e[(e.PathDifference = 2)] = 'PathDifference'),
+ (e[(e.Subpath = 3)] = 'Subpath'),
+ (e[(e.RefAccessDifference = 4)] = 'RefAccessDifference');
+ })(Rn || (Rn = {}));
+ function PZ(e, t) {
+ return Math.max(e, t);
+ }
+ function xZ(e) {
+ switch (e) {
+ case Rn.Ok:
+ return 'Dependencies equal';
+ case Rn.RootDifference:
+ case Rn.PathDifference:
+ return 'Inferred different dependency than source';
+ case Rn.RefAccessDifference:
+ return 'Differences in ref.current access';
+ case Rn.Subpath:
+ return 'Inferred less specific property than source';
+ }
+ }
+ function wZ(e, t) {
+ if (
+ !(
+ (e.root.kind === 'Global' &&
+ t.root.kind === 'Global' &&
+ e.root.identifierName === t.root.identifierName) ||
+ (e.root.kind === 'NamedLocal' &&
+ t.root.kind === 'NamedLocal' &&
+ e.root.value.identifier.id === t.root.value.identifier.id)
+ )
+ )
+ return Rn.RootDifference;
+ let i = !0;
+ for (let r = 0; r < Math.min(e.path.length, t.path.length); r++)
+ if (e.path[r].property !== t.path[r].property) {
+ i = !1;
+ break;
+ } else if (e.path[r].optional !== t.path[r].optional)
+ return Rn.PathDifference;
+ return i &&
+ (t.path.length === e.path.length ||
+ (e.path.length >= t.path.length &&
+ !e.path.some((r) => r.property === 'current')))
+ ? Rn.Ok
+ : i
+ ? t.path.some((r) => r.property === 'current') ||
+ e.path.some((r) => r.property === 'current')
+ ? Rn.RefAccessDifference
+ : Rn.Subpath
+ : Rn.PathDifference;
+ }
+ function OZ(e, t, n, i, r, a) {
+ var o;
+ let s,
+ l = t.get(e.identifier.id);
+ l != null
+ ? (s = {root: l.root, path: [...l.path, ...e.path]})
+ : (D.invariant(
+ ((o = e.identifier.name) === null || o === void 0
+ ? void 0
+ : o.kind) === 'named',
+ {
+ reason:
+ 'ValidatePreservedManualMemoization: expected scope dependency to be named',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ }
+ ),
+ (s = {
+ root: {
+ kind: 'NamedLocal',
+ value: {
+ kind: 'Identifier',
+ identifier: e.identifier,
+ loc: F,
+ effect: x.Read,
+ reactive: !1,
+ },
+ },
+ path: [...e.path],
+ }));
+ for (let u of n)
+ if (
+ s.root.kind === 'NamedLocal' &&
+ u === s.root.value.identifier.declarationId
+ )
+ return;
+ let d = null;
+ for (let u of i) {
+ let p = wZ(s, u);
+ if (p === Rn.Ok) return;
+ d = PZ(d ?? p, p);
+ }
+ r.pushDiagnostic(
+ Tt.create({
+ category: K.PreserveManualMemo,
+ reason: 'Existing memoization could not be preserved',
+ description: [
+ 'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. ',
+ 'The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. ',
+ e.identifier.name != null && e.identifier.name.kind === 'named'
+ ? `The inferred dependency was \`${IZ(
+ e
+ )}\`, but the source dependencies were [${i
+ .map((u) => lI(u, !0))
+ .join(', ')}]. ${
+ d ? xZ(d) : 'Inferred dependency not present in source'
+ }`
+ : '',
+ ]
+ .join('')
+ .trim(),
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: a,
+ message: 'Could not preserve existing manual memoization',
+ })
+ );
+ }
+ var Gv = class extends Qt {
+ constructor() {
+ super(...arguments),
+ (this.scopes = new Set()),
+ (this.prunedScopes = new Set()),
+ (this.temporaries = new Map());
+ }
+ recordDepsInValue(t, n) {
+ var i, r;
+ switch (t.kind) {
+ case 'SequenceExpression': {
+ for (let a of t.instructions) this.visitInstruction(a, n);
+ this.recordDepsInValue(t.value, n);
+ break;
+ }
+ case 'OptionalExpression': {
+ this.recordDepsInValue(t.value, n);
+ break;
+ }
+ case 'ConditionalExpression': {
+ this.recordDepsInValue(t.test, n),
+ this.recordDepsInValue(t.consequent, n),
+ this.recordDepsInValue(t.alternate, n);
+ break;
+ }
+ case 'LogicalExpression': {
+ this.recordDepsInValue(t.left, n), this.recordDepsInValue(t.right, n);
+ break;
+ }
+ default: {
+ if (
+ (_P(t, this.temporaries, !1),
+ t.kind === 'StoreLocal' ||
+ t.kind === 'StoreContext' ||
+ t.kind === 'Destructure')
+ )
+ for (let a of yo(t))
+ (i = n.manualMemoState) === null ||
+ i === void 0 ||
+ i.decls.add(a.identifier.declarationId),
+ ((r = a.identifier.name) === null || r === void 0
+ ? void 0
+ : r.kind) === 'named' &&
+ this.temporaries.set(a.identifier.id, {
+ root: {kind: 'NamedLocal', value: a},
+ path: [],
+ });
+ break;
+ }
+ }
+ }
+ recordTemporaries(t, n) {
+ var i;
+ let r = this.temporaries,
+ {lvalue: a, value: o} = t,
+ s = a?.identifier.id;
+ if (s != null && r.has(s)) return;
+ let l =
+ ((i = a?.identifier.name) === null || i === void 0
+ ? void 0
+ : i.kind) === 'named';
+ a !== null &&
+ l &&
+ n.manualMemoState != null &&
+ n.manualMemoState.decls.add(a.identifier.declarationId),
+ this.recordDepsInValue(o, n),
+ a != null &&
+ r.set(a.identifier.id, {
+ root: {kind: 'NamedLocal', value: Object.assign({}, a)},
+ path: [],
+ });
+ }
+ visitScope(t, n) {
+ if (
+ (this.traverseScope(t, n),
+ n.manualMemoState != null && n.manualMemoState.depsFromSource != null)
+ )
+ for (let i of t.scope.dependencies)
+ OZ(
+ i,
+ this.temporaries,
+ n.manualMemoState.decls,
+ n.manualMemoState.depsFromSource,
+ n.errors,
+ n.manualMemoState.loc
+ );
+ this.scopes.add(t.scope.id);
+ for (let i of t.scope.merged) this.scopes.add(i);
+ }
+ visitPrunedScope(t, n) {
+ this.traversePrunedScope(t, n), this.prunedScopes.add(t.scope.id);
+ }
+ visitInstruction(t, n) {
+ var i, r, a;
+ this.recordTemporaries(t, n);
+ let o = t.value;
+ if (
+ (o.kind === 'StoreLocal' &&
+ o.lvalue.kind === 'Reassign' &&
+ n.manualMemoState != null &&
+ Xn(
+ n.manualMemoState.reassignments,
+ o.lvalue.place.identifier.declarationId,
+ new Set()
+ ).add(o.value.identifier),
+ o.kind === 'LoadLocal' &&
+ o.place.identifier.scope != null &&
+ t.lvalue != null &&
+ t.lvalue.identifier.scope == null &&
+ n.manualMemoState != null &&
+ Xn(
+ n.manualMemoState.reassignments,
+ t.lvalue.identifier.declarationId,
+ new Set()
+ ).add(o.place.identifier),
+ o.kind === 'StartMemoize')
+ ) {
+ let s = null;
+ o.deps != null && (s = o.deps),
+ D.invariant(n.manualMemoState == null, {
+ reason: 'Unexpected nested StartMemoize instructions',
+ description: `Bad manual memoization ids: ${
+ (i = n.manualMemoState) === null || i === void 0
+ ? void 0
+ : i.manualMemoId
+ }, ${o.manualMemoId}`,
+ details: [{kind: 'error', loc: o.loc, message: null}],
+ suggestions: null,
+ }),
+ (n.manualMemoState = {
+ loc: t.loc,
+ decls: new Set(),
+ depsFromSource: s,
+ manualMemoId: o.manualMemoId,
+ reassignments: new Map(),
+ });
+ for (let {identifier: l, loc: d} of Ot(o))
+ l.scope != null &&
+ !this.scopes.has(l.scope.id) &&
+ !this.prunedScopes.has(l.scope.id) &&
+ n.errors.pushDiagnostic(
+ Tt.create({
+ category: K.PreserveManualMemo,
+ reason: 'Existing memoization could not be preserved',
+ description: [
+ 'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. ',
+ 'This dependency may be mutated later, which could cause the value to change unexpectedly',
+ ].join(''),
+ }).withDetails({
+ kind: 'error',
+ loc: d,
+ message: 'This dependency may be modified later',
+ })
+ );
+ }
+ if (o.kind === 'FinishMemoize') {
+ D.invariant(
+ n.manualMemoState != null &&
+ n.manualMemoState.manualMemoId === o.manualMemoId,
+ {
+ reason:
+ 'Unexpected mismatch between StartMemoize and FinishMemoize',
+ description: `Encountered StartMemoize id=${
+ (r = n.manualMemoState) === null || r === void 0
+ ? void 0
+ : r.manualMemoId
+ } followed by FinishMemoize id=${o.manualMemoId}`,
+ details: [{kind: 'error', loc: o.loc, message: null}],
+ suggestions: null,
+ }
+ );
+ let s = n.manualMemoState.reassignments;
+ if (((n.manualMemoState = null), !o.pruned))
+ for (let {identifier: l, loc: d} of Ot(o)) {
+ let u;
+ l.scope == null
+ ? (u =
+ (a = s.get(l.declarationId)) !== null && a !== void 0
+ ? a
+ : [l])
+ : (u = [l]);
+ for (let p of u)
+ $Z(p, this.scopes) &&
+ n.errors.pushDiagnostic(
+ Tt.create({
+ category: K.PreserveManualMemo,
+ reason: 'Existing memoization could not be preserved',
+ description: [
+ 'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output',
+ '',
+ ]
+ .join('')
+ .trim(),
+ }).withDetails({
+ kind: 'error',
+ loc: d,
+ message: 'Could not preserve existing memoization',
+ })
+ );
+ }
+ }
+ }
+ };
+ function $Z(e, t) {
+ return e.scope != null && !t.has(e.scope.id);
+ }
+ function jZ(e) {
+ let t = new D(),
+ n = new D(),
+ i = new Set(),
+ r = new Set(),
+ a = new Map(),
+ o = new Map();
+ for (let [, s] of e.body.blocks) {
+ for (let {lvalue: l, value: d} of s.instructions) {
+ if (o.size !== 0) for (let u of Ot(d)) o.delete(u.identifier.id);
+ switch (d.kind) {
+ case 'LoadGlobal': {
+ d.binding.name === 'useMemo'
+ ? i.add(l.identifier.id)
+ : d.binding.name === 'React' && r.add(l.identifier.id);
+ break;
+ }
+ case 'PropertyLoad': {
+ r.has(d.object.identifier.id) &&
+ d.property === 'useMemo' &&
+ i.add(l.identifier.id);
+ break;
+ }
+ case 'FunctionExpression': {
+ a.set(l.identifier.id, d);
+ break;
+ }
+ case 'MethodCall':
+ case 'CallExpression': {
+ let u = d.kind === 'CallExpression' ? d.callee : d.property;
+ if (!i.has(u.identifier.id) || d.args.length === 0) continue;
+ let [y] = d.args;
+ if (y.kind !== 'Identifier') continue;
+ let m = a.get(y.identifier.id);
+ if (m === void 0) continue;
+ if (m.loweredFunc.func.params.length > 0) {
+ let g = m.loweredFunc.func.params[0],
+ S = g.kind === 'Identifier' ? g.loc : g.place.loc;
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason: 'useMemo() callbacks may not accept parameters',
+ description:
+ 'useMemo() callbacks are called by React to cache calculations across re-renders. They should not take parameters. Instead, directly reference the props, state, or local variables needed for the computation',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: S,
+ message: 'Callbacks with parameters are not supported',
+ })
+ );
+ }
+ (m.loweredFunc.func.async || m.loweredFunc.func.generator) &&
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason:
+ 'useMemo() callbacks may not be async or generator functions',
+ description:
+ 'useMemo() callbacks are called once and must synchronously return a value',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: m.loc,
+ message: 'Async and generator functions are not supported',
+ })
+ ),
+ CZ(m.loweredFunc.func, t),
+ e.env.config.validateNoVoidUseMemo &&
+ (DZ(m.loweredFunc.func)
+ ? o.set(l.identifier.id, u.loc)
+ : n.pushDiagnostic(
+ Tt.create({
+ category: K.VoidUseMemo,
+ reason: 'useMemo() callbacks must return a value',
+ description:
+ "This useMemo() callback doesn't return a value. useMemo() is for computing and caching values, not for arbitrary side effects",
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: m.loc,
+ message: 'useMemo() callbacks must return a value',
+ })
+ ));
+ break;
+ }
+ }
+ }
+ if (o.size !== 0) for (let l of Gt(s.terminal)) o.delete(l.identifier.id);
+ }
+ if (o.size !== 0)
+ for (let s of o.values())
+ n.pushDiagnostic(
+ Tt.create({
+ category: K.VoidUseMemo,
+ reason: 'useMemo() result is unused',
+ description:
+ 'This useMemo() value is unused. useMemo() is for computing and caching values, not for arbitrary side effects',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: s,
+ message: 'useMemo() result is unused',
+ })
+ );
+ return e.env.logErrors(n.asResult()), t.asResult();
+ }
+ function CZ(e, t) {
+ let n = new Set(e.context.map((i) => i.identifier.id));
+ for (let i of e.body.blocks.values())
+ for (let r of i.instructions) {
+ let a = r.value;
+ switch (a.kind) {
+ case 'StoreContext': {
+ n.has(a.lvalue.place.identifier.id) &&
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.UseMemo,
+ reason:
+ 'useMemo() callbacks may not reassign variables declared outside of the callback',
+ description:
+ 'useMemo() callbacks must be pure functions and cannot reassign variables defined outside of the callback function',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: a.lvalue.place.loc,
+ message: 'Cannot reassign variable',
+ })
+ );
+ break;
+ }
+ }
+ }
+ }
+ function DZ(e) {
+ for (let [, t] of e.body.blocks)
+ if (
+ t.terminal.kind === 'return' &&
+ (t.terminal.returnVariant === 'Explicit' ||
+ t.terminal.returnVariant === 'Implicit')
+ )
+ return !0;
+ return !1;
+ }
+ function AZ(e) {
+ let n = KP(e, new Set(), !1, !1);
+ if (n !== null) {
+ let i = new D(),
+ r =
+ n.identifier.name != null && n.identifier.name.kind === 'named'
+ ? `\`${n.identifier.name.value}\``
+ : 'variable';
+ throw (
+ (i.pushDiagnostic(
+ Tt.create({
+ category: K.Immutability,
+ reason: 'Cannot reassign variable after render completes',
+ description: `Reassigning ${r} after render has completed can cause inconsistent behavior on subsequent renders. Consider using state instead`,
+ }).withDetails({
+ kind: 'error',
+ loc: n.loc,
+ message: `Cannot reassign ${r} after render completes`,
+ })
+ ),
+ i)
+ );
+ }
+ }
+ function KP(e, t, n, i) {
+ let r = new Map();
+ for (let [, a] of e.body.blocks) {
+ for (let o of a.instructions) {
+ let {lvalue: s, value: l} = o;
+ switch (l.kind) {
+ case 'FunctionExpression':
+ case 'ObjectMethod': {
+ let d = KP(
+ l.loweredFunc.func,
+ t,
+ !0,
+ i || l.loweredFunc.func.async
+ );
+ if (d === null)
+ for (let u of Ot(l)) {
+ let p = r.get(u.identifier.id);
+ if (p !== void 0) {
+ d = p;
+ break;
+ }
+ }
+ if (d !== null) {
+ if (i || l.loweredFunc.func.async) {
+ let u = new D(),
+ p =
+ d.identifier.name !== null &&
+ d.identifier.name.kind === 'named'
+ ? `\`${d.identifier.name.value}\``
+ : 'variable';
+ throw (
+ (u.pushDiagnostic(
+ Tt.create({
+ category: K.Immutability,
+ reason: 'Cannot reassign variable in async function',
+ description:
+ 'Reassigning a variable in an async function can cause inconsistent behavior on subsequent renders. Consider using state instead',
+ }).withDetails({
+ kind: 'error',
+ loc: d.loc,
+ message: `Cannot reassign ${p}`,
+ })
+ ),
+ u)
+ );
+ }
+ r.set(s.identifier.id, d);
+ }
+ break;
+ }
+ case 'StoreLocal': {
+ let d = r.get(l.value.identifier.id);
+ d !== void 0 &&
+ (r.set(l.lvalue.place.identifier.id, d),
+ r.set(s.identifier.id, d));
+ break;
+ }
+ case 'LoadLocal': {
+ let d = r.get(l.place.identifier.id);
+ d !== void 0 && r.set(s.identifier.id, d);
+ break;
+ }
+ case 'DeclareContext': {
+ n || t.add(l.lvalue.place.identifier.id);
+ break;
+ }
+ case 'StoreContext': {
+ if (n) {
+ if (t.has(l.lvalue.place.identifier.id)) return l.lvalue.place;
+ } else t.add(l.lvalue.place.identifier.id);
+ let d = r.get(l.value.identifier.id);
+ d !== void 0 &&
+ (r.set(l.lvalue.place.identifier.id, d),
+ r.set(s.identifier.id, d));
+ break;
+ }
+ default: {
+ let d = Ot(l);
+ if (l.kind === 'CallExpression') {
+ let u = Ui(e.env, l.callee.identifier.type);
+ u?.noAlias && (d = [l.callee]);
+ } else if (l.kind === 'MethodCall') {
+ let u = Ui(e.env, l.property.identifier.type);
+ u?.noAlias && (d = [l.receiver, l.property]);
+ } else if (l.kind === 'TaggedTemplateExpression') {
+ let u = Ui(e.env, l.tag.identifier.type);
+ u?.noAlias && (d = [l.tag]);
+ }
+ for (let u of d) {
+ D.invariant(u.effect !== x.Unknown, {
+ reason:
+ 'Expected effects to be inferred prior to ValidateLocalsNotReassignedAfterRender',
+ description: null,
+ details: [{kind: 'error', loc: u.loc, message: ''}],
+ });
+ let p = r.get(u.identifier.id);
+ if (p !== void 0) {
+ if (u.effect === x.Freeze) return p;
+ for (let y of rn(o)) r.set(y.identifier.id, p);
+ }
+ }
+ break;
+ }
+ }
+ }
+ for (let o of Gt(a.terminal)) {
+ let s = r.get(o.identifier.id);
+ if (s !== void 0) return s;
+ }
+ }
+ return null;
+ }
+ function VP(e, t) {
+ var n;
+ for (let [, i] of e.body.blocks)
+ for (let r of i.instructions) {
+ let {value: a, lvalue: o} = r;
+ if (
+ ((a.kind === 'FunctionExpression' || a.kind === 'ObjectMethod') &&
+ VP(a.loweredFunc.func, t),
+ a.kind === 'FunctionExpression' &&
+ a.loweredFunc.func.context.length === 0 &&
+ a.loweredFunc.func.id === null &&
+ !t.has(o.identifier.id))
+ ) {
+ let s = a.loweredFunc.func,
+ l = e.env.generateGloballyUniqueIdentifierName(
+ (n = s.id) !== null && n !== void 0 ? n : s.nameHint
+ );
+ (s.id = l.value),
+ e.env.outlineFunction(s, null),
+ (r.value = {
+ kind: 'LoadGlobal',
+ binding: {kind: 'Global', name: l.value},
+ loc: a.loc,
+ });
+ }
+ }
+ }
+ function MZ(e, t) {
+ let n = new Map(),
+ i = new Map();
+ for (let [, a] of e.body.blocks)
+ for (let o of a.instructions) {
+ let {value: s, lvalue: l} = o;
+ if (s.kind === 'CallExpression' && yE(s.callee.identifier)) {
+ n.set(l.identifier.id, s);
+ continue;
+ }
+ if (s.kind !== 'Destructure') continue;
+ let d = s.value.identifier.id;
+ if (!n.has(d)) continue;
+ let u = RZ(s);
+ if (u === null || i.has(d)) return;
+ i.set(d, u);
+ }
+ let r = null;
+ if (n.size > 0 && i.size > 0) {
+ for (let [, a] of e.body.blocks) {
+ let o = null;
+ for (let s = 0; s < a.instructions.length; s++) {
+ let l = a.instructions[s],
+ {lvalue: d, value: u} = l;
+ if (
+ u.kind === 'CallExpression' &&
+ yE(u.callee.identifier) &&
+ i.has(d.identifier.id)
+ ) {
+ r ?? (r = e.env.programContext.addImportSpecifier(t));
+ let p = NZ(e.env, r);
+ o === null && (o = a.instructions.slice(0, s)), o.push(p);
+ let y = i.get(d.identifier.id),
+ m = FZ(e.env, y);
+ o.push(m);
+ let g = p.lvalue;
+ u.callee = g;
+ let S = m.lvalue;
+ u.args.push(S);
+ }
+ o && o.push(l);
+ }
+ o && (a.instructions = o);
+ }
+ fr(e.body), Lh(e);
+ }
+ }
+ function NZ(e, t) {
+ let n = {kind: 'LoadGlobal', binding: Object.assign({}, t), loc: F};
+ return {id: V(0), loc: F, lvalue: _t(e, F), effects: null, value: n};
+ }
+ function RZ(e) {
+ let t = [],
+ n = e.lvalue.pattern;
+ switch (n.kind) {
+ case 'ArrayPattern':
+ return null;
+ case 'ObjectPattern': {
+ for (let i of n.properties) {
+ if (
+ i.kind !== 'ObjectProperty' ||
+ i.type !== 'property' ||
+ i.key.kind !== 'identifier' ||
+ i.place.identifier.name === null ||
+ i.place.identifier.name.kind !== 'named'
+ )
+ return null;
+ t.push(i.key.name);
+ }
+ return t;
+ }
+ }
+ }
+ function LZ(e, t, n) {
+ let i = {kind: 'LoadLocal', place: t, loc: F},
+ r = _t(e, F),
+ a = {lvalue: r, value: i, id: V(0), effects: null, loc: F},
+ o = {kind: 'PropertyLoad', object: r, property: n, loc: F},
+ s = _t(e, F),
+ l = {lvalue: s, value: o, id: V(0), effects: null, loc: F};
+ return {instructions: [a, l], element: s};
+ }
+ function FZ(e, t) {
+ let n = _t(e, F);
+ $n(n.identifier);
+ let i = [],
+ r = [];
+ for (let d of t) {
+ let {instructions: u, element: p} = LZ(e, n, d);
+ i.push(...u), r.push(p);
+ }
+ let a = zZ(r, e);
+ i.push(a);
+ let o = {
+ kind: 'block',
+ id: Zi(0),
+ instructions: i,
+ terminal: {
+ id: V(0),
+ kind: 'return',
+ returnVariant: 'Explicit',
+ loc: F,
+ value: a.lvalue,
+ effects: null,
+ },
+ preds: new Set(),
+ phis: new Set(),
+ },
+ s = {
+ loc: F,
+ id: null,
+ nameHint: null,
+ fnType: 'Other',
+ env: e,
+ params: [n],
+ returnTypeAnnotation: null,
+ returns: _t(e, F),
+ context: [],
+ body: {entry: o.id, blocks: new Map([[o.id, o]])},
+ generator: !1,
+ async: !1,
+ directives: [],
+ aliasingEffects: [],
+ };
+ return (
+ Pa(s.body),
+ fr(s.body),
+ XI(s),
+ Lh(s),
+ {
+ id: V(0),
+ value: {
+ kind: 'FunctionExpression',
+ name: null,
+ nameHint: null,
+ loweredFunc: {func: s},
+ type: 'ArrowFunctionExpression',
+ loc: F,
+ },
+ lvalue: _t(e, F),
+ effects: null,
+ loc: F,
+ }
+ );
+ }
+ function zZ(e, t) {
+ let n = {kind: 'ArrayExpression', elements: e, loc: F},
+ i = _t(t, F);
+ return {id: V(0), value: n, lvalue: i, effects: null, loc: F};
+ }
+ function BZ(e, t) {
+ let n = new Map(),
+ i = new D();
+ for (let [, r] of e.body.blocks)
+ for (let a of r.instructions)
+ switch (a.value.kind) {
+ case 'LoadLocal': {
+ n.has(a.value.place.identifier.id) &&
+ n.set(a.lvalue.identifier.id, a.value.place);
+ break;
+ }
+ case 'StoreLocal': {
+ n.has(a.value.value.identifier.id) &&
+ (n.set(a.value.lvalue.place.identifier.id, a.value.value),
+ n.set(a.lvalue.identifier.id, a.value.value));
+ break;
+ }
+ case 'FunctionExpression': {
+ if (
+ [...Ot(a.value)].some(
+ (o) => vr(o.identifier) || n.has(o.identifier.id)
+ )
+ ) {
+ let o = UZ(a.value.loweredFunc.func, n, t);
+ o !== null && n.set(a.lvalue.identifier.id, o);
+ }
+ break;
+ }
+ case 'MethodCall':
+ case 'CallExpression': {
+ let o =
+ a.value.kind === 'MethodCall' ? a.value.receiver : a.value.callee;
+ if (Ku(o.identifier) || rI(o.identifier) || iI(o.identifier)) {
+ let s = a.value.args[0];
+ if (s !== void 0 && s.kind === 'Identifier') {
+ let l = n.get(s.identifier.id);
+ l !== void 0 &&
+ i.pushDiagnostic(
+ Tt.create({
+ category: K.EffectSetState,
+ reason:
+ 'Calling setState synchronously within an effect can trigger cascading renders',
+ description: `Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
+* Update external systems with the latest state from React.
+* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
+
+Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect)`,
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: l.loc,
+ message:
+ 'Avoid calling setState() directly within an effect',
+ })
+ );
+ }
+ }
+ break;
+ }
+ }
+ return i.asResult();
+ }
+ function UZ(e, t, n) {
+ let i = new Set(),
+ r = (a) => i.has(a.identifier.id) || Yn(a.identifier) || fo(a.identifier);
+ for (let [, a] of e.body.blocks)
+ for (let o of a.instructions) {
+ if (n.config.enableAllowSetStateFromRefsInEffects) {
+ if (Cu(Ot(o.value), r)) for (let l of rn(o)) i.add(l.identifier.id);
+ o.value.kind === 'PropertyLoad' &&
+ o.value.property === 'current' &&
+ (Yn(o.value.object.identifier) || fo(o.value.object.identifier)) &&
+ i.add(o.lvalue.identifier.id);
+ }
+ switch (o.value.kind) {
+ case 'LoadLocal': {
+ t.has(o.value.place.identifier.id) &&
+ t.set(o.lvalue.identifier.id, o.value.place);
+ break;
+ }
+ case 'StoreLocal': {
+ t.has(o.value.value.identifier.id) &&
+ (t.set(o.value.lvalue.place.identifier.id, o.value.value),
+ t.set(o.lvalue.identifier.id, o.value.value));
+ break;
+ }
+ case 'CallExpression': {
+ let s = o.value.callee;
+ if (vr(s.identifier) || t.has(s.identifier.id)) {
+ if (n.config.enableAllowSetStateFromRefsInEffects) {
+ let l = o.value.args.at(0);
+ if (
+ l !== void 0 &&
+ l.kind === 'Identifier' &&
+ i.has(l.identifier.id)
+ )
+ return null;
+ }
+ return s;
+ }
+ }
+ }
+ }
+ return null;
+ }
+ function ZZ(e) {
+ let t = [],
+ n = new D();
+ for (let [, i] of e.body.blocks) {
+ if ((ra(t, (r) => r !== i.id), t.length !== 0))
+ for (let r of i.instructions) {
+ let {value: a} = r;
+ switch (a.kind) {
+ case 'JsxExpression':
+ case 'JsxFragment': {
+ n.pushDiagnostic(
+ Tt.create({
+ category: K.ErrorBoundaries,
+ reason: 'Avoid constructing JSX within try/catch',
+ description:
+ 'React does not immediately render components when JSX is rendered, so any errors from this component will not be caught by the try/catch. To catch errors in rendering a given component, wrap that component in an error boundary. (https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary)',
+ }).withDetails({
+ kind: 'error',
+ loc: a.loc,
+ message: 'Avoid constructing JSX within try/catch',
+ })
+ );
+ break;
+ }
+ }
+ }
+ i.terminal.kind === 'try' && t.push(i.terminal.handler);
+ }
+ return n.asResult();
+ }
+ function qZ(e) {
+ let t = [];
+ JP(e, t);
+ for (let n of t) e.env.outlineFunction(n, 'Component');
+ }
+ function JP(e, t) {
+ let n = new Map();
+ function i(r, a) {
+ if (r.jsx.length <= 1) return;
+ let o = KZ(
+ e,
+ [...r.jsx].sort((s, l) => s.id - l.id),
+ n
+ );
+ o && (t.push(o.fn), a.set(r.jsx.at(0).id, o.instrs));
+ }
+ for (let [, r] of e.body.blocks) {
+ let a = new Map(),
+ o = {jsx: [], children: new Set()};
+ for (let s = r.instructions.length - 1; s >= 0; s--) {
+ let l = r.instructions[s],
+ {value: d, lvalue: u} = l;
+ switch (d.kind) {
+ case 'LoadGlobal': {
+ n.set(u.identifier.id, l);
+ break;
+ }
+ case 'FunctionExpression': {
+ JP(d.loweredFunc.func, t);
+ break;
+ }
+ case 'JsxExpression': {
+ if (
+ (o.children.has(u.identifier.id) ||
+ (i(o, a), (o = {jsx: [], children: new Set()})),
+ o.jsx.push(l),
+ d.children)
+ )
+ for (let p of d.children) o.children.add(p.identifier.id);
+ break;
+ }
+ case 'ArrayExpression':
+ case 'Await':
+ case 'BinaryExpression':
+ case 'CallExpression':
+ case 'ComputedDelete':
+ case 'ComputedLoad':
+ case 'ComputedStore':
+ case 'Debugger':
+ case 'DeclareContext':
+ case 'DeclareLocal':
+ case 'Destructure':
+ case 'FinishMemoize':
+ case 'GetIterator':
+ case 'IteratorNext':
+ case 'JSXText':
+ case 'JsxFragment':
+ case 'LoadContext':
+ case 'LoadLocal':
+ case 'MetaProperty':
+ case 'MethodCall':
+ case 'NewExpression':
+ case 'NextPropertyOf':
+ case 'ObjectExpression':
+ case 'ObjectMethod':
+ case 'PostfixUpdate':
+ case 'PrefixUpdate':
+ case 'Primitive':
+ case 'PropertyDelete':
+ case 'PropertyLoad':
+ case 'PropertyStore':
+ case 'RegExpLiteral':
+ case 'StartMemoize':
+ case 'StoreContext':
+ case 'StoreGlobal':
+ case 'StoreLocal':
+ case 'TaggedTemplateExpression':
+ case 'TemplateLiteral':
+ case 'TypeCastExpression':
+ case 'UnsupportedNode':
+ case 'UnaryExpression':
+ break;
+ default:
+ Me(d, `Unexpected instruction: ${d}`);
+ }
+ }
+ if ((i(o, a), a.size > 0)) {
+ let s = [];
+ for (let l = 0; l < r.instructions.length; l++) {
+ let d = l + 1;
+ if (a.has(d)) {
+ let u = a.get(d);
+ s.push(...u);
+ } else s.push(r.instructions[l]);
+ }
+ r.instructions = s;
+ }
+ Xm(e);
+ }
+ }
+ function KZ(e, t, n) {
+ if (e.fnType === 'Component') return null;
+ let i = VZ(e.env, t);
+ if (!i) return null;
+ let r = e.env.generateGloballyUniqueIdentifierName(null).value,
+ a = JZ(e.env, t, i, r);
+ if (!a) return null;
+ let o = HZ(e.env, t, i, n);
+ return o ? ((o.id = r), {instrs: a, fn: o}) : null;
+ }
+ function VZ(e, t) {
+ let n = 1;
+ function i(s) {
+ let l = s;
+ for (; o.has(l); ) l = `${s}${n++}`;
+ return o.add(l), e.programContext.addNewReference(l), l;
+ }
+ let r = [],
+ a = new Set(t.map((s) => s.lvalue.identifier.id)),
+ o = new Set();
+ for (let s of t) {
+ let {value: l} = s;
+ for (let d of l.props) {
+ if (d.kind === 'JsxSpreadAttribute') return null;
+ if (d.kind === 'JsxAttribute') {
+ let u = i(d.name);
+ r.push({originalName: d.name, newName: u, place: d.place});
+ }
+ }
+ if (l.children)
+ for (let d of l.children) {
+ if (a.has(d.identifier.id)) continue;
+ $n(d.identifier);
+ let u = i('t');
+ r.push({originalName: d.identifier.name.value, newName: u, place: d});
+ }
+ }
+ return r;
+ }
+ function JZ(e, t, n, i) {
+ let r = n.map((s) => ({
+ kind: 'JsxAttribute',
+ name: s.newName,
+ place: s.place,
+ })),
+ a = {
+ id: V(0),
+ loc: F,
+ lvalue: _t(e, F),
+ value: {
+ kind: 'LoadGlobal',
+ binding: {kind: 'ModuleLocal', name: i},
+ loc: F,
+ },
+ effects: null,
+ };
+ G0(a.lvalue.identifier);
+ let o = {
+ id: V(0),
+ loc: F,
+ lvalue: t.at(-1).lvalue,
+ value: {
+ kind: 'JsxExpression',
+ tag: Object.assign({}, a.lvalue),
+ props: r,
+ children: null,
+ loc: F,
+ openingLoc: F,
+ closingLoc: F,
+ },
+ effects: null,
+ };
+ return [a, o];
+ }
+ function HZ(e, t, n, i) {
+ let r = [],
+ a = XZ(e, n),
+ o = _t(e, F);
+ $n(o.identifier);
+ let s = YZ(e, o, a);
+ r.push(s);
+ let l = GZ(t, a),
+ d = WZ(t, i);
+ if (!d) return null;
+ r.push(...d), r.push(...l);
+ let u = {
+ kind: 'block',
+ id: Zi(0),
+ instructions: r,
+ terminal: {
+ id: V(0),
+ kind: 'return',
+ returnVariant: 'Explicit',
+ loc: F,
+ value: r.at(-1).lvalue,
+ effects: null,
+ },
+ preds: new Set(),
+ phis: new Set(),
+ };
+ return {
+ loc: F,
+ id: null,
+ nameHint: null,
+ fnType: 'Other',
+ env: e,
+ params: [o],
+ returnTypeAnnotation: null,
+ returns: _t(e, F),
+ context: [],
+ body: {entry: u.id, blocks: new Map([[u.id, u]])},
+ generator: !1,
+ async: !1,
+ directives: [],
+ aliasingEffects: [],
+ };
+ }
+ function WZ(e, t) {
+ let n = [];
+ for (let {value: i} of e)
+ if (i.tag.kind === 'Identifier') {
+ let r = t.get(i.tag.identifier.id);
+ if (!r) return null;
+ n.push(r);
+ }
+ return n;
+ }
+ function GZ(e, t) {
+ let n = [],
+ i = new Set(e.map((r) => r.lvalue.identifier.id));
+ for (let r of e) {
+ let {value: a} = r,
+ o = [];
+ for (let l of a.props) {
+ if (
+ (so(
+ l.kind === 'JsxAttribute',
+ `Expected only attributes but found ${l.kind}`
+ ),
+ l.name === 'key')
+ )
+ continue;
+ let d = t.get(l.place.identifier.id);
+ so(
+ d !== void 0,
+ `Expected a new property for ${un(l.place.identifier)}`
+ ),
+ o.push({kind: 'JsxAttribute', name: d.originalName, place: d.place});
+ }
+ let s = null;
+ if (a.children) {
+ s = [];
+ for (let l of a.children) {
+ if (i.has(l.identifier.id)) {
+ s.push(Object.assign({}, l));
+ continue;
+ }
+ let d = t.get(l.identifier.id);
+ so(d !== void 0, `Expected a new prop for ${un(l.identifier)}`),
+ s.push(Object.assign({}, d.place));
+ }
+ }
+ n.push(
+ Object.assign(Object.assign({}, r), {
+ value: Object.assign(Object.assign({}, a), {props: o, children: s}),
+ })
+ );
+ }
+ return n;
+ }
+ function XZ(e, t) {
+ let n = new Map();
+ for (let i of t) {
+ if (i.originalName === 'key') continue;
+ let r = Object.assign(Object.assign({}, i), {place: _t(e, F)});
+ (r.place.identifier.name = uo(i.newName)),
+ n.set(i.place.identifier.id, r);
+ }
+ return n;
+ }
+ function YZ(e, t, n) {
+ let i = [];
+ for (let [a, o] of n)
+ i.push({
+ kind: 'ObjectProperty',
+ key: {kind: 'string', name: o.newName},
+ type: 'property',
+ place: o.place,
+ });
+ return {
+ id: V(0),
+ lvalue: _t(e, F),
+ loc: F,
+ value: {
+ kind: 'Destructure',
+ lvalue: {pattern: {kind: 'ObjectPattern', properties: i}, kind: Q.Let},
+ loc: F,
+ value: t,
+ },
+ effects: null,
+ };
+ }
+ function QZ(e) {
+ for (let [, t] of e.body.blocks)
+ for (let n = 0; n < t.instructions.length; n++) {
+ let i = t.instructions[n];
+ i.value.kind === 'MethodCall' &&
+ uB(i.value.receiver.identifier) &&
+ (i.value = {
+ kind: 'CallExpression',
+ callee: i.value.property,
+ args: i.value.args,
+ loc: i.value.loc,
+ });
+ }
+ }
+ var dm,
+ Iu,
+ fm,
+ pm,
+ mm,
+ Xv,
+ ym,
+ Xi,
+ io,
+ gm,
+ vm,
+ oo = 'Cannot compile `fire`';
+ function eq(e) {
+ let t = new Yv(e.env);
+ HP(e, t), t.hasErrors() || nq(e, t), t.throwIfErrorsFound();
+ }
+ function HP(e, t) {
+ let n = null,
+ i = !1;
+ for (let [, r] of e.body.blocks) {
+ let a = new Map(),
+ o = new Set();
+ for (let s of r.instructions) {
+ let {value: l, lvalue: d} = s;
+ if (
+ l.kind === 'CallExpression' &&
+ Ku(l.callee.identifier) &&
+ l.args.length > 0 &&
+ l.args[0].kind === 'Identifier'
+ ) {
+ let u = t.getFunctionExpression(l.args[0].identifier.id);
+ if (u != null) {
+ let p = l0(u, t, !0),
+ y = [];
+ for (let [m, g] of p.entries())
+ if (!t.hasCalleeWithInsertedFire(m)) {
+ t.addCalleeWithInsertedFire(m),
+ n ??
+ (n = e.env.programContext.addImportSpecifier({
+ source: e.env.programContext.reactRuntimeModule,
+ importSpecifierName: QU,
+ }));
+ let S = rq(e.env, n),
+ _ = iq(e.env, g.capturedCalleeIdentifier),
+ O = aq(e.env, S.lvalue, _.lvalue),
+ P = oq(e.env, O.lvalue, g.fireFunctionBinding);
+ y.push(S, _, O, P);
+ let M = t.getLoadGlobalInstrId(l.callee.identifier.id);
+ if (M == null) {
+ t.pushError({
+ loc: l.loc,
+ description: null,
+ category: K.Invariant,
+ reason:
+ '[InsertFire] No LoadGlobal found for useEffect call',
+ suggestions: null,
+ });
+ continue;
+ }
+ a.set(M, y);
+ }
+ if (
+ (tq(u.loweredFunc.func, t, p),
+ l.args.length > 1 &&
+ l.args[1] != null &&
+ l.args[1].kind === 'Identifier')
+ ) {
+ let m = l.args[1],
+ g = t.getArrayExpression(m.identifier.id);
+ if (g != null) {
+ for (let S of g.elements)
+ if (S.kind === 'Identifier') {
+ let _ = t.getLoadLocalInstr(S.identifier.id);
+ if (_ != null) {
+ let O = p.get(_.place.identifier.id);
+ O != null && (_.place = O.fireFunctionBinding);
+ }
+ }
+ } else
+ t.pushError({
+ loc: l.args[1].loc,
+ description:
+ 'You must use an array literal for an effect dependency array when that effect uses `fire()`',
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ } else
+ l.args.length > 1 &&
+ l.args[1].kind === 'Spread' &&
+ t.pushError({
+ loc: l.args[1].place.loc,
+ description:
+ 'You must use an array literal for an effect dependency array when that effect uses `fire()`',
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ }
+ } else if (
+ l.kind === 'CallExpression' &&
+ l.callee.identifier.type.kind === 'Function' &&
+ l.callee.identifier.type.shapeId === xh &&
+ t.inUseEffectLambda()
+ )
+ if (l.args.length === 1 && l.args[0].kind === 'Identifier') {
+ let u = t.getCallExpression(l.args[0].identifier.id);
+ if (u != null) {
+ let p = u.callee.identifier.id,
+ y = t.getLoadLocalInstr(p);
+ if (y == null) {
+ t.pushError({
+ loc: l.loc,
+ description: null,
+ category: K.Invariant,
+ reason:
+ '[InsertFire] No loadLocal found for fire call argument',
+ suggestions: null,
+ });
+ continue;
+ }
+ let m = t.getOrGenerateFireFunctionBinding(y.place, l.loc);
+ (y.place = Object.assign({}, m)), o.add(s.id);
+ } else
+ t.pushError({
+ loc: l.loc,
+ description:
+ '`fire()` can only receive a function call such as `fire(fn(a,b)). Method calls and other expressions are not allowed',
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ } else {
+ let u =
+ 'fire() can only take in a single call expression as an argument';
+ l.args.length === 0
+ ? (u += ' but received none')
+ : l.args.length > 1
+ ? (u += ' but received multiple arguments')
+ : l.args[0].kind === 'Spread' &&
+ (u += ' but received a spread argument'),
+ t.pushError({
+ loc: l.loc,
+ description: u,
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ }
+ else
+ l.kind === 'CallExpression'
+ ? t.addCallExpression(d.identifier.id, l)
+ : l.kind === 'FunctionExpression' && t.inUseEffectLambda()
+ ? l0(l, t, !1)
+ : l.kind === 'FunctionExpression'
+ ? t.addFunctionExpression(d.identifier.id, l)
+ : l.kind === 'LoadLocal'
+ ? t.addLoadLocalInstr(d.identifier.id, l)
+ : l.kind === 'LoadGlobal' &&
+ l.binding.kind === 'ImportSpecifier' &&
+ l.binding.module === 'react' &&
+ l.binding.imported === 'fire' &&
+ t.inUseEffectLambda()
+ ? o.add(s.id)
+ : l.kind === 'LoadGlobal'
+ ? t.addLoadGlobalInstrId(d.identifier.id, s.id)
+ : l.kind === 'ArrayExpression' &&
+ t.addArrayExpression(d.identifier.id, l);
+ }
+ (r.instructions = lq(a, r.instructions)),
+ (r.instructions = sq(o, r.instructions)),
+ (a.size > 0 || o.size > 0) && ((i = !0), (e.env.hasFireRewrite = !0));
+ }
+ i && fr(e.body);
+ }
+ function l0(e, t, n) {
+ let r = (
+ n ? t.withUseEffectLambdaScope.bind(t) : t.withFunctionScope.bind(t)
+ )(() => HP(e.loweredFunc.func, t));
+ for (let a = 0; a < e.loweredFunc.func.context.length; a++) {
+ let o = e.loweredFunc.func.context[a],
+ s = r.get(o.identifier.id);
+ s != null &&
+ (e.loweredFunc.func.context[a] = Object.assign(
+ {},
+ s.fireFunctionBinding
+ ));
+ }
+ return t.mergeCalleesFromInnerScope(r), r;
+ }
+ function* zh(e) {
+ for (let [, t] of e.body.blocks)
+ for (let n of t.instructions)
+ n.value.kind === 'FunctionExpression' || n.value.kind === 'ObjectMethod'
+ ? yield* zh(n.value.loweredFunc.func)
+ : yield* sn(n);
+ }
+ function tq(e, t, n) {
+ var i;
+ for (let r of zh(e)) {
+ let a = n.get(r.identifier.id);
+ if (a != null) {
+ let o =
+ ((i = a.capturedCalleeIdentifier.name) === null || i === void 0
+ ? void 0
+ : i.kind) === 'named'
+ ? a.capturedCalleeIdentifier.name.value
+ : '';
+ t.pushError({
+ loc: r.loc,
+ description: `All uses of ${o} must be either used with a fire() call in this effect or not used with a fire() call at all. ${o} was used with fire() on line ${OB(
+ a.fireLoc
+ )} in this effect`,
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ }
+ }
+ }
+ function nq(e, t) {
+ for (let n of zh(e))
+ n.identifier.type.kind === 'Function' &&
+ n.identifier.type.shapeId === xh &&
+ t.pushError({
+ loc: n.identifier.loc,
+ description: 'Cannot use `fire` outside of a useEffect function',
+ category: K.Fire,
+ reason: oo,
+ suggestions: null,
+ });
+ }
+ function rq(e, t) {
+ let n = _t(e, F);
+ (n.effect = x.Read), (n.identifier.type = $I);
+ let i = {kind: 'LoadGlobal', binding: Object.assign({}, t), loc: F};
+ return {
+ id: V(0),
+ value: i,
+ lvalue: Object.assign({}, n),
+ loc: F,
+ effects: null,
+ };
+ }
+ function iq(e, t) {
+ let n = _t(e, F),
+ i = {
+ kind: 'Identifier',
+ identifier: t,
+ reactive: !1,
+ effect: x.Unknown,
+ loc: t.loc,
+ };
+ return {
+ id: V(0),
+ value: {kind: 'LoadLocal', loc: F, place: Object.assign({}, i)},
+ lvalue: Object.assign({}, n),
+ loc: F,
+ effects: null,
+ };
+ }
+ function aq(e, t, n) {
+ let i = _t(e, F);
+ i.effect = x.Read;
+ let r = {
+ kind: 'CallExpression',
+ callee: Object.assign({}, t),
+ args: [n],
+ loc: F,
+ };
+ return {
+ id: V(0),
+ value: r,
+ lvalue: Object.assign({}, i),
+ loc: F,
+ effects: null,
+ };
+ }
+ function oq(e, t, n) {
+ $n(n.identifier);
+ let i = _t(e, F);
+ return {
+ id: V(0),
+ value: {
+ kind: 'StoreLocal',
+ lvalue: {kind: Q.Const, place: Object.assign({}, n)},
+ value: Object.assign({}, t),
+ type: null,
+ loc: F,
+ },
+ lvalue: i,
+ loc: F,
+ effects: null,
+ };
+ }
+ var Yv = class {
+ constructor(t) {
+ dm.set(this, void 0),
+ Iu.set(this, new D()),
+ fm.set(this, new Map()),
+ pm.set(this, new Map()),
+ mm.set(this, new Map()),
+ Xv.set(this, new Map()),
+ ym.set(this, new Set()),
+ Xi.set(this, new Map()),
+ io.set(this, !1),
+ gm.set(this, new Map()),
+ vm.set(this, new Map()),
+ at(this, dm, t, 'f');
+ }
+ pushError(t) {
+ j(this, Iu, 'f').push(t);
+ }
+ withFunctionScope(t) {
+ return t(), j(this, Xi, 'f');
+ }
+ withUseEffectLambdaScope(t) {
+ let n = j(this, Xi, 'f'),
+ i = j(this, io, 'f');
+ at(this, Xi, new Map(), 'f'), at(this, io, !0, 'f');
+ let r = this.withFunctionScope(t);
+ return at(this, Xi, n, 'f'), at(this, io, i, 'f'), r;
+ }
+ addCallExpression(t, n) {
+ j(this, fm, 'f').set(t, n);
+ }
+ getCallExpression(t) {
+ return j(this, fm, 'f').get(t);
+ }
+ addLoadLocalInstr(t, n) {
+ j(this, mm, 'f').set(t, n);
+ }
+ getLoadLocalInstr(t) {
+ return j(this, mm, 'f').get(t);
+ }
+ getOrGenerateFireFunctionBinding(t, n) {
+ let i = dr(j(this, Xv, 'f'), t.identifier.id, () =>
+ _t(j(this, dm, 'f'), F)
+ );
+ return (
+ (i.identifier.type = {
+ kind: 'Function',
+ shapeId: PI,
+ return: {kind: 'Poly'},
+ isConstructor: !1,
+ }),
+ j(this, Xi, 'f').set(t.identifier.id, {
+ fireFunctionBinding: i,
+ capturedCalleeIdentifier: t.identifier,
+ fireLoc: n,
+ }),
+ i
+ );
+ }
+ mergeCalleesFromInnerScope(t) {
+ for (let [n, i] of t.entries()) j(this, Xi, 'f').set(n, i);
+ }
+ addCalleeWithInsertedFire(t) {
+ j(this, ym, 'f').add(t);
+ }
+ hasCalleeWithInsertedFire(t) {
+ return j(this, ym, 'f').has(t);
+ }
+ inUseEffectLambda() {
+ return j(this, io, 'f');
+ }
+ addFunctionExpression(t, n) {
+ j(this, pm, 'f').set(t, n);
+ }
+ getFunctionExpression(t) {
+ return j(this, pm, 'f').get(t);
+ }
+ addLoadGlobalInstrId(t, n) {
+ j(this, gm, 'f').set(t, n);
+ }
+ getLoadGlobalInstrId(t) {
+ return j(this, gm, 'f').get(t);
+ }
+ addArrayExpression(t, n) {
+ j(this, vm, 'f').set(t, n);
+ }
+ getArrayExpression(t) {
+ return j(this, vm, 'f').get(t);
+ }
+ hasErrors() {
+ return j(this, Iu, 'f').hasAnyErrors();
+ }
+ throwIfErrorsFound() {
+ if (this.hasErrors()) throw j(this, Iu, 'f');
+ }
+ };
+ (dm = new WeakMap()),
+ (Iu = new WeakMap()),
+ (fm = new WeakMap()),
+ (pm = new WeakMap()),
+ (mm = new WeakMap()),
+ (Xv = new WeakMap()),
+ (ym = new WeakMap()),
+ (Xi = new WeakMap()),
+ (io = new WeakMap()),
+ (gm = new WeakMap()),
+ (vm = new WeakMap());
+ function sq(e, t) {
+ return e.size > 0 ? t.filter((i) => !e.has(i.id)) : t;
+ }
+ function lq(e, t) {
+ if (e.size > 0) {
+ let n = [];
+ for (let i of t) {
+ let r = e.get(i.id);
+ r != null ? n.push(...r, i) : n.push(i);
+ }
+ return n;
+ }
+ return t;
+ }
+ function cq(e) {
+ let t = new D();
+ for (let [, n] of e.body.blocks)
+ for (let i of n.instructions) {
+ let r = i.value;
+ if (r.kind === 'MethodCall' || r.kind == 'CallExpression') {
+ let a = r.kind === 'MethodCall' ? r.property : r.callee,
+ o = Ui(e.env, a.identifier.type);
+ o != null &&
+ o.impure === !0 &&
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.Purity,
+ reason: 'Cannot call impure function during render',
+ description:
+ (o.canonicalName != null
+ ? `\`${o.canonicalName}\` is an impure function. `
+ : '') +
+ 'Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent)',
+ suggestions: null,
+ }).withDetails({
+ kind: 'error',
+ loc: a.loc,
+ message: 'Cannot call impure function',
+ })
+ );
+ }
+ }
+ return t.asResult();
+ }
+ function uq(e) {
+ let t = new D(),
+ n = new Map();
+ for (let i of e.body.blocks.values()) {
+ e: for (let r of i.phis)
+ for (let a of r.operands.values()) {
+ let o = n.get(a.identifier.id);
+ if (o != null) {
+ n.set(r.place.identifier.id, o);
+ continue e;
+ }
+ }
+ for (let r of i.instructions) {
+ let {lvalue: a, value: o} = r;
+ switch (o.kind) {
+ case 'FunctionExpression':
+ case 'NewExpression':
+ case 'MethodCall':
+ case 'CallExpression': {
+ n.set(a.identifier.id, o.loc);
+ break;
+ }
+ case 'LoadLocal': {
+ let s = n.get(o.place.identifier.id);
+ s != null && n.set(a.identifier.id, s);
+ break;
+ }
+ case 'StoreLocal': {
+ let s = n.get(o.value.identifier.id);
+ s != null &&
+ (n.set(a.identifier.id, s),
+ n.set(o.lvalue.place.identifier.id, s));
+ break;
+ }
+ case 'JsxExpression':
+ if (o.tag.kind === 'Identifier') {
+ let s = n.get(o.tag.identifier.id);
+ s != null &&
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.StaticComponents,
+ reason: 'Cannot create components during render',
+ description:
+ 'Components created during render will reset their state each time they are created. Declare components outside of render',
+ })
+ .withDetails({
+ kind: 'error',
+ loc: o.tag.loc,
+ message: 'This component is created during render',
+ })
+ .withDetails({
+ kind: 'error',
+ loc: s,
+ message: 'The component is created during render here',
+ })
+ );
+ }
+ }
+ }
+ }
+ return t.asResult();
+ }
+ function dq(e) {
+ let t = new D(),
+ n = new Map();
+ function i(r) {
+ if (r.effect === x.Freeze) {
+ let a = n.get(r.identifier.id);
+ if (a != null) {
+ let o = a.value,
+ s =
+ o != null &&
+ o.identifier.name != null &&
+ o.identifier.name.kind === 'named'
+ ? `\`${o.identifier.name.value}\``
+ : 'a local variable';
+ t.pushDiagnostic(
+ Tt.create({
+ category: K.Immutability,
+ reason: 'Cannot modify local variables after render completes',
+ description: `This argument is a function which may reassign or mutate ${s} after render, which can cause inconsistent behavior on subsequent renders. Consider using state instead`,
+ })
+ .withDetails({
+ kind: 'error',
+ loc: r.loc,
+ message: `This function may (indirectly) reassign or modify ${s} after render`,
+ })
+ .withDetails({
+ kind: 'error',
+ loc: a.value.loc,
+ message: `This modifies ${s}`,
+ })
+ );
+ }
+ }
+ }
+ for (let r of e.body.blocks.values()) {
+ for (let a of r.instructions) {
+ let {lvalue: o, value: s} = a;
+ switch (s.kind) {
+ case 'LoadLocal': {
+ let l = n.get(s.place.identifier.id);
+ l != null && n.set(o.identifier.id, l);
+ break;
+ }
+ case 'StoreLocal': {
+ let l = n.get(s.value.identifier.id);
+ l != null &&
+ (n.set(o.identifier.id, l),
+ n.set(s.lvalue.place.identifier.id, l));
+ break;
+ }
+ case 'FunctionExpression': {
+ if (s.loweredFunc.func.aliasingEffects != null) {
+ let l = new Set(
+ s.loweredFunc.func.context.map((d) => d.identifier.id)
+ );
+ e: for (let d of s.loweredFunc.func.aliasingEffects)
+ switch (d.kind) {
+ case 'Mutate':
+ case 'MutateTransitive': {
+ let u = n.get(d.value.identifier.id);
+ if (u != null) n.set(o.identifier.id, u);
+ else if (
+ l.has(d.value.identifier.id) &&
+ !dB(d.value.identifier.type)
+ ) {
+ n.set(o.identifier.id, d);
+ break e;
+ }
+ break;
+ }
+ case 'MutateConditionally':
+ case 'MutateTransitiveConditionally': {
+ let u = n.get(d.value.identifier.id);
+ u != null && n.set(o.identifier.id, u);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ default:
+ for (let l of Ot(s)) i(l);
+ }
+ }
+ for (let a of Gt(r.terminal)) i(a);
+ }
+ return t.asResult();
+ }
+ function fq(e) {
+ let t = new Map(),
+ n = new Map(),
+ i = new Map(),
+ r = new D();
+ for (let a of e.body.blocks.values())
+ for (let o of a.instructions) {
+ let {lvalue: s, value: l} = o;
+ if (l.kind === 'LoadLocal')
+ i.set(s.identifier.id, l.place.identifier.id);
+ else if (l.kind === 'ArrayExpression') t.set(s.identifier.id, l);
+ else if (l.kind === 'FunctionExpression') n.set(s.identifier.id, l);
+ else if (l.kind === 'CallExpression' || l.kind === 'MethodCall') {
+ let d = l.kind === 'CallExpression' ? l.callee : l.property;
+ if (
+ Ku(d.identifier) &&
+ l.args.length === 2 &&
+ l.args[0].kind === 'Identifier' &&
+ l.args[1].kind === 'Identifier'
+ ) {
+ let u = n.get(l.args[0].identifier.id),
+ p = t.get(l.args[1].identifier.id);
+ if (
+ u != null &&
+ p != null &&
+ p.elements.length !== 0 &&
+ p.elements.every((y) => y.kind === 'Identifier')
+ ) {
+ let y = p.elements.map((m) => {
+ var g;
+ return (
+ D.invariant(m.kind === 'Identifier', {
+ reason: 'Dependency is checked as a place above',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: l.loc,
+ message: 'this is checked as a place above',
+ },
+ ],
+ }),
+ (g = i.get(m.identifier.id)) !== null && g !== void 0
+ ? g
+ : m.identifier.id
+ );
+ });
+ pq(u.loweredFunc.func, y, r);
+ }
+ }
+ }
+ }
+ if (r.hasAnyErrors()) throw r;
+ }
+ function pq(e, t, n) {
+ for (let o of e.context)
+ if (!vr(o.identifier)) {
+ if (t.find((s) => s === o.identifier.id) != null) continue;
+ return;
+ }
+ for (let o of t)
+ if (e.context.find((s) => s.identifier.id === o) == null) return;
+ let i = new Set(),
+ r = new Map();
+ for (let o of t) r.set(o, [o]);
+ let a = [];
+ for (let o of e.body.blocks.values()) {
+ for (let s of o.preds) if (!i.has(s)) return;
+ for (let s of o.phis) {
+ let l = new Set();
+ for (let d of s.operands.values()) {
+ let u = r.get(d.identifier.id);
+ if (u != null) for (let p of u) l.add(p);
+ }
+ l.size !== 0 && r.set(s.place.identifier.id, Array.from(l));
+ }
+ for (let s of o.instructions)
+ switch (s.value.kind) {
+ case 'Primitive':
+ case 'JSXText':
+ case 'LoadGlobal':
+ break;
+ case 'LoadLocal': {
+ let l = r.get(s.value.place.identifier.id);
+ l != null && r.set(s.lvalue.identifier.id, l);
+ break;
+ }
+ case 'ComputedLoad':
+ case 'PropertyLoad':
+ case 'BinaryExpression':
+ case 'TemplateLiteral':
+ case 'CallExpression':
+ case 'MethodCall': {
+ let l = new Set();
+ for (let d of Ot(s.value)) {
+ let u = r.get(d.identifier.id);
+ if (u != null) for (let p of u) l.add(p);
+ }
+ if (
+ (l.size !== 0 && r.set(s.lvalue.identifier.id, Array.from(l)),
+ s.value.kind === 'CallExpression' &&
+ vr(s.value.callee.identifier) &&
+ s.value.args.length === 1 &&
+ s.value.args[0].kind === 'Identifier')
+ ) {
+ let d = r.get(s.value.args[0].identifier.id);
+ if (d != null && new Set(d).size === t.length)
+ a.push(s.value.callee.loc);
+ else return;
+ }
+ break;
+ }
+ default:
+ return;
+ }
+ for (let s of Gt(o.terminal)) if (r.has(s.identifier.id)) return;
+ i.add(o.id);
+ }
+ for (let o of a)
+ n.push({
+ category: K.EffectDerivationsOfState,
+ reason:
+ 'Values derived from props and state should be calculated during render, not in an effect. (https://react.dev/learn/you-might-not-need-an-effect#updating-state-based-on-props-or-state)',
+ description: null,
+ loc: o,
+ suggestions: null,
+ });
+ }
+ var Qv = class {
+ constructor() {
+ (this.hasChanges = !1), (this.cache = new Map());
+ }
+ snapshot() {
+ let t = this.hasChanges;
+ return (this.hasChanges = !1), t;
+ }
+ addDerivationEntry(t, n, i) {
+ var r, a;
+ let o = {place: t, sourcesIds: new Set(), typeOfValue: i ?? 'ignored'};
+ if (n !== void 0)
+ for (let l of n) {
+ let d =
+ (r = this.cache.get(l)) === null || r === void 0 ? void 0 : r.place;
+ d !== void 0 &&
+ (d.identifier.name === null ||
+ ((a = d.identifier.name) === null || a === void 0
+ ? void 0
+ : a.kind) === 'promoted'
+ ? o.sourcesIds.add(t.identifier.id)
+ : o.sourcesIds.add(d.identifier.id));
+ }
+ o.sourcesIds.size === 0 && o.sourcesIds.add(t.identifier.id);
+ let s = this.cache.get(t.identifier.id);
+ (s === void 0 || !this.isDerivationEqual(s, o)) &&
+ (this.cache.set(t.identifier.id, o), (this.hasChanges = !0));
+ }
+ isDerivationEqual(t, n) {
+ if (
+ t.typeOfValue !== n.typeOfValue ||
+ t.sourcesIds.size !== n.sourcesIds.size
+ )
+ return !1;
+ for (let i of t.sourcesIds) if (!n.sourcesIds.has(i)) return !1;
+ return !0;
+ }
+ };
+ function mq(e) {
+ let t = new Map(),
+ n = new Qv(),
+ i = new D(),
+ r = new Set(),
+ s = {
+ functions: t,
+ errors: i,
+ derivationCache: n,
+ effects: r,
+ setStateCache: new Map(),
+ effectSetStateCache: new Map(),
+ };
+ if (e.fnType === 'Hook')
+ for (let d of e.params)
+ d.kind === 'Identifier' &&
+ (s.derivationCache.cache.set(d.identifier.id, {
+ place: d,
+ sourcesIds: new Set([d.identifier.id]),
+ typeOfValue: 'fromProps',
+ }),
+ (s.derivationCache.hasChanges = !0));
+ else if (e.fnType === 'Component') {
+ let d = e.params[0];
+ d != null &&
+ d.kind === 'Identifier' &&
+ (s.derivationCache.cache.set(d.identifier.id, {
+ place: d,
+ sourcesIds: new Set([d.identifier.id]),
+ typeOfValue: 'fromProps',
+ }),
+ (s.derivationCache.hasChanges = !0));
+ }
+ let l = !0;
+ do {
+ for (let d of e.body.blocks.values()) {
+ yq(d, s);
+ for (let u of d.instructions) WP(u, s, l);
+ }
+ l = !1;
+ } while (s.derivationCache.snapshot());
+ for (let d of r) gq(d, s);
+ if (i.hasAnyErrors()) throw i;
+ }
+ function yq(e, t) {
+ for (let n of e.phis) {
+ let i = 'ignored',
+ r = new Set();
+ for (let a of n.operands.values()) {
+ let o = t.derivationCache.cache.get(a.identifier.id);
+ o !== void 0 && ((i = eh(i, o.typeOfValue)), r.add(a.identifier.id));
+ }
+ i !== 'ignored' && t.derivationCache.addDerivationEntry(n.place, r, i);
+ }
+ }
+ function eh(e, t) {
+ return e === 'ignored'
+ ? t
+ : t === 'ignored' || e === t
+ ? e
+ : 'fromPropsAndState';
+ }
+ function WP(e, t, n) {
+ let i = 'ignored',
+ r = new Set(),
+ {lvalue: a, value: o} = e;
+ if (o.kind === 'FunctionExpression') {
+ t.functions.set(a.identifier.id, o);
+ for (let [, s] of o.loweredFunc.func.body.blocks)
+ for (let l of s.instructions) WP(l, t, n);
+ } else if (o.kind === 'CallExpression' || o.kind === 'MethodCall') {
+ let s = o.kind === 'CallExpression' ? o.callee : o.property;
+ if (
+ Ku(s.identifier) &&
+ o.args.length === 2 &&
+ o.args[0].kind === 'Identifier' &&
+ o.args[1].kind === 'Identifier'
+ ) {
+ let l = t.functions.get(o.args[0].identifier.id);
+ l != null && t.effects.add(l.loweredFunc.func);
+ } else if (vh(a.identifier) && o.args.length > 0) {
+ let l = o.args[0];
+ l.kind === 'Identifier' && r.add(l.identifier.id),
+ (i = eh(i, 'fromState'));
+ }
+ }
+ for (let s of sn(e)) {
+ vr(s.identifier) &&
+ s.loc !== F &&
+ n &&
+ (t.setStateCache.has(s.loc.identifierName)
+ ? t.setStateCache.get(s.loc.identifierName).push(s)
+ : t.setStateCache.set(s.loc.identifierName, [s]));
+ let l = t.derivationCache.cache.get(s.identifier.id);
+ if (l !== void 0) {
+ i = eh(i, l.typeOfValue);
+ for (let d of l.sourcesIds) r.add(d);
+ }
+ }
+ if (i !== 'ignored') {
+ for (let s of rn(e)) t.derivationCache.addDerivationEntry(s, r, i);
+ for (let s of sn(e))
+ switch (s.effect) {
+ case x.Capture:
+ case x.Store:
+ case x.ConditionallyMutate:
+ case x.ConditionallyMutateIterator:
+ case x.Mutate: {
+ ta(e, s) && t.derivationCache.addDerivationEntry(s, r, i);
+ break;
+ }
+ case x.Freeze:
+ case x.Read:
+ break;
+ case x.Unknown:
+ D.invariant(!1, {
+ reason: 'Unexpected unknown effect',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: s.loc,
+ message: 'Unexpected unknown effect',
+ },
+ ],
+ });
+ default:
+ Me(s.effect, `Unexpected effect kind \`${s.effect}\``);
+ }
+ }
+ }
+ function gq(e, t) {
+ let n = new Set(),
+ i = [],
+ r = new Set();
+ for (let a of e.body.blocks.values()) {
+ for (let o of a.preds) if (!n.has(o)) return;
+ for (let o of a.instructions) {
+ if (Yn(o.lvalue.identifier)) return;
+ for (let s of sn(o))
+ vr(s.identifier) &&
+ s.loc !== F &&
+ (t.effectSetStateCache.has(s.loc.identifierName)
+ ? t.effectSetStateCache.get(s.loc.identifierName).push(s)
+ : t.effectSetStateCache.set(s.loc.identifierName, [s]));
+ if (
+ o.value.kind === 'CallExpression' &&
+ vr(o.value.callee.identifier) &&
+ o.value.args.length === 1 &&
+ o.value.args[0].kind === 'Identifier'
+ ) {
+ let s = t.derivationCache.cache.get(o.value.args[0].identifier.id);
+ s !== void 0 &&
+ i.push({
+ value: o.value,
+ loc: o.value.callee.loc,
+ sourceIds: s.sourcesIds,
+ typeOfValue: s.typeOfValue,
+ });
+ } else if (o.value.kind === 'CallExpression') {
+ let s = t.derivationCache.cache.get(o.value.callee.identifier.id);
+ if (
+ (s !== void 0 &&
+ (s.typeOfValue === 'fromProps' ||
+ s.typeOfValue === 'fromPropsAndState')) ||
+ r.has(o.value.callee.identifier.id)
+ )
+ return;
+ } else if (o.value.kind === 'LoadGlobal') {
+ r.add(o.lvalue.identifier.id);
+ for (let s of sn(o)) r.add(s.identifier.id);
+ }
+ }
+ n.add(a.id);
+ }
+ for (let a of i)
+ if (
+ a.loc !== F &&
+ t.effectSetStateCache.has(a.loc.identifierName) &&
+ t.setStateCache.has(a.loc.identifierName) &&
+ t.effectSetStateCache.get(a.loc.identifierName).length ===
+ t.setStateCache.get(a.loc.identifierName).length - 1
+ ) {
+ let o = Array.from(a.sourceIds)
+ .map((l) => {
+ var d;
+ let u = t.derivationCache.cache.get(l);
+ return (d = u?.place.identifier.name) === null || d === void 0
+ ? void 0
+ : d.value;
+ })
+ .filter(Boolean)
+ .join(', '),
+ s;
+ a.typeOfValue === 'fromProps'
+ ? (s = `From props: [${o}]`)
+ : a.typeOfValue === 'fromState'
+ ? (s = `From local state: [${o}]`)
+ : (s = `From props and local state: [${o}]`),
+ t.errors.pushDiagnostic(
+ Tt.create({
+ description: `Derived values (${s}) should be computed during render, rather than in effects. Using an effect triggers an additional render which can hurt performance and user experience, potentially briefly showing stale values to the user`,
+ category: K.EffectDerivationsOfState,
+ reason:
+ 'You might not need an effect. Derive values in render, not effects.',
+ }).withDetails({
+ kind: 'error',
+ loc: a.value.callee.loc,
+ message:
+ 'This should be computed during render, not in an effect',
+ })
+ );
+ }
+ }
+ function vq(e) {
+ if (e.id == null) return;
+ let t = e.id,
+ n = GP(e);
+ function i(r, a) {
+ var o, s;
+ if (r.generatedName != null && r.fn.nameHint == null) {
+ let d = `${a}${r.generatedName}]`;
+ (r.fn.nameHint = d), (r.fn.loweredFunc.func.nameHint = d);
+ }
+ let l = `${a}${
+ (s = (o = r.generatedName) !== null && o !== void 0 ? o : r.fn.name) !==
+ null && s !== void 0
+ ? s
+ : ''
+ } > `;
+ for (let d of r.inner) i(d, l);
+ }
+ for (let r of n) i(r, `${t}[`);
+ }
+ function GP(e) {
+ var t, n;
+ let i = new Map(),
+ r = new Map(),
+ a = [];
+ for (let o of e.body.blocks.values())
+ for (let s of o.instructions) {
+ let {lvalue: l, value: d} = s;
+ switch (d.kind) {
+ case 'LoadGlobal': {
+ r.set(l.identifier.id, d.binding.name);
+ break;
+ }
+ case 'LoadContext':
+ case 'LoadLocal': {
+ let u = d.place.identifier.name;
+ u != null && u.kind === 'named' && r.set(l.identifier.id, u.value);
+ let p = i.get(d.place.identifier.id);
+ p != null && i.set(l.identifier.id, p);
+ break;
+ }
+ case 'PropertyLoad': {
+ let u = r.get(d.object.identifier.id);
+ u != null && r.set(l.identifier.id, `${u}.${String(d.property)}`);
+ break;
+ }
+ case 'FunctionExpression': {
+ let u = GP(d.loweredFunc.func),
+ p = {fn: d, generatedName: null, inner: u};
+ a.push(p), d.name == null && i.set(l.identifier.id, p);
+ break;
+ }
+ case 'StoreContext':
+ case 'StoreLocal': {
+ let u = i.get(d.value.identifier.id),
+ p = d.lvalue.place.identifier.name;
+ u != null &&
+ u.generatedName == null &&
+ p != null &&
+ p.kind === 'named' &&
+ ((u.generatedName = p.value), i.delete(d.value.identifier.id));
+ break;
+ }
+ case 'CallExpression':
+ case 'MethodCall': {
+ let u = d.kind === 'MethodCall' ? d.property : d.callee,
+ p = Qn(e.env, u.identifier),
+ y = null;
+ p != null && p !== 'Custom'
+ ? (y = p)
+ : (y =
+ (t = r.get(u.identifier.id)) !== null && t !== void 0
+ ? t
+ : '(anonymous)');
+ let m = 0;
+ for (let g of d.args)
+ g.kind === 'Identifier' && i.has(g.identifier.id) && m++;
+ for (let g = 0; g < d.args.length; g++) {
+ let S = d.args[g];
+ if (S.kind === 'Spread') continue;
+ let _ = i.get(S.identifier.id);
+ if (_ != null && _.generatedName == null) {
+ let O = m > 1 ? `${y}(arg${g})` : `${y}()`;
+ (_.generatedName = O), i.delete(S.identifier.id);
+ }
+ }
+ break;
+ }
+ case 'JsxExpression': {
+ for (let u of d.props) {
+ if (u.kind === 'JsxSpreadAttribute') continue;
+ let p = i.get(u.place.identifier.id);
+ if (p != null && p.generatedName == null) {
+ let y =
+ d.tag.kind === 'BuiltinTag'
+ ? d.tag.name
+ : (n = r.get(d.tag.identifier.id)) !== null &&
+ n !== void 0
+ ? n
+ : null,
+ m = y == null ? u.name : `<${y}>.${u.name}`;
+ (p.generatedName = `${m}`), i.delete(u.place.identifier.id);
+ }
+ }
+ break;
+ }
+ }
+ }
+ return a;
+ }
+ function hq(e, t, n, i, r, a, o, s) {
+ var l, d;
+ let u = p4(e),
+ p = new Nu(e.scope, n, i, t, u, e, a, o, s, r);
+ return (
+ (d = (l = p.logger) === null || l === void 0 ? void 0 : l.debugLogIRs) ===
+ null ||
+ d === void 0 ||
+ d.call(l, {
+ kind: 'debug',
+ name: 'EnvironmentConfig',
+ value: FI(p.config),
+ }),
+ bq(e, p)
+ );
+ }
+ function bq(e, t) {
+ let n = (u) => {
+ var p, y;
+ (y =
+ (p = t.logger) === null || p === void 0 ? void 0 : p.debugLogIRs) ===
+ null ||
+ y === void 0 ||
+ y.call(p, u);
+ },
+ i = jI(e, t).unwrap();
+ n({kind: 'hir', name: 'HIR', value: i}),
+ VE(i),
+ n({kind: 'hir', name: 'PruneMaybeThrows', value: i}),
+ dZ(i),
+ jZ(i).unwrap(),
+ t.isInferredMemoEnabled &&
+ !t.config.enablePreserveExistingManualUseMemo &&
+ !t.config.disableMemoizationForDebugging &&
+ !t.config.enableChangeDetectionForDebugging &&
+ (b2(i).unwrap(),
+ n({kind: 'hir', name: 'DropManualMemoization', value: i})),
+ E2(i),
+ n({
+ kind: 'hir',
+ name: 'InlineImmediatelyInvokedFunctionExpressions',
+ value: i,
+ }),
+ Hu(i),
+ n({kind: 'hir', name: 'MergeConsecutiveBlocks', value: i}),
+ Tm(i),
+ Em(i),
+ XI(i),
+ n({kind: 'hir', name: 'SSA', value: i}),
+ Ch(i),
+ n({kind: 'hir', name: 'EliminateRedundantPhi', value: i}),
+ Tm(i),
+ g4(i),
+ n({kind: 'hir', name: 'ConstantPropagation', value: i}),
+ Lh(i),
+ n({kind: 'hir', name: 'InferTypes', value: i}),
+ t.isInferredMemoEnabled &&
+ (t.config.validateHooksUsage && fZ(i).unwrap(),
+ t.config.validateNoCapitalizedCalls && gZ(i).unwrap()),
+ t.config.enableFire &&
+ (eq(i), n({kind: 'hir', name: 'TransformFire', value: i})),
+ t.config.lowerContextAccess && MZ(i, t.config.lowerContextAccess),
+ QZ(i),
+ n({kind: 'hir', name: 'OptimizePropsMethodCalls', value: i}),
+ SP(i),
+ n({kind: 'hir', name: 'AnalyseFunctions', value: i});
+ let r = yP(i);
+ if (
+ (n({kind: 'hir', name: 'InferMutationAliasingEffects', value: i}),
+ t.isInferredMemoEnabled && r.isErr())
+ )
+ throw r.unwrapErr();
+ Xm(i),
+ n({kind: 'hir', name: 'DeadCodeElimination', value: i}),
+ t.config.enableInstructionReordering &&
+ (H2(i), n({kind: 'hir', name: 'InstructionReordering', value: i})),
+ VE(i),
+ n({kind: 'hir', name: 'PruneMaybeThrows', value: i});
+ let a = kP(i, {isFunctionExpression: !1});
+ if (
+ (n({kind: 'hir', name: 'InferMutationAliasingRanges', value: i}),
+ t.isInferredMemoEnabled)
+ ) {
+ if (a.isErr()) throw a.unwrapErr();
+ AZ(i);
+ }
+ t.isInferredMemoEnabled &&
+ (t.config.assertValidMutableRanges && NB(i),
+ t.config.validateRefAccessDuringRender && bZ(i).unwrap(),
+ t.config.validateNoSetStateInRender && TZ(i).unwrap(),
+ t.config.validateNoDerivedComputationsInEffects && fq(i),
+ t.config.validateNoDerivedComputationsInEffects_exp && mq(i),
+ t.config.validateNoSetStateInEffects && t.logErrors(BZ(i, t)),
+ t.config.validateNoJSXInTryStatements && t.logErrors(ZZ(i)),
+ t.config.validateNoImpureFunctionsInRender && cq(i).unwrap(),
+ dq(i).unwrap()),
+ S2(i),
+ n({kind: 'hir', name: 'InferReactivePlaces', value: i}),
+ QI(i),
+ n({
+ kind: 'hir',
+ name: 'RewriteInstructionKindsBasedOnReassignment',
+ value: i,
+ }),
+ t.isInferredMemoEnabled &&
+ (t.config.validateStaticComponents && t.logErrors(uq(i)),
+ JI(i),
+ n({kind: 'hir', name: 'InferReactiveScopeVariables', value: i}));
+ let o = R4(i);
+ n({kind: 'hir', name: 'MemoizeFbtAndMacroOperandsInSameScope', value: i}),
+ t.config.enableJsxOutlining && qZ(i),
+ t.config.enableNameAnonymousFunctions &&
+ (vq(i), n({kind: 'hir', name: 'NameAnonymousFunctions', value: i})),
+ t.config.enableFunctionOutlining &&
+ (VP(i, o), n({kind: 'hir', name: 'OutlineFunctions', value: i})),
+ LP(i),
+ n({kind: 'hir', name: 'AlignMethodCallScopes', value: i}),
+ nP(i),
+ n({kind: 'hir', name: 'AlignObjectMethodScopes', value: i}),
+ u4(i),
+ n({kind: 'hir', name: 'PruneUnusedLabelsHIR', value: i}),
+ Y2(i),
+ n({kind: 'hir', name: 'AlignReactiveScopesToBlockScopesHIR', value: i}),
+ s4(i),
+ n({kind: 'hir', name: 'MergeOverlappingReactiveScopesHIR', value: i}),
+ hE(i),
+ tU(i),
+ n({kind: 'hir', name: 'BuildReactiveScopeTerminalsHIR', value: i}),
+ hE(i),
+ Q2(i),
+ n({kind: 'hir', name: 'FlattenReactiveLoopsHIR', value: i}),
+ eZ(i),
+ n({kind: 'hir', name: 'FlattenScopesWithHooksOrUseHIR', value: i}),
+ Em(i),
+ AB(i),
+ N2(i),
+ n({kind: 'hir', name: 'PropagateScopeDependenciesHIR', value: i}),
+ t.config.inferEffectDependencies &&
+ (B2(i), n({kind: 'hir', name: 'InferEffectDependencies', value: i})),
+ t.config.inlineJsxTransform &&
+ (tP(i, t.config.inlineJsxTransform),
+ n({kind: 'hir', name: 'inlineJsxTransform', value: i}));
+ let s = $m(i);
+ n({kind: 'reactive', name: 'BuildReactiveFunction', value: s}),
+ D4(s),
+ Mm(s),
+ n({kind: 'reactive', name: 'PruneUnusedLabels', value: s}),
+ C4(s),
+ G6(s),
+ n({kind: 'reactive', name: 'PruneNonEscapingScopes', value: s}),
+ r2(s),
+ n({kind: 'reactive', name: 'PruneNonReactiveDependencies', value: s}),
+ s2(s),
+ n({kind: 'reactive', name: 'PruneUnusedScopes', value: s}),
+ O6(s),
+ n({
+ kind: 'reactive',
+ name: 'MergeReactiveScopesThatInvalidateTogether',
+ value: s,
+ }),
+ tZ(s),
+ n({kind: 'reactive', name: 'PruneAlwaysInvalidatingScopes', value: s}),
+ t.config.enableChangeDetectionForDebugging != null &&
+ (rZ(s),
+ n({
+ kind: 'reactive',
+ name: 'PruneInitializationDependencies',
+ value: s,
+ })),
+ M6(s),
+ n({kind: 'reactive', name: 'PropagateEarlyReturns', value: s}),
+ Am(s),
+ n({kind: 'reactive', name: 'PruneUnusedLValues', value: s}),
+ A6(s),
+ n({kind: 'reactive', name: 'PromoteUsedTemporaries', value: s}),
+ I6(s),
+ n({
+ kind: 'reactive',
+ name: 'ExtractScopeDeclarationsFromDestructuring',
+ value: s,
+ }),
+ p2(s),
+ n({kind: 'reactive', name: 'StabilizeBlockIds', value: s});
+ let l = hP(s);
+ n({kind: 'reactive', name: 'RenameVariables', value: s}),
+ Mh(s),
+ n({kind: 'reactive', name: 'PruneHoistedContexts', value: s}),
+ t.config.validateMemoizedEffectDependencies && pZ(s).unwrap(),
+ (t.config.enablePreserveExistingMemoizationGuarantees ||
+ t.config.validatePreserveExistingMemoizationGuarantees) &&
+ EZ(s).unwrap();
+ let d = U4(s, {uniqueIdentifiers: l, fbtOperands: o}).unwrap();
+ n({kind: 'ast', name: 'Codegen', value: d});
+ for (let u of d.outlined)
+ n({kind: 'ast', name: 'Codegen (outlined)', value: u.fn});
+ if (t.config.throwUnknownException__testonly)
+ throw new Error('unexpected error');
+ return d;
+ }
+ function XP(e, t, n, i, r, a, o, s) {
+ return hq(e, t, n, i, r, a, o, s);
+ }
+ function kq(e, t) {
+ let n = [],
+ i = t.node;
+ for (let r of e)
+ r.disableComment.start == null ||
+ i.start == null ||
+ i.end == null ||
+ (r.disableComment.start > i.start &&
+ (r.enableComment === null ||
+ (r.enableComment.end != null && r.enableComment.end < i.end)) &&
+ n.push(r),
+ r.disableComment.start < i.start &&
+ (r.enableComment === null ||
+ (r.enableComment.end != null && r.enableComment.end > i.end)) &&
+ n.push(r));
+ return n;
+ }
+ function Sq(e, t, n) {
+ let i = [],
+ r = null,
+ a = null,
+ o = null,
+ s = null,
+ l = null,
+ d = null;
+ if (t.length !== 0) {
+ let p = `(${t.join('|')})`;
+ (s = new RegExp(`eslint-disable-next-line ${p}`)),
+ (l = new RegExp(`eslint-disable ${p}`)),
+ (d = new RegExp(`eslint-enable ${p}`));
+ }
+ let u = new RegExp(
+ '\\$(FlowFixMe\\w*|FlowExpectedError|FlowIssue)\\[react\\-rule'
+ );
+ for (let p of e)
+ p.start == null ||
+ p.end == null ||
+ (r == null &&
+ s != null &&
+ s.test(p.value) &&
+ ((r = p), (a = p), (o = 'Eslint')),
+ n && r == null && u.test(p.value) && ((r = p), (a = p), (o = 'Flow')),
+ l != null && l.test(p.value) && ((r = p), (o = 'Eslint')),
+ d != null && d.test(p.value) && o === 'Eslint' && (a = p),
+ r != null &&
+ o != null &&
+ (i.push({disableComment: r, enableComment: a, source: o}),
+ (r = null),
+ (a = null),
+ (o = null)));
+ return i;
+ }
+ function _q(e) {
+ var t;
+ D.invariant(e.length !== 0, {
+ reason: 'Expected at least suppression comment source range',
+ description: null,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let n = new D();
+ for (let i of e) {
+ if (i.disableComment.start == null || i.disableComment.end == null)
+ continue;
+ let r, a;
+ switch (i.source) {
+ case 'Eslint':
+ (r =
+ 'React Compiler has skipped optimizing this component because one or more React ESLint rules were disabled'),
+ (a = 'Remove the ESLint suppression and address the React error');
+ break;
+ case 'Flow':
+ (r =
+ 'React Compiler has skipped optimizing this component because one or more React rule violations were reported by Flow'),
+ (a = 'Remove the Flow suppression and address the React error');
+ break;
+ default:
+ Me(i.source, 'Unhandled suppression source');
+ }
+ n.pushDiagnostic(
+ Tt.create({
+ reason: r,
+ description: `React Compiler only works when your components follow all the rules of React, disabling them may result in unexpected or incorrect behavior. Found suppression \`${i.disableComment.value.trim()}\``,
+ category: K.Suppression,
+ suggestions: [
+ {
+ description: a,
+ range: [i.disableComment.start, i.disableComment.end],
+ op: _i.Remove,
+ },
+ ],
+ }).withDetails({
+ kind: 'error',
+ loc: (t = i.disableComment.loc) !== null && t !== void 0 ? t : null,
+ message: 'Found React rule suppression',
+ })
+ );
+ }
+ return n;
+ }
+ var Tq = new Set(['use forget', 'use memo']),
+ Eq = new Set(['use no forget', 'use no memo']),
+ Iq = new RegExp('^use memo if\\(([^\\)]*)\\)$');
+ function YP(e, t) {
+ var n, i;
+ let r = e.find((o) => Tq.has(o.value.value));
+ if (r != null) return zn(r);
+ let a = ex(e, t);
+ return a.isOk()
+ ? zn(
+ (i =
+ (n = a.unwrap()) === null || n === void 0
+ ? void 0
+ : n.directive) !== null && i !== void 0
+ ? i
+ : null
+ )
+ : gr(a.unwrapErr());
+ }
+ function QP(e, {customOptOutDirectives: t}) {
+ var n, i;
+ return t != null
+ ? (n = e.find((r) => t.indexOf(r.value.value) !== -1)) !== null &&
+ n !== void 0
+ ? n
+ : null
+ : (i = e.find((r) => Eq.has(r.value.value))) !== null && i !== void 0
+ ? i
+ : null;
+ }
+ function ex(e, t) {
+ var n, i;
+ if (t.dynamicGating === null) return zn(null);
+ let r = new D(),
+ a = [];
+ for (let o of e) {
+ let s = Iq.exec(o.value.value);
+ s != null &&
+ s[1] != null &&
+ ($.isValidIdentifier(s[1])
+ ? a.push({directive: o, match: s[1]})
+ : r.push({
+ reason:
+ 'Dynamic gating directive is not a valid JavaScript identifier',
+ description: `Found '${o.value.value}'`,
+ category: K.Gating,
+ loc: (n = o.loc) !== null && n !== void 0 ? n : null,
+ suggestions: null,
+ }));
+ }
+ if (r.hasAnyErrors()) return gr(r);
+ if (a.length > 1) {
+ let o = new D();
+ return (
+ o.push({
+ reason: 'Multiple dynamic gating directives found',
+ description: `Expected a single directive but found [${a
+ .map((s) => s.directive.value.value)
+ .join(', ')}]`,
+ category: K.Gating,
+ loc: (i = a[0].directive.loc) !== null && i !== void 0 ? i : null,
+ suggestions: null,
+ }),
+ gr(o)
+ );
+ } else
+ return a.length === 1
+ ? zn({
+ gating: {
+ source: t.dynamicGating.source,
+ importSpecifierName: a[0].match,
+ },
+ directive: a[0].directive,
+ })
+ : zn(null);
+ }
+ function Pq(e) {
+ return !(e instanceof D) || e.hasErrors();
+ }
+ function xq(e) {
+ return e instanceof D ? e.details.some((t) => t.category === K.Config) : !1;
+ }
+ function tx(e, t, n) {
+ var i, r;
+ if (t.opts.logger)
+ if (e instanceof D)
+ for (let a of e.details)
+ t.opts.logger.logEvent(t.filename, {
+ kind: 'CompileError',
+ fnLoc: n,
+ detail: a,
+ });
+ else {
+ let a;
+ e instanceof Error
+ ? (a = (i = e.stack) !== null && i !== void 0 ? i : e.message)
+ : (a = (r = e?.toString()) !== null && r !== void 0 ? r : '[ null ]'),
+ t.opts.logger.logEvent(t.filename, {
+ kind: 'PipelineError',
+ fnLoc: n,
+ data: a,
+ });
+ }
+ }
+ function Uu(e, t, n) {
+ if (
+ (tx(e, t, n),
+ t.opts.panicThreshold === 'all_errors' ||
+ (t.opts.panicThreshold === 'critical_errors' && Pq(e)) ||
+ xq(e))
+ )
+ throw e;
+ }
+ function nx(e, t) {
+ var n, i, r;
+ let a;
+ switch (e.node.type) {
+ case 'FunctionDeclaration': {
+ a = {
+ type: 'FunctionDeclaration',
+ id: t.id,
+ loc: (n = e.node.loc) !== null && n !== void 0 ? n : null,
+ async: t.async,
+ generator: t.generator,
+ params: t.params,
+ body: t.body,
+ };
+ break;
+ }
+ case 'ArrowFunctionExpression': {
+ a = {
+ type: 'ArrowFunctionExpression',
+ loc: (i = e.node.loc) !== null && i !== void 0 ? i : null,
+ async: t.async,
+ generator: t.generator,
+ params: t.params,
+ expression: e.node.expression,
+ body: t.body,
+ };
+ break;
+ }
+ case 'FunctionExpression': {
+ a = {
+ type: 'FunctionExpression',
+ id: t.id,
+ loc: (r = e.node.loc) !== null && r !== void 0 ? r : null,
+ async: t.async,
+ generator: t.generator,
+ params: t.params,
+ body: t.body,
+ };
+ break;
+ }
+ default:
+ Me(e.node, `Creating unhandled function: ${e.node}`);
+ }
+ return a;
+ }
+ function wq(e, t, n) {
+ var i, r, a;
+ switch (t.type) {
+ case 'FunctionDeclaration':
+ return t.insertAfter(nx(t, n))[0];
+ case 'ArrowFunctionExpression':
+ case 'FunctionExpression': {
+ let o = {
+ type: 'FunctionDeclaration',
+ id: n.id,
+ loc: (i = t.node.loc) !== null && i !== void 0 ? i : null,
+ async: n.async,
+ generator: n.generator,
+ params: n.params,
+ body: n.body,
+ },
+ s = e.pushContainer('body', [o])[0];
+ return (
+ D.invariant(s.isFunctionDeclaration(), {
+ reason: 'Expected inserted function declaration',
+ description: `Got: ${s}`,
+ details: [
+ {
+ kind: 'error',
+ loc:
+ (a =
+ (r = s.node) === null || r === void 0 ? void 0 : r.loc) !==
+ null && a !== void 0
+ ? a
+ : null,
+ message: null,
+ },
+ ],
+ }),
+ s
+ );
+ }
+ default:
+ Me(t, `Inserting unhandled function: ${t}`);
+ }
+ }
+ var Oq = ['react-hooks/exhaustive-deps', 'react-hooks/rules-of-hooks'];
+ function $q(e, t) {
+ if (typeof e == 'function') return e(t);
+ for (let n of e) if (t.indexOf(n) !== -1) return !0;
+ return !1;
+ }
+ function jq(e, t) {
+ var n;
+ if (Rq(e, t)) return null;
+ let i = Hq(e, t.opts.environment);
+ if (i) return Uu(i, t, null), null;
+ let r = Sq(
+ t.comments,
+ (n = t.opts.eslintSuppressionRules) !== null && n !== void 0 ? n : Oq,
+ t.opts.flowSuppressions
+ ),
+ a = new th({
+ program: e,
+ opts: t.opts,
+ filename: t.filename,
+ code: t.code,
+ suppressions: r,
+ hasModuleScopeOptOut: QP(e.node.directives, t.opts) != null,
+ }),
+ o = Cq(e, t, a),
+ s = [];
+ for (; o.length !== 0; ) {
+ let l = o.shift(),
+ d = Dq(l.fn, l.fnType, a);
+ if (d != null) {
+ for (let u of d.outlined) {
+ D.invariant(u.fn.outlined.length === 0, {
+ reason: 'Unexpected nested outlined functions',
+ description: null,
+ details: [{kind: 'error', loc: u.fn.loc, message: null}],
+ });
+ let p = wq(e, l.fn, u.fn);
+ p.skip(),
+ a.alreadyCompiled.add(p.node),
+ u.type !== null &&
+ o.push({kind: 'outlined', fn: p, fnType: u.type});
+ }
+ s.push({kind: l.kind, originalFn: l.fn, compiledFn: d});
+ }
+ }
+ if (a.hasModuleScopeOptOut) {
+ if (s.length > 0) {
+ let l = new D();
+ l.pushErrorDetail(
+ new Nn({
+ reason:
+ 'Unexpected compiled functions when module scope opt-out is present',
+ category: K.Invariant,
+ loc: null,
+ })
+ ),
+ Uu(l, a, null);
+ }
+ return null;
+ }
+ return (
+ Nq(e, s, t, a),
+ {
+ retryErrors: a.retryErrors,
+ inferredEffectLocations: a.inferredEffectLocations,
+ }
+ );
+ }
+ function Cq(e, t, n) {
+ var i;
+ let r = [],
+ a = (o, s) => {
+ if (
+ s.opts.compilationMode === 'all' &&
+ o.scope.getProgramParent() !== o.scope.parent
+ )
+ return;
+ let l = rx(o, s);
+ s.opts.environment.validateNoDynamicallyCreatedComponentsOrHooks &&
+ Lq(o, s, n),
+ !(l === null || n.alreadyCompiled.has(o.node)) &&
+ (n.alreadyCompiled.add(o.node),
+ o.skip(),
+ r.push({kind: 'original', fn: o, fnType: l}));
+ };
+ return (
+ e.traverse(
+ {
+ ClassDeclaration(o) {
+ o.skip();
+ },
+ ClassExpression(o) {
+ o.skip();
+ },
+ FunctionDeclaration: a,
+ FunctionExpression: a,
+ ArrowFunctionExpression: a,
+ },
+ Object.assign(Object.assign({}, t), {
+ opts: Object.assign(Object.assign({}, t.opts), t.opts),
+ filename: (i = t.filename) !== null && i !== void 0 ? i : null,
+ })
+ ),
+ r
+ );
+ }
+ function Dq(e, t, n) {
+ var i, r, a, o, s, l, d, u;
+ let p;
+ if (e.node.body.type !== 'BlockStatement') p = {optIn: null, optOut: null};
+ else {
+ let g = YP(e.node.body.directives, n.opts);
+ if (g.isErr())
+ return (
+ Uu(
+ g.unwrapErr(),
+ n,
+ (i = e.node.loc) !== null && i !== void 0 ? i : null
+ ),
+ null
+ );
+ p = {optIn: g.unwrapOr(null), optOut: QP(e.node.body.directives, n.opts)};
+ }
+ let y,
+ m = Aq(e, t, n);
+ if (m.kind === 'error') {
+ p.optOut != null
+ ? tx(m.error, n, (r = e.node.loc) !== null && r !== void 0 ? r : null)
+ : Uu(m.error, n, (a = e.node.loc) !== null && a !== void 0 ? a : null);
+ let g = Mq(e, t, n);
+ if (g == null) return null;
+ y = g;
+ } else y = m.compiledFn;
+ if (n.opts.ignoreUseNoForget === !1 && p.optOut != null)
+ return (
+ n.logEvent({
+ kind: 'CompileSkip',
+ fnLoc: (o = e.node.body.loc) !== null && o !== void 0 ? o : null,
+ reason: `Skipped due to '${p.optOut.value}' directive.`,
+ loc: (s = p.optOut.loc) !== null && s !== void 0 ? s : null,
+ }),
+ null
+ );
+ if (
+ (n.logEvent({
+ kind: 'CompileSuccess',
+ fnLoc: (l = e.node.loc) !== null && l !== void 0 ? l : null,
+ fnName:
+ (u = (d = y.id) === null || d === void 0 ? void 0 : d.name) !==
+ null && u !== void 0
+ ? u
+ : null,
+ memoSlots: y.memoSlotsUsed,
+ memoBlocks: y.memoBlocks,
+ memoValues: y.memoValues,
+ prunedMemoBlocks: y.prunedMemoBlocks,
+ prunedMemoValues: y.prunedMemoValues,
+ }),
+ n.hasModuleScopeOptOut)
+ )
+ return null;
+ if (n.opts.noEmit) {
+ for (let g of y.inferredEffectLocations)
+ g !== F && n.inferredEffectLocations.add(g);
+ return null;
+ } else
+ return n.opts.compilationMode === 'annotation' && p.optIn == null
+ ? null
+ : y;
+ }
+ function Aq(e, t, n) {
+ let i = kq(n.suppressions, e);
+ if (i.length > 0) return {kind: 'error', error: _q(i)};
+ try {
+ return {
+ kind: 'compile',
+ compiledFn: XP(
+ e,
+ n.opts.environment,
+ t,
+ 'all_features',
+ n,
+ n.opts.logger,
+ n.filename,
+ n.code
+ ),
+ };
+ } catch (r) {
+ return {kind: 'error', error: r};
+ }
+ }
+ function Mq(e, t, n) {
+ let i = n.opts.environment;
+ if (!(i.enableFire || i.inferEffectDependencies != null)) return null;
+ try {
+ let r = XP(
+ e,
+ i,
+ t,
+ 'no_inferred_memo',
+ n,
+ n.opts.logger,
+ n.filename,
+ n.code
+ );
+ return !r.hasFireRewrite && !r.hasInferredEffect ? null : r;
+ } catch (r) {
+ return r instanceof D && n.retryErrors.push({fn: e, error: r}), null;
+ }
+ }
+ function Nq(e, t, n, i) {
+ var r, a;
+ let o = null;
+ for (let s of t) {
+ let {kind: l, originalFn: d, compiledFn: u} = s,
+ p = nx(d, u);
+ i.alreadyCompiled.add(p);
+ let y = null;
+ if (d.node.body.type === 'BlockStatement') {
+ let g = ex(d.node.body.directives, n.opts);
+ g.isOk() &&
+ (y =
+ (a =
+ (r = g.unwrap()) === null || r === void 0 ? void 0 : r.gating) !==
+ null && a !== void 0
+ ? a
+ : null);
+ }
+ let m = y ?? n.opts.gating;
+ l === 'original' && m != null
+ ? (o ?? (o = Jq(e, t)), Vz(d, p, i, m, o.has(s)))
+ : d.replaceWith(p);
+ }
+ t.length > 0 && Gq(e, i);
+ }
+ function Rq(e, t) {
+ if (t.opts.sources) {
+ if (t.filename === null) {
+ let n = new D();
+ return (
+ n.pushErrorDetail(
+ new Nn({
+ reason: 'Expected a filename but found none.',
+ description:
+ "When the 'sources' config options is specified, the React compiler will only compile files with a name",
+ category: K.Config,
+ loc: null,
+ })
+ ),
+ Uu(n, t, null),
+ !0
+ );
+ }
+ if (!$q(t.opts.sources, t.filename)) return !0;
+ }
+ return !!Fq(e, ax(t.opts.target));
+ }
+ function Lq(e, t, n) {
+ let i = Fm(e),
+ r = i !== null && i.isIdentifier() ? i.node.name : '',
+ a = (o) => {
+ var s, l, d, u;
+ if (!(o.node === e.node || n.alreadyCompiled.has(o.node))) {
+ if (o.scope.getProgramParent() !== o.scope.parent) {
+ let p = rx(o, t),
+ y = Fm(o),
+ m = y !== null && y.isIdentifier() ? y.node.name : '';
+ (p === 'Component' || p === 'Hook') &&
+ D.throwDiagnostic({
+ category: K.Factories,
+ reason: 'Components and hooks cannot be created dynamically',
+ description: `The function \`${m}\` appears to be a React ${p.toLowerCase()}, but it's defined inside \`${r}\`. Components and Hooks should always be declared at module scope`,
+ details: [
+ {
+ kind: 'error',
+ message:
+ 'this function dynamically created a component/hook',
+ loc:
+ (l =
+ (s = i?.node.loc) !== null && s !== void 0
+ ? s
+ : e.node.loc) !== null && l !== void 0
+ ? l
+ : null,
+ },
+ {
+ kind: 'error',
+ message: 'the component is created here',
+ loc:
+ (u =
+ (d = y?.node.loc) !== null && d !== void 0
+ ? d
+ : o.node.loc) !== null && u !== void 0
+ ? u
+ : null,
+ },
+ ],
+ });
+ }
+ o.skip();
+ }
+ };
+ e.traverse({
+ FunctionDeclaration: a,
+ FunctionExpression: a,
+ ArrowFunctionExpression: a,
+ });
+ }
+ function rx(e, t) {
+ var n, i;
+ let r = t.opts.environment.hookPattern;
+ if (
+ e.node.body.type === 'BlockStatement' &&
+ YP(e.node.body.directives, t.opts).unwrapOr(null) != null
+ )
+ return (n = Ug(e, r)) !== null && n !== void 0 ? n : 'Other';
+ let a = null;
+ switch (
+ (e.isFunctionDeclaration() &&
+ (d4(e.node) ? (a = 'Component') : f4(e.node) && (a = 'Hook')),
+ t.opts.compilationMode)
+ ) {
+ case 'annotation':
+ return null;
+ case 'infer':
+ return a ?? Ug(e, r);
+ case 'syntax':
+ return a;
+ case 'all':
+ return (i = Ug(e, r)) !== null && i !== void 0 ? i : 'Other';
+ default:
+ Me(
+ t.opts.compilationMode,
+ `Unexpected compilationMode \`${t.opts.compilationMode}\``
+ );
+ }
+ }
+ function Fq(e, t) {
+ let n = !1;
+ return (
+ e.traverse({
+ ImportSpecifier(i) {
+ let r = i.get('imported'),
+ a = null;
+ r.isIdentifier()
+ ? (a = r.node.name)
+ : r.isStringLiteral() && (a = r.node.value),
+ a === 'c' &&
+ i.parentPath.isImportDeclaration() &&
+ i.parentPath.get('source').node.value === t &&
+ (n = !0);
+ },
+ }),
+ n
+ );
+ }
+ function zq(e, t) {
+ return t !== null ? new RegExp(t).test(e) : /^use[A-Z0-9]/.test(e);
+ }
+ function Bh(e, t) {
+ if (e.isIdentifier()) return zq(e.node.name, t);
+ if (
+ e.isMemberExpression() &&
+ !e.node.computed &&
+ Bh(e.get('property'), t)
+ ) {
+ let n = e.get('object').node,
+ i = /^[A-Z].*/;
+ return n.type === 'Identifier' && i.test(n.name);
+ } else return !1;
+ }
+ function Bq(e) {
+ return e.isIdentifier() && /^[A-Z]/.test(e.node.name);
+ }
+ function ix(e, t) {
+ let n = e.node;
+ return (
+ (n.type === 'Identifier' && n.name === t) ||
+ (n.type === 'MemberExpression' &&
+ n.object.type === 'Identifier' &&
+ n.object.name === 'React' &&
+ n.property.type === 'Identifier' &&
+ n.property.name === t)
+ );
+ }
+ function Uq(e) {
+ return !!(
+ e.parentPath.isCallExpression() &&
+ e.parentPath.get('callee').isExpression() &&
+ ix(e.parentPath.get('callee'), 'forwardRef')
+ );
+ }
+ function Zq(e) {
+ return (
+ e.parentPath.isCallExpression() &&
+ e.parentPath.get('callee').isExpression() &&
+ ix(e.parentPath.get('callee'), 'memo')
+ );
+ }
+ function qq(e) {
+ if (e == null) return !0;
+ if (e.type === 'TSTypeAnnotation') {
+ switch (e.typeAnnotation.type) {
+ case 'TSArrayType':
+ case 'TSBigIntKeyword':
+ case 'TSBooleanKeyword':
+ case 'TSConstructorType':
+ case 'TSFunctionType':
+ case 'TSLiteralType':
+ case 'TSNeverKeyword':
+ case 'TSNumberKeyword':
+ case 'TSStringKeyword':
+ case 'TSSymbolKeyword':
+ case 'TSTupleType':
+ return !1;
+ }
+ return !0;
+ } else if (e.type === 'TypeAnnotation') {
+ switch (e.typeAnnotation.type) {
+ case 'ArrayTypeAnnotation':
+ case 'BooleanLiteralTypeAnnotation':
+ case 'BooleanTypeAnnotation':
+ case 'EmptyTypeAnnotation':
+ case 'FunctionTypeAnnotation':
+ case 'NumberLiteralTypeAnnotation':
+ case 'NumberTypeAnnotation':
+ case 'StringLiteralTypeAnnotation':
+ case 'StringTypeAnnotation':
+ case 'SymbolTypeAnnotation':
+ case 'ThisTypeAnnotation':
+ case 'TupleTypeAnnotation':
+ return !1;
+ }
+ return !0;
+ } else {
+ if (e.type === 'Noop') return !0;
+ Me(e, `Unexpected annotation node \`${e}\``);
+ }
+ }
+ function Kq(e) {
+ if (e.length === 0) return !0;
+ if (e.length > 0 && e.length <= 2) {
+ if (!qq(e[0].node.typeAnnotation)) return !1;
+ if (e.length === 1) return !e[0].isRestElement();
+ if (e[1].isIdentifier()) {
+ let {name: t} = e[1].node;
+ return t.includes('ref') || t.includes('Ref');
+ } else return !1;
+ }
+ return !1;
+ }
+ function Ug(e, t) {
+ let n = Fm(e);
+ return n !== null && Bq(n)
+ ? Zg(e, t) && Kq(e.get('params')) && !Vq(e)
+ ? 'Component'
+ : null
+ : n !== null && Bh(n, t)
+ ? Zg(e, t)
+ ? 'Hook'
+ : null
+ : (e.isFunctionExpression() || e.isArrowFunctionExpression()) &&
+ (Uq(e) || Zq(e)) &&
+ Zg(e, t)
+ ? 'Component'
+ : null;
+ }
+ function lo(e) {
+ return (t) => {
+ t.node !== e.node && t.skip();
+ };
+ }
+ function Zg(e, t) {
+ let n = !1,
+ i = !1;
+ return (
+ e.traverse({
+ JSX() {
+ i = !0;
+ },
+ CallExpression(r) {
+ let a = r.get('callee');
+ a.isExpression() && Bh(a, t) && (n = !0);
+ },
+ ArrowFunctionExpression: lo(e),
+ FunctionExpression: lo(e),
+ FunctionDeclaration: lo(e),
+ }),
+ n || i
+ );
+ }
+ function c0(e) {
+ if (!e) return !0;
+ switch (e.type) {
+ case 'ObjectExpression':
+ case 'ArrowFunctionExpression':
+ case 'FunctionExpression':
+ case 'BigIntLiteral':
+ case 'ClassExpression':
+ case 'NewExpression':
+ return !0;
+ }
+ return !1;
+ }
+ function Vq(e) {
+ let t = !1;
+ return (
+ e.type === 'ArrowFunctionExpression' &&
+ e.node.body.type !== 'BlockStatement' &&
+ (t = c0(e.node.body)),
+ e.traverse({
+ ReturnStatement(n) {
+ t = c0(n.node.argument);
+ },
+ ArrowFunctionExpression: lo(e),
+ FunctionExpression: lo(e),
+ FunctionDeclaration: lo(e),
+ ObjectMethod: (n) => n.skip(),
+ }),
+ t
+ );
+ }
+ function Fm(e) {
+ if (e.isFunctionDeclaration()) {
+ let i = e.get('id');
+ return i.isIdentifier() ? i : null;
+ }
+ let t = null,
+ n = e.parentPath;
+ return (
+ n.isVariableDeclarator() && n.get('init').node === e.node
+ ? (t = n.get('id'))
+ : n.isAssignmentExpression() &&
+ n.get('right').node === e.node &&
+ n.get('operator') === '='
+ ? (t = n.get('left'))
+ : n.isProperty() &&
+ n.get('value').node === e.node &&
+ !n.get('computed') &&
+ n.get('key').isLVal()
+ ? (t = n.get('key'))
+ : n.isAssignmentPattern() &&
+ n.get('right').node === e.node &&
+ !n.get('computed') &&
+ (t = n.get('left')),
+ t !== null && (t.isIdentifier() || t.isMemberExpression()) ? t : null
+ );
+ }
+ function Jq(e, t) {
+ let n = new Map(
+ t
+ .map((r) => [Fm(r.originalFn), r])
+ .filter((r) => !!r[0] && r[0].isIdentifier())
+ .map((r) => [r[0].node.name, {id: r[0].node, fn: r[1]}])
+ ),
+ i = new Set();
+ return (
+ e.traverse({
+ TypeAnnotation(r) {
+ r.skip();
+ },
+ TSTypeAnnotation(r) {
+ r.skip();
+ },
+ TypeAlias(r) {
+ r.skip();
+ },
+ TSTypeAliasDeclaration(r) {
+ r.skip();
+ },
+ Identifier(r) {
+ let a = n.get(r.node.name);
+ if (!a) return;
+ if (r.node === a.id) {
+ n.delete(r.node.name);
+ return;
+ }
+ r.scope.getFunctionParent() === null &&
+ r.isReferencedIdentifier() &&
+ i.add(a.fn);
+ },
+ }),
+ i
+ );
+ }
+ function ax(e) {
+ return e === '19'
+ ? 'react/compiler-runtime'
+ : e === '17' || e === '18'
+ ? 'react-compiler-runtime'
+ : (D.invariant(
+ e != null &&
+ e.kind === 'donotuse_meta_internal' &&
+ typeof e.runtimeModule == 'string',
+ {
+ reason: 'Expected target to already be validated',
+ description: null,
+ details: [{kind: 'error', loc: null, message: null}],
+ suggestions: null,
+ }
+ ),
+ e.runtimeModule);
+ }
+ function Hq(e, {validateBlocklistedImports: t}) {
+ if (t == null || t.length === 0) return null;
+ let n = new D(),
+ i = new Set(t);
+ return (
+ e.traverse({
+ ImportDeclaration(r) {
+ var a;
+ i.has(r.node.source.value) &&
+ n.push({
+ category: K.Todo,
+ reason: 'Bailing out due to blocklisted import',
+ description: `Import from module ${r.node.source.value}`,
+ loc: (a = r.node.loc) !== null && a !== void 0 ? a : null,
+ });
+ },
+ }),
+ n.hasAnyErrors() ? n : null
+ );
+ }
+ var th = class {
+ constructor({
+ program: t,
+ suppressions: n,
+ opts: i,
+ filename: r,
+ code: a,
+ hasModuleScopeOptOut: o,
+ }) {
+ (this.alreadyCompiled = new (WeakSet ?? Set)()),
+ (this.knownReferencedNames = new Set()),
+ (this.imports = new Map()),
+ (this.retryErrors = []),
+ (this.inferredEffectLocations = new Set()),
+ (this.scope = t.scope),
+ (this.opts = i),
+ (this.filename = r),
+ (this.code = a),
+ (this.reactRuntimeModule = ax(i.target)),
+ (this.suppressions = n),
+ (this.hasModuleScopeOptOut = o);
+ }
+ isHookName(t) {
+ if (this.opts.environment.hookPattern == null) return cn(t);
+ {
+ let n = new RegExp(this.opts.environment.hookPattern).exec(t);
+ return n != null && typeof n[1] == 'string' && cn(n[1]);
+ }
+ }
+ hasReference(t) {
+ return (
+ this.knownReferencedNames.has(t) ||
+ this.scope.hasBinding(t) ||
+ this.scope.hasGlobal(t) ||
+ this.scope.hasReference(t)
+ );
+ }
+ newUid(t) {
+ let n;
+ if (this.isHookName(t)) {
+ n = t;
+ let i = 0;
+ for (; this.hasReference(n); )
+ this.knownReferencedNames.add(n), (n = `${t}_${i++}`);
+ } else this.hasReference(t) ? (n = this.scope.generateUid(t)) : (n = t);
+ return this.knownReferencedNames.add(n), n;
+ }
+ addMemoCacheImport() {
+ return this.addImportSpecifier(
+ {source: this.reactRuntimeModule, importSpecifierName: 'c'},
+ '_c'
+ );
+ }
+ addImportSpecifier({source: t, importSpecifierName: n}, i) {
+ var r;
+ let a =
+ (r = this.imports.get(t)) === null || r === void 0 ? void 0 : r.get(n);
+ if (a != null) return Object.assign({}, a);
+ let o = {
+ kind: 'ImportSpecifier',
+ name: this.newUid(i ?? n),
+ module: t,
+ imported: n,
+ };
+ return (
+ dr(this.imports, t, () => new Map()).set(n, Object.assign({}, o)), o
+ );
+ }
+ addNewReference(t) {
+ this.knownReferencedNames.add(t);
+ }
+ assertGlobalBinding(t, n) {
+ var i, r;
+ let a = n ?? this.scope;
+ if (!a.hasReference(t) && !a.hasBinding(t)) return zn(void 0);
+ let o = new D();
+ return (
+ o.push({
+ category: K.Todo,
+ reason: 'Encountered conflicting global in generated program',
+ description: `Conflict from local binding ${t}`,
+ loc:
+ (r =
+ (i = a.getBinding(t)) === null || i === void 0
+ ? void 0
+ : i.path.node.loc) !== null && r !== void 0
+ ? r
+ : null,
+ suggestions: null,
+ }),
+ gr(o)
+ );
+ }
+ logEvent(t) {
+ this.opts.logger != null && this.opts.logger.logEvent(this.filename, t);
+ }
+ };
+ function Wq(e) {
+ let t = new Map();
+ return (
+ e.traverse({
+ ImportDeclaration(n) {
+ Xq(n) && t.set(n.node.source.value, n);
+ },
+ }),
+ t
+ );
+ }
+ function Gq(e, t) {
+ let n = Wq(e),
+ i = [],
+ r = [...t.imports.entries()].sort(([a], [o]) => a.localeCompare(o));
+ for (let [a, o] of r) {
+ for (let [u, p] of o)
+ D.invariant(e.scope.getBinding(p.name) == null, {
+ reason:
+ 'Encountered conflicting import specifiers in generated program',
+ description: `Conflict from import ${p.module}:(${p.imported} as ${p.name})`,
+ details: [{kind: 'error', loc: F, message: null}],
+ suggestions: null,
+ }),
+ D.invariant(p.module === a && p.imported === u, {
+ reason:
+ 'Found inconsistent import specifier. This is an internal bug.',
+ description: `Expected import ${a}:${u} but found ${p.module}:${p.imported}`,
+ details: [{kind: 'error', loc: F, message: null}],
+ });
+ let s = [...o.values()].sort(({imported: u}, {imported: p}) =>
+ u.localeCompare(p)
+ ),
+ l = s.map((u) =>
+ $.importSpecifier($.identifier(u.name), $.identifier(u.imported))
+ ),
+ d = n.get(a);
+ d != null
+ ? d.pushContainer('specifiers', l)
+ : e.node.sourceType === 'module'
+ ? i.push($.importDeclaration(l, $.stringLiteral(a)))
+ : i.push(
+ $.variableDeclaration('const', [
+ $.variableDeclarator(
+ $.objectPattern(
+ s.map((u) =>
+ $.objectProperty(
+ $.identifier(u.imported),
+ $.identifier(u.name)
+ )
+ )
+ ),
+ $.callExpression($.identifier('require'), [$.stringLiteral(a)])
+ ),
+ ])
+ );
+ }
+ e.unshiftContainer('body', i);
+ }
+ function Xq(e) {
+ return (
+ e.get('specifiers').every((t) => t.isImportSpecifier()) &&
+ e.node.importKind !== 'type' &&
+ e.node.importKind !== 'typeof'
+ );
+ }
+ W.z.enum(['all_errors', 'critical_errors', 'none']);
+ var Yq = W.z.object({source: W.z.string()}),
+ Qq = W.z.nullable(W.z.array(W.z.string())).default(null),
+ e5 = W.z.union([
+ W.z.literal('17'),
+ W.z.literal('18'),
+ W.z.literal('19'),
+ W.z.object({
+ kind: W.z.literal('donotuse_meta_internal'),
+ runtimeModule: W.z.string().default('react'),
+ }),
+ ]);
+ W.z.enum(['infer', 'syntax', 'annotation', 'all']);
+ var nh = {
+ compilationMode: 'infer',
+ panicThreshold: 'none',
+ environment: KI({}).unwrap(),
+ logger: null,
+ gating: null,
+ noEmit: !1,
+ dynamicGating: null,
+ eslintSuppressionRules: null,
+ flowSuppressions: !0,
+ ignoreUseNoForget: !1,
+ sources: (e) => e.indexOf('node_modules') === -1,
+ enableReanimatedCheck: !0,
+ customOptOutDirectives: null,
+ target: '19',
+ };
+ function ox(e) {
+ if (e == null || typeof e != 'object') return nh;
+ let t = Object.create(null);
+ for (let [n, i] of Object.entries(e))
+ if ((typeof i == 'string' && (i = i.toLowerCase()), n5(n)))
+ switch (n) {
+ case 'environment': {
+ let r = KI(i);
+ r.isErr() &&
+ D.throwInvalidConfig({
+ reason:
+ 'Error in validating environment config. This is an advanced setting and not meant to be used directly',
+ description: r.unwrapErr().toString(),
+ suggestions: null,
+ loc: null,
+ }),
+ (t[n] = r.unwrap());
+ break;
+ }
+ case 'target': {
+ t[n] = t5(i);
+ break;
+ }
+ case 'gating': {
+ i == null ? (t[n] = null) : (t[n] = i4(i));
+ break;
+ }
+ case 'dynamicGating': {
+ if (i == null) t[n] = null;
+ else {
+ let r = Yq.safeParse(i);
+ r.success
+ ? (t[n] = r.data)
+ : D.throwInvalidConfig({
+ reason:
+ 'Could not parse dynamic gating. Update React Compiler config to fix the error',
+ description: `${ju.fromZodError(r.error)}`,
+ loc: null,
+ suggestions: null,
+ });
+ }
+ break;
+ }
+ case 'customOptOutDirectives': {
+ let r = Qq.safeParse(i);
+ r.success
+ ? (t[n] = r.data)
+ : D.throwInvalidConfig({
+ reason:
+ 'Could not parse custom opt out directives. Update React Compiler config to fix the error',
+ description: `${ju.fromZodError(r.error)}`,
+ loc: null,
+ suggestions: null,
+ });
+ break;
+ }
+ default:
+ t[n] = i;
+ }
+ return Object.assign(Object.assign({}, nh), t);
+ }
+ function t5(e) {
+ let t = e5.safeParse(e);
+ if (t.success) return t.data;
+ D.throwInvalidConfig({
+ reason: 'Not a valid target',
+ description: `${ju.fromZodError(t.error)}`,
+ suggestions: null,
+ loc: null,
+ });
+ }
+ function n5(e) {
+ return K0(nh, e);
+ }
+ function r5(e) {
+ if (typeof Ny > 'u') return !1;
+ try {
+ return !!Ny.resolve(e);
+ } catch (t) {
+ if (t.code === 'MODULE_NOT_FOUND' && t.message.indexOf(e) !== -1)
+ return !1;
+ throw t;
+ }
+ }
+ function i5(e) {
+ if (Array.isArray(e)) {
+ for (let t of e)
+ if (K0(t, 'key')) {
+ let n = t.key;
+ if (
+ typeof n == 'string' &&
+ n.indexOf('react-native-reanimated') !== -1
+ )
+ return !0;
+ }
+ }
+ return r5('react-native-reanimated');
+ }
+ function a5(e) {
+ return Object.assign(Object.assign({}, e), {
+ environment: Object.assign(Object.assign({}, e.environment), {
+ enableCustomTypeDefinitionForReanimated: !0,
+ }),
+ });
+ }
+ function sx(e, {logger: t, filename: n}) {
+ t?.logEvent(n, {kind: 'CompileError', fnLoc: null, detail: new Tt(e)}),
+ D.throwDiagnostic(e);
+ }
+ function o5(e) {
+ if (e.isIdentifier() && e.node.name === 'AUTODEPS') {
+ let t = e.scope.getBinding(e.node.name);
+ if (t && t.path.isImportSpecifier()) {
+ let n = t.path.node;
+ if (n.imported.type === 'Identifier')
+ return n.imported.name === 'AUTODEPS';
+ }
+ return !1;
+ }
+ if (e.isMemberExpression() && !e.node.computed) {
+ let t = e.get('object'),
+ n = e.get('property');
+ if (
+ t.isIdentifier() &&
+ t.node.name === 'React' &&
+ n.isIdentifier() &&
+ n.node.name === 'AUTODEPS'
+ )
+ return !0;
+ }
+ return !1;
+ }
+ function s5(e, t, n) {
+ var i;
+ for (let r of t) {
+ let a = r.parentPath;
+ if (a != null && a.isCallExpression()) {
+ let o = a.get('arguments'),
+ s = r.node.loc,
+ l = s != null && n.inferredEffectLocations.has(s);
+ if (o.some(o5) && !l) {
+ let u = lx(r, n.transformErrors);
+ sx(
+ {
+ category: K.AutomaticEffectDependencies,
+ reason:
+ 'Cannot infer dependencies of this effect. This will break your build!',
+ description:
+ 'To resolve, either pass a dependency array or fix reported compiler bailout diagnostics' +
+ (u ? ` ${u}` : ''),
+ details: [
+ {
+ kind: 'error',
+ message: 'Cannot infer dependencies',
+ loc: (i = a.node.loc) !== null && i !== void 0 ? i : F,
+ },
+ ],
+ },
+ n
+ );
+ }
+ }
+ }
+ }
+ function l5(e, t) {
+ var n;
+ if (e.length > 0) {
+ let i = lx(e[0], t.transformErrors);
+ sx(
+ {
+ category: K.Fire,
+ reason:
+ '[Fire] Untransformed reference to compiler-required feature.',
+ description:
+ 'Either remove this `fire` call or ensure it is successfully transformed by the compiler' +
+ (i != null ? ` ${i}` : ''),
+ details: [
+ {
+ kind: 'error',
+ message: 'Untransformed `fire` call',
+ loc: (n = e[0].node.loc) !== null && n !== void 0 ? n : F,
+ },
+ ],
+ },
+ t
+ );
+ }
+ }
+ function c5(e, t, n, i, r) {
+ let a = new Map();
+ if (i.enableFire)
+ for (let o of Nu.knownReactModules)
+ dr(a, o, () => new Map()).set('fire', l5);
+ if (i.inferEffectDependencies)
+ for (let {
+ function: {source: o, importSpecifierName: s},
+ autodepsIndex: l,
+ } of i.inferEffectDependencies)
+ dr(a, o, () => new Map()).set(s, s5.bind(null, l));
+ a.size > 0 && f5(e, a, t, n, r);
+ }
+ function u5(e, t, n) {
+ var i;
+ let r = e.get('imported'),
+ a = r.node.type === 'Identifier' ? r.node.name : r.node.value,
+ o = t.get(a);
+ if (o == null) return;
+ n.shouldInvalidateScopes &&
+ ((n.shouldInvalidateScopes = !1), n.program.scope.crawl());
+ let s = e.get('local'),
+ l = s.scope.getBinding(s.node.name);
+ D.invariant(l != null, {
+ reason: 'Expected binding to be found for import specifier',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = s.node.loc) !== null && i !== void 0 ? i : null,
+ message: null,
+ },
+ ],
+ }),
+ o(l.referencePaths, n);
+ }
+ function d5(e, t, n) {
+ var i;
+ n.shouldInvalidateScopes &&
+ ((n.shouldInvalidateScopes = !1), n.program.scope.crawl());
+ let r = e.get('local'),
+ a = r.scope.getBinding(r.node.name),
+ o = t.get(VI);
+ D.invariant(a != null, {
+ reason: 'Expected binding to be found for import specifier',
+ description: null,
+ details: [
+ {
+ kind: 'error',
+ loc: (i = r.node.loc) !== null && i !== void 0 ? i : null,
+ message: null,
+ },
+ ],
+ });
+ let s = new Map();
+ for (let l of a.referencePaths) {
+ o != null && dr(s, o, () => []).push(l);
+ let d = l.parentPath;
+ if (d != null && d.isMemberExpression() && d.get('object') === l) {
+ if (d.node.computed || d.node.property.type !== 'Identifier') continue;
+ let u = t.get(d.node.property.name);
+ u != null && dr(s, u, () => []).push(d);
+ }
+ }
+ for (let [l, d] of s) l(d, n);
+ }
+ function f5(e, t, n, i, r) {
+ var a, o;
+ let s = {
+ shouldInvalidateScopes: !0,
+ program: e,
+ filename: n,
+ logger: i,
+ transformErrors: (a = r?.retryErrors) !== null && a !== void 0 ? a : [],
+ inferredEffectLocations:
+ (o = r?.inferredEffectLocations) !== null && o !== void 0
+ ? o
+ : new Set(),
+ };
+ e.traverse({
+ ImportDeclaration(l) {
+ let d = t.get(l.node.source.value);
+ if (d == null) return;
+ let u = l.get('specifiers');
+ for (let p of u) p.isImportSpecifier() ? u5(p, d, s) : d5(p, d, s);
+ },
+ });
+ }
+ function lx(e, t) {
+ for (let {fn: n, error: i} of t) if (n.isAncestor(e)) return i.toString();
+ return null;
+ }
+ var qg = process.env.ENABLE_REACT_COMPILER_TIMINGS === '1';
+ function p5(e) {
+ return {
+ name: 'react-forget',
+ visitor: {
+ Program: {
+ enter(t, n) {
+ var i, r, a, o;
+ try {
+ let s = (i = n.filename) !== null && i !== void 0 ? i : 'unknown';
+ qg === !0 &&
+ performance.mark(`${s}:start`, {
+ detail: 'BabelPlugin:Program:start',
+ });
+ let l = ox(n.opts),
+ d = !1;
+ l.enableReanimatedCheck === !0 &&
+ i5(n.file.opts.plugins) &&
+ (l = a5(l)),
+ l.environment.enableResetCacheOnSourceFileChanges !== !1 &&
+ d &&
+ (l = Object.assign(Object.assign({}, l), {
+ environment: Object.assign(
+ Object.assign({}, l.environment),
+ {enableResetCacheOnSourceFileChanges: !0}
+ ),
+ }));
+ let u = jq(t, {
+ opts: l,
+ filename: (r = n.filename) !== null && r !== void 0 ? r : null,
+ comments:
+ (a = n.file.ast.comments) !== null && a !== void 0 ? a : [],
+ code: n.file.code,
+ });
+ c5(
+ t,
+ (o = n.filename) !== null && o !== void 0 ? o : null,
+ l.logger,
+ l.environment,
+ u
+ ),
+ qg === !0 &&
+ performance.mark(`${s}:end`, {
+ detail: 'BabelPlugin:Program:end',
+ });
+ } catch (s) {
+ throw s instanceof D
+ ? s.withPrintedMessage(n.file.code, {eslint: !1})
+ : s;
+ }
+ },
+ exit(t, n) {
+ var i;
+ if (qg === !0) {
+ let r = (i = n.filename) !== null && i !== void 0 ? i : 'unknown',
+ a = performance.measure(r, {
+ start: `${r}:start`,
+ end: `${r}:end`,
+ detail: 'BabelPlugin:Program',
+ });
+ 'logger' in n.opts &&
+ n.opts.logger != null &&
+ n.opts.logger.logEvent(r, {kind: 'Timing', measurement: a});
+ }
+ },
+ },
+ },
+ };
+ }
+ var Vn,
+ hi,
+ u0 = {
+ noEmit: !0,
+ panicThreshold: 'none',
+ flowSuppressions: !1,
+ environment: {
+ validateRefAccessDuringRender: !0,
+ validateNoSetStateInRender: !0,
+ validateNoSetStateInEffects: !0,
+ validateNoJSXInTryStatements: !0,
+ validateNoImpureFunctionsInRender: !0,
+ validateStaticComponents: !0,
+ validateNoFreezingKnownMutableFunctions: !0,
+ validateNoVoidUseMemo: !0,
+ validateNoCapitalizedCalls: [],
+ validateHooksUsage: !0,
+ validateNoDerivedComputationsInEffects: !0,
+ },
+ },
+ m5 = /\$FlowFixMe\[([^\]]*)\]/g;
+ function y5(e) {
+ let t = e.getAllComments(),
+ n = [];
+ for (let i of t) {
+ let r = i.value.matchAll(m5);
+ for (let a of r)
+ if (a.index != null && i.loc != null) {
+ let o = a[1];
+ n.push({line: i.loc.end.line, code: o});
+ }
+ }
+ return n;
+ }
+ function g5({sourceCode: e, filename: t, userOpts: n}) {
+ var i, r;
+ let a = ox(
+ Object.assign(Object.assign(Object.assign({}, u0), n), {
+ environment: Object.assign(
+ Object.assign({}, u0.environment),
+ n.environment
+ ),
+ })
+ ),
+ o = {
+ sourceCode: e.text,
+ filename: t,
+ userOpts: n,
+ flowSuppressions: [],
+ events: [],
+ },
+ s = a.logger;
+ a.logger = {
+ logEvent: (d, u) => {
+ s?.logEvent(d, u), o.events.push(u);
+ },
+ };
+ try {
+ a.environment = r4((i = a.environment) !== null && i !== void 0 ? i : {});
+ } catch (d) {
+ (r = a.logger) === null || r === void 0 || r.logEvent(t, d);
+ }
+ let l = null;
+ if (t.endsWith('.tsx') || t.endsWith('.ts'))
+ try {
+ l = kF.parse(e.text, {
+ sourceFilename: t,
+ sourceType: 'unambiguous',
+ plugins: ['typescript', 'jsx'],
+ });
+ } catch {}
+ else
+ try {
+ l = _F.parse(e.text, {
+ babel: !0,
+ enableExperimentalComponentSyntax: !0,
+ sourceFilename: t,
+ sourceType: 'module',
+ });
+ } catch {}
+ if (l != null) {
+ o.flowSuppressions = y5(e);
+ try {
+ bF.transformFromAstSync(l, e.text, {
+ filename: t,
+ highlightCode: !1,
+ retainLines: !0,
+ plugins: [[p5, a]],
+ sourceType: 'module',
+ configFile: !1,
+ babelrc: !1,
+ });
+ } catch {}
+ }
+ return o;
+ }
+ var v5 = Symbol(),
+ rh = class {
+ constructor(t) {
+ Vn.set(this, void 0),
+ hi.set(this, 0),
+ at(this, Vn, new Array(t).fill(v5), 'f');
+ }
+ get(t) {
+ let n = j(this, Vn, 'f').findIndex((a) => a[0] === t);
+ if (n === j(this, hi, 'f'))
+ return j(this, Vn, 'f')[j(this, hi, 'f')][1];
+ if (n < 0) return null;
+ let i = j(this, Vn, 'f')[n],
+ r = j(this, Vn, 'f').length;
+ for (let a = 0; a < Math.min(n, r - 1); a++)
+ j(this, Vn, 'f')[(j(this, hi, 'f') + a + 1) % r] = j(this, Vn, 'f')[
+ (j(this, hi, 'f') + a) % r
+ ];
+ return (j(this, Vn, 'f')[j(this, hi, 'f')] = i), i[1];
+ }
+ push(t, n) {
+ at(
+ this,
+ hi,
+ (j(this, hi, 'f') - 1 + j(this, Vn, 'f').length) %
+ j(this, Vn, 'f').length,
+ 'f'
+ ),
+ (j(this, Vn, 'f')[j(this, hi, 'f')] = [t, n]);
+ }
+ };
+ (Vn = new WeakMap()), (hi = new WeakMap());
+ var d0 = new rh(10);
+ function h5({sourceCode: e, filename: t, userOpts: n}) {
+ let i = d0.get(t);
+ if (
+ i != null &&
+ i.sourceCode === e.text &&
+ TF.isDeepStrictEqual(i.userOpts, n)
+ )
+ return i;
+ let r = g5({sourceCode: e, filename: t, userOpts: n});
+ return (
+ i != null ? Object.assign(i, r) : d0.push(t, r), Object.assign({}, r)
+ );
+ }
+ function cx(e, t) {
+ throw new Error(t);
+ }
+ function b5(e) {
+ let t = [];
+ if (Array.isArray(e.suggestions))
+ for (let n of e.suggestions)
+ switch (n.op) {
+ case _i.InsertBefore:
+ t.push({
+ desc: n.description,
+ fix(i) {
+ return i.insertTextBeforeRange(n.range, n.text);
+ },
+ });
+ break;
+ case _i.InsertAfter:
+ t.push({
+ desc: n.description,
+ fix(i) {
+ return i.insertTextAfterRange(n.range, n.text);
+ },
+ });
+ break;
+ case _i.Replace:
+ t.push({
+ desc: n.description,
+ fix(i) {
+ return i.replaceTextRange(n.range, n.text);
+ },
+ });
+ break;
+ case _i.Remove:
+ t.push({
+ desc: n.description,
+ fix(i) {
+ return i.removeRange(n.range);
+ },
+ });
+ break;
+ default:
+ cx(n, 'Unhandled suggestion operation');
+ }
+ return t;
+ }
+ function k5(e) {
+ var t, n, i;
+ let r = (t = e.sourceCode) !== null && t !== void 0 ? t : e.getSourceCode(),
+ a = (n = e.filename) !== null && n !== void 0 ? n : e.getFilename(),
+ o = (i = e.options[0]) !== null && i !== void 0 ? i : {};
+ return h5({sourceCode: r, filename: a, userOpts: o});
+ }
+ function S5(e, t, n) {
+ for (let i of e.flowSuppressions)
+ if (n.includes(i.code) && i.line === t.start.line - 1) return !0;
+ return !1;
+ }
+ function Uh(e) {
+ let t = (n) => {
+ let i = k5(n);
+ for (let r of i.events)
+ if (r.kind === 'CompileError') {
+ let a = r.detail;
+ if (a.category === e.category) {
+ let o = a.primaryLocation();
+ if (
+ o == null ||
+ typeof o == 'symbol' ||
+ S5(i, o, ['react-rule-hook', 'react-rule-unsafe-ref'])
+ )
+ continue;
+ n.report({
+ message: a.printErrorMessage(i.sourceCode, {eslint: !0}),
+ loc: o,
+ suggest: b5(a.options),
+ });
+ }
+ }
+ return {};
+ };
+ return {
+ meta: {
+ type: 'problem',
+ docs: {
+ description: e.description,
+ recommended: e.preset === Dt.Recommended,
+ },
+ fixable: 'code',
+ hasSuggestions: !0,
+ schema: [{type: 'object', additionalProperties: !0}],
+ },
+ create: t,
+ };
+ }
+ var _5 = fh.reduce(
+ (e, t) => ((e[t.name] = {rule: Uh(t), severity: t.severity}), e),
+ {}
+ ),
+ T5 = fh
+ .filter((e) => e.preset === Dt.Recommended)
+ .reduce(
+ (e, t) => ((e[t.name] = {rule: Uh(t), severity: t.severity}), e),
+ {}
+ ),
+ E5 = fh
+ .filter(
+ (e) => e.preset === Dt.Recommended || e.preset === Dt.RecommendedLatest
+ )
+ .reduce(
+ (e, t) => ((e[t.name] = {rule: Uh(t), severity: t.severity}), e),
+ {}
+ );
+ function ux(e) {
+ switch (e) {
+ case wt.Error:
+ return 'error';
+ case wt.Warning:
+ return 'warn';
+ case wt.Hint:
+ case wt.Off:
+ return 'off';
+ default:
+ cx(e, `Unhandled severity: ${e}`);
+ }
+ }
+ var Kg, f0;
+ function dx() {
+ if (f0) return Kg;
+ f0 = 1;
+ function e(t) {
+ if (!t) throw new Error('Assertion violated.');
+ }
+ return (Kg = e), Kg;
+ }
+ var Vg, p0;
+ function Zh() {
+ if (p0) return Vg;
+ p0 = 1;
+ function e(n) {
+ return n.reachable;
+ }
+ class t {
+ constructor(i, r, a) {
+ (this.id = i),
+ (this.nextSegments = []),
+ (this.prevSegments = r.filter(e)),
+ (this.allNextSegments = []),
+ (this.allPrevSegments = r),
+ (this.reachable = a),
+ Object.defineProperty(this, 'internal', {
+ value: {used: !1, loopedPrevSegments: []},
+ });
+ }
+ isLoopedPrevSegment(i) {
+ return this.internal.loopedPrevSegments.includes(i);
+ }
+ static newRoot(i) {
+ return new t(i, [], !0);
+ }
+ static newNext(i, r) {
+ return new t(i, t.flattenUnusedSegments(r), r.some(e));
+ }
+ static newUnreachable(i, r) {
+ let a = new t(i, t.flattenUnusedSegments(r), !1);
+ return t.markUsed(a), a;
+ }
+ static newDisconnected(i, r) {
+ return new t(i, [], r.some(e));
+ }
+ static markUsed(i) {
+ if (i.internal.used) return;
+ i.internal.used = !0;
+ let r;
+ if (i.reachable)
+ for (r = 0; r < i.allPrevSegments.length; ++r) {
+ let a = i.allPrevSegments[r];
+ a.allNextSegments.push(i), a.nextSegments.push(i);
+ }
+ else
+ for (r = 0; r < i.allPrevSegments.length; ++r)
+ i.allPrevSegments[r].allNextSegments.push(i);
+ }
+ static markPrevSegmentAsLooped(i, r) {
+ i.internal.loopedPrevSegments.push(r);
+ }
+ static flattenUnusedSegments(i) {
+ let r = Object.create(null),
+ a = [];
+ for (let o = 0; o < i.length; ++o) {
+ let s = i[o];
+ if (!r[s.id])
+ if (s.internal.used) (r[s.id] = !0), a.push(s);
+ else
+ for (let l = 0; l < s.allPrevSegments.length; ++l) {
+ let d = s.allPrevSegments[l];
+ r[d.id] || ((r[d.id] = !0), a.push(d));
+ }
+ }
+ return a;
+ }
+ }
+ return (Vg = t), Vg;
+ }
+ var Jg, m0;
+ function I5() {
+ if (m0) return Jg;
+ m0 = 1;
+ let e = dx(),
+ t = Zh();
+ function n(o) {
+ return o.reachable;
+ }
+ function i(o, s, l, d) {
+ let u = o.segmentsList,
+ p = s >= 0 ? s : u.length + s,
+ y = l >= 0 ? l : u.length + l,
+ m = [];
+ for (let g = 0; g < o.count; ++g) {
+ let S = [];
+ for (let _ = p; _ <= y; ++_) S.push(u[_][g]);
+ m.push(d(o.idGenerator.next(), S));
+ }
+ return m;
+ }
+ function r(o, s) {
+ let l = s;
+ for (; l.length > o.count; ) {
+ let d = [];
+ for (let u = 0, p = (l.length / 2) | 0; u < p; ++u)
+ d.push(t.newNext(o.idGenerator.next(), [l[u], l[u + p]]));
+ l = d;
+ }
+ return l;
+ }
+ class a {
+ constructor(s, l, d) {
+ (this.idGenerator = s),
+ (this.upper = l),
+ (this.count = d),
+ (this.segmentsList = []);
+ }
+ get head() {
+ let s = this.segmentsList;
+ return s.length === 0 ? [] : s[s.length - 1];
+ }
+ get empty() {
+ return this.segmentsList.length === 0;
+ }
+ get reachable() {
+ let s = this.head;
+ return s.length > 0 && s.some(n);
+ }
+ makeNext(s, l) {
+ return i(this, s, l, t.newNext);
+ }
+ makeUnreachable(s, l) {
+ return i(this, s, l, t.newUnreachable);
+ }
+ makeDisconnected(s, l) {
+ return i(this, s, l, t.newDisconnected);
+ }
+ add(s) {
+ e(s.length >= this.count, s.length + ' >= ' + this.count),
+ this.segmentsList.push(r(this, s));
+ }
+ replaceHead(s) {
+ e(s.length >= this.count, s.length + ' >= ' + this.count),
+ this.segmentsList.splice(-1, 1, r(this, s));
+ }
+ addAll(s) {
+ e(s.count === this.count);
+ let l = s.segmentsList;
+ for (let d = 0; d < l.length; ++d) this.segmentsList.push(l[d]);
+ }
+ clear() {
+ this.segmentsList = [];
+ }
+ static newRoot(s) {
+ let l = new a(s, null, 1);
+ return l.add([t.newRoot(s.next())]), l;
+ }
+ static newEmpty(s, l) {
+ return new a(s.idGenerator, s, (l ? 2 : 1) * s.count);
+ }
+ }
+ return (Jg = a), Jg;
+ }
+ var Hg, y0;
+ function P5() {
+ if (y0) return Hg;
+ y0 = 1;
+ let e = Zh(),
+ t = I5();
+ function n(y, m, g, S) {
+ for (let _ = 0; _ < S.length; ++_) {
+ let O = S[_];
+ y.push(O), m.includes(O) || g.push(O);
+ }
+ }
+ function i(y, m) {
+ if (!m) return y.loopContext;
+ let g = y.loopContext;
+ for (; g; ) {
+ if (g.label === m) return g;
+ g = g.upper;
+ }
+ return null;
+ }
+ function r(y, m) {
+ let g = y.breakContext;
+ for (; g; ) {
+ if (m ? g.label === m : g.breakable) return g;
+ g = g.upper;
+ }
+ return null;
+ }
+ function a(y) {
+ let m = y.tryContext;
+ for (; m; ) {
+ if (m.hasFinalizer && m.position !== 'finally') return m;
+ m = m.upper;
+ }
+ return y;
+ }
+ function o(y) {
+ let m = y.tryContext;
+ for (; m; ) {
+ if (m.position === 'try' || (m.hasFinalizer && m.position === 'catch'))
+ return m;
+ m = m.upper;
+ }
+ return y;
+ }
+ function s(y, m) {
+ y.splice(y.indexOf(m), 1);
+ }
+ function l(y, m) {
+ for (let g = 0; g < y.length; ++g) {
+ let S = y[g],
+ _ = m[g];
+ s(S.nextSegments, _),
+ s(S.allNextSegments, _),
+ s(_.prevSegments, S),
+ s(_.allPrevSegments, S);
+ }
+ }
+ function d(y, m, g) {
+ let S = e.flattenUnusedSegments(m),
+ _ = e.flattenUnusedSegments(g),
+ O = Math.min(S.length, _.length);
+ for (let P = 0; P < O; ++P) {
+ let M = S[P],
+ w = _[P];
+ w.reachable && M.nextSegments.push(w),
+ M.reachable && w.prevSegments.push(M),
+ M.allNextSegments.push(w),
+ w.allPrevSegments.push(M),
+ w.allPrevSegments.length >= 2 && e.markPrevSegmentAsLooped(w, M),
+ y.notifyLooped(M, w);
+ }
+ }
+ function u(y, m, g) {
+ m.processed ||
+ (m.trueForkContext.add(g),
+ m.falseForkContext.add(g),
+ m.qqForkContext.add(g)),
+ y.test !== !0 && y.brokenForkContext.addAll(m.falseForkContext),
+ (y.endOfTestSegments = m.trueForkContext.makeNext(0, -1));
+ }
+ class p {
+ constructor(m, g) {
+ (this.idGenerator = m),
+ (this.notifyLooped = g),
+ (this.forkContext = t.newRoot(m)),
+ (this.choiceContext = null),
+ (this.switchContext = null),
+ (this.tryContext = null),
+ (this.loopContext = null),
+ (this.breakContext = null),
+ (this.chainContext = null),
+ (this.currentSegments = []),
+ (this.initialSegment = this.forkContext.head[0]);
+ let S = (this.finalSegments = []),
+ _ = (this.returnedForkContext = []),
+ O = (this.thrownForkContext = []);
+ (_.add = n.bind(null, _, O, S)), (O.add = n.bind(null, O, _, S));
+ }
+ get headSegments() {
+ return this.forkContext.head;
+ }
+ get parentForkContext() {
+ let m = this.forkContext;
+ return m && m.upper;
+ }
+ pushForkContext(m) {
+ return (
+ (this.forkContext = t.newEmpty(this.forkContext, m)), this.forkContext
+ );
+ }
+ popForkContext() {
+ let m = this.forkContext;
+ return (
+ (this.forkContext = m.upper),
+ this.forkContext.replaceHead(m.makeNext(0, -1)),
+ m
+ );
+ }
+ forkPath() {
+ this.forkContext.add(this.parentForkContext.makeNext(-1, -1));
+ }
+ forkBypassPath() {
+ this.forkContext.add(this.parentForkContext.head);
+ }
+ pushChoiceContext(m, g) {
+ this.choiceContext = {
+ upper: this.choiceContext,
+ kind: m,
+ isForkingAsResult: g,
+ trueForkContext: t.newEmpty(this.forkContext),
+ falseForkContext: t.newEmpty(this.forkContext),
+ qqForkContext: t.newEmpty(this.forkContext),
+ processed: !1,
+ };
+ }
+ popChoiceContext() {
+ let m = this.choiceContext;
+ this.choiceContext = m.upper;
+ let g = this.forkContext,
+ S = g.head;
+ switch (m.kind) {
+ case '&&':
+ case '||':
+ case '??':
+ if (
+ (m.processed ||
+ (m.trueForkContext.add(S),
+ m.falseForkContext.add(S),
+ m.qqForkContext.add(S)),
+ m.isForkingAsResult)
+ ) {
+ let O = this.choiceContext;
+ return (
+ O.trueForkContext.addAll(m.trueForkContext),
+ O.falseForkContext.addAll(m.falseForkContext),
+ O.qqForkContext.addAll(m.qqForkContext),
+ (O.processed = !0),
+ m
+ );
+ }
+ break;
+ case 'test':
+ m.processed
+ ? (m.falseForkContext.clear(), m.falseForkContext.add(S))
+ : (m.trueForkContext.clear(), m.trueForkContext.add(S));
+ break;
+ case 'loop':
+ return m;
+ default:
+ throw new Error('unreachable');
+ }
+ let _ = m.trueForkContext;
+ return (
+ _.addAll(m.falseForkContext), g.replaceHead(_.makeNext(0, -1)), m
+ );
+ }
+ makeLogicalRight() {
+ let m = this.choiceContext,
+ g = this.forkContext;
+ if (m.processed) {
+ let S;
+ switch (m.kind) {
+ case '&&':
+ S = m.trueForkContext;
+ break;
+ case '||':
+ S = m.falseForkContext;
+ break;
+ case '??':
+ S = m.qqForkContext;
+ break;
+ default:
+ throw new Error('unreachable');
+ }
+ g.replaceHead(S.makeNext(0, -1)), S.clear(), (m.processed = !1);
+ } else {
+ switch (m.kind) {
+ case '&&':
+ m.falseForkContext.add(g.head);
+ break;
+ case '||':
+ m.trueForkContext.add(g.head);
+ break;
+ case '??':
+ m.trueForkContext.add(g.head), m.falseForkContext.add(g.head);
+ break;
+ default:
+ throw new Error('unreachable');
+ }
+ g.replaceHead(g.makeNext(-1, -1));
+ }
+ }
+ makeIfConsequent() {
+ let m = this.choiceContext,
+ g = this.forkContext;
+ m.processed ||
+ (m.trueForkContext.add(g.head),
+ m.falseForkContext.add(g.head),
+ m.qqForkContext.add(g.head)),
+ (m.processed = !1),
+ g.replaceHead(m.trueForkContext.makeNext(0, -1));
+ }
+ makeIfAlternate() {
+ let m = this.choiceContext,
+ g = this.forkContext;
+ m.trueForkContext.clear(),
+ m.trueForkContext.add(g.head),
+ (m.processed = !0),
+ g.replaceHead(m.falseForkContext.makeNext(0, -1));
+ }
+ pushChainContext() {
+ this.chainContext = {upper: this.chainContext, countChoiceContexts: 0};
+ }
+ popChainContext() {
+ let m = this.chainContext;
+ this.chainContext = m.upper;
+ for (let g = m.countChoiceContexts; g > 0; --g) this.popChoiceContext();
+ }
+ makeOptionalNode() {
+ this.chainContext &&
+ ((this.chainContext.countChoiceContexts += 1),
+ this.pushChoiceContext('??', !1));
+ }
+ makeOptionalRight() {
+ this.chainContext && this.makeLogicalRight();
+ }
+ pushSwitchContext(m, g) {
+ (this.switchContext = {
+ upper: this.switchContext,
+ hasCase: m,
+ defaultSegments: null,
+ defaultBodySegments: null,
+ foundDefault: !1,
+ lastIsDefault: !1,
+ countForks: 0,
+ }),
+ this.pushBreakContext(!0, g);
+ }
+ popSwitchContext() {
+ let m = this.switchContext;
+ this.switchContext = m.upper;
+ let g = this.forkContext,
+ S = this.popBreakContext().brokenForkContext;
+ if (m.countForks === 0) {
+ S.empty ||
+ (S.add(g.makeNext(-1, -1)), g.replaceHead(S.makeNext(0, -1)));
+ return;
+ }
+ let _ = g.head;
+ this.forkBypassPath();
+ let O = g.head;
+ S.add(_),
+ m.lastIsDefault ||
+ (m.defaultBodySegments
+ ? (l(m.defaultSegments, m.defaultBodySegments),
+ d(this, O, m.defaultBodySegments))
+ : S.add(O));
+ for (let P = 0; P < m.countForks; ++P)
+ this.forkContext = this.forkContext.upper;
+ this.forkContext.replaceHead(S.makeNext(0, -1));
+ }
+ makeSwitchCaseBody(m, g) {
+ let S = this.switchContext;
+ if (!S.hasCase) return;
+ let _ = this.forkContext,
+ O = this.pushForkContext();
+ O.add(_.makeNext(0, -1)),
+ g
+ ? ((S.defaultSegments = _.head),
+ m ? (S.foundDefault = !0) : (S.defaultBodySegments = O.head))
+ : !m &&
+ S.foundDefault &&
+ ((S.foundDefault = !1), (S.defaultBodySegments = O.head)),
+ (S.lastIsDefault = g),
+ (S.countForks += 1);
+ }
+ pushTryContext(m) {
+ this.tryContext = {
+ upper: this.tryContext,
+ position: 'try',
+ hasFinalizer: m,
+ returnedForkContext: m ? t.newEmpty(this.forkContext) : null,
+ thrownForkContext: t.newEmpty(this.forkContext),
+ lastOfTryIsReachable: !1,
+ lastOfCatchIsReachable: !1,
+ };
+ }
+ popTryContext() {
+ let m = this.tryContext;
+ if (((this.tryContext = m.upper), m.position === 'catch')) {
+ this.popForkContext();
+ return;
+ }
+ let g = m.returnedForkContext,
+ S = m.thrownForkContext;
+ if (g.empty && S.empty) return;
+ let _ = this.forkContext.head;
+ this.forkContext = this.forkContext.upper;
+ let O = _.slice(0, (_.length / 2) | 0),
+ P = _.slice((_.length / 2) | 0);
+ g.empty || a(this).returnedForkContext.add(P),
+ S.empty || o(this).thrownForkContext.add(P),
+ this.forkContext.replaceHead(O),
+ !m.lastOfTryIsReachable &&
+ !m.lastOfCatchIsReachable &&
+ this.forkContext.makeUnreachable();
+ }
+ makeCatchBlock() {
+ let m = this.tryContext,
+ g = this.forkContext,
+ S = m.thrownForkContext;
+ (m.position = 'catch'),
+ (m.thrownForkContext = t.newEmpty(g)),
+ (m.lastOfTryIsReachable = g.reachable),
+ S.add(g.head);
+ let _ = S.makeNext(0, -1);
+ this.pushForkContext(), this.forkBypassPath(), this.forkContext.add(_);
+ }
+ makeFinallyBlock() {
+ let m = this.tryContext,
+ g = this.forkContext,
+ S = m.returnedForkContext,
+ _ = m.thrownForkContext,
+ O = g.head;
+ if (
+ (m.position === 'catch'
+ ? (this.popForkContext(),
+ (g = this.forkContext),
+ (m.lastOfCatchIsReachable = g.reachable))
+ : (m.lastOfTryIsReachable = g.reachable),
+ (m.position = 'finally'),
+ S.empty && _.empty)
+ )
+ return;
+ let P = g.makeNext(-1, -1);
+ for (let M = 0; M < g.count; ++M) {
+ let w = [O[M]];
+ for (let I = 0; I < S.segmentsList.length; ++I)
+ w.push(S.segmentsList[I][M]);
+ for (let I = 0; I < _.segmentsList.length; ++I)
+ w.push(_.segmentsList[I][M]);
+ P.push(e.newNext(this.idGenerator.next(), w));
+ }
+ this.pushForkContext(!0), this.forkContext.add(P);
+ }
+ makeFirstThrowablePathInTryBlock() {
+ let m = this.forkContext;
+ if (!m.reachable) return;
+ let g = o(this);
+ g === this ||
+ g.position !== 'try' ||
+ !g.thrownForkContext.empty ||
+ (g.thrownForkContext.add(m.head), m.replaceHead(m.makeNext(-1, -1)));
+ }
+ pushLoopContext(m, g) {
+ let S = this.forkContext,
+ _ = this.pushBreakContext(!0, g);
+ switch (m) {
+ case 'WhileStatement':
+ this.pushChoiceContext('loop', !1),
+ (this.loopContext = {
+ upper: this.loopContext,
+ type: m,
+ label: g,
+ test: void 0,
+ continueDestSegments: null,
+ brokenForkContext: _.brokenForkContext,
+ });
+ break;
+ case 'DoWhileStatement':
+ this.pushChoiceContext('loop', !1),
+ (this.loopContext = {
+ upper: this.loopContext,
+ type: m,
+ label: g,
+ test: void 0,
+ entrySegments: null,
+ continueForkContext: t.newEmpty(S),
+ brokenForkContext: _.brokenForkContext,
+ });
+ break;
+ case 'ForStatement':
+ this.pushChoiceContext('loop', !1),
+ (this.loopContext = {
+ upper: this.loopContext,
+ type: m,
+ label: g,
+ test: void 0,
+ endOfInitSegments: null,
+ testSegments: null,
+ endOfTestSegments: null,
+ updateSegments: null,
+ endOfUpdateSegments: null,
+ continueDestSegments: null,
+ brokenForkContext: _.brokenForkContext,
+ });
+ break;
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ this.loopContext = {
+ upper: this.loopContext,
+ type: m,
+ label: g,
+ prevSegments: null,
+ leftSegments: null,
+ endOfLeftSegments: null,
+ continueDestSegments: null,
+ brokenForkContext: _.brokenForkContext,
+ };
+ break;
+ default:
+ throw new Error('unknown type: "' + m + '"');
+ }
+ }
+ popLoopContext() {
+ let m = this.loopContext;
+ this.loopContext = m.upper;
+ let g = this.forkContext,
+ S = this.popBreakContext().brokenForkContext;
+ switch (m.type) {
+ case 'WhileStatement':
+ case 'ForStatement':
+ this.popChoiceContext(), d(this, g.head, m.continueDestSegments);
+ break;
+ case 'DoWhileStatement': {
+ let _ = this.popChoiceContext();
+ _.processed ||
+ (_.trueForkContext.add(g.head), _.falseForkContext.add(g.head)),
+ m.test !== !0 && S.addAll(_.falseForkContext);
+ let O = _.trueForkContext.segmentsList;
+ for (let P = 0; P < O.length; ++P) d(this, O[P], m.entrySegments);
+ break;
+ }
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ S.add(g.head), d(this, g.head, m.leftSegments);
+ break;
+ default:
+ throw new Error('unreachable');
+ }
+ S.empty
+ ? g.replaceHead(g.makeUnreachable(-1, -1))
+ : g.replaceHead(S.makeNext(0, -1));
+ }
+ makeWhileTest(m) {
+ let g = this.loopContext,
+ S = this.forkContext,
+ _ = S.makeNext(0, -1);
+ (g.test = m), (g.continueDestSegments = _), S.replaceHead(_);
+ }
+ makeWhileBody() {
+ let m = this.loopContext,
+ g = this.choiceContext,
+ S = this.forkContext;
+ g.processed ||
+ (g.trueForkContext.add(S.head), g.falseForkContext.add(S.head)),
+ m.test !== !0 && m.brokenForkContext.addAll(g.falseForkContext),
+ S.replaceHead(g.trueForkContext.makeNext(0, -1));
+ }
+ makeDoWhileBody() {
+ let m = this.loopContext,
+ g = this.forkContext,
+ S = g.makeNext(-1, -1);
+ (m.entrySegments = S), g.replaceHead(S);
+ }
+ makeDoWhileTest(m) {
+ let g = this.loopContext,
+ S = this.forkContext;
+ if (((g.test = m), !g.continueForkContext.empty)) {
+ g.continueForkContext.add(S.head);
+ let _ = g.continueForkContext.makeNext(0, -1);
+ S.replaceHead(_);
+ }
+ }
+ makeForTest(m) {
+ let g = this.loopContext,
+ S = this.forkContext,
+ _ = S.head,
+ O = S.makeNext(-1, -1);
+ (g.test = m),
+ (g.endOfInitSegments = _),
+ (g.continueDestSegments = g.testSegments = O),
+ S.replaceHead(O);
+ }
+ makeForUpdate() {
+ let m = this.loopContext,
+ g = this.choiceContext,
+ S = this.forkContext;
+ m.testSegments ? u(m, g, S.head) : (m.endOfInitSegments = S.head);
+ let _ = S.makeDisconnected(-1, -1);
+ (m.continueDestSegments = m.updateSegments = _), S.replaceHead(_);
+ }
+ makeForBody() {
+ let m = this.loopContext,
+ g = this.choiceContext,
+ S = this.forkContext;
+ m.updateSegments
+ ? ((m.endOfUpdateSegments = S.head),
+ m.testSegments && d(this, m.endOfUpdateSegments, m.testSegments))
+ : m.testSegments
+ ? u(m, g, S.head)
+ : (m.endOfInitSegments = S.head);
+ let _ = m.endOfTestSegments;
+ if (!_) {
+ let O = t.newEmpty(S);
+ O.add(m.endOfInitSegments),
+ m.endOfUpdateSegments && O.add(m.endOfUpdateSegments),
+ (_ = O.makeNext(0, -1));
+ }
+ (m.continueDestSegments = m.continueDestSegments || _),
+ S.replaceHead(_);
+ }
+ makeForInOfLeft() {
+ let m = this.loopContext,
+ g = this.forkContext,
+ S = g.makeDisconnected(-1, -1);
+ (m.prevSegments = g.head),
+ (m.leftSegments = m.continueDestSegments = S),
+ g.replaceHead(S);
+ }
+ makeForInOfRight() {
+ let m = this.loopContext,
+ g = this.forkContext,
+ S = t.newEmpty(g);
+ S.add(m.prevSegments);
+ let _ = S.makeNext(-1, -1);
+ (m.endOfLeftSegments = g.head), g.replaceHead(_);
+ }
+ makeForInOfBody() {
+ let m = this.loopContext,
+ g = this.forkContext,
+ S = t.newEmpty(g);
+ S.add(m.endOfLeftSegments);
+ let _ = S.makeNext(-1, -1);
+ d(this, g.head, m.leftSegments),
+ m.brokenForkContext.add(g.head),
+ g.replaceHead(_);
+ }
+ pushBreakContext(m, g) {
+ return (
+ (this.breakContext = {
+ upper: this.breakContext,
+ breakable: m,
+ label: g,
+ brokenForkContext: t.newEmpty(this.forkContext),
+ }),
+ this.breakContext
+ );
+ }
+ popBreakContext() {
+ let m = this.breakContext,
+ g = this.forkContext;
+ if (((this.breakContext = m.upper), !m.breakable)) {
+ let S = m.brokenForkContext;
+ S.empty || (S.add(g.head), g.replaceHead(S.makeNext(0, -1)));
+ }
+ return m;
+ }
+ makeBreak(m) {
+ let g = this.forkContext;
+ if (!g.reachable) return;
+ let S = r(this, m);
+ S && S.brokenForkContext.add(g.head),
+ g.replaceHead(g.makeUnreachable(-1, -1));
+ }
+ makeContinue(m) {
+ let g = this.forkContext;
+ if (!g.reachable) return;
+ let S = i(this, m);
+ S &&
+ (S.continueDestSegments
+ ? (d(this, g.head, S.continueDestSegments),
+ (S.type === 'ForInStatement' || S.type === 'ForOfStatement') &&
+ S.brokenForkContext.add(g.head))
+ : S.continueForkContext.add(g.head)),
+ g.replaceHead(g.makeUnreachable(-1, -1));
+ }
+ makeReturn() {
+ let m = this.forkContext;
+ m.reachable &&
+ (a(this).returnedForkContext.add(m.head),
+ m.replaceHead(m.makeUnreachable(-1, -1)));
+ }
+ makeThrow() {
+ let m = this.forkContext;
+ m.reachable &&
+ (o(this).thrownForkContext.add(m.head),
+ m.replaceHead(m.makeUnreachable(-1, -1)));
+ }
+ makeFinal() {
+ let m = this.currentSegments;
+ m.length > 0 && m[0].reachable && this.returnedForkContext.add(m);
+ }
+ }
+ return (Hg = p), Hg;
+ }
+ var Wg, g0;
+ function fx() {
+ if (g0) return Wg;
+ g0 = 1;
+ class e {
+ constructor(n) {
+ (this.prefix = String(n)), (this.n = 0);
+ }
+ next() {
+ return (
+ (this.n = (1 + this.n) | 0),
+ this.n < 0 && (this.n = 1),
+ this.prefix + this.n
+ );
+ }
+ }
+ return (Wg = e), Wg;
+ }
+ var Gg, v0;
+ function x5() {
+ if (v0) return Gg;
+ v0 = 1;
+ let e = P5(),
+ t = fx();
+ class n {
+ constructor(r) {
+ let a = r.id,
+ o = r.origin,
+ s = r.upper,
+ l = r.onLooped;
+ (this.id = a),
+ (this.origin = o),
+ (this.upper = s),
+ (this.childCodePaths = []),
+ Object.defineProperty(this, 'internal', {
+ value: new e(new t(a + '_'), l),
+ }),
+ s && s.childCodePaths.push(this);
+ }
+ static getState(r) {
+ return r.internal;
+ }
+ get initialSegment() {
+ return this.internal.initialSegment;
+ }
+ get finalSegments() {
+ return this.internal.finalSegments;
+ }
+ get returnedSegments() {
+ return this.internal.returnedForkContext;
+ }
+ get thrownSegments() {
+ return this.internal.thrownForkContext;
+ }
+ get currentSegments() {
+ return this.internal.currentSegments;
+ }
+ traverseSegments(r, a) {
+ let o, s;
+ typeof r == 'function' ? ((s = r), (o = {})) : ((o = r || {}), (s = a));
+ let l = o.first || this.internal.initialSegment,
+ d = o.last,
+ u = null,
+ p = 0,
+ y = 0,
+ m = null,
+ g = Object.create(null),
+ S = [[l, 0]],
+ _ = null,
+ O = !1,
+ P = {
+ skip() {
+ S.length <= 1 ? (O = !0) : (_ = S[S.length - 2][0]);
+ },
+ break() {
+ O = !0;
+ },
+ };
+ function M(w) {
+ return g[w.id] || m.isLoopedPrevSegment(w);
+ }
+ for (; S.length > 0; ) {
+ if (((u = S[S.length - 1]), (m = u[0]), (p = u[1]), p === 0)) {
+ if (g[m.id]) {
+ S.pop();
+ continue;
+ }
+ if (
+ m !== l &&
+ m.prevSegments.length > 0 &&
+ !m.prevSegments.every(M)
+ ) {
+ S.pop();
+ continue;
+ }
+ if (
+ (_ && m.prevSegments.includes(_) && (_ = null),
+ (g[m.id] = !0),
+ !_ && (s.call(this, m, P), m === d && P.skip(), O))
+ )
+ break;
+ }
+ (y = m.nextSegments.length - 1),
+ p < y
+ ? ((u[1] += 1), S.push([m.nextSegments[p], 0]))
+ : p === y
+ ? ((u[0] = m.nextSegments[p]), (u[1] = 0))
+ : S.pop();
+ }
+ }
+ }
+ return (Gg = n), Gg;
+ }
+ var Xg, h0;
+ function w5() {
+ if (h0) return Xg;
+ h0 = 1;
+ let e = dx(),
+ t = x5(),
+ n = Zh(),
+ i = fx(),
+ r = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u;
+ function a(w) {
+ return !!w.test;
+ }
+ function o(w) {
+ let I = w.parent;
+ return I && I.type === 'PropertyDefinition' && I.value === w;
+ }
+ function s(w) {
+ return w === '&&' || w === '||' || w === '??';
+ }
+ function l(w) {
+ return w === '&&=' || w === '||=' || w === '??=';
+ }
+ function d(w) {
+ return w.parent.type === 'LabeledStatement' ? w.parent.label.name : null;
+ }
+ function u(w) {
+ let I = w.parent;
+ switch (I.type) {
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ case 'WhileStatement':
+ case 'DoWhileStatement':
+ case 'ForStatement':
+ return I.test === w;
+ case 'LogicalExpression':
+ return s(I.operator);
+ case 'AssignmentExpression':
+ return l(I.operator);
+ default:
+ return !1;
+ }
+ }
+ function p(w) {
+ if (w.type === 'Literal') return !!w.value;
+ }
+ function y(w) {
+ let I = w.parent;
+ switch (I.type) {
+ case 'LabeledStatement':
+ case 'BreakStatement':
+ case 'ContinueStatement':
+ case 'ArrayPattern':
+ case 'RestElement':
+ case 'ImportSpecifier':
+ case 'ImportDefaultSpecifier':
+ case 'ImportNamespaceSpecifier':
+ case 'CatchClause':
+ return !1;
+ case 'FunctionDeclaration':
+ case 'ComponentDeclaration':
+ case 'HookDeclaration':
+ case 'FunctionExpression':
+ case 'ArrowFunctionExpression':
+ case 'ClassDeclaration':
+ case 'ClassExpression':
+ case 'VariableDeclarator':
+ return I.id !== w;
+ case 'Property':
+ case 'PropertyDefinition':
+ case 'MethodDefinition':
+ return I.key !== w || I.computed || I.shorthand;
+ case 'AssignmentPattern':
+ return I.key !== w;
+ default:
+ return !0;
+ }
+ }
+ function m(w, I) {
+ let U = w.codePath,
+ A = t.getState(U),
+ q = A.currentSegments,
+ ae = A.headSegments,
+ le = Math.max(q.length, ae.length),
+ G,
+ ve,
+ de;
+ for (G = 0; G < le; ++G)
+ (ve = q[G]),
+ (de = ae[G]),
+ ve !== de &&
+ ve &&
+ ve.reachable &&
+ w.emitter.emit('onCodePathSegmentEnd', ve, I);
+ for (A.currentSegments = ae, G = 0; G < le; ++G)
+ (ve = q[G]),
+ (de = ae[G]),
+ ve !== de &&
+ de &&
+ (n.markUsed(de),
+ de.reachable && w.emitter.emit('onCodePathSegmentStart', de, I));
+ }
+ function g(w, I) {
+ let U = t.getState(w.codePath),
+ A = U.currentSegments;
+ for (let q = 0; q < A.length; ++q) {
+ let ae = A[q];
+ ae.reachable && w.emitter.emit('onCodePathSegmentEnd', ae, I);
+ }
+ U.currentSegments = [];
+ }
+ function S(w, I) {
+ let U = w.codePath,
+ A = t.getState(U),
+ q = I.parent;
+ switch (q.type) {
+ case 'CallExpression':
+ q.optional === !0 &&
+ q.arguments.length >= 1 &&
+ q.arguments[0] === I &&
+ A.makeOptionalRight();
+ break;
+ case 'MemberExpression':
+ q.optional === !0 && q.property === I && A.makeOptionalRight();
+ break;
+ case 'LogicalExpression':
+ q.right === I && s(q.operator) && A.makeLogicalRight();
+ break;
+ case 'AssignmentExpression':
+ q.right === I && l(q.operator) && A.makeLogicalRight();
+ break;
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ q.consequent === I
+ ? A.makeIfConsequent()
+ : q.alternate === I && A.makeIfAlternate();
+ break;
+ case 'SwitchCase':
+ q.consequent[0] === I && A.makeSwitchCaseBody(!1, !q.test);
+ break;
+ case 'TryStatement':
+ q.handler === I
+ ? A.makeCatchBlock()
+ : q.finalizer === I && A.makeFinallyBlock();
+ break;
+ case 'WhileStatement':
+ q.test === I
+ ? A.makeWhileTest(p(I))
+ : (e(q.body === I), A.makeWhileBody());
+ break;
+ case 'DoWhileStatement':
+ q.body === I
+ ? A.makeDoWhileBody()
+ : (e(q.test === I), A.makeDoWhileTest(p(I)));
+ break;
+ case 'ForStatement':
+ q.test === I
+ ? A.makeForTest(p(I))
+ : q.update === I
+ ? A.makeForUpdate()
+ : q.body === I && A.makeForBody();
+ break;
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ q.left === I
+ ? A.makeForInOfLeft()
+ : q.right === I
+ ? A.makeForInOfRight()
+ : (e(q.body === I), A.makeForInOfBody());
+ break;
+ case 'AssignmentPattern':
+ q.right === I &&
+ (A.pushForkContext(), A.forkBypassPath(), A.forkPath());
+ break;
+ }
+ }
+ function _(w, I) {
+ let U = w.codePath,
+ A = U && t.getState(U),
+ q = I.parent;
+ function ae(le) {
+ U && m(w, I),
+ (U = w.codePath =
+ new t({
+ id: w.idGenerator.next(),
+ origin: le,
+ upper: U,
+ onLooped: w.onLooped,
+ })),
+ (A = t.getState(U)),
+ w.emitter.emit('onCodePathStart', U, I);
+ }
+ switch ((o(I) && ae('class-field-initializer'), I.type)) {
+ case 'Program':
+ ae('program');
+ break;
+ case 'FunctionDeclaration':
+ case 'ComponentDeclaration':
+ case 'HookDeclaration':
+ case 'FunctionExpression':
+ case 'ArrowFunctionExpression':
+ ae('function');
+ break;
+ case 'StaticBlock':
+ ae('class-static-block');
+ break;
+ case 'ChainExpression':
+ A.pushChainContext();
+ break;
+ case 'CallExpression':
+ I.optional === !0 && A.makeOptionalNode();
+ break;
+ case 'MemberExpression':
+ I.optional === !0 && A.makeOptionalNode();
+ break;
+ case 'LogicalExpression':
+ s(I.operator) && A.pushChoiceContext(I.operator, u(I));
+ break;
+ case 'AssignmentExpression':
+ l(I.operator) && A.pushChoiceContext(I.operator.slice(0, -1), u(I));
+ break;
+ case 'ConditionalExpression':
+ case 'IfStatement':
+ A.pushChoiceContext('test', !1);
+ break;
+ case 'SwitchStatement':
+ A.pushSwitchContext(I.cases.some(a), d(I));
+ break;
+ case 'TryStatement':
+ A.pushTryContext(!!I.finalizer);
+ break;
+ case 'SwitchCase':
+ q.discriminant !== I && q.cases[0] !== I && A.forkPath();
+ break;
+ case 'WhileStatement':
+ case 'DoWhileStatement':
+ case 'ForStatement':
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ A.pushLoopContext(I.type, d(I));
+ break;
+ case 'LabeledStatement':
+ r.test(I.body.type) || A.pushBreakContext(!1, I.label.name);
+ break;
+ }
+ m(w, I);
+ }
+ function O(w, I) {
+ let U = w.codePath,
+ A = t.getState(U),
+ q = !1;
+ switch (I.type) {
+ case 'ChainExpression':
+ A.popChainContext();
+ break;
+ case 'IfStatement':
+ case 'ConditionalExpression':
+ A.popChoiceContext();
+ break;
+ case 'LogicalExpression':
+ s(I.operator) && A.popChoiceContext();
+ break;
+ case 'AssignmentExpression':
+ l(I.operator) && A.popChoiceContext();
+ break;
+ case 'SwitchStatement':
+ A.popSwitchContext();
+ break;
+ case 'SwitchCase':
+ I.consequent.length === 0 && A.makeSwitchCaseBody(!0, !I.test),
+ A.forkContext.reachable && (q = !0);
+ break;
+ case 'TryStatement':
+ A.popTryContext();
+ break;
+ case 'BreakStatement':
+ m(w, I), A.makeBreak(I.label && I.label.name), (q = !0);
+ break;
+ case 'ContinueStatement':
+ m(w, I), A.makeContinue(I.label && I.label.name), (q = !0);
+ break;
+ case 'ReturnStatement':
+ m(w, I), A.makeReturn(), (q = !0);
+ break;
+ case 'ThrowStatement':
+ m(w, I), A.makeThrow(), (q = !0);
+ break;
+ case 'Identifier':
+ y(I) && (A.makeFirstThrowablePathInTryBlock(), (q = !0));
+ break;
+ case 'CallExpression':
+ case 'ImportExpression':
+ case 'MemberExpression':
+ case 'NewExpression':
+ case 'YieldExpression':
+ A.makeFirstThrowablePathInTryBlock();
+ break;
+ case 'WhileStatement':
+ case 'DoWhileStatement':
+ case 'ForStatement':
+ case 'ForInStatement':
+ case 'ForOfStatement':
+ A.popLoopContext();
+ break;
+ case 'AssignmentPattern':
+ A.popForkContext();
+ break;
+ case 'LabeledStatement':
+ r.test(I.body.type) || A.popBreakContext();
+ break;
+ }
+ q || m(w, I);
+ }
+ function P(w, I) {
+ function U() {
+ let A = w.codePath;
+ t.getState(A).makeFinal(),
+ g(w, I),
+ w.emitter.emit('onCodePathEnd', A, I),
+ (A = w.codePath = w.codePath.upper);
+ }
+ switch (I.type) {
+ case 'Program':
+ case 'FunctionDeclaration':
+ case 'ComponentDeclaration':
+ case 'HookDeclaration':
+ case 'FunctionExpression':
+ case 'ArrowFunctionExpression':
+ case 'StaticBlock': {
+ U();
+ break;
+ }
+ case 'CallExpression':
+ I.optional === !0 &&
+ I.arguments.length === 0 &&
+ t.getState(w.codePath).makeOptionalRight();
+ break;
+ }
+ o(I) && U();
+ }
+ class M {
+ constructor(I) {
+ (this.emitter = {
+ emit(U) {
+ for (
+ var A = arguments.length,
+ q = new Array(A > 1 ? A - 1 : 0),
+ ae = 1;
+ ae < A;
+ ae++
+ )
+ q[ae - 1] = arguments[ae];
+ I[U]?.(...q);
+ },
+ }),
+ (this.codePath = null),
+ (this.idGenerator = new i('s')),
+ (this.currentNode = null),
+ (this.onLooped = this.onLooped.bind(this));
+ }
+ enterNode(I) {
+ (this.currentNode = I),
+ I.parent && S(this, I),
+ _(this, I),
+ (this.currentNode = null);
+ }
+ leaveNode(I) {
+ (this.currentNode = I),
+ O(this, I),
+ P(this, I),
+ (this.currentNode = null);
+ }
+ onLooped(I, U) {
+ I.reachable &&
+ U.reachable &&
+ this.emitter.emit('onCodePathSegmentLoop', I, U, this.currentNode);
+ }
+ }
+ return (Xg = M), Xg;
+ }
+ var O5 = w5(),
+ $5 = ah(O5);
+ function j5(e) {
+ return e === 'use' || /^use[A-Z0-9]/.test(e);
+ }
+ function zm(e) {
+ if (e.type === 'Identifier') return j5(e.name);
+ if (e.type === 'MemberExpression' && !e.computed && zm(e.property)) {
+ let t = e.object,
+ n = /^[A-Z].*/;
+ return t.type === 'Identifier' && n.test(t.name);
+ } else return !1;
+ }
+ function px(e) {
+ return e.type === 'Identifier' && /^[A-Z]/.test(e.name);
+ }
+ function qh(e, t) {
+ return (
+ ('name' in e && e.name === t) ||
+ (e.type === 'MemberExpression' &&
+ 'name' in e.object &&
+ e.object.name === 'React' &&
+ 'name' in e.property &&
+ e.property.name === t)
+ );
+ }
+ function mx(e) {
+ return !!(
+ e.parent &&
+ 'callee' in e.parent &&
+ e.parent.callee &&
+ qh(e.parent.callee, 'forwardRef')
+ );
+ }
+ function yx(e) {
+ return !!(
+ e.parent &&
+ 'callee' in e.parent &&
+ e.parent.callee &&
+ qh(e.parent.callee, 'memo')
+ );
+ }
+ function Yg(e) {
+ for (; e; ) {
+ let t = gx(e);
+ if ((t && (px(t) || zm(t))) || mx(e) || yx(e)) return !0;
+ e = e.parent;
+ }
+ return !1;
+ }
+ function b0(e) {
+ for (; e; ) {
+ if (e.type === 'DoWhileStatement') return !0;
+ e = e.parent;
+ }
+ return !1;
+ }
+ function C5(e) {
+ for (; e; ) {
+ if (e.type === 'TryStatement' || e.type === 'CatchClause') return !0;
+ e = e.parent;
+ }
+ return !1;
+ }
+ function D5(e) {
+ return e.type === 'MemberExpression' &&
+ e.object.type === 'Identifier' &&
+ e.object.name === 'React' &&
+ e.property.type === 'Identifier' &&
+ !e.computed
+ ? e.property
+ : e;
+ }
+ function A5(e, t) {
+ return e.type === 'Identifier' &&
+ (e.name === 'useEffect' ||
+ e.name === 'useLayoutEffect' ||
+ e.name === 'useInsertionEffect')
+ ? !0
+ : t && e.type === 'Identifier'
+ ? t.test(e.name)
+ : !1;
+ }
+ function Qg(e) {
+ return e.type === 'Identifier' && e.name === 'useEffectEvent';
+ }
+ function k0(e, t) {
+ return e === null
+ ? 'React Hook "useEffectEvent" can only be called at the top level of your component. It cannot be passed down.'
+ : `\`${e}\` is a function created with React Hook "useEffectEvent", and can only be called from Effects and Effect Events in the same component.` +
+ (t ? '' : ' It cannot be assigned to a variable or passed down.');
+ }
+ function Mp(e) {
+ return qh(e, 'use');
+ }
+ var M5 = {
+ meta: {
+ type: 'problem',
+ docs: {
+ description: 'enforces the Rules of Hooks',
+ recommended: !0,
+ url: 'https://react.dev/reference/rules/rules-of-hooks',
+ },
+ schema: [
+ {
+ type: 'object',
+ additionalProperties: !1,
+ properties: {additionalHooks: {type: 'string'}},
+ },
+ ],
+ },
+ create(e) {
+ let t = e.settings || {},
+ n = T0(t),
+ i = null,
+ r = [],
+ a = [],
+ o = new WeakSet();
+ function s(y) {
+ for (let m of y.references) {
+ let g = m.identifier.parent;
+ if (
+ g?.type === 'VariableDeclarator' &&
+ g.init &&
+ g.init.type === 'CallExpression' &&
+ g.init.callee &&
+ Qg(g.init.callee)
+ ) {
+ if (m.resolved === null)
+ throw new Error('Unexpected null reference.resolved');
+ for (let S of m.resolved.references) S !== m && o.add(S.identifier);
+ }
+ }
+ }
+ let l =
+ typeof e.getSourceCode == 'function'
+ ? () => e.getSourceCode()
+ : () => e.sourceCode,
+ d =
+ typeof e.getScope == 'function'
+ ? () => e.getScope()
+ : (y) => l().getScope(y);
+ function u(y, m) {
+ let S = l().getAllComments(),
+ _ = new RegExp('\\$FlowFixMe\\[' + m + '\\]');
+ return S.some(
+ (O) =>
+ _.test(O.value) &&
+ O.loc != null &&
+ y.loc != null &&
+ O.loc.end.line === y.loc.start.line - 1
+ );
+ }
+ let p = new $5({
+ onCodePathSegmentStart: (y) => a.push(y),
+ onCodePathSegmentEnd: () => a.pop(),
+ onCodePathStart: () => r.push(new Map()),
+ onCodePathEnd(y, m) {
+ let g = r.pop();
+ if (g?.size === 0) return;
+ if (typeof g > 'u')
+ throw new Error('Unexpected undefined reactHooksMap');
+ let S = new Set();
+ function _(q, ae) {
+ let {cache: le} = _,
+ G = le.get(q.id),
+ ve = new Set(ae);
+ if (ve.has(q.id)) {
+ let de = [...ve],
+ oe = de.slice(de.indexOf(q.id) + 1);
+ for (let be of oe) S.add(be);
+ return BigInt('0');
+ }
+ if ((ve.add(q.id), G !== void 0)) return G;
+ if (y.thrownSegments.includes(q)) G = BigInt('0');
+ else if (q.prevSegments.length === 0) G = BigInt('1');
+ else {
+ G = BigInt('0');
+ for (let de of q.prevSegments) G += _(de, ve);
+ }
+ return (
+ q.reachable && G === BigInt('0')
+ ? le.delete(q.id)
+ : le.set(q.id, G),
+ G
+ );
+ }
+ function O(q, ae) {
+ let {cache: le} = O,
+ G = le.get(q.id),
+ ve = new Set(ae);
+ if (ve.has(q.id)) {
+ let de = Array.from(ve),
+ oe = de.slice(de.indexOf(q.id) + 1);
+ for (let be of oe) S.add(be);
+ return BigInt('0');
+ }
+ if ((ve.add(q.id), G !== void 0)) return G;
+ if (y.thrownSegments.includes(q)) G = BigInt('0');
+ else if (q.nextSegments.length === 0) G = BigInt('1');
+ else {
+ G = BigInt('0');
+ for (let de of q.nextSegments) G += O(de, ve);
+ }
+ return le.set(q.id, G), G;
+ }
+ function P(q) {
+ let {cache: ae} = P,
+ le = ae.get(q.id);
+ if (le === null) return 1 / 0;
+ if (le !== void 0) return le;
+ if ((ae.set(q.id, null), q.prevSegments.length === 0)) le = 1;
+ else {
+ le = 1 / 0;
+ for (let G of q.prevSegments) {
+ let ve = P(G);
+ ve < le && (le = ve);
+ }
+ le += 1;
+ }
+ return ae.set(q.id, le), le;
+ }
+ (_.cache = new Map()), (O.cache = new Map()), (P.cache = new Map());
+ let M = O(y.initialSegment),
+ w = gx(m),
+ I = Yg(m),
+ U = w ? px(w) || zm(w) : mx(m) || yx(m),
+ A = 1 / 0;
+ for (let q of y.finalSegments) {
+ if (!q.reachable) continue;
+ let ae = P(q);
+ ae < A && (A = ae);
+ }
+ for (let [q, ae] of g) {
+ if (!q.reachable) continue;
+ let le = q.nextSegments.length === 0 ? A <= P(q) : A < P(q),
+ G = _(q) * O(q),
+ ve = S.has(q.id);
+ for (let de of ae)
+ if (!u(de, 'react-rule-hook')) {
+ if (
+ (Mp(de) &&
+ C5(de) &&
+ e.report({
+ node: de,
+ message: `React Hook "${l().getText(
+ de
+ )}" cannot be called in a try/catch block.`,
+ }),
+ (ve || b0(de)) &&
+ !Mp(de) &&
+ e.report({
+ node: de,
+ message: `React Hook "${l().getText(
+ de
+ )}" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render.`,
+ }),
+ U)
+ ) {
+ if (
+ (m.async &&
+ e.report({
+ node: de,
+ message: `React Hook "${l().getText(
+ de
+ )}" cannot be called in an async function.`,
+ }),
+ !ve && G !== M && !Mp(de) && !b0(de))
+ ) {
+ let be =
+ `React Hook "${l().getText(
+ de
+ )}" is called conditionally. React Hooks must be called in the exact same order in every component render.` +
+ (le
+ ? ' Did you accidentally call a React Hook after an early return?'
+ : '');
+ e.report({node: de, message: be});
+ }
+ } else if (
+ m.parent != null &&
+ (m.parent.type === 'MethodDefinition' ||
+ m.parent.type === 'ClassProperty' ||
+ m.parent.type === 'PropertyDefinition') &&
+ m.parent.value === m
+ ) {
+ let oe = `React Hook "${l().getText(
+ de
+ )}" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function.`;
+ e.report({node: de, message: oe});
+ } else if (w) {
+ let oe = `React Hook "${l().getText(
+ de
+ )}" is called in function "${l().getText(
+ w
+ )}" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".`;
+ e.report({node: de, message: oe});
+ } else if (m.type === 'Program') {
+ let oe = `React Hook "${l().getText(
+ de
+ )}" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.`;
+ e.report({node: de, message: oe});
+ } else if (I && !Mp(de)) {
+ let oe = `React Hook "${l().getText(
+ de
+ )}" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.`;
+ e.report({node: de, message: oe});
+ }
+ }
+ }
+ },
+ });
+ return {
+ '*'(y) {
+ p.enterNode(y);
+ },
+ '*:exit'(y) {
+ p.leaveNode(y);
+ },
+ CallExpression(y) {
+ var m, g;
+ if (zm(y.callee)) {
+ let _ = S0(r),
+ O = S0(a),
+ P = _.get(O);
+ P || ((P = []), _.set(O, P)), P.push(y.callee);
+ }
+ let S = D5(y.callee);
+ if (
+ ((A5(S, n) || Qg(S)) && y.arguments.length > 0 && (i = y),
+ Qg(S) &&
+ ((m = y.parent) === null || m === void 0 ? void 0 : m.type) !==
+ 'VariableDeclarator' &&
+ ((g = y.parent) === null || g === void 0 ? void 0 : g.type) !==
+ 'ExpressionStatement')
+ ) {
+ let _ = k0(null, !1);
+ e.report({node: y, message: _});
+ }
+ },
+ Identifier(y) {
+ if (i == null && o.has(y)) {
+ let m = k0(l().getText(y), y.parent.type === 'CallExpression');
+ e.report({node: y, message: m});
+ }
+ },
+ 'CallExpression:exit'(y) {
+ y === i && (i = null);
+ },
+ FunctionDeclaration(y) {
+ Yg(y) && s(d(y));
+ },
+ ArrowFunctionExpression(y) {
+ Yg(y) && s(d(y));
+ },
+ };
+ },
+ };
+ function gx(e) {
+ var t, n, i, r;
+ return e.type === 'ComponentDeclaration' ||
+ e.type === 'HookDeclaration' ||
+ e.type === 'FunctionDeclaration' ||
+ (e.type === 'FunctionExpression' && e.id)
+ ? e.id
+ : e.type === 'FunctionExpression' || e.type === 'ArrowFunctionExpression'
+ ? ((t = e.parent) === null || t === void 0 ? void 0 : t.type) ===
+ 'VariableDeclarator' && e.parent.init === e
+ ? e.parent.id
+ : ((n = e.parent) === null || n === void 0 ? void 0 : n.type) ===
+ 'AssignmentExpression' &&
+ e.parent.right === e &&
+ e.parent.operator === '='
+ ? e.parent.left
+ : ((i = e.parent) === null || i === void 0 ? void 0 : i.type) ===
+ 'Property' &&
+ e.parent.value === e &&
+ !e.parent.computed
+ ? e.parent.key
+ : ((r = e.parent) === null || r === void 0 ? void 0 : r.type) ===
+ 'AssignmentPattern' &&
+ e.parent.right === e &&
+ !e.parent.computed
+ ? e.parent.left
+ : void 0
+ : void 0;
+ }
+ function S0(e) {
+ return e[e.length - 1];
+ }
+ var N5 = Object.assign(
+ {'exhaustive-deps': PF, 'rules-of-hooks': M5},
+ Object.fromEntries(Object.entries(_5).map(([e, t]) => [e, t.rule]))
+ ),
+ vx = {
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'warn',
+ },
+ R5 = Object.fromEntries(
+ Object.entries(T5).map(([e, t]) => [`react-hooks/${e}`, ux(t.severity)])
+ ),
+ L5 = Object.fromEntries(
+ Object.entries(E5).map(([e, t]) => [`react-hooks/${e}`, ux(t.severity)])
+ ),
+ F5 = Object.assign(Object.assign({}, vx), R5),
+ z5 = Object.assign(Object.assign({}, vx), L5),
+ _0 = ['react-hooks'],
+ hm = {
+ recommended: {plugins: _0, rules: F5},
+ 'recommended-latest': {plugins: _0, rules: z5},
+ flat: {},
+ },
+ ih = {
+ meta: {name: 'eslint-plugin-react-hooks', version: '7.0.0'},
+ rules: N5,
+ configs: hm,
+ };
+ Object.assign(hm.flat, {
+ 'recommended-latest': {
+ plugins: {'react-hooks': ih},
+ rules: hm['recommended-latest'].rules,
+ },
+ recommended: {plugins: {'react-hooks': ih}, rules: hm.recommended.rules},
+ });
+ hx.exports = ih;
+});
+var Sx = xe((VK, kx) => {
+ 'use strict';
+ kx.exports = bx();
+});
+var _x = Sx(),
+ B5 = _x.rules['rules-of-hooks'],
+ U5 = _x.rules['exhaustive-deps'],
+ JK = {rules: {'rules-of-hooks': B5, 'exhaustive-deps': U5}};
+export {JK as reactHooksPlugin};
+/*! Bundled license information:
+
+eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js:
+ (**
+ * @license React
+ * eslint-plugin-react-hooks.production.js
+ *
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *)
+ (*! *****************************************************************************
+ Copyright (c) Microsoft Corporation.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+ ***************************************************************************** *)
+*/
diff --git a/src/components/MDX/Sandpack/generatedTheme.ts b/src/components/MDX/Sandpack/generatedTheme.ts
new file mode 100644
index 00000000000..abf43c73ff9
--- /dev/null
+++ b/src/components/MDX/Sandpack/generatedTheme.ts
@@ -0,0 +1,14 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// This file is generated by scripts/buildSandpackTheme.mjs.
+
+export const sandpackThemeFonts = {
+ body: 'Optimistic Text, -apple-system, ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji',
+ mono: 'Source Code Pro, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace',
+ size: 'calc(1em - 20%)',
+} as const;
diff --git a/src/components/MDX/Sandpack/index.tsx b/src/components/MDX/Sandpack/index.tsx
index a8b802cec75..665d441f051 100644
--- a/src/components/MDX/Sandpack/index.tsx
+++ b/src/components/MDX/Sandpack/index.tsx
@@ -9,10 +9,9 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-import {lazy, memo, Children, Suspense} from 'react';
+import {memo, Children, Suspense} from 'react';
import {AppJSPath, createFileMap} from './createFileMap';
-
-const SandpackRoot = lazy(() => import('./SandpackRoot'));
+import SandpackRoot from './SandpackRoot';
const SandpackGlimmer = ({code}: {code: string}) => (
@@ -53,53 +52,62 @@ const SandpackGlimmer = ({code}: {code: string}) => (
);
export const SandpackClient = memo(function SandpackWrapper(props: any): any {
- const codeSnippet = createFileMap(Children.toArray(props.children));
+ const files = createFileMap(Children.toArray(props.children));
+ const providedFiles = Object.keys(files);
// To set the active file in the fallback we have to find the active file first.
// If there are no active files we fallback to App.js as default.
- let activeCodeSnippet = Object.keys(codeSnippet).filter(
+ let activeCodeSnippet = Object.keys(files).filter(
(fileName) =>
- codeSnippet[fileName]?.active === true &&
- codeSnippet[fileName]?.hidden === false
+ files[fileName]?.active === true && files[fileName]?.hidden === false
);
let activeCode;
if (!activeCodeSnippet.length) {
- activeCode = codeSnippet[AppJSPath].code;
+ activeCode = files[AppJSPath]?.code ?? '';
} else {
- activeCode = codeSnippet[activeCodeSnippet[0]].code;
+ activeCode = files[activeCodeSnippet[0]]?.code ?? '';
}
return (
}>
-
+
);
});
-const SandpackRSCRoot = lazy(() => import('./SandpackRSCRoot'));
+import SandpackRSCRoot from './SandpackRSCRoot';
export const SandpackRSC = memo(function SandpackRSCWrapper(props: {
children: React.ReactNode;
+ autorun?: boolean;
}): any {
- const codeSnippet = createFileMap(Children.toArray(props.children));
+ const files = createFileMap(Children.toArray(props.children));
+ const providedFiles = Object.keys(files);
// To set the active file in the fallback we have to find the active file first.
// If there are no active files we fallback to App.js as default.
- let activeCodeSnippet = Object.keys(codeSnippet).filter(
+ let activeCodeSnippet = Object.keys(files).filter(
(fileName) =>
- codeSnippet[fileName]?.active === true &&
- codeSnippet[fileName]?.hidden === false
+ files[fileName]?.active === true && files[fileName]?.hidden === false
);
let activeCode;
if (!activeCodeSnippet.length) {
- activeCode = codeSnippet[AppJSPath]?.code ?? '';
+ activeCode = files[AppJSPath]?.code ?? '';
} else {
- activeCode = codeSnippet[activeCodeSnippet[0]].code;
+ activeCode = files[activeCodeSnippet[0]]?.code ?? '';
}
return (
}>
- {props.children}
+
);
});
diff --git a/src/components/MDX/Sandpack/runESLint.tsx b/src/components/MDX/Sandpack/runESLint.tsx
index 667b22d7eb2..c978f3a699c 100644
--- a/src/components/MDX/Sandpack/runESLint.tsx
+++ b/src/components/MDX/Sandpack/runESLint.tsx
@@ -7,10 +7,11 @@
// @ts-nocheck
-import {Linter} from 'eslint/lib/linter/linter';
+import {Linter} from 'eslint-linter-browserify';
import type {Diagnostic} from '@codemirror/lint';
import type {Text} from '@codemirror/text';
+import {reactHooksPlugin} from './generatedHooksLint';
const getCodeMirrorPosition = (
doc: Text,
@@ -21,29 +22,33 @@ const getCodeMirrorPosition = (
const linter = new Linter();
-const reactRules = require('eslint-plugin-react-hooks').rules;
-linter.defineRules({
- 'react-hooks/rules-of-hooks': reactRules['rules-of-hooks'],
- 'react-hooks/exhaustive-deps': reactRules['exhaustive-deps'],
-});
-
-const options = {
- parserOptions: {
- ecmaVersion: 12,
- sourceType: 'module',
- ecmaFeatures: {jsx: true},
- },
- rules: {
- 'react-hooks/rules-of-hooks': 'error',
- 'react-hooks/exhaustive-deps': 'error',
+const options = [
+ {
+ files: ['**/*.{js,jsx,ts,tsx}'],
+ plugins: {
+ 'react-hooks': reactHooksPlugin,
+ },
+ languageOptions: {
+ ecmaVersion: 2022,
+ sourceType: 'module',
+ parserOptions: {
+ ecmaFeatures: {jsx: true},
+ },
+ },
+ rules: {
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'error',
+ },
},
-};
+];
export const runESLint = (
doc: Text
): {errors: any[]; codeMirrorErrors: Diagnostic[]} => {
const codeString = doc.toString();
- const errors = linter.verify(codeString, options) as any[];
+ const errors = linter.verify(codeString, options, {
+ filename: 'SandpackEditor.jsx',
+ }) as any[];
const severity = {
1: 'warning',
diff --git a/src/components/MDX/Sandpack/sandpack-rsc/RscFileBridge.tsx b/src/components/MDX/Sandpack/sandpack-rsc/RscFileBridge.tsx
index cca545a40d0..4b73e895c73 100644
--- a/src/components/MDX/Sandpack/sandpack-rsc/RscFileBridge.tsx
+++ b/src/components/MDX/Sandpack/sandpack-rsc/RscFileBridge.tsx
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-import {useEffect, useRef} from 'react';
+import {useEffect, useLayoutEffect, useRef} from 'react';
import {useSandpack} from '@codesandbox/sandpack-react/unstyled';
/**
@@ -17,9 +17,11 @@ export function RscFileBridge() {
const {sandpack, dispatch, listen} = useSandpack();
const filesRef = useRef(sandpack.files);
- // TODO: fix this with useEffectEvent
- // eslint-disable-next-line react-compiler/react-compiler
- filesRef.current = sandpack.files;
+ // Keep the latest file map available before passive effects can observe a
+ // completed bundle and dispatch it to the iframe.
+ useLayoutEffect(() => {
+ filesRef.current = sandpack.files;
+ }, [sandpack.files]);
useEffect(() => {
const unsubscribe = listen((msg: any) => {
diff --git a/src/components/MDX/Sandpack/sandpack-rsc/generatedSources.ts b/src/components/MDX/Sandpack/sandpack-rsc/generatedSources.ts
new file mode 100644
index 00000000000..859a74e1928
--- /dev/null
+++ b/src/components/MDX/Sandpack/sandpack-rsc/generatedSources.ts
@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+// This file is generated by scripts/buildRscWorker.mjs.
+
+export const REACT_REFRESH_INIT_SOURCE =
+ "// Must run before React loads. Creates __REACT_DEVTOOLS_GLOBAL_HOOK__ so\n// React's renderer injects into it, enabling react-refresh to work.\nif (typeof window !== 'undefined' && !window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {\n var nextID = 0;\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n var id = nextID++;\n this.renderers.set(id, injected);\n return id;\n },\n onScheduleFiberRoot: function () {},\n onCommitFiberRoot: function () {},\n onCommitFiberUnmount: function () {},\n };\n}\n" as string;
+export const RSC_CLIENT_SOURCE =
+ "// RSC Client Entry Point\n// Runs inside the Sandpack iframe. Orchestrates the RSC pipeline:\n// 1. Creates a Web Worker from pre-bundled server runtime\n// 2. Receives file updates from parent (RscFileBridge) via postMessage\n// 3. Sends all user files to Worker for directive detection + compilation\n// 4. Worker compiles with Sucrase + executes, sends back Flight chunks\n// 5. Renders the Flight stream result with React\n\n// Minimal webpack shim for RSDW compatibility.\n// Works in both browser (window) and worker (self) contexts via globalThis.\n\nimport * as React from 'react';\nimport * as ReactJSXRuntime from 'react/jsx-runtime';\nimport * as ReactJSXDevRuntime from 'react/jsx-dev-runtime';\nimport {useState, startTransition, use} from 'react';\nimport {jsx} from 'react/jsx-runtime';\nimport {createRoot} from 'react-dom/client';\n\nimport rscServerForWorker from './rsc-server.js';\n\nimport './__webpack_shim__';\nimport {\n createFromReadableStream,\n encodeReply,\n} from 'react-server-dom-webpack/client.browser';\n\nimport {\n injectIntoGlobalHook,\n register as refreshRegister,\n performReactRefresh,\n isLikelyComponentType,\n} from 'react-refresh/runtime';\n\n// Patch the DevTools hook to capture renderer helpers and track roots.\n// Must run after react-dom evaluates (injects renderer) but before createRoot().\ninjectIntoGlobalHook(window);\n\nexport function initClient() {\n // Create Worker from pre-bundled server runtime\n var blob = new Blob([rscServerForWorker], {type: 'application/javascript'});\n var workerUrl = URL.createObjectURL(blob);\n var worker = new Worker(workerUrl);\n\n // Render tracking\n var nextStreamId = 0;\n var chunkControllers = {};\n var setCurrentPromise;\n var firstRender = true;\n var workerReady = false;\n var pendingFiles = null;\n\n function Root({initialPromise}) {\n var _state = useState(initialPromise);\n setCurrentPromise = _state[1];\n return use(_state[0]);\n }\n\n // Set up React root\n var initialResolve;\n var initialPromise = new Promise(function (resolve) {\n initialResolve = resolve;\n });\n\n var rootEl = document.getElementById('root');\n if (!rootEl) throw new Error('#root element not found');\n var root = createRoot(rootEl, {\n onUncaughtError: function (error) {\n var msg =\n error && error.digest\n ? error.digest\n : error && error.message\n ? error.message\n : String(error);\n console.error(msg);\n showError(msg);\n },\n });\n startTransition(function () {\n root.render(jsx(Root, {initialPromise: initialPromise}));\n });\n\n // Error overlay — rendered inside the iframe via DOM so it doesn't\n // interfere with Sandpack's parent-frame message protocol.\n function showError(message) {\n var overlay = document.getElementById('rsc-error-overlay');\n if (!overlay) {\n overlay = document.createElement('div');\n overlay.id = 'rsc-error-overlay';\n overlay.style.cssText =\n 'background:#fff;border:2px solid #c00;border-radius:8px;padding:16px;margin:20px;font-family:sans-serif;';\n var heading = document.createElement('h2');\n heading.style.cssText = 'color:#c00;margin:0 0 8px;font-size:16px;';\n heading.textContent = 'Server Error';\n overlay.appendChild(heading);\n var pre = document.createElement('pre');\n pre.style.cssText =\n 'margin:0;white-space:pre-wrap;word-break:break-word;font-size:14px;color:#222;';\n overlay.appendChild(pre);\n rootEl.parentNode.insertBefore(overlay, rootEl);\n }\n overlay.lastChild.textContent = message;\n overlay.style.display = '';\n rootEl.style.display = 'none';\n }\n\n function clearError() {\n var overlay = document.getElementById('rsc-error-overlay');\n if (overlay) overlay.style.display = 'none';\n rootEl.style.display = '';\n }\n\n // Worker message handler\n worker.onmessage = function (e) {\n var msg = e.data;\n if (msg.type === 'ready') {\n workerReady = true;\n if (pendingFiles) {\n processFiles(pendingFiles);\n pendingFiles = null;\n }\n } else if (msg.type === 'deploy-result') {\n clearError();\n // Register compiled client modules in the webpack cache before rendering\n if (msg.result && msg.result.compiledClients) {\n registerClientModules(\n msg.result.compiledClients,\n msg.result.clientEntries || {}\n );\n }\n triggerRender();\n } else if (msg.type === 'rsc-chunk') {\n handleChunk(msg);\n } else if (msg.type === 'rsc-error') {\n showError(msg.error);\n }\n };\n\n function callServer(id, args) {\n return encodeReply(args).then(function (body) {\n nextStreamId++;\n var reqId = nextStreamId;\n\n var stream = new ReadableStream({\n start: function (controller) {\n chunkControllers[reqId] = controller;\n },\n });\n\n // FormData is not structured-cloneable for postMessage.\n // Serialize to an array of entries; the worker reconstructs it.\n var encodedArgs;\n if (typeof body === 'string') {\n encodedArgs = body;\n } else {\n var entries = [];\n body.forEach(function (value, key) {\n entries.push([key, value]);\n });\n encodedArgs = {__formData: entries};\n }\n\n worker.postMessage({\n type: 'callAction',\n requestId: reqId,\n actionId: id,\n encodedArgs: encodedArgs,\n });\n\n var response = createFromReadableStream(stream, {\n callServer: callServer,\n });\n\n // Update UI with re-rendered root\n startTransition(function () {\n updateUI(\n Promise.resolve(response).then(function (v) {\n return v.root;\n })\n );\n });\n\n // Return action's return value (for useActionState support)\n return Promise.resolve(response).then(function (v) {\n return v.returnValue;\n });\n });\n }\n\n function triggerRender() {\n // Close any in-flight streams from previous renders\n Object.keys(chunkControllers).forEach(function (id) {\n try {\n chunkControllers[id].close();\n } catch (e) {}\n delete chunkControllers[id];\n });\n\n nextStreamId++;\n var reqId = nextStreamId;\n\n var stream = new ReadableStream({\n start: function (controller) {\n chunkControllers[reqId] = controller;\n },\n });\n\n worker.postMessage({type: 'render', requestId: reqId});\n\n var promise = createFromReadableStream(stream, {\n callServer: callServer,\n });\n\n updateUI(promise);\n }\n\n function handleChunk(msg) {\n var ctrl = chunkControllers[msg.requestId];\n if (!ctrl) return;\n if (msg.done) {\n ctrl.close();\n delete chunkControllers[msg.requestId];\n } else {\n ctrl.enqueue(msg.chunk);\n }\n }\n\n function updateUI(promise) {\n if (firstRender) {\n firstRender = false;\n if (initialResolve) initialResolve(promise);\n } else {\n startTransition(function () {\n if (setCurrentPromise) setCurrentPromise(promise);\n });\n }\n }\n\n // File update handler — receives raw file contents from RscFileBridge\n window.addEventListener('message', function (e) {\n var msg = e.data;\n if (msg.type !== 'rsc-file-update') return;\n if (!workerReady) {\n pendingFiles = msg.files;\n return;\n }\n processFiles(msg.files);\n });\n\n function processFiles(files) {\n console.clear();\n var userFiles = {};\n Object.keys(files).forEach(function (filePath) {\n if (!filePath.match(/\\.(js|jsx|ts|tsx)$/)) return;\n if (filePath.indexOf('node_modules') !== -1) return;\n if (filePath === '/src/index.js') return;\n if (filePath === '/src/rsc-client.js') return;\n if (filePath === '/src/rsc-server.js') return;\n if (filePath === '/src/__webpack_shim__.js') return;\n if (filePath === '/src/__react_refresh_init__.js') return;\n userFiles[filePath] = files[filePath];\n });\n worker.postMessage({\n type: 'deploy',\n files: userFiles,\n });\n }\n\n // Resolve relative paths (e.g., './Button' from '/src/Counter.js' → '/src/Button')\n function resolvePath(from, to) {\n if (!to.startsWith('.')) return to;\n var parts = from.split('/');\n parts.pop();\n var toParts = to.split('/');\n for (var i = 0; i < toParts.length; i++) {\n if (toParts[i] === '.') continue;\n if (toParts[i] === '..') {\n parts.pop();\n continue;\n }\n parts.push(toParts[i]);\n }\n return parts.join('/');\n }\n\n // Evaluate compiled client modules and register them in the webpack cache\n // so RSDW client can resolve them via __webpack_require__.\n function registerClientModules(compiledClients, clientEntries) {\n // Clear stale client modules from previous deploys\n Object.keys(globalThis.__webpack_module_cache__).forEach(function (key) {\n delete globalThis.__webpack_module_cache__[key];\n });\n\n // Store all compiled code for lazy evaluation\n var allCompiled = compiledClients;\n\n function evaluateModule(moduleId) {\n if (globalThis.__webpack_module_cache__[moduleId]) {\n var cached = globalThis.__webpack_module_cache__[moduleId];\n return cached.exports !== undefined ? cached.exports : cached;\n }\n var code = allCompiled[moduleId];\n if (!code)\n throw new Error('Client require: module \"' + moduleId + '\" not found');\n\n var mod = {exports: {}};\n // Register before evaluating to handle circular deps\n var cacheEntry = {exports: mod.exports};\n globalThis.__webpack_module_cache__[moduleId] = cacheEntry;\n\n var clientRequire = function (id) {\n if (id === 'react') return React;\n if (id === 'react/jsx-runtime') return ReactJSXRuntime;\n if (id === 'react/jsx-dev-runtime') return ReactJSXDevRuntime;\n if (id.endsWith('.css')) return {};\n var resolvedId = id.startsWith('.') ? resolvePath(moduleId, id) : id;\n var candidates = [resolvedId];\n var exts = ['.js', '.jsx', '.ts', '.tsx'];\n for (var i = 0; i < exts.length; i++) {\n candidates.push(resolvedId + exts[i]);\n }\n for (var j = 0; j < candidates.length; j++) {\n if (\n allCompiled[candidates[j]] ||\n globalThis.__webpack_module_cache__[candidates[j]]\n ) {\n return evaluateModule(candidates[j]);\n }\n }\n throw new Error('Client require: module \"' + id + '\" not found');\n };\n\n try {\n new Function('module', 'exports', 'require', 'React', code)(\n mod,\n mod.exports,\n clientRequire,\n React\n );\n } catch (err) {\n console.error('Error executing client module ' + moduleId + ':', err);\n return mod.exports;\n }\n // Update the SAME cache entry's exports (don't replace the wrapper)\n cacheEntry.exports = mod.exports;\n return mod.exports;\n }\n\n // Eagerly evaluate 'use client' entry points; their imports resolve lazily\n Object.keys(clientEntries).forEach(function (moduleId) {\n evaluateModule(moduleId);\n });\n\n // Register all evaluated components with react-refresh for Fast Refresh.\n // This creates stable \"component families\" so React can preserve state\n // across re-evaluations when component identity changes.\n Object.keys(globalThis.__webpack_module_cache__).forEach(function (\n moduleId\n ) {\n var moduleExports = globalThis.__webpack_module_cache__[moduleId];\n var exports =\n moduleExports.exports !== undefined\n ? moduleExports.exports\n : moduleExports;\n if (exports && typeof exports === 'object') {\n for (var key in exports) {\n var exportValue = exports[key];\n if (isLikelyComponentType(exportValue)) {\n refreshRegister(exportValue, moduleId + ' %exports% ' + key);\n }\n }\n }\n if (typeof exports === 'function' && isLikelyComponentType(exports)) {\n refreshRegister(exports, moduleId + ' %exports% default');\n }\n });\n\n // Tell React about updated component families so it can\n // preserve state for components whose implementation changed.\n performReactRefresh();\n }\n}\n" as string;
+export const RSDW_CLIENT_SOURCE =
+ '/**\n * @license React\n * react-server-dom-webpack-client.browser.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n"use strict";\nvar ReactDOM = require("react-dom"),\n decoderOptions = { stream: !0 },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction resolveClientReference(bundlerConfig, metadata) {\n if (bundlerConfig) {\n var moduleExports = bundlerConfig[metadata[0]];\n if ((bundlerConfig = moduleExports && moduleExports[metadata[2]]))\n moduleExports = bundlerConfig.name;\n else {\n bundlerConfig = moduleExports && moduleExports["*"];\n if (!bundlerConfig)\n throw Error(\n \'Could not find the module "\' +\n metadata[0] +\n \'" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.\'\n );\n moduleExports = metadata[2];\n }\n return 4 === metadata.length\n ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1]\n : [bundlerConfig.id, bundlerConfig.chunks, moduleExports];\n }\n return metadata;\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = "",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf("#");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n \'Could not find the module "\' +\n id +\n \'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.\'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = __webpack_require__(id);\n if ("function" !== typeof promise.then || "fulfilled" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = "fulfilled";\n promise.value = value;\n },\n function (reason) {\n promise.status = "rejected";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++],\n chunkFilename = chunks[i++],\n entry = chunkCache.get(chunkId);\n void 0 === entry\n ? (chunkMap.set(chunkId, chunkFilename),\n (chunkFilename = __webpack_chunk_load__(chunkId)),\n promises.push(chunkFilename),\n (entry = chunkCache.set.bind(chunkCache, chunkId, null)),\n chunkFilename.then(entry, ignoreReject),\n chunkCache.set(chunkId, chunkFilename))\n : null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = __webpack_require__(metadata[0]);\n if (4 === metadata.length && "function" === typeof moduleExports.then)\n if ("fulfilled" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n if ("*" === metadata[2]) return moduleExports;\n if ("" === metadata[2])\n return moduleExports.__esModule ? moduleExports.default : moduleExports;\n if (hasOwnProperty.call(moduleExports, metadata[2]))\n return moduleExports[metadata[2]];\n}\nvar chunkMap = new Map(),\n webpackGetChunkFilename = __webpack_require__.u;\n__webpack_require__.u = function (chunkId) {\n var flightChunk = chunkMap.get(chunkId);\n return void 0 !== flightChunk\n ? flightChunk\n : webpackGetChunkFilename(chunkId);\n};\nvar ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),\n REACT_LAZY_TYPE = Symbol.for("react.lazy"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || "object" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable["@@iterator"];\n return "function" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf,\n ObjectPrototype = Object.prototype,\n knownServerReferences = new WeakMap();\nfunction serializeNumber(number) {\n return Number.isFinite(number)\n ? 0 === number && -Infinity === 1 / number\n ? "$-0"\n : number\n : Infinity === number\n ? "$Infinity"\n : -Infinity === number\n ? "$-Infinity"\n : "$NaN";\n}\nfunction processReply(\n root,\n formFieldPrefix,\n temporaryReferences,\n resolve,\n reject\n) {\n function serializeTypedArray(tag, typedArray) {\n typedArray = new Blob([\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n ]);\n var blobId = nextPartId++;\n null === formData && (formData = new FormData());\n formData.append(formFieldPrefix + blobId, typedArray);\n return "$" + tag + blobId.toString(16);\n }\n function serializeBinaryReader(reader) {\n function progress(entry) {\n entry.done\n ? ((entry = nextPartId++),\n data.append(formFieldPrefix + entry, new Blob(buffer)),\n data.append(\n formFieldPrefix + streamId,\n \'"$o\' + entry.toString(16) + \'"\'\n ),\n data.append(formFieldPrefix + streamId, "C"),\n pendingParts--,\n 0 === pendingParts && resolve(data))\n : (buffer.push(entry.value),\n reader.read(new Uint8Array(1024)).then(progress, reject));\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++,\n buffer = [];\n reader.read(new Uint8Array(1024)).then(progress, reject);\n return "$r" + streamId.toString(16);\n }\n function serializeReader(reader) {\n function progress(entry) {\n if (entry.done)\n data.append(formFieldPrefix + streamId, "C"),\n pendingParts--,\n 0 === pendingParts && resolve(data);\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON);\n reader.read().then(progress, reject);\n } catch (x) {\n reject(x);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n reader.read().then(progress, reject);\n return "$R" + streamId.toString(16);\n }\n function serializeReadableStream(stream) {\n try {\n var binaryReader = stream.getReader({ mode: "byob" });\n } catch (x) {\n return serializeReader(stream.getReader());\n }\n return serializeBinaryReader(binaryReader);\n }\n function serializeAsyncIterable(iterable, iterator) {\n function progress(entry) {\n if (entry.done) {\n if (void 0 === entry.value)\n data.append(formFieldPrefix + streamId, "C");\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, "C" + partJSON);\n } catch (x) {\n reject(x);\n return;\n }\n pendingParts--;\n 0 === pendingParts && resolve(data);\n } else\n try {\n var partJSON$21 = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON$21);\n iterator.next().then(progress, reject);\n } catch (x$22) {\n reject(x$22);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n iterable = iterable === iterator;\n iterator.next().then(progress, reject);\n return "$" + (iterable ? "x" : "X") + streamId.toString(16);\n }\n function resolveToJSON(key, value) {\n if (null === value) return null;\n if ("object" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n if (void 0 !== temporaryReferences && -1 === key.indexOf(":")) {\n var parentReference = writtenObjects.get(this);\n if (void 0 !== parentReference)\n return (\n temporaryReferences.set(parentReference + ":" + key, value),\n "$T"\n );\n }\n throw Error(\n "React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options."\n );\n case REACT_LAZY_TYPE:\n parentReference = value._payload;\n var init = value._init;\n null === formData && (formData = new FormData());\n pendingParts++;\n try {\n var resolvedModel = init(parentReference),\n lazyId = nextPartId++,\n partJSON = serializeModel(resolvedModel, lazyId);\n formData.append(formFieldPrefix + lazyId, partJSON);\n return "$" + lazyId.toString(16);\n } catch (x) {\n if (\n "object" === typeof x &&\n null !== x &&\n "function" === typeof x.then\n ) {\n pendingParts++;\n var lazyId$23 = nextPartId++;\n parentReference = function () {\n try {\n var partJSON$24 = serializeModel(value, lazyId$23),\n data$25 = formData;\n data$25.append(formFieldPrefix + lazyId$23, partJSON$24);\n pendingParts--;\n 0 === pendingParts && resolve(data$25);\n } catch (reason) {\n reject(reason);\n }\n };\n x.then(parentReference, parentReference);\n return "$" + lazyId$23.toString(16);\n }\n reject(x);\n return null;\n } finally {\n pendingParts--;\n }\n }\n parentReference = writtenObjects.get(value);\n if ("function" === typeof value.then) {\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n null === formData && (formData = new FormData());\n pendingParts++;\n var promiseId = nextPartId++;\n key = "$@" + promiseId.toString(16);\n writtenObjects.set(value, key);\n value.then(function (partValue) {\n try {\n var previousReference = writtenObjects.get(partValue);\n var partJSON$27 =\n void 0 !== previousReference\n ? JSON.stringify(previousReference)\n : serializeModel(partValue, promiseId);\n partValue = formData;\n partValue.append(formFieldPrefix + promiseId, partJSON$27);\n pendingParts--;\n 0 === pendingParts && resolve(partValue);\n } catch (reason) {\n reject(reason);\n }\n }, reject);\n return key;\n }\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n else\n -1 === key.indexOf(":") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference &&\n ((key = parentReference + ":" + key),\n writtenObjects.set(value, key),\n void 0 !== temporaryReferences &&\n temporaryReferences.set(key, value)));\n if (isArrayImpl(value)) return value;\n if (value instanceof FormData) {\n null === formData && (formData = new FormData());\n var data$31 = formData;\n key = nextPartId++;\n var prefix = formFieldPrefix + key + "_";\n value.forEach(function (originalValue, originalKey) {\n data$31.append(prefix + originalKey, originalValue);\n });\n return "$K" + key.toString(16);\n }\n if (value instanceof Map)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n "$Q" + key.toString(16)\n );\n if (value instanceof Set)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n "$W" + key.toString(16)\n );\n if (value instanceof ArrayBuffer)\n return (\n (key = new Blob([value])),\n (parentReference = nextPartId++),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + parentReference, key),\n "$A" + parentReference.toString(16)\n );\n if (value instanceof Int8Array) return serializeTypedArray("O", value);\n if (value instanceof Uint8Array) return serializeTypedArray("o", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray("U", value);\n if (value instanceof Int16Array) return serializeTypedArray("S", value);\n if (value instanceof Uint16Array) return serializeTypedArray("s", value);\n if (value instanceof Int32Array) return serializeTypedArray("L", value);\n if (value instanceof Uint32Array) return serializeTypedArray("l", value);\n if (value instanceof Float32Array) return serializeTypedArray("G", value);\n if (value instanceof Float64Array) return serializeTypedArray("g", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray("M", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray("m", value);\n if (value instanceof DataView) return serializeTypedArray("V", value);\n if ("function" === typeof Blob && value instanceof Blob)\n return (\n null === formData && (formData = new FormData()),\n (key = nextPartId++),\n formData.append(formFieldPrefix + key, value),\n "$B" + key.toString(16)\n );\n if ((key = getIteratorFn(value)))\n return (\n (parentReference = key.call(value)),\n parentReference === value\n ? ((key = nextPartId++),\n (parentReference = serializeModel(\n Array.from(parentReference),\n key\n )),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n "$i" + key.toString(16))\n : Array.from(parentReference)\n );\n if (\n "function" === typeof ReadableStream &&\n value instanceof ReadableStream\n )\n return serializeReadableStream(value);\n key = value[ASYNC_ITERATOR];\n if ("function" === typeof key)\n return serializeAsyncIterable(value, key.call(value));\n key = getPrototypeOf(value);\n if (\n key !== ObjectPrototype &&\n (null === key || null !== getPrototypeOf(key))\n ) {\n if (void 0 === temporaryReferences)\n throw Error(\n "Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported."\n );\n return "$T";\n }\n return value;\n }\n if ("string" === typeof value) {\n if ("Z" === value[value.length - 1] && this[key] instanceof Date)\n return "$D" + value;\n key = "$" === value[0] ? "$" + value : value;\n return key;\n }\n if ("boolean" === typeof value) return value;\n if ("number" === typeof value) return serializeNumber(value);\n if ("undefined" === typeof value) return "$undefined";\n if ("function" === typeof value) {\n parentReference = knownServerReferences.get(value);\n if (void 0 !== parentReference) {\n key = writtenObjects.get(value);\n if (void 0 !== key) return key;\n key = JSON.stringify(\n { id: parentReference.id, bound: parentReference.bound },\n resolveToJSON\n );\n null === formData && (formData = new FormData());\n parentReference = nextPartId++;\n formData.set(formFieldPrefix + parentReference, key);\n key = "$h" + parentReference.toString(16);\n writtenObjects.set(value, key);\n return key;\n }\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(":") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + ":" + key, value), "$T"\n );\n throw Error(\n "Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again."\n );\n }\n if ("symbol" === typeof value) {\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(":") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + ":" + key, value), "$T"\n );\n throw Error(\n "Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options."\n );\n }\n if ("bigint" === typeof value) return "$n" + value.toString(10);\n throw Error(\n "Type " +\n typeof value +\n " is not supported as an argument to a Server Function."\n );\n }\n function serializeModel(model, id) {\n "object" === typeof model &&\n null !== model &&\n ((id = "$" + id.toString(16)),\n writtenObjects.set(model, id),\n void 0 !== temporaryReferences && temporaryReferences.set(id, model));\n modelRoot = model;\n return JSON.stringify(model, resolveToJSON);\n }\n var nextPartId = 1,\n pendingParts = 0,\n formData = null,\n writtenObjects = new WeakMap(),\n modelRoot = root,\n json = serializeModel(root, 0);\n null === formData\n ? resolve(json)\n : (formData.set(formFieldPrefix + "0", json),\n 0 === pendingParts && resolve(formData));\n return function () {\n 0 < pendingParts &&\n ((pendingParts = 0),\n null === formData ? resolve(json) : resolve(formData));\n };\n}\nfunction registerBoundServerReference(reference, id, bound) {\n knownServerReferences.has(reference) ||\n knownServerReferences.set(reference, {\n id: id,\n originalBind: reference.bind,\n bound: bound\n });\n}\nfunction createBoundServerReference(metaData, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return bound\n ? "fulfilled" === bound.status\n ? callServer(id, bound.value.concat(args))\n : Promise.resolve(bound).then(function (boundArgs) {\n return callServer(id, boundArgs.concat(args));\n })\n : callServer(id, args);\n }\n var id = metaData.id,\n bound = metaData.bound;\n registerBoundServerReference(action, id, bound);\n return action;\n}\nfunction ReactPromise(status, value, reason) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n}\nReactPromise.prototype = Object.create(Promise.prototype);\nReactPromise.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case "resolved_model":\n initializeModelChunk(this);\n break;\n case "resolved_module":\n initializeModuleChunk(this);\n }\n switch (this.status) {\n case "fulfilled":\n "function" === typeof resolve && resolve(this.value);\n break;\n case "pending":\n case "blocked":\n "function" === typeof resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n "function" === typeof reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n case "halted":\n break;\n default:\n "function" === typeof reject && reject(this.reason);\n }\n};\nfunction readChunk(chunk) {\n switch (chunk.status) {\n case "resolved_model":\n initializeModelChunk(chunk);\n break;\n case "resolved_module":\n initializeModuleChunk(chunk);\n }\n switch (chunk.status) {\n case "fulfilled":\n return chunk.value;\n case "pending":\n case "blocked":\n case "halted":\n throw chunk;\n default:\n throw chunk.reason;\n }\n}\nfunction wakeChunk(listeners, value, chunk) {\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n "function" === typeof listener\n ? listener(value)\n : fulfillReference(listener, value, chunk);\n }\n}\nfunction rejectChunk(listeners, error) {\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n "function" === typeof listener\n ? listener(error)\n : rejectReference(listener, error);\n }\n}\nfunction resolveBlockedCycle(resolvedChunk, reference) {\n var referencedChunk = reference.handler.chunk;\n if (null === referencedChunk) return null;\n if (referencedChunk === resolvedChunk) return reference.handler;\n reference = referencedChunk.value;\n if (null !== reference)\n for (\n referencedChunk = 0;\n referencedChunk < reference.length;\n referencedChunk++\n ) {\n var listener = reference[referencedChunk];\n if (\n "function" !== typeof listener &&\n ((listener = resolveBlockedCycle(resolvedChunk, listener)),\n null !== listener)\n )\n return listener;\n }\n return null;\n}\nfunction wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {\n switch (chunk.status) {\n case "fulfilled":\n wakeChunk(resolveListeners, chunk.value, chunk);\n break;\n case "blocked":\n for (var i = 0; i < resolveListeners.length; i++) {\n var listener = resolveListeners[i];\n if ("function" !== typeof listener) {\n var cyclicHandler = resolveBlockedCycle(chunk, listener);\n if (null !== cyclicHandler)\n switch (\n (fulfillReference(listener, cyclicHandler.value, chunk),\n resolveListeners.splice(i, 1),\n i--,\n null !== rejectListeners &&\n ((listener = rejectListeners.indexOf(listener)),\n -1 !== listener && rejectListeners.splice(listener, 1)),\n chunk.status)\n ) {\n case "fulfilled":\n wakeChunk(resolveListeners, chunk.value, chunk);\n return;\n case "rejected":\n null !== rejectListeners &&\n rejectChunk(rejectListeners, chunk.reason);\n return;\n }\n }\n }\n case "pending":\n if (chunk.value)\n for (i = 0; i < resolveListeners.length; i++)\n chunk.value.push(resolveListeners[i]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (\n resolveListeners = 0;\n resolveListeners < rejectListeners.length;\n resolveListeners++\n )\n chunk.reason.push(rejectListeners[resolveListeners]);\n } else chunk.reason = rejectListeners;\n break;\n case "rejected":\n rejectListeners && rejectChunk(rejectListeners, chunk.reason);\n }\n}\nfunction triggerErrorOnChunk(response, chunk, error) {\n "pending" !== chunk.status && "blocked" !== chunk.status\n ? chunk.reason.error(error)\n : ((response = chunk.reason),\n (chunk.status = "rejected"),\n (chunk.reason = error),\n null !== response && rejectChunk(response, error));\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new ReactPromise(\n "resolved_model",\n (done ? \'{"done":true,"value":\' : \'{"done":false,"value":\') + value + "}",\n response\n );\n}\nfunction resolveIteratorResultChunk(response, chunk, value, done) {\n resolveModelChunk(\n response,\n chunk,\n (done ? \'{"done":true,"value":\' : \'{"done":false,"value":\') + value + "}"\n );\n}\nfunction resolveModelChunk(response, chunk, value) {\n if ("pending" !== chunk.status) chunk.reason.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = "resolved_model";\n chunk.value = value;\n chunk.reason = response;\n null !== resolveListeners &&\n (initializeModelChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nfunction resolveModuleChunk(response, chunk, value) {\n if ("pending" === chunk.status || "blocked" === chunk.status) {\n response = chunk.value;\n var rejectListeners = chunk.reason;\n chunk.status = "resolved_module";\n chunk.value = value;\n chunk.reason = null;\n null !== response &&\n (initializeModuleChunk(chunk),\n wakeChunkIfInitialized(chunk, response, rejectListeners));\n }\n}\nvar initializingHandler = null;\nfunction initializeModelChunk(chunk) {\n var prevHandler = initializingHandler;\n initializingHandler = null;\n var resolvedModel = chunk.value,\n response = chunk.reason;\n chunk.status = "blocked";\n chunk.value = null;\n chunk.reason = null;\n try {\n var value = JSON.parse(resolvedModel, response._fromJSON),\n resolveListeners = chunk.value;\n if (null !== resolveListeners)\n for (\n chunk.value = null, chunk.reason = null, resolvedModel = 0;\n resolvedModel < resolveListeners.length;\n resolvedModel++\n ) {\n var listener = resolveListeners[resolvedModel];\n "function" === typeof listener\n ? listener(value)\n : fulfillReference(listener, value, chunk);\n }\n if (null !== initializingHandler) {\n if (initializingHandler.errored) throw initializingHandler.reason;\n if (0 < initializingHandler.deps) {\n initializingHandler.value = value;\n initializingHandler.chunk = chunk;\n return;\n }\n }\n chunk.status = "fulfilled";\n chunk.value = value;\n } catch (error) {\n (chunk.status = "rejected"), (chunk.reason = error);\n } finally {\n initializingHandler = prevHandler;\n }\n}\nfunction initializeModuleChunk(chunk) {\n try {\n var value = requireModule(chunk.value);\n chunk.status = "fulfilled";\n chunk.value = value;\n } catch (error) {\n (chunk.status = "rejected"), (chunk.reason = error);\n }\n}\nfunction reportGlobalError(weakResponse, error) {\n weakResponse._closed = !0;\n weakResponse._closedReason = error;\n weakResponse._chunks.forEach(function (chunk) {\n "pending" === chunk.status\n ? triggerErrorOnChunk(weakResponse, chunk, error)\n : "fulfilled" === chunk.status &&\n null !== chunk.reason &&\n chunk.reason.error(error);\n });\n}\nfunction createLazyChunkWrapper(chunk) {\n return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk ||\n ((chunk = response._closed\n ? new ReactPromise("rejected", null, response._closedReason)\n : new ReactPromise("pending", null, null)),\n chunks.set(id, chunk));\n return chunk;\n}\nfunction fulfillReference(reference, value) {\n var response = reference.response,\n handler = reference.handler,\n parentObject = reference.parentObject,\n key = reference.key,\n map = reference.map,\n path = reference.path;\n try {\n for (var i = 1; i < path.length; i++) {\n for (\n ;\n "object" === typeof value &&\n null !== value &&\n value.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n var referencedChunk = value._payload;\n if (referencedChunk === handler.chunk) value = handler.value;\n else {\n switch (referencedChunk.status) {\n case "resolved_model":\n initializeModelChunk(referencedChunk);\n break;\n case "resolved_module":\n initializeModuleChunk(referencedChunk);\n }\n switch (referencedChunk.status) {\n case "fulfilled":\n value = referencedChunk.value;\n continue;\n case "blocked":\n var cyclicHandler = resolveBlockedCycle(\n referencedChunk,\n reference\n );\n if (null !== cyclicHandler) {\n value = cyclicHandler.value;\n continue;\n }\n case "pending":\n path.splice(0, i - 1);\n null === referencedChunk.value\n ? (referencedChunk.value = [reference])\n : referencedChunk.value.push(reference);\n null === referencedChunk.reason\n ? (referencedChunk.reason = [reference])\n : referencedChunk.reason.push(reference);\n return;\n case "halted":\n return;\n default:\n rejectReference(reference, referencedChunk.reason);\n return;\n }\n }\n }\n var name = path[i];\n if (\n "object" === typeof value &&\n null !== value &&\n hasOwnProperty.call(value, name)\n )\n value = value[name];\n else throw Error("Invalid reference.");\n }\n for (\n ;\n "object" === typeof value &&\n null !== value &&\n value.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n var referencedChunk$44 = value._payload;\n if (referencedChunk$44 === handler.chunk) value = handler.value;\n else {\n switch (referencedChunk$44.status) {\n case "resolved_model":\n initializeModelChunk(referencedChunk$44);\n break;\n case "resolved_module":\n initializeModuleChunk(referencedChunk$44);\n }\n switch (referencedChunk$44.status) {\n case "fulfilled":\n value = referencedChunk$44.value;\n continue;\n }\n break;\n }\n }\n var mappedValue = map(response, value, parentObject, key);\n "__proto__" !== key && (parentObject[key] = mappedValue);\n "" === key && null === handler.value && (handler.value = mappedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n "object" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n ) {\n var element = handler.value;\n switch (key) {\n case "3":\n element.props = mappedValue;\n }\n }\n } catch (error) {\n rejectReference(reference, error);\n return;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((reference = handler.chunk),\n null !== reference &&\n "blocked" === reference.status &&\n ((value = reference.value),\n (reference.status = "fulfilled"),\n (reference.value = handler.value),\n (reference.reason = handler.reason),\n null !== value && wakeChunk(value, handler.value, reference)));\n}\nfunction rejectReference(reference, error) {\n var handler = reference.handler;\n reference = reference.response;\n handler.errored ||\n ((handler.errored = !0),\n (handler.value = null),\n (handler.reason = error),\n (handler = handler.chunk),\n null !== handler &&\n "blocked" === handler.status &&\n triggerErrorOnChunk(reference, handler, error));\n}\nfunction waitForReference(\n referencedChunk,\n parentObject,\n key,\n response,\n map,\n path\n) {\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n };\n parentObject = {\n response: response,\n handler: handler,\n parentObject: parentObject,\n key: key,\n map: map,\n path: path\n };\n null === referencedChunk.value\n ? (referencedChunk.value = [parentObject])\n : referencedChunk.value.push(parentObject);\n null === referencedChunk.reason\n ? (referencedChunk.reason = [parentObject])\n : referencedChunk.reason.push(parentObject);\n return null;\n}\nfunction loadServerReference(response, metaData, parentObject, key) {\n if (!response._serverReferenceConfig)\n return createBoundServerReference(metaData, response._callServer);\n var serverReference = resolveServerReference(\n response._serverReferenceConfig,\n metaData.id\n ),\n promise = preloadModule(serverReference);\n if (promise)\n metaData.bound && (promise = Promise.all([promise, metaData.bound]));\n else if (metaData.bound) promise = Promise.resolve(metaData.bound);\n else\n return (\n (promise = requireModule(serverReference)),\n registerBoundServerReference(promise, metaData.id, metaData.bound),\n promise\n );\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n };\n promise.then(\n function () {\n var resolvedValue = requireModule(serverReference);\n if (metaData.bound) {\n var boundArgs = metaData.bound.value.slice(0);\n boundArgs.unshift(null);\n resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs);\n }\n registerBoundServerReference(resolvedValue, metaData.id, metaData.bound);\n "__proto__" !== key && (parentObject[key] = resolvedValue);\n "" === key && null === handler.value && (handler.value = resolvedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n "object" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((boundArgs = handler.value), key)) {\n case "3":\n boundArgs.props = resolvedValue;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((resolvedValue = handler.chunk),\n null !== resolvedValue &&\n "blocked" === resolvedValue.status &&\n ((boundArgs = resolvedValue.value),\n (resolvedValue.status = "fulfilled"),\n (resolvedValue.value = handler.value),\n (resolvedValue.reason = null),\n null !== boundArgs &&\n wakeChunk(boundArgs, handler.value, resolvedValue)));\n },\n function (error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = null;\n handler.reason = error;\n var chunk = handler.chunk;\n null !== chunk &&\n "blocked" === chunk.status &&\n triggerErrorOnChunk(response, chunk, error);\n }\n }\n );\n return null;\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(":");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case "resolved_model":\n initializeModelChunk(id);\n break;\n case "resolved_module":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case "fulfilled":\n id = id.value;\n for (var i = 1; i < reference.length; i++) {\n for (\n ;\n "object" === typeof id &&\n null !== id &&\n id.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n id = id._payload;\n switch (id.status) {\n case "resolved_model":\n initializeModelChunk(id);\n break;\n case "resolved_module":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case "fulfilled":\n id = id.value;\n break;\n case "blocked":\n case "pending":\n return waitForReference(\n id,\n parentObject,\n key,\n response,\n map,\n reference.slice(i - 1)\n );\n case "halted":\n return (\n initializingHandler\n ? ((response = initializingHandler), response.deps++)\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n }),\n null\n );\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = null),\n (initializingHandler.reason = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n }\n id = id[reference[i]];\n }\n for (\n ;\n "object" === typeof id &&\n null !== id &&\n id.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n reference = id._payload;\n switch (reference.status) {\n case "resolved_model":\n initializeModelChunk(reference);\n break;\n case "resolved_module":\n initializeModuleChunk(reference);\n }\n switch (reference.status) {\n case "fulfilled":\n id = reference.value;\n continue;\n }\n break;\n }\n return map(response, id, parentObject, key);\n case "pending":\n case "blocked":\n return waitForReference(id, parentObject, key, response, map, reference);\n case "halted":\n return (\n initializingHandler\n ? ((response = initializingHandler), response.deps++)\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n }),\n null\n );\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = null),\n (initializingHandler.reason = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction createBlob(response, model) {\n return new Blob(model.slice(1), { type: model[0] });\n}\nfunction createFormData(response, model) {\n response = new FormData();\n for (var i = 0; i < model.length; i++)\n response.append(model[i][0], model[i][1]);\n return response;\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseModelString(response, parentObject, key, value) {\n if ("$" === value[0]) {\n if ("$" === value)\n return (\n null !== initializingHandler &&\n "0" === key &&\n (initializingHandler = {\n parent: initializingHandler,\n chunk: null,\n value: null,\n reason: null,\n deps: 0,\n errored: !1\n }),\n REACT_ELEMENT_TYPE\n );\n switch (value[1]) {\n case "$":\n return value.slice(1);\n case "L":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n (response = getChunk(response, parentObject)),\n createLazyChunkWrapper(response)\n );\n case "@":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n getChunk(response, parentObject)\n );\n case "S":\n return Symbol.for(value.slice(2));\n case "h":\n return (\n (value = value.slice(2)),\n getOutlinedModel(\n response,\n value,\n parentObject,\n key,\n loadServerReference\n )\n );\n case "T":\n parentObject = "$" + value.slice(2);\n response = response._tempRefs;\n if (null == response)\n throw Error(\n "Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply."\n );\n return response.get(parentObject);\n case "Q":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createMap)\n );\n case "W":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createSet)\n );\n case "B":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createBlob)\n );\n case "K":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createFormData)\n );\n case "Z":\n return resolveErrorProd();\n case "i":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, extractIterator)\n );\n case "I":\n return Infinity;\n case "-":\n return "$-0" === value ? -0 : -Infinity;\n case "N":\n return NaN;\n case "u":\n return;\n case "D":\n return new Date(Date.parse(value.slice(2)));\n case "n":\n return BigInt(value.slice(2));\n default:\n return (\n (value = value.slice(1)),\n getOutlinedModel(response, value, parentObject, key, createModel)\n );\n }\n }\n return value;\n}\nfunction missingCall() {\n throw Error(\n \'Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.\'\n );\n}\nfunction ResponseInstance(\n bundlerConfig,\n serverReferenceConfig,\n moduleLoading,\n callServer,\n encodeFormAction,\n nonce,\n temporaryReferences\n) {\n var chunks = new Map();\n this._bundlerConfig = bundlerConfig;\n this._serverReferenceConfig = serverReferenceConfig;\n this._moduleLoading = moduleLoading;\n this._callServer = void 0 !== callServer ? callServer : missingCall;\n this._encodeFormAction = encodeFormAction;\n this._nonce = nonce;\n this._chunks = chunks;\n this._stringDecoder = new TextDecoder();\n this._fromJSON = null;\n this._closed = !1;\n this._closedReason = null;\n this._tempRefs = temporaryReferences;\n this._fromJSON = createFromJSONCallback(this);\n}\nfunction resolveBuffer(response, id, buffer) {\n response = response._chunks;\n var chunk = response.get(id);\n chunk && "pending" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : ((buffer = new ReactPromise("fulfilled", buffer, null)),\n response.set(id, buffer));\n}\nfunction resolveModule(response, id, model) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n model = JSON.parse(model, response._fromJSON);\n var clientReference = resolveClientReference(response._bundlerConfig, model);\n if ((model = preloadModule(clientReference))) {\n if (chunk) {\n var blockedChunk = chunk;\n blockedChunk.status = "blocked";\n } else\n (blockedChunk = new ReactPromise("blocked", null, null)),\n chunks.set(id, blockedChunk);\n model.then(\n function () {\n return resolveModuleChunk(response, blockedChunk, clientReference);\n },\n function (error) {\n return triggerErrorOnChunk(response, blockedChunk, error);\n }\n );\n } else\n chunk\n ? resolveModuleChunk(response, chunk, clientReference)\n : ((chunk = new ReactPromise("resolved_module", clientReference, null)),\n chunks.set(id, chunk));\n}\nfunction resolveStream(response, id, stream, controller) {\n response = response._chunks;\n var chunk = response.get(id);\n chunk\n ? "pending" === chunk.status &&\n ((id = chunk.value),\n (chunk.status = "fulfilled"),\n (chunk.value = stream),\n (chunk.reason = controller),\n null !== id && wakeChunk(id, chunk.value, chunk))\n : ((stream = new ReactPromise("fulfilled", stream, controller)),\n response.set(id, stream));\n}\nfunction startReadableStream(response, id, type) {\n var controller = null,\n closed = !1;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, id, type, {\n enqueueValue: function (value) {\n null === previousBlockedChunk\n ? controller.enqueue(value)\n : previousBlockedChunk.then(function () {\n controller.enqueue(value);\n });\n },\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new ReactPromise("resolved_model", json, response);\n initializeModelChunk(chunk);\n "fulfilled" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$55 = new ReactPromise("pending", null, null);\n chunk$55.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$55;\n chunk.then(function () {\n previousBlockedChunk === chunk$55 && (previousBlockedChunk = null);\n resolveModelChunk(response, chunk$55, json);\n });\n }\n },\n close: function () {\n if (!closed)\n if (((closed = !0), null === previousBlockedChunk)) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (!closed)\n if (((closed = !0), null === previousBlockedChunk))\n controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction startAsyncIterable(response, id, iterator) {\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n iterable = {};\n iterable[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n "Values cannot be passed to next() of AsyncIterables passed to Client Components."\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new ReactPromise(\n "fulfilled",\n { done: !0, value: void 0 },\n null\n );\n buffer[nextReadIndex] = new ReactPromise("pending", null, null);\n }\n return buffer[nextReadIndex++];\n });\n };\n resolveStream(\n response,\n id,\n iterator ? iterable[ASYNC_ITERATOR]() : iterable,\n {\n enqueueValue: function (value) {\n if (nextWriteIndex === buffer.length)\n buffer[nextWriteIndex] = new ReactPromise(\n "fulfilled",\n { done: !1, value: value },\n null\n );\n else {\n var chunk = buffer[nextWriteIndex],\n resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = "fulfilled";\n chunk.value = { done: !1, value: value };\n chunk.reason = null;\n null !== resolveListeners &&\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners);\n }\n nextWriteIndex++;\n },\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex],\n value,\n !1\n );\n nextWriteIndex++;\n },\n close: function (value) {\n if (!closed)\n for (\n closed = !0,\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex],\n value,\n !0\n ),\n nextWriteIndex++;\n nextWriteIndex < buffer.length;\n\n )\n resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex++],\n \'"$undefined"\',\n !0\n );\n },\n error: function (error) {\n if (!closed)\n for (\n closed = !0,\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = new ReactPromise(\n "pending",\n null,\n null\n ));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);\n }\n }\n );\n}\nfunction resolveErrorProd() {\n var error = Error(\n "An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error."\n );\n error.stack = "Error: " + error.message;\n return error;\n}\nfunction mergeBuffer(buffer, lastChunk) {\n for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)\n byteLength += buffer[i].byteLength;\n byteLength = new Uint8Array(byteLength);\n for (var i$56 = (i = 0); i$56 < l; i$56++) {\n var chunk = buffer[i$56];\n byteLength.set(chunk, i);\n i += chunk.byteLength;\n }\n byteLength.set(lastChunk, i);\n return byteLength;\n}\nfunction resolveTypedArray(\n response,\n id,\n buffer,\n lastChunk,\n constructor,\n bytesPerElement\n) {\n buffer =\n 0 === buffer.length && 0 === lastChunk.byteOffset % bytesPerElement\n ? lastChunk\n : mergeBuffer(buffer, lastChunk);\n constructor = new constructor(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength / bytesPerElement\n );\n resolveBuffer(response, id, constructor);\n}\nfunction processFullBinaryRow(response, streamState, id, tag, buffer, chunk) {\n switch (tag) {\n case 65:\n resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);\n return;\n case 79:\n resolveTypedArray(response, id, buffer, chunk, Int8Array, 1);\n return;\n case 111:\n resolveBuffer(\n response,\n id,\n 0 === buffer.length ? chunk : mergeBuffer(buffer, chunk)\n );\n return;\n case 85:\n resolveTypedArray(response, id, buffer, chunk, Uint8ClampedArray, 1);\n return;\n case 83:\n resolveTypedArray(response, id, buffer, chunk, Int16Array, 2);\n return;\n case 115:\n resolveTypedArray(response, id, buffer, chunk, Uint16Array, 2);\n return;\n case 76:\n resolveTypedArray(response, id, buffer, chunk, Int32Array, 4);\n return;\n case 108:\n resolveTypedArray(response, id, buffer, chunk, Uint32Array, 4);\n return;\n case 71:\n resolveTypedArray(response, id, buffer, chunk, Float32Array, 4);\n return;\n case 103:\n resolveTypedArray(response, id, buffer, chunk, Float64Array, 8);\n return;\n case 77:\n resolveTypedArray(response, id, buffer, chunk, BigInt64Array, 8);\n return;\n case 109:\n resolveTypedArray(response, id, buffer, chunk, BigUint64Array, 8);\n return;\n case 86:\n resolveTypedArray(response, id, buffer, chunk, DataView, 1);\n return;\n }\n streamState = response._stringDecoder;\n for (var row = "", i = 0; i < buffer.length; i++)\n row += streamState.decode(buffer[i], decoderOptions);\n buffer = row += streamState.decode(chunk);\n switch (tag) {\n case 73:\n resolveModule(response, id, buffer);\n break;\n case 72:\n id = buffer[0];\n buffer = buffer.slice(1);\n response = JSON.parse(buffer, response._fromJSON);\n buffer = ReactDOMSharedInternals.d;\n switch (id) {\n case "D":\n buffer.D(response);\n break;\n case "C":\n "string" === typeof response\n ? buffer.C(response)\n : buffer.C(response[0], response[1]);\n break;\n case "L":\n id = response[0];\n tag = response[1];\n 3 === response.length\n ? buffer.L(id, tag, response[2])\n : buffer.L(id, tag);\n break;\n case "m":\n "string" === typeof response\n ? buffer.m(response)\n : buffer.m(response[0], response[1]);\n break;\n case "X":\n "string" === typeof response\n ? buffer.X(response)\n : buffer.X(response[0], response[1]);\n break;\n case "S":\n "string" === typeof response\n ? buffer.S(response)\n : buffer.S(\n response[0],\n 0 === response[1] ? void 0 : response[1],\n 3 === response.length ? response[2] : void 0\n );\n break;\n case "M":\n "string" === typeof response\n ? buffer.M(response)\n : buffer.M(response[0], response[1]);\n }\n break;\n case 69:\n tag = response._chunks;\n chunk = tag.get(id);\n buffer = JSON.parse(buffer);\n streamState = resolveErrorProd();\n streamState.digest = buffer.digest;\n chunk\n ? triggerErrorOnChunk(response, chunk, streamState)\n : ((response = new ReactPromise("rejected", null, streamState)),\n tag.set(id, response));\n break;\n case 84:\n response = response._chunks;\n (tag = response.get(id)) && "pending" !== tag.status\n ? tag.reason.enqueueValue(buffer)\n : ((buffer = new ReactPromise("fulfilled", buffer, null)),\n response.set(id, buffer));\n break;\n case 78:\n case 68:\n case 74:\n case 87:\n throw Error(\n "Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client."\n );\n case 82:\n startReadableStream(response, id, void 0);\n break;\n case 114:\n startReadableStream(response, id, "bytes");\n break;\n case 88:\n startAsyncIterable(response, id, !1);\n break;\n case 120:\n startAsyncIterable(response, id, !0);\n break;\n case 67:\n (id = response._chunks.get(id)) &&\n "fulfilled" === id.status &&\n id.reason.close("" === buffer ? \'"$undefined"\' : buffer);\n break;\n default:\n (tag = response._chunks),\n (chunk = tag.get(id))\n ? resolveModelChunk(response, chunk, buffer)\n : ((response = new ReactPromise("resolved_model", buffer, response)),\n tag.set(id, response));\n }\n}\nfunction createFromJSONCallback(response) {\n return function (key, value) {\n if ("__proto__" !== key) {\n if ("string" === typeof value)\n return parseModelString(response, this, key, value);\n if ("object" === typeof value && null !== value) {\n if (value[0] === REACT_ELEMENT_TYPE) {\n if (\n ((key = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: value[1],\n key: value[2],\n ref: null,\n props: value[3]\n }),\n null !== initializingHandler)\n )\n if (\n ((value = initializingHandler),\n (initializingHandler = value.parent),\n value.errored)\n )\n (key = new ReactPromise("rejected", null, value.reason)),\n (key = createLazyChunkWrapper(key));\n else if (0 < value.deps) {\n var blockedChunk = new ReactPromise("blocked", null, null);\n value.value = key;\n value.chunk = blockedChunk;\n key = createLazyChunkWrapper(blockedChunk);\n }\n } else key = value;\n return key;\n }\n return value;\n }\n };\n}\nfunction close(weakResponse) {\n reportGlobalError(weakResponse, Error("Connection closed."));\n}\nfunction createResponseFromOptions(options) {\n return new ResponseInstance(\n null,\n null,\n null,\n options && options.callServer ? options.callServer : void 0,\n void 0,\n void 0,\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0\n );\n}\nfunction startReadingFromStream(response, stream, onDone) {\n function progress(_ref2) {\n var value = _ref2.value;\n if (_ref2.done) return onDone();\n var i = 0,\n rowState = streamState._rowState;\n _ref2 = streamState._rowID;\n for (\n var rowTag = streamState._rowTag,\n rowLength = streamState._rowLength,\n buffer = streamState._buffer,\n chunkLength = value.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = value[i++];\n 58 === lastIdx\n ? (rowState = 1)\n : (_ref2 =\n (_ref2 << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = value[i];\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 35 === rowState ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = value[i++];\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) |\n (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = value.indexOf(10, i);\n break;\n case 4:\n (lastIdx = i + rowLength), lastIdx > value.length && (lastIdx = -1);\n }\n var offset = value.byteOffset + i;\n if (-1 < lastIdx)\n (rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),\n processFullBinaryRow(\n response,\n streamState,\n _ref2,\n rowTag,\n buffer,\n rowLength\n ),\n (i = lastIdx),\n 3 === rowState && i++,\n (rowLength = _ref2 = rowTag = rowState = 0),\n (buffer.length = 0);\n else {\n value = new Uint8Array(value.buffer, offset, value.byteLength - i);\n buffer.push(value);\n rowLength -= value.byteLength;\n break;\n }\n }\n streamState._rowState = rowState;\n streamState._rowID = _ref2;\n streamState._rowTag = rowTag;\n streamState._rowLength = rowLength;\n return reader.read().then(progress).catch(error);\n }\n function error(e) {\n reportGlobalError(response, e);\n }\n var streamState = {\n _rowState: 0,\n _rowID: 0,\n _rowTag: 0,\n _rowLength: 0,\n _buffer: []\n },\n reader = stream.getReader();\n reader.read().then(progress).catch(error);\n}\nexports.createFromFetch = function (promiseForResponse, options) {\n var response = createResponseFromOptions(options);\n promiseForResponse.then(\n function (r) {\n startReadingFromStream(response, r.body, close.bind(null, response));\n },\n function (e) {\n reportGlobalError(response, e);\n }\n );\n return getChunk(response, 0);\n};\nexports.createFromReadableStream = function (stream, options) {\n options = createResponseFromOptions(options);\n startReadingFromStream(options, stream, close.bind(null, options));\n return getChunk(options, 0);\n};\nexports.createServerReference = function (id, callServer) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return callServer(id, args);\n }\n registerBoundServerReference(action, id, null);\n return action;\n};\nexports.createTemporaryReferenceSet = function () {\n return new Map();\n};\nexports.encodeReply = function (value, options) {\n return new Promise(function (resolve, reject) {\n var abort = processReply(\n value,\n "",\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0,\n resolve,\n reject\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(signal.reason);\n else {\n var listener = function () {\n abort(signal.reason);\n signal.removeEventListener("abort", listener);\n };\n signal.addEventListener("abort", listener);\n }\n }\n });\n};\nexports.registerServerReference = function (reference, id) {\n registerBoundServerReference(reference, id, null);\n return reference;\n};\n' as string;
+export const WEBPACK_SHIM_SOURCE =
+ "// Minimal webpack shim for RSDW compatibility.\n// Works in both browser (window) and worker (self) contexts via globalThis.\n\nvar moduleCache = {};\n\nglobalThis.__webpack_module_cache__ = moduleCache;\n\nglobalThis.__webpack_require__ = function (moduleId) {\n var cached = moduleCache[moduleId];\n if (cached) return cached.exports !== undefined ? cached.exports : cached;\n throw new Error('Module \"' + moduleId + '\" not found in webpack shim cache');\n};\n\nglobalThis.__webpack_chunk_load__ = function () {\n return Promise.resolve();\n};\n\nglobalThis.__webpack_require__.u = function (chunkId) {\n return chunkId;\n};\n\nglobalThis.__webpack_get_script_filename__ = function (chunkId) {\n return chunkId;\n};\n" as string;
+export const WORKER_BUNDLE_MODULE_SOURCE =
+ 'export default "// Minimal webpack shim for RSDW compatibility.\\n// Works in both browser (window) and worker (self) contexts via globalThis.\\n\\nvar moduleCache = {};\\n\\nglobalThis.__webpack_module_cache__ = moduleCache;\\n\\nglobalThis.__webpack_require__ = function (moduleId) {\\n var cached = moduleCache[moduleId];\\n if (cached) return cached.exports !== undefined ? cached.exports : cached;\\n throw new Error(\'Module \\"\' + moduleId + \'\\" not found in webpack shim cache\');\\n};\\n\\nglobalThis.__webpack_chunk_load__ = function () {\\n return Promise.resolve();\\n};\\n\\nglobalThis.__webpack_require__.u = function (chunkId) {\\n return chunkId;\\n};\\n\\nglobalThis.__webpack_get_script_filename__ = function (chunkId) {\\n return chunkId;\\n};\\n\\n\\"use strict\\";(()=>{var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Wc=Z(ht=>{\\"use strict\\";var ei={H:null,A:null};function Yo(e){var t=\\"https://react.dev/errors/\\"+e;if(1{\\"use strict\\";Gc.exports=Wc()});var Xc=Z(Oi=>{\\"use strict\\";var Kf=Li(),Uf=Symbol.for(\\"react.transitional.element\\"),Hf=Symbol.for(\\"react.fragment\\");if(!Kf.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)throw Error(\'The \\"react\\" package in this environment is not configured correctly. The \\"react-server\\" condition must be enabled in any environment that runs React Server Components.\');function zc(e,t,s){var i=null;if(s!==void 0&&(i=\\"\\"+s),t.key!==void 0&&(i=\\"\\"+t.key),\\"key\\"in t){s={};for(var r in t)r!==\\"key\\"&&(s[r]=t[r])}else s=t;return t=s.ref,{$$typeof:Uf,type:e,key:i,ref:t!==void 0?t:null,props:s}}Oi.Fragment=Hf;Oi.jsx=zc;Oi.jsxDEV=void 0;Oi.jsxs=zc});var Jc=Z((n_,Yc)=>{\\"use strict\\";Yc.exports=Xc()});var Qc=Z(jn=>{\\"use strict\\";var Wf=Li();function ns(){}var Sn={d:{f:ns,r:function(){throw Error(\\"Invalid form element. requestFormReset must be passed a form that was rendered by React.\\")},D:ns,C:ns,L:ns,m:ns,X:ns,S:ns,M:ns},p:0,findDOMNode:null};if(!Wf.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)throw Error(\'The \\"react\\" package in this environment is not configured correctly. The \\"react-server\\" condition must be enabled in any environment that runs React Server Components.\');function br(e,t){if(e===\\"font\\")return\\"\\";if(typeof t==\\"string\\")return t===\\"use-credentials\\"?t:\\"\\"}jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Sn;jn.preconnect=function(e,t){typeof e==\\"string\\"&&(t?(t=t.crossOrigin,t=typeof t==\\"string\\"?t===\\"use-credentials\\"?t:\\"\\":void 0):t=null,Sn.d.C(e,t))};jn.prefetchDNS=function(e){typeof e==\\"string\\"&&Sn.d.D(e)};jn.preinit=function(e,t){if(typeof e==\\"string\\"&&t&&typeof t.as==\\"string\\"){var s=t.as,i=br(s,t.crossOrigin),r=typeof t.integrity==\\"string\\"?t.integrity:void 0,a=typeof t.fetchPriority==\\"string\\"?t.fetchPriority:void 0;s===\\"style\\"?Sn.d.S(e,typeof t.precedence==\\"string\\"?t.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):s===\\"script\\"&&Sn.d.X(e,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof t.nonce==\\"string\\"?t.nonce:void 0})}};jn.preinitModule=function(e,t){if(typeof e==\\"string\\")if(typeof t==\\"object\\"&&t!==null){if(t.as==null||t.as===\\"script\\"){var s=br(t.as,t.crossOrigin);Sn.d.M(e,{crossOrigin:s,integrity:typeof t.integrity==\\"string\\"?t.integrity:void 0,nonce:typeof t.nonce==\\"string\\"?t.nonce:void 0})}}else t==null&&Sn.d.M(e)};jn.preload=function(e,t){if(typeof e==\\"string\\"&&typeof t==\\"object\\"&&t!==null&&typeof t.as==\\"string\\"){var s=t.as,i=br(s,t.crossOrigin);Sn.d.L(e,s,{crossOrigin:i,integrity:typeof t.integrity==\\"string\\"?t.integrity:void 0,nonce:typeof t.nonce==\\"string\\"?t.nonce:void 0,type:typeof t.type==\\"string\\"?t.type:void 0,fetchPriority:typeof t.fetchPriority==\\"string\\"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==\\"string\\"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==\\"string\\"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==\\"string\\"?t.imageSizes:void 0,media:typeof t.media==\\"string\\"?t.media:void 0})}};jn.preloadModule=function(e,t){if(typeof e==\\"string\\")if(t){var s=br(t.as,t.crossOrigin);Sn.d.m(e,{as:typeof t.as==\\"string\\"&&t.as!==\\"script\\"?t.as:void 0,crossOrigin:s,integrity:typeof t.integrity==\\"string\\"?t.integrity:void 0})}else Sn.d.m(e)};jn.version=\\"19.0.0\\"});var eu=Z((i_,Zc)=>{\\"use strict\\";Zc.exports=Qc()});var Zu=Z(En=>{\\"use strict\\";var Gf=eu(),zf=Li(),Tu=new MessageChannel,ku=[];Tu.port1.onmessage=function(){var e=ku.shift();e&&e()};function Bi(e){ku.push(e),Tu.port2.postMessage(null)}function Xf(e){setTimeout(function(){throw e})}var Yf=Promise,vu=typeof queueMicrotask==\\"function\\"?queueMicrotask:function(e){Yf.resolve(null).then(e).catch(Xf)},ln=null,cn=0;function Cr(e,t){if(t.byteLength!==0)if(2048=e.length?e:e.slice(0,10)+\\"...\\");case\\"object\\":return kn(e)?\\"[...]\\":e!==null&&e.$$typeof===sa?\\"client\\":(e=Nu(e),e===\\"Object\\"?\\"{...}\\":e);case\\"function\\":return e.$$typeof===sa?\\"client\\":(e=e.displayName||e.name)?\\"function \\"+e:\\"function\\";default:return String(e)}}function Er(e){if(typeof e==\\"string\\")return e;switch(e){case hd:return\\"Suspense\\";case fd:return\\"SuspenseList\\"}if(typeof e==\\"object\\")switch(e.$$typeof){case wu:return Er(e.render);case Su:return Er(e.type);case $i:var t=e._payload;e=e._init;try{return Er(e(t))}catch{}}return\\"\\"}var sa=Symbol.for(\\"react.client.reference\\");function _s(e,t){var s=Nu(e);if(s!==\\"Object\\"&&s!==\\"Array\\")return s;s=-1;var i=0;if(kn(e)){for(var r=\\"[\\",a=0;au.length&&40>r.length+u.length?r+u:r+\\"...\\"}r+=\\"]\\"}else if(e.$$typeof===In)r=\\"<\\"+Er(e.type)+\\"/>\\";else{if(e.$$typeof===sa)return\\"client\\";for(r=\\"{\\",a=Object.keys(e),u=0;uy.length&&40>r.length+y.length?r+y:r+\\"...\\"}r+=\\"}\\"}return t===void 0?r:-1\\"u\\")return\\"$undefined\\";if(typeof r==\\"function\\"){if(r.$$typeof===rs)return pu(e,s,i,r);if(r.$$typeof===Ar)return t=e.writtenServerReferences,i=t.get(r),i!==void 0?e=\\"$h\\"+i.toString(16):(i=r.$$bound,i=i===null?null:Promise.resolve(i),e=bs(e,{id:r.$$id,bound:i},0),t.set(r,e),e=\\"$h\\"+e.toString(16)),e;if(e.temporaryReferences!==void 0&&(e=e.temporaryReferences.get(r),e!==void 0))return\\"$T\\"+e;throw r.$$typeof===ca?Error(\\"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server.\\"):/^on[A-Z]/.test(i)?Error(\\"Event handlers cannot be passed to Client Component props.\\"+_s(s,i)+`\\nIf you need interactivity, consider converting part of this to a Client Component.`):Error(\'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \\"use server\\". Or maybe you meant to call this function rather than return it.\'+_s(s,i))}if(typeof r==\\"symbol\\"){if(t=e.writtenSymbols,a=t.get(r),a!==void 0)return Ct(a);if(a=r.description,Symbol.for(a)!==r)throw Error(\\"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(\\"+(r.description+\\") cannot be found among global symbols.\\")+_s(s,i));return e.pendingChunks++,i=e.nextChunkId++,s=Lu(e,i,\\"$S\\"+a),e.completedImportChunks.push(s),t.set(r,i),Ct(i)}if(typeof r==\\"bigint\\")return\\"$n\\"+r.toString(10);throw Error(\\"Type \\"+typeof r+\\" is not supported in Client Component props.\\"+_s(s,i))}function Kn(e,t){var s=st;st=null;try{var i=e.onError,r=i(t)}finally{st=s}if(r!=null&&typeof r!=\\"string\\")throw Error(\'onError returned something with a type other than \\"string\\". onError should return a string and may return null or undefined but must not return anything else. It received something of type \\"\'+typeof r+\'\\" instead\');return r||\\"\\"}function Ki(e,t){var s=e.onFatalError;s(t),e.destination!==null?(e.status=14,xu(e.destination,t)):(e.status=13,e.fatalError=t),e.cacheController.abort(Error(\\"The render was aborted due to a fatal error.\\",{cause:t}))}function Rr(e,t,s){s={digest:s},t=t.toString(16)+\\":E\\"+Es(s)+`\\n`,t=pn(t),e.completedErrorChunks.push(t)}function Ou(e,t,s){t=t.toString(16)+\\":\\"+s+`\\n`,t=pn(t),e.completedRegularChunks.push(t)}function Kt(e,t,s,i,r){r?e.pendingDebugChunks++:e.pendingChunks++,r=new Uint8Array(i.buffer,i.byteOffset,i.byteLength),i=2048e.status&&e.cacheController.abort(Error(\\"This render completed successfully. All cacheSignals are now aborted to allow clean up of any unused resources.\\")),e.destination!==null&&(e.status=14,e.destination.close(),e.destination=null))}function Vu(e){e.flushScheduled=e.destination!==null,vu(function(){return ra(e)}),Bi(function(){e.status===10&&(e.status=11)})}function un(e){e.flushScheduled===!1&&e.pingedTasks.length===0&&e.destination!==null&&(e.flushScheduled=!0,Bi(function(){e.flushScheduled=!1,ai(e)}))}function Or(e){e.abortableTasks.size===0&&(e=e.onAllReady,e())}function ju(e,t){if(e.status===13)e.status=14,xu(t,e.fatalError);else if(e.status!==14&&e.destination===null){e.destination=t;try{ai(e)}catch(s){Kn(e,s,null),Ki(e,s)}}}function Id(e,t){try{t.forEach(function(i){return oi(i,e)});var s=e.onAllReady;s(),ai(e)}catch(i){Kn(e,i,null),Ki(e,i)}}function Ed(e,t,s){try{t.forEach(function(r){return fa(r,e,s)});var i=e.onAllReady;i(),ai(e)}catch(r){Kn(e,r,null),Ki(e,r)}}function si(e,t){if(!(11s._arraySizeLimit&&e.fork)throw Error(\\"Maximum array nesting exceeded. Large nested arrays can be dangerous. Try adding intermediate objects.\\")}var Ye=null;function Br(e){var t=Ye;Ye=null;var s=e.reason,i=s[Dr];s=s.id,s=s===-1?void 0:s.toString(16);var r=e.value;e.status=\\"blocked\\",e.value=null,e.reason=null;try{var a=JSON.parse(r);r={count:0,fork:!1};var u=oa(i,{\\"\\":a},\\"\\",a,s,r),d=e.value;if(d!==null)for(e.value=null,e.reason=null,a=0;a{\\"use strict\\";var Hn;Hn=Zu();Wn.renderToReadableStream=Hn.renderToReadableStream;Wn.decodeReply=Hn.decodeReply;Wn.decodeAction=Hn.decodeAction;Wn.decodeFormState=Hn.decodeFormState;Wn.registerServerReference=Hn.registerServerReference;Wn.registerClientReference=Hn.registerClientReference;Wn.createClientModuleProxy=Hn.createClientModuleProxy;Wn.createTemporaryReferenceSet=Hn.createTemporaryReferenceSet});var It=Z(ya=>{\\"use strict\\";Object.defineProperty(ya,\\"__esModule\\",{value:!0});var t1;(function(e){e[e.NONE=0]=\\"NONE\\";let s=1;e[e._abstract=s]=\\"_abstract\\";let i=s+1;e[e._accessor=i]=\\"_accessor\\";let r=i+1;e[e._as=r]=\\"_as\\";let a=r+1;e[e._assert=a]=\\"_assert\\";let u=a+1;e[e._asserts=u]=\\"_asserts\\";let d=u+1;e[e._async=d]=\\"_async\\";let y=d+1;e[e._await=y]=\\"_await\\";let g=y+1;e[e._checks=g]=\\"_checks\\";let L=g+1;e[e._constructor=L]=\\"_constructor\\";let p=L+1;e[e._declare=p]=\\"_declare\\";let h=p+1;e[e._enum=h]=\\"_enum\\";let T=h+1;e[e._exports=T]=\\"_exports\\";let x=T+1;e[e._from=x]=\\"_from\\";let w=x+1;e[e._get=w]=\\"_get\\";let S=w+1;e[e._global=S]=\\"_global\\";let A=S+1;e[e._implements=A]=\\"_implements\\";let U=A+1;e[e._infer=U]=\\"_infer\\";let M=U+1;e[e._interface=M]=\\"_interface\\";let c=M+1;e[e._is=c]=\\"_is\\";let R=c+1;e[e._keyof=R]=\\"_keyof\\";let W=R+1;e[e._mixins=W]=\\"_mixins\\";let X=W+1;e[e._module=X]=\\"_module\\";let ie=X+1;e[e._namespace=ie]=\\"_namespace\\";let pe=ie+1;e[e._of=pe]=\\"_of\\";let ae=pe+1;e[e._opaque=ae]=\\"_opaque\\";let He=ae+1;e[e._out=He]=\\"_out\\";let qe=He+1;e[e._override=qe]=\\"_override\\";let Bt=qe+1;e[e._private=Bt]=\\"_private\\";let mt=Bt+1;e[e._protected=mt]=\\"_protected\\";let kt=mt+1;e[e._proto=kt]=\\"_proto\\";let At=kt+1;e[e._public=At]=\\"_public\\";let tt=At+1;e[e._readonly=tt]=\\"_readonly\\";let nt=tt+1;e[e._require=nt]=\\"_require\\";let _t=nt+1;e[e._satisfies=_t]=\\"_satisfies\\";let ct=_t+1;e[e._set=ct]=\\"_set\\";let wt=ct+1;e[e._static=wt]=\\"_static\\";let $t=wt+1;e[e._symbol=$t]=\\"_symbol\\";let Pt=$t+1;e[e._type=Pt]=\\"_type\\";let qt=Pt+1;e[e._unique=qt]=\\"_unique\\";let Tn=qt+1;e[e._using=Tn]=\\"_using\\"})(t1||(ya.ContextualKeyword=t1={}))});var be=Z(jr=>{\\"use strict\\";Object.defineProperty(jr,\\"__esModule\\",{value:!0});var q;(function(e){e[e.PRECEDENCE_MASK=15]=\\"PRECEDENCE_MASK\\";let s=16;e[e.IS_KEYWORD=s]=\\"IS_KEYWORD\\";let i=32;e[e.IS_ASSIGN=i]=\\"IS_ASSIGN\\";let r=64;e[e.IS_RIGHT_ASSOCIATIVE=r]=\\"IS_RIGHT_ASSOCIATIVE\\";let a=128;e[e.IS_PREFIX=a]=\\"IS_PREFIX\\";let u=256;e[e.IS_POSTFIX=u]=\\"IS_POSTFIX\\";let d=512;e[e.IS_EXPRESSION_START=d]=\\"IS_EXPRESSION_START\\";let y=512;e[e.num=y]=\\"num\\";let g=1536;e[e.bigint=g]=\\"bigint\\";let L=2560;e[e.decimal=L]=\\"decimal\\";let p=3584;e[e.regexp=p]=\\"regexp\\";let h=4608;e[e.string=h]=\\"string\\";let T=5632;e[e.name=T]=\\"name\\";let x=6144;e[e.eof=x]=\\"eof\\";let w=7680;e[e.bracketL=w]=\\"bracketL\\";let S=8192;e[e.bracketR=S]=\\"bracketR\\";let A=9728;e[e.braceL=A]=\\"braceL\\";let U=10752;e[e.braceBarL=U]=\\"braceBarL\\";let M=11264;e[e.braceR=M]=\\"braceR\\";let c=12288;e[e.braceBarR=c]=\\"braceBarR\\";let R=13824;e[e.parenL=R]=\\"parenL\\";let W=14336;e[e.parenR=W]=\\"parenR\\";let X=15360;e[e.comma=X]=\\"comma\\";let ie=16384;e[e.semi=ie]=\\"semi\\";let pe=17408;e[e.colon=pe]=\\"colon\\";let ae=18432;e[e.doubleColon=ae]=\\"doubleColon\\";let He=19456;e[e.dot=He]=\\"dot\\";let qe=20480;e[e.question=qe]=\\"question\\";let Bt=21504;e[e.questionDot=Bt]=\\"questionDot\\";let mt=22528;e[e.arrow=mt]=\\"arrow\\";let kt=23552;e[e.template=kt]=\\"template\\";let At=24576;e[e.ellipsis=At]=\\"ellipsis\\";let tt=25600;e[e.backQuote=tt]=\\"backQuote\\";let nt=27136;e[e.dollarBraceL=nt]=\\"dollarBraceL\\";let _t=27648;e[e.at=_t]=\\"at\\";let ct=29184;e[e.hash=ct]=\\"hash\\";let wt=29728;e[e.eq=wt]=\\"eq\\";let $t=30752;e[e.assign=$t]=\\"assign\\";let Pt=32640;e[e.preIncDec=Pt]=\\"preIncDec\\";let qt=33664;e[e.postIncDec=qt]=\\"postIncDec\\";let Tn=34432;e[e.bang=Tn]=\\"bang\\";let V=35456;e[e.tilde=V]=\\"tilde\\";let G=35841;e[e.pipeline=G]=\\"pipeline\\";let J=36866;e[e.nullishCoalescing=J]=\\"nullishCoalescing\\";let re=37890;e[e.logicalOR=re]=\\"logicalOR\\";let ve=38915;e[e.logicalAND=ve]=\\"logicalAND\\";let he=39940;e[e.bitwiseOR=he]=\\"bitwiseOR\\";let Ie=40965;e[e.bitwiseXOR=Ie]=\\"bitwiseXOR\\";let Ee=41990;e[e.bitwiseAND=Ee]=\\"bitwiseAND\\";let Le=43015;e[e.equality=Le]=\\"equality\\";let Xe=44040;e[e.lessThan=Xe]=\\"lessThan\\";let We=45064;e[e.greaterThan=We]=\\"greaterThan\\";let Ke=46088;e[e.relationalOrEqual=Ke]=\\"relationalOrEqual\\";let ut=47113;e[e.bitShiftL=ut]=\\"bitShiftL\\";let pt=48137;e[e.bitShiftR=pt]=\\"bitShiftR\\";let bt=49802;e[e.plus=bt]=\\"plus\\";let yt=50826;e[e.minus=yt]=\\"minus\\";let vt=51723;e[e.modulo=vt]=\\"modulo\\";let bn=52235;e[e.star=bn]=\\"star\\";let Dn=53259;e[e.slash=Dn]=\\"slash\\";let Ge=54348;e[e.exponent=Ge]=\\"exponent\\";let St=55296;e[e.jsxName=St]=\\"jsxName\\";let ot=56320;e[e.jsxText=ot]=\\"jsxText\\";let zt=57344;e[e.jsxEmptyText=zt]=\\"jsxEmptyText\\";let Xt=58880;e[e.jsxTagStart=Xt]=\\"jsxTagStart\\";let te=59392;e[e.jsxTagEnd=te]=\\"jsxTagEnd\\";let Cn=60928;e[e.typeParameterStart=Cn]=\\"typeParameterStart\\";let Zn=61440;e[e.nonNullAssertion=Zn]=\\"nonNullAssertion\\";let _i=62480;e[e._break=_i]=\\"_break\\";let Mn=63504;e[e._case=Mn]=\\"_case\\";let xs=64528;e[e._catch=xs]=\\"_catch\\";let Ds=65552;e[e._continue=Ds]=\\"_continue\\";let bi=66576;e[e._debugger=bi]=\\"_debugger\\";let es=67600;e[e._default=es]=\\"_default\\";let Nt=68624;e[e._do=Nt]=\\"_do\\";let Rt=69648;e[e._else=Rt]=\\"_else\\";let Ue=70672;e[e._finally=Ue]=\\"_finally\\";let wn=71696;e[e._for=wn]=\\"_for\\";let de=73232;e[e._function=de]=\\"_function\\";let Ms=73744;e[e._if=Ms]=\\"_if\\";let gs=74768;e[e._return=gs]=\\"_return\\";let Ci=75792;e[e._switch=Ci]=\\"_switch\\";let ts=77456;e[e._throw=ts]=\\"_throw\\";let rn=77840;e[e._try=rn]=\\"_try\\";let wi=78864;e[e._var=wi]=\\"_var\\";let Fn=79888;e[e._let=Fn]=\\"_let\\";let Bn=80912;e[e._const=Bn]=\\"_const\\";let Fs=81936;e[e._while=Fs]=\\"_while\\";let Si=82960;e[e._with=Si]=\\"_with\\";let Bs=84496;e[e._new=Bs]=\\"_new\\";let Vs=85520;e[e._this=Vs]=\\"_this\\";let js=86544;e[e._super=js]=\\"_super\\";let $s=87568;e[e._class=$s]=\\"_class\\";let qs=88080;e[e._extends=qs]=\\"_extends\\";let Ii=89104;e[e._export=Ii]=\\"_export\\";let Ei=90640;e[e._import=Ei]=\\"_import\\";let Ai=91664;e[e._yield=Ai]=\\"_yield\\";let Pi=92688;e[e._null=Pi]=\\"_null\\";let Ks=93712;e[e._true=Ks]=\\"_true\\";let Us=94736;e[e._false=Us]=\\"_false\\";let Hs=95256;e[e._in=Hs]=\\"_in\\";let Ws=96280;e[e._instanceof=Ws]=\\"_instanceof\\";let Gs=97936;e[e._typeof=Gs]=\\"_typeof\\";let zs=98960;e[e._void=zs]=\\"_void\\";let jo=99984;e[e._delete=jo]=\\"_delete\\";let $o=100880;e[e._async=$o]=\\"_async\\";let mr=101904;e[e._get=mr]=\\"_get\\";let qo=102928;e[e._set=qo]=\\"_set\\";let Ni=103952;e[e._declare=Ni]=\\"_declare\\";let yr=104976;e[e._readonly=yr]=\\"_readonly\\";let Ko=106e3;e[e._abstract=Ko]=\\"_abstract\\";let le=107024;e[e._static=le]=\\"_static\\";let Xs=107536;e[e._public=Xs]=\\"_public\\";let on=108560;e[e._private=on]=\\"_private\\";let Uo=109584;e[e._protected=Uo]=\\"_protected\\";let Ho=110608;e[e._override=Ho]=\\"_override\\";let Tr=112144;e[e._as=Tr]=\\"_as\\";let Wo=113168;e[e._enum=Wo]=\\"_enum\\";let Go=114192;e[e._type=Go]=\\"_type\\";let kr=115216;e[e._implements=kr]=\\"_implements\\"})(q||(jr.TokenType=q={}));function Bd(e){switch(e){case q.num:return\\"num\\";case q.bigint:return\\"bigint\\";case q.decimal:return\\"decimal\\";case q.regexp:return\\"regexp\\";case q.string:return\\"string\\";case q.name:return\\"name\\";case q.eof:return\\"eof\\";case q.bracketL:return\\"[\\";case q.bracketR:return\\"]\\";case q.braceL:return\\"{\\";case q.braceBarL:return\\"{|\\";case q.braceR:return\\"}\\";case q.braceBarR:return\\"|}\\";case q.parenL:return\\"(\\";case q.parenR:return\\")\\";case q.comma:return\\",\\";case q.semi:return\\";\\";case q.colon:return\\":\\";case q.doubleColon:return\\"::\\";case q.dot:return\\".\\";case q.question:return\\"?\\";case q.questionDot:return\\"?.\\";case q.arrow:return\\"=>\\";case q.template:return\\"template\\";case q.ellipsis:return\\"...\\";case q.backQuote:return\\"`\\";case q.dollarBraceL:return\\"${\\";case q.at:return\\"@\\";case q.hash:return\\"#\\";case q.eq:return\\"=\\";case q.assign:return\\"_=\\";case q.preIncDec:return\\"++/--\\";case q.postIncDec:return\\"++/--\\";case q.bang:return\\"!\\";case q.tilde:return\\"~\\";case q.pipeline:return\\"|>\\";case q.nullishCoalescing:return\\"??\\";case q.logicalOR:return\\"||\\";case q.logicalAND:return\\"&&\\";case q.bitwiseOR:return\\"|\\";case q.bitwiseXOR:return\\"^\\";case q.bitwiseAND:return\\"&\\";case q.equality:return\\"==/!=\\";case q.lessThan:return\\"<\\";case q.greaterThan:return\\">\\";case q.relationalOrEqual:return\\"<=/>=\\";case q.bitShiftL:return\\"<<\\";case q.bitShiftR:return\\">>/>>>\\";case q.plus:return\\"+\\";case q.minus:return\\"-\\";case q.modulo:return\\"%\\";case q.star:return\\"*\\";case q.slash:return\\"/\\";case q.exponent:return\\"**\\";case q.jsxName:return\\"jsxName\\";case q.jsxText:return\\"jsxText\\";case q.jsxEmptyText:return\\"jsxEmptyText\\";case q.jsxTagStart:return\\"jsxTagStart\\";case q.jsxTagEnd:return\\"jsxTagEnd\\";case q.typeParameterStart:return\\"typeParameterStart\\";case q.nonNullAssertion:return\\"nonNullAssertion\\";case q._break:return\\"break\\";case q._case:return\\"case\\";case q._catch:return\\"catch\\";case q._continue:return\\"continue\\";case q._debugger:return\\"debugger\\";case q._default:return\\"default\\";case q._do:return\\"do\\";case q._else:return\\"else\\";case q._finally:return\\"finally\\";case q._for:return\\"for\\";case q._function:return\\"function\\";case q._if:return\\"if\\";case q._return:return\\"return\\";case q._switch:return\\"switch\\";case q._throw:return\\"throw\\";case q._try:return\\"try\\";case q._var:return\\"var\\";case q._let:return\\"let\\";case q._const:return\\"const\\";case q._while:return\\"while\\";case q._with:return\\"with\\";case q._new:return\\"new\\";case q._this:return\\"this\\";case q._super:return\\"super\\";case q._class:return\\"class\\";case q._extends:return\\"extends\\";case q._export:return\\"export\\";case q._import:return\\"import\\";case q._yield:return\\"yield\\";case q._null:return\\"null\\";case q._true:return\\"true\\";case q._false:return\\"false\\";case q._in:return\\"in\\";case q._instanceof:return\\"instanceof\\";case q._typeof:return\\"typeof\\";case q._void:return\\"void\\";case q._delete:return\\"delete\\";case q._async:return\\"async\\";case q._get:return\\"get\\";case q._set:return\\"set\\";case q._declare:return\\"declare\\";case q._readonly:return\\"readonly\\";case q._abstract:return\\"abstract\\";case q._static:return\\"static\\";case q._public:return\\"public\\";case q._private:return\\"private\\";case q._protected:return\\"protected\\";case q._override:return\\"override\\";case q._as:return\\"as\\";case q._enum:return\\"enum\\";case q._type:return\\"type\\";case q._implements:return\\"implements\\";default:return\\"\\"}}jr.formatTokenType=Bd});var qr=Z(Ui=>{\\"use strict\\";Object.defineProperty(Ui,\\"__esModule\\",{value:!0});var Vd=It(),jd=be(),Ta=class{constructor(t,s,i){this.startTokenIndex=t,this.endTokenIndex=s,this.isFunctionScope=i}};Ui.Scope=Ta;var $r=class{constructor(t,s,i,r,a,u,d,y,g,L,p,h,T){this.potentialArrowAt=t,this.noAnonFunctionType=s,this.inDisallowConditionalTypesContext=i,this.tokensLength=r,this.scopesLength=a,this.pos=u,this.type=d,this.contextualKeyword=y,this.start=g,this.end=L,this.isType=p,this.scopeDepth=h,this.error=T}};Ui.StateSnapshot=$r;var ka=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this),e.prototype.__init6.call(this),e.prototype.__init7.call(this),e.prototype.__init8.call(this),e.prototype.__init9.call(this),e.prototype.__init10.call(this),e.prototype.__init11.call(this),e.prototype.__init12.call(this),e.prototype.__init13.call(this)}__init(){this.potentialArrowAt=-1}__init2(){this.noAnonFunctionType=!1}__init3(){this.inDisallowConditionalTypesContext=!1}__init4(){this.tokens=[]}__init5(){this.scopes=[]}__init6(){this.pos=0}__init7(){this.type=jd.TokenType.eof}__init8(){this.contextualKeyword=Vd.ContextualKeyword.NONE}__init9(){this.start=0}__init10(){this.end=0}__init11(){this.isType=!1}__init12(){this.scopeDepth=0}__init13(){this.error=null}snapshot(){return new $r(this.potentialArrowAt,this.noAnonFunctionType,this.inDisallowConditionalTypesContext,this.tokens.length,this.scopes.length,this.pos,this.type,this.contextualKeyword,this.start,this.end,this.isType,this.scopeDepth,this.error)}restoreFromSnapshot(t){this.potentialArrowAt=t.potentialArrowAt,this.noAnonFunctionType=t.noAnonFunctionType,this.inDisallowConditionalTypesContext=t.inDisallowConditionalTypesContext,this.tokens.length=t.tokensLength,this.scopes.length=t.scopesLength,this.pos=t.pos,this.type=t.type,this.contextualKeyword=t.contextualKeyword,this.start=t.start,this.end=t.end,this.isType=t.isType,this.scopeDepth=t.scopeDepth,this.error=t.error}};Ui.default=ka});var Qt=Z(Kr=>{\\"use strict\\";Object.defineProperty(Kr,\\"__esModule\\",{value:!0});var as;(function(e){e[e.backSpace=8]=\\"backSpace\\";let s=10;e[e.lineFeed=s]=\\"lineFeed\\";let i=9;e[e.tab=i]=\\"tab\\";let r=13;e[e.carriageReturn=r]=\\"carriageReturn\\";let a=14;e[e.shiftOut=a]=\\"shiftOut\\";let u=32;e[e.space=u]=\\"space\\";let d=33;e[e.exclamationMark=d]=\\"exclamationMark\\";let y=34;e[e.quotationMark=y]=\\"quotationMark\\";let g=35;e[e.numberSign=g]=\\"numberSign\\";let L=36;e[e.dollarSign=L]=\\"dollarSign\\";let p=37;e[e.percentSign=p]=\\"percentSign\\";let h=38;e[e.ampersand=h]=\\"ampersand\\";let T=39;e[e.apostrophe=T]=\\"apostrophe\\";let x=40;e[e.leftParenthesis=x]=\\"leftParenthesis\\";let w=41;e[e.rightParenthesis=w]=\\"rightParenthesis\\";let S=42;e[e.asterisk=S]=\\"asterisk\\";let A=43;e[e.plusSign=A]=\\"plusSign\\";let U=44;e[e.comma=U]=\\"comma\\";let M=45;e[e.dash=M]=\\"dash\\";let c=46;e[e.dot=c]=\\"dot\\";let R=47;e[e.slash=R]=\\"slash\\";let W=48;e[e.digit0=W]=\\"digit0\\";let X=49;e[e.digit1=X]=\\"digit1\\";let ie=50;e[e.digit2=ie]=\\"digit2\\";let pe=51;e[e.digit3=pe]=\\"digit3\\";let ae=52;e[e.digit4=ae]=\\"digit4\\";let He=53;e[e.digit5=He]=\\"digit5\\";let qe=54;e[e.digit6=qe]=\\"digit6\\";let Bt=55;e[e.digit7=Bt]=\\"digit7\\";let mt=56;e[e.digit8=mt]=\\"digit8\\";let kt=57;e[e.digit9=kt]=\\"digit9\\";let At=58;e[e.colon=At]=\\"colon\\";let tt=59;e[e.semicolon=tt]=\\"semicolon\\";let nt=60;e[e.lessThan=nt]=\\"lessThan\\";let _t=61;e[e.equalsTo=_t]=\\"equalsTo\\";let ct=62;e[e.greaterThan=ct]=\\"greaterThan\\";let wt=63;e[e.questionMark=wt]=\\"questionMark\\";let $t=64;e[e.atSign=$t]=\\"atSign\\";let Pt=65;e[e.uppercaseA=Pt]=\\"uppercaseA\\";let qt=66;e[e.uppercaseB=qt]=\\"uppercaseB\\";let Tn=67;e[e.uppercaseC=Tn]=\\"uppercaseC\\";let V=68;e[e.uppercaseD=V]=\\"uppercaseD\\";let G=69;e[e.uppercaseE=G]=\\"uppercaseE\\";let J=70;e[e.uppercaseF=J]=\\"uppercaseF\\";let re=71;e[e.uppercaseG=re]=\\"uppercaseG\\";let ve=72;e[e.uppercaseH=ve]=\\"uppercaseH\\";let he=73;e[e.uppercaseI=he]=\\"uppercaseI\\";let Ie=74;e[e.uppercaseJ=Ie]=\\"uppercaseJ\\";let Ee=75;e[e.uppercaseK=Ee]=\\"uppercaseK\\";let Le=76;e[e.uppercaseL=Le]=\\"uppercaseL\\";let Xe=77;e[e.uppercaseM=Xe]=\\"uppercaseM\\";let We=78;e[e.uppercaseN=We]=\\"uppercaseN\\";let Ke=79;e[e.uppercaseO=Ke]=\\"uppercaseO\\";let ut=80;e[e.uppercaseP=ut]=\\"uppercaseP\\";let pt=81;e[e.uppercaseQ=pt]=\\"uppercaseQ\\";let bt=82;e[e.uppercaseR=bt]=\\"uppercaseR\\";let yt=83;e[e.uppercaseS=yt]=\\"uppercaseS\\";let vt=84;e[e.uppercaseT=vt]=\\"uppercaseT\\";let bn=85;e[e.uppercaseU=bn]=\\"uppercaseU\\";let Dn=86;e[e.uppercaseV=Dn]=\\"uppercaseV\\";let Ge=87;e[e.uppercaseW=Ge]=\\"uppercaseW\\";let St=88;e[e.uppercaseX=St]=\\"uppercaseX\\";let ot=89;e[e.uppercaseY=ot]=\\"uppercaseY\\";let zt=90;e[e.uppercaseZ=zt]=\\"uppercaseZ\\";let Xt=91;e[e.leftSquareBracket=Xt]=\\"leftSquareBracket\\";let te=92;e[e.backslash=te]=\\"backslash\\";let Cn=93;e[e.rightSquareBracket=Cn]=\\"rightSquareBracket\\";let Zn=94;e[e.caret=Zn]=\\"caret\\";let _i=95;e[e.underscore=_i]=\\"underscore\\";let Mn=96;e[e.graveAccent=Mn]=\\"graveAccent\\";let xs=97;e[e.lowercaseA=xs]=\\"lowercaseA\\";let Ds=98;e[e.lowercaseB=Ds]=\\"lowercaseB\\";let bi=99;e[e.lowercaseC=bi]=\\"lowercaseC\\";let es=100;e[e.lowercaseD=es]=\\"lowercaseD\\";let Nt=101;e[e.lowercaseE=Nt]=\\"lowercaseE\\";let Rt=102;e[e.lowercaseF=Rt]=\\"lowercaseF\\";let Ue=103;e[e.lowercaseG=Ue]=\\"lowercaseG\\";let wn=104;e[e.lowercaseH=wn]=\\"lowercaseH\\";let de=105;e[e.lowercaseI=de]=\\"lowercaseI\\";let Ms=106;e[e.lowercaseJ=Ms]=\\"lowercaseJ\\";let gs=107;e[e.lowercaseK=gs]=\\"lowercaseK\\";let Ci=108;e[e.lowercaseL=Ci]=\\"lowercaseL\\";let ts=109;e[e.lowercaseM=ts]=\\"lowercaseM\\";let rn=110;e[e.lowercaseN=rn]=\\"lowercaseN\\";let wi=111;e[e.lowercaseO=wi]=\\"lowercaseO\\";let Fn=112;e[e.lowercaseP=Fn]=\\"lowercaseP\\";let Bn=113;e[e.lowercaseQ=Bn]=\\"lowercaseQ\\";let Fs=114;e[e.lowercaseR=Fs]=\\"lowercaseR\\";let Si=115;e[e.lowercaseS=Si]=\\"lowercaseS\\";let Bs=116;e[e.lowercaseT=Bs]=\\"lowercaseT\\";let Vs=117;e[e.lowercaseU=Vs]=\\"lowercaseU\\";let js=118;e[e.lowercaseV=js]=\\"lowercaseV\\";let $s=119;e[e.lowercaseW=$s]=\\"lowercaseW\\";let qs=120;e[e.lowercaseX=qs]=\\"lowercaseX\\";let Ii=121;e[e.lowercaseY=Ii]=\\"lowercaseY\\";let Ei=122;e[e.lowercaseZ=Ei]=\\"lowercaseZ\\";let Ai=123;e[e.leftCurlyBrace=Ai]=\\"leftCurlyBrace\\";let Pi=124;e[e.verticalBar=Pi]=\\"verticalBar\\";let Ks=125;e[e.rightCurlyBrace=Ks]=\\"rightCurlyBrace\\";let Us=126;e[e.tilde=Us]=\\"tilde\\";let Hs=160;e[e.nonBreakingSpace=Hs]=\\"nonBreakingSpace\\";let Ws=5760;e[e.oghamSpaceMark=Ws]=\\"oghamSpaceMark\\";let Gs=8232;e[e.lineSeparator=Gs]=\\"lineSeparator\\";let zs=8233;e[e.paragraphSeparator=zs]=\\"paragraphSeparator\\"})(as||(Kr.charCodes=as={}));function $d(e){return e>=as.digit0&&e<=as.digit9||e>=as.lowercaseA&&e<=as.lowercaseF||e>=as.uppercaseA&&e<=as.uppercaseF}Kr.isDigit=$d});var Zt=Z(ft=>{\\"use strict\\";Object.defineProperty(ft,\\"__esModule\\",{value:!0});function qd(e){return e&&e.__esModule?e:{default:e}}var Kd=qr(),Ud=qd(Kd),Hd=Qt();ft.isJSXEnabled;ft.isTypeScriptEnabled;ft.isFlowEnabled;ft.state;ft.input;ft.nextContextId;function Wd(){return ft.nextContextId++}ft.getNextContextId=Wd;function Gd(e){if(\\"pos\\"in e){let t=n1(e.pos);e.message+=` (${t.line}:${t.column})`,e.loc=t}return e}ft.augmentError=Gd;var Ur=class{constructor(t,s){this.line=t,this.column=s}};ft.Loc=Ur;function n1(e){let t=1,s=1;for(let i=0;i{\\"use strict\\";Object.defineProperty(tn,\\"__esModule\\",{value:!0});var ls=xt(),As=be(),Hr=Qt(),en=Zt();function Xd(e){return en.state.contextualKeyword===e}tn.isContextual=Xd;function Yd(e){let t=ls.lookaheadTypeAndKeyword.call(void 0);return t.type===As.TokenType.name&&t.contextualKeyword===e}tn.isLookaheadContextual=Yd;function s1(e){return en.state.contextualKeyword===e&&ls.eat.call(void 0,As.TokenType.name)}tn.eatContextual=s1;function Jd(e){s1(e)||Wr()}tn.expectContextual=Jd;function i1(){return ls.match.call(void 0,As.TokenType.eof)||ls.match.call(void 0,As.TokenType.braceR)||r1()}tn.canInsertSemicolon=i1;function r1(){let e=en.state.tokens[en.state.tokens.length-1],t=e?e.end:0;for(let s=t;s{\\"use strict\\";Object.defineProperty(Ps,\\"__esModule\\",{value:!0});var va=Qt(),tm=[9,11,12,va.charCodes.space,va.charCodes.nonBreakingSpace,va.charCodes.oghamSpaceMark,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];Ps.WHITESPACE_CHARS=tm;var nm=/(?:\\\\s|\\\\/\\\\/.*|\\\\/\\\\*[^]*?\\\\*\\\\/)*/g;Ps.skipWhiteSpace=nm;var sm=new Uint8Array(65536);Ps.IS_WHITESPACE=sm;for(let e of Ps.WHITESPACE_CHARS)Ps.IS_WHITESPACE[e]=1});var li=Z(vn=>{\\"use strict\\";Object.defineProperty(vn,\\"__esModule\\",{value:!0});var a1=Qt(),im=xa();function rm(e){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e<128)return!1;throw new Error(\\"Should not be called with non-ASCII char code.\\")}var om=new Uint8Array(65536);vn.IS_IDENTIFIER_CHAR=om;for(let e=0;e<128;e++)vn.IS_IDENTIFIER_CHAR[e]=rm(e)?1:0;for(let e=128;e<65536;e++)vn.IS_IDENTIFIER_CHAR[e]=1;for(let e of im.WHITESPACE_CHARS)vn.IS_IDENTIFIER_CHAR[e]=0;vn.IS_IDENTIFIER_CHAR[8232]=0;vn.IS_IDENTIFIER_CHAR[8233]=0;var am=vn.IS_IDENTIFIER_CHAR.slice();vn.IS_IDENTIFIER_START=am;for(let e=a1.charCodes.digit0;e<=a1.charCodes.digit9;e++)vn.IS_IDENTIFIER_START[e]=0});var l1=Z(ga=>{\\"use strict\\";Object.defineProperty(ga,\\"__esModule\\",{value:!0});var ge=It(),Ce=be(),lm=new Int32Array([-1,27,783,918,1755,2376,2862,3483,-1,3699,-1,4617,4752,4833,5130,5508,5940,-1,6480,6939,7749,8181,8451,8613,-1,8829,-1,-1,-1,54,243,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,432,-1,-1,-1,675,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,81,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,108,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,135,-1,-1,-1,-1,-1,-1,-1,-1,-1,162,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,189,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,216,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._abstract<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,270,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,297,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,324,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,351,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,378,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,405,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._accessor<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._as<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,459,-1,-1,-1,-1,-1,594,-1,-1,-1,-1,-1,-1,486,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,513,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,540,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._assert<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,567,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._asserts<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,621,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,648,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._async<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,702,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,729,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,756,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._await<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,810,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,837,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,864,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,891,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._break<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,945,-1,-1,-1,-1,-1,-1,1107,-1,-1,-1,1242,-1,-1,1350,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,972,1026,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,999,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._case<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1053,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1080,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._catch<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1134,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1161,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1188,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1215,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._checks<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1269,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1296,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1323,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._class<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1377,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1404,1620,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1431,-1,-1,-1,-1,-1,-1,(Ce.TokenType._const<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1458,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1485,-1,-1,-1,-1,-1,-1,-1,-1,1512,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1539,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1566,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1593,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._constructor<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1647,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1674,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1701,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1728,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._continue<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1782,-1,-1,-1,-1,-1,-1,-1,-1,-1,2349,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1809,1971,-1,-1,2106,-1,-1,-1,-1,-1,2241,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1836,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1863,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1890,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1917,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1944,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._debugger<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1998,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2025,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2052,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2079,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._declare<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2133,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2160,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2187,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2214,-1,-1,-1,-1,-1,-1,(Ce.TokenType._default<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2268,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2295,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2322,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._delete<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._do<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2403,-1,2484,-1,-1,-1,-1,-1,-1,-1,-1,-1,2565,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2430,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2457,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._else<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2511,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2538,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._enum<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2592,-1,-1,-1,2727,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2619,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2646,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2673,-1,-1,-1,-1,-1,-1,(Ce.TokenType._export<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2700,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._exports<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2754,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2781,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2808,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2835,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._extends<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2889,-1,-1,-1,-1,-1,-1,-1,2997,-1,-1,-1,-1,-1,3159,-1,-1,3213,-1,-1,3294,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2916,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2943,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2970,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._false<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3024,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3051,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3078,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3105,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3132,-1,(Ce.TokenType._finally<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3186,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._for<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3240,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3267,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._from<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3321,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3348,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3375,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3402,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3429,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3456,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._function<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3510,-1,-1,-1,-1,-1,-1,3564,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3537,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._get<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3591,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3618,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3645,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3672,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._global<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3726,-1,-1,-1,-1,-1,-1,3753,4077,-1,-1,-1,-1,4590,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._if<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3780,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3807,-1,-1,3996,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3834,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3861,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3888,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3915,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3942,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3969,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._implements<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4023,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4050,-1,-1,-1,-1,-1,-1,(Ce.TokenType._import<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._in<<1)+1,-1,-1,-1,-1,-1,4104,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4185,4401,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4131,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4158,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._infer<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4212,-1,-1,-1,-1,-1,-1,-1,4239,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4266,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4293,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4320,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4347,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4374,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._instanceof<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4428,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4455,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4482,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4509,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4536,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4563,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._interface<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._is<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4644,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4671,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4698,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4725,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._keyof<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4779,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4806,-1,-1,-1,-1,-1,-1,(Ce.TokenType._let<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4860,-1,-1,-1,-1,-1,4995,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4887,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4914,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4941,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4968,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._mixins<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5022,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5049,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5076,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5103,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._module<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5157,-1,-1,-1,5373,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5427,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5184,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5211,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5238,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5265,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5292,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5319,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5346,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._namespace<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5400,-1,-1,-1,(Ce.TokenType._new<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5454,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5481,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._null<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5535,-1,-1,-1,-1,-1,-1,-1,-1,-1,5562,-1,-1,-1,-1,5697,5751,-1,-1,-1,-1,ge.ContextualKeyword._of<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5589,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5616,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5643,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5670,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._opaque<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5724,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._out<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5778,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5805,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5832,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5859,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5886,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5913,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._override<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5967,-1,-1,6345,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5994,-1,-1,-1,-1,-1,6129,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6021,-1,-1,-1,-1,-1,6048,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6075,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6102,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._private<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6156,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6183,-1,-1,-1,-1,-1,-1,-1,-1,-1,6318,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6210,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6237,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6264,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6291,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._protected<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._proto<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6372,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6399,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6426,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6453,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._public<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6507,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6534,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6696,-1,-1,6831,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6561,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6588,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6615,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6642,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6669,-1,ge.ContextualKeyword._readonly<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6723,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6750,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6777,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6804,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._require<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6858,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6885,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6912,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._return<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6966,-1,-1,-1,7182,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7236,7371,-1,7479,-1,7614,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6993,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7020,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7047,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7074,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7101,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7128,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7155,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._satisfies<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7209,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._set<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7263,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7290,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7317,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7344,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._static<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7398,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7425,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7452,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._super<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7506,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7533,-1,-1,-1,-1,-1,-1,-1,-1,-1,7560,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7587,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._switch<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7641,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7668,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7695,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7722,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._symbol<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7776,-1,-1,-1,-1,-1,-1,-1,-1,-1,7938,-1,-1,-1,-1,-1,-1,8046,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7803,-1,-1,-1,-1,-1,-1,-1,-1,7857,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7830,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._this<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7884,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7911,-1,-1,-1,(Ce.TokenType._throw<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7965,-1,-1,-1,8019,-1,-1,-1,-1,-1,-1,7992,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._true<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._try<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8073,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8100,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._type<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8127,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8154,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._typeof<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8208,-1,-1,-1,-1,8343,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8235,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8262,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8289,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8316,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._unique<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8370,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8397,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8424,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,ge.ContextualKeyword._using<<1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8478,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8532,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8505,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._var<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8559,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8586,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._void<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8640,8748,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8667,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8694,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8721,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._while<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8775,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8802,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._with<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8856,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8883,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8910,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8937,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,(Ce.TokenType._yield<<1)+1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);ga.READ_WORD_TREE=lm});var h1=Z(ba=>{\\"use strict\\";Object.defineProperty(ba,\\"__esModule\\",{value:!0});var xn=Zt(),us=Qt(),c1=li(),_a=xt(),u1=l1(),p1=be();function cm(){let e=0,t=0,s=xn.state.pos;for(;sus.charCodes.lowercaseZ));){let r=u1.READ_WORD_TREE[e+(t-us.charCodes.lowercaseA)+1];if(r===-1)break;e=r,s++}let i=u1.READ_WORD_TREE[e];if(i>-1&&!c1.IS_IDENTIFIER_CHAR[t]){xn.state.pos=s,i&1?_a.finishToken.call(void 0,i>>>1):_a.finishToken.call(void 0,p1.TokenType.name,i>>>1);return}for(;s{\\"use strict\\";Object.defineProperty(Be,\\"__esModule\\",{value:!0});function um(e){return e&&e.__esModule?e:{default:e}}var b=Zt(),ci=cs(),F=Qt(),d1=li(),wa=xa(),pm=It(),hm=h1(),fm=um(hm),ne=be(),it;(function(e){e[e.Access=0]=\\"Access\\";let s=1;e[e.ExportAccess=s]=\\"ExportAccess\\";let i=s+1;e[e.TopLevelDeclaration=i]=\\"TopLevelDeclaration\\";let r=i+1;e[e.FunctionScopedDeclaration=r]=\\"FunctionScopedDeclaration\\";let a=r+1;e[e.BlockScopedDeclaration=a]=\\"BlockScopedDeclaration\\";let u=a+1;e[e.ObjectShorthandTopLevelDeclaration=u]=\\"ObjectShorthandTopLevelDeclaration\\";let d=u+1;e[e.ObjectShorthandFunctionScopedDeclaration=d]=\\"ObjectShorthandFunctionScopedDeclaration\\";let y=d+1;e[e.ObjectShorthandBlockScopedDeclaration=y]=\\"ObjectShorthandBlockScopedDeclaration\\";let g=y+1;e[e.ObjectShorthand=g]=\\"ObjectShorthand\\";let L=g+1;e[e.ImportDeclaration=L]=\\"ImportDeclaration\\";let p=L+1;e[e.ObjectKey=p]=\\"ObjectKey\\";let h=p+1;e[e.ImportAccess=h]=\\"ImportAccess\\"})(it||(Be.IdentifierRole=it={}));var f1;(function(e){e[e.NoChildren=0]=\\"NoChildren\\";let s=1;e[e.OneChild=s]=\\"OneChild\\";let i=s+1;e[e.StaticChildren=i]=\\"StaticChildren\\";let r=i+1;e[e.KeyAfterPropSpread=r]=\\"KeyAfterPropSpread\\"})(f1||(Be.JSXRole=f1={}));function dm(e){let t=e.identifierRole;return t===it.TopLevelDeclaration||t===it.FunctionScopedDeclaration||t===it.BlockScopedDeclaration||t===it.ObjectShorthandTopLevelDeclaration||t===it.ObjectShorthandFunctionScopedDeclaration||t===it.ObjectShorthandBlockScopedDeclaration}Be.isDeclaration=dm;function mm(e){let t=e.identifierRole;return t===it.FunctionScopedDeclaration||t===it.BlockScopedDeclaration||t===it.ObjectShorthandFunctionScopedDeclaration||t===it.ObjectShorthandBlockScopedDeclaration}Be.isNonTopLevelDeclaration=mm;function ym(e){let t=e.identifierRole;return t===it.TopLevelDeclaration||t===it.ObjectShorthandTopLevelDeclaration||t===it.ImportDeclaration}Be.isTopLevelDeclaration=ym;function Tm(e){let t=e.identifierRole;return t===it.TopLevelDeclaration||t===it.BlockScopedDeclaration||t===it.ObjectShorthandTopLevelDeclaration||t===it.ObjectShorthandBlockScopedDeclaration}Be.isBlockScopedDeclaration=Tm;function km(e){let t=e.identifierRole;return t===it.FunctionScopedDeclaration||t===it.ObjectShorthandFunctionScopedDeclaration}Be.isFunctionScopedDeclaration=km;function vm(e){return e.identifierRole===it.ObjectShorthandTopLevelDeclaration||e.identifierRole===it.ObjectShorthandBlockScopedDeclaration||e.identifierRole===it.ObjectShorthandFunctionScopedDeclaration}Be.isObjectShorthandDeclaration=vm;var Hi=class{constructor(){this.type=b.state.type,this.contextualKeyword=b.state.contextualKeyword,this.start=b.state.start,this.end=b.state.end,this.scopeDepth=b.state.scopeDepth,this.isType=b.state.isType,this.identifierRole=null,this.jsxRole=null,this.shadowsGlobal=!1,this.isAsyncOperation=!1,this.contextId=null,this.rhsEndIndex=null,this.isExpression=!1,this.numNullishCoalesceStarts=0,this.numNullishCoalesceEnds=0,this.isOptionalChainStart=!1,this.isOptionalChainEnd=!1,this.subscriptStartIndex=null,this.nullishStartIndex=null}};Be.Token=Hi;function zr(){b.state.tokens.push(new Hi),k1()}Be.next=zr;function xm(){b.state.tokens.push(new Hi),b.state.start=b.state.pos,Km()}Be.nextTemplateToken=xm;function gm(){b.state.type===ne.TokenType.assign&&--b.state.pos,jm()}Be.retokenizeSlashAsRegex=gm;function _m(e){for(let s=b.state.tokens.length-e;s=b.input.length){let e=b.state.tokens;e.length>=2&&e[e.length-1].start>=b.input.length&&e[e.length-2].start>=b.input.length&&ci.unexpected.call(void 0,\\"Unexpectedly reached the end of input.\\"),Ve(ne.TokenType.eof);return}Em(b.input.charCodeAt(b.state.pos))}Be.nextToken=k1;function Em(e){d1.IS_IDENTIFIER_START[e]||e===F.charCodes.backslash||e===F.charCodes.atSign&&b.input.charCodeAt(b.state.pos+1)===F.charCodes.atSign?fm.default.call(void 0):_1(e)}function Am(){for(;b.input.charCodeAt(b.state.pos)!==F.charCodes.asterisk||b.input.charCodeAt(b.state.pos+1)!==F.charCodes.slash;)if(b.state.pos++,b.state.pos>b.input.length){ci.unexpected.call(void 0,\\"Unterminated comment\\",b.state.pos-2);return}b.state.pos+=2}function v1(e){let t=b.input.charCodeAt(b.state.pos+=e);if(b.state.pos=F.charCodes.digit0&&e<=F.charCodes.digit9){b1(!0);return}e===F.charCodes.dot&&b.input.charCodeAt(b.state.pos+2)===F.charCodes.dot?(b.state.pos+=3,Ve(ne.TokenType.ellipsis)):(++b.state.pos,Ve(ne.TokenType.dot))}function Nm(){b.input.charCodeAt(b.state.pos+1)===F.charCodes.equalsTo?Fe(ne.TokenType.assign,2):Fe(ne.TokenType.slash,1)}function Rm(e){let t=e===F.charCodes.asterisk?ne.TokenType.star:ne.TokenType.modulo,s=1,i=b.input.charCodeAt(b.state.pos+1);e===F.charCodes.asterisk&&i===F.charCodes.asterisk&&(s++,i=b.input.charCodeAt(b.state.pos+2),t=ne.TokenType.exponent),i===F.charCodes.equalsTo&&b.input.charCodeAt(b.state.pos+2)!==F.charCodes.greaterThan&&(s++,t=ne.TokenType.assign),Fe(t,s)}function Lm(e){let t=b.input.charCodeAt(b.state.pos+1);if(t===e){b.input.charCodeAt(b.state.pos+2)===F.charCodes.equalsTo?Fe(ne.TokenType.assign,3):Fe(e===F.charCodes.verticalBar?ne.TokenType.logicalOR:ne.TokenType.logicalAND,2);return}if(e===F.charCodes.verticalBar){if(t===F.charCodes.greaterThan){Fe(ne.TokenType.pipeline,2);return}else if(t===F.charCodes.rightCurlyBrace&&b.isFlowEnabled){Fe(ne.TokenType.braceBarR,2);return}}if(t===F.charCodes.equalsTo){Fe(ne.TokenType.assign,2);return}Fe(e===F.charCodes.verticalBar?ne.TokenType.bitwiseOR:ne.TokenType.bitwiseAND,1)}function Om(){b.input.charCodeAt(b.state.pos+1)===F.charCodes.equalsTo?Fe(ne.TokenType.assign,2):Fe(ne.TokenType.bitwiseXOR,1)}function Dm(e){let t=b.input.charCodeAt(b.state.pos+1);if(t===e){Fe(ne.TokenType.preIncDec,2);return}t===F.charCodes.equalsTo?Fe(ne.TokenType.assign,2):e===F.charCodes.plusSign?Fe(ne.TokenType.plus,1):Fe(ne.TokenType.minus,1)}function Mm(){let e=b.input.charCodeAt(b.state.pos+1);if(e===F.charCodes.lessThan){if(b.input.charCodeAt(b.state.pos+2)===F.charCodes.equalsTo){Fe(ne.TokenType.assign,3);return}b.state.isType?Fe(ne.TokenType.lessThan,1):Fe(ne.TokenType.bitShiftL,2);return}e===F.charCodes.equalsTo?Fe(ne.TokenType.relationalOrEqual,2):Fe(ne.TokenType.lessThan,1)}function g1(){if(b.state.isType){Fe(ne.TokenType.greaterThan,1);return}let e=b.input.charCodeAt(b.state.pos+1);if(e===F.charCodes.greaterThan){let t=b.input.charCodeAt(b.state.pos+2)===F.charCodes.greaterThan?3:2;if(b.input.charCodeAt(b.state.pos+t)===F.charCodes.equalsTo){Fe(ne.TokenType.assign,t+1);return}Fe(ne.TokenType.bitShiftR,t);return}e===F.charCodes.equalsTo?Fe(ne.TokenType.relationalOrEqual,2):Fe(ne.TokenType.greaterThan,1)}function Fm(){b.state.type===ne.TokenType.greaterThan&&(b.state.pos-=1,g1())}Be.rescan_gt=Fm;function Bm(e){let t=b.input.charCodeAt(b.state.pos+1);if(t===F.charCodes.equalsTo){Fe(ne.TokenType.equality,b.input.charCodeAt(b.state.pos+2)===F.charCodes.equalsTo?3:2);return}if(e===F.charCodes.equalsTo&&t===F.charCodes.greaterThan){b.state.pos+=2,Ve(ne.TokenType.arrow);return}Fe(e===F.charCodes.equalsTo?ne.TokenType.eq:ne.TokenType.bang,1)}function Vm(){let e=b.input.charCodeAt(b.state.pos+1),t=b.input.charCodeAt(b.state.pos+2);e===F.charCodes.questionMark&&!(b.isFlowEnabled&&b.state.isType)?t===F.charCodes.equalsTo?Fe(ne.TokenType.assign,3):Fe(ne.TokenType.nullishCoalescing,2):e===F.charCodes.dot&&!(t>=F.charCodes.digit0&&t<=F.charCodes.digit9)?(b.state.pos+=2,Ve(ne.TokenType.questionDot)):(++b.state.pos,Ve(ne.TokenType.question))}function _1(e){switch(e){case F.charCodes.numberSign:++b.state.pos,Ve(ne.TokenType.hash);return;case F.charCodes.dot:Pm();return;case F.charCodes.leftParenthesis:++b.state.pos,Ve(ne.TokenType.parenL);return;case F.charCodes.rightParenthesis:++b.state.pos,Ve(ne.TokenType.parenR);return;case F.charCodes.semicolon:++b.state.pos,Ve(ne.TokenType.semi);return;case F.charCodes.comma:++b.state.pos,Ve(ne.TokenType.comma);return;case F.charCodes.leftSquareBracket:++b.state.pos,Ve(ne.TokenType.bracketL);return;case F.charCodes.rightSquareBracket:++b.state.pos,Ve(ne.TokenType.bracketR);return;case F.charCodes.leftCurlyBrace:b.isFlowEnabled&&b.input.charCodeAt(b.state.pos+1)===F.charCodes.verticalBar?Fe(ne.TokenType.braceBarL,2):(++b.state.pos,Ve(ne.TokenType.braceL));return;case F.charCodes.rightCurlyBrace:++b.state.pos,Ve(ne.TokenType.braceR);return;case F.charCodes.colon:b.input.charCodeAt(b.state.pos+1)===F.charCodes.colon?Fe(ne.TokenType.doubleColon,2):(++b.state.pos,Ve(ne.TokenType.colon));return;case F.charCodes.questionMark:Vm();return;case F.charCodes.atSign:++b.state.pos,Ve(ne.TokenType.at);return;case F.charCodes.graveAccent:++b.state.pos,Ve(ne.TokenType.backQuote);return;case F.charCodes.digit0:{let t=b.input.charCodeAt(b.state.pos+1);if(t===F.charCodes.lowercaseX||t===F.charCodes.uppercaseX||t===F.charCodes.lowercaseO||t===F.charCodes.uppercaseO||t===F.charCodes.lowercaseB||t===F.charCodes.uppercaseB){$m();return}}case F.charCodes.digit1:case F.charCodes.digit2:case F.charCodes.digit3:case F.charCodes.digit4:case F.charCodes.digit5:case F.charCodes.digit6:case F.charCodes.digit7:case F.charCodes.digit8:case F.charCodes.digit9:b1(!1);return;case F.charCodes.quotationMark:case F.charCodes.apostrophe:qm(e);return;case F.charCodes.slash:Nm();return;case F.charCodes.percentSign:case F.charCodes.asterisk:Rm(e);return;case F.charCodes.verticalBar:case F.charCodes.ampersand:Lm(e);return;case F.charCodes.caret:Om();return;case F.charCodes.plusSign:case F.charCodes.dash:Dm(e);return;case F.charCodes.lessThan:Mm();return;case F.charCodes.greaterThan:g1();return;case F.charCodes.equalsTo:case F.charCodes.exclamationMark:Bm(e);return;case F.charCodes.tilde:Fe(ne.TokenType.tilde,1);return;default:break}ci.unexpected.call(void 0,`Unexpected character \'${String.fromCharCode(e)}\'`,b.state.pos)}Be.getTokenFromCode=_1;function Fe(e,t){b.state.pos+=t,Ve(e)}function jm(){let e=b.state.pos,t=!1,s=!1;for(;;){if(b.state.pos>=b.input.length){ci.unexpected.call(void 0,\\"Unterminated regular expression\\",e);return}let i=b.input.charCodeAt(b.state.pos);if(t)t=!1;else{if(i===F.charCodes.leftSquareBracket)s=!0;else if(i===F.charCodes.rightSquareBracket&&s)s=!1;else if(i===F.charCodes.slash&&!s)break;t=i===F.charCodes.backslash}++b.state.pos}++b.state.pos,C1(),Ve(ne.TokenType.regexp)}function Ca(){for(;;){let e=b.input.charCodeAt(b.state.pos);if(e>=F.charCodes.digit0&&e<=F.charCodes.digit9||e===F.charCodes.underscore)b.state.pos++;else break}}function $m(){for(b.state.pos+=2;;){let t=b.input.charCodeAt(b.state.pos);if(t>=F.charCodes.digit0&&t<=F.charCodes.digit9||t>=F.charCodes.lowercaseA&&t<=F.charCodes.lowercaseF||t>=F.charCodes.uppercaseA&&t<=F.charCodes.uppercaseF||t===F.charCodes.underscore)b.state.pos++;else break}b.input.charCodeAt(b.state.pos)===F.charCodes.lowercaseN?(++b.state.pos,Ve(ne.TokenType.bigint)):Ve(ne.TokenType.num)}function b1(e){let t=!1,s=!1;e||Ca();let i=b.input.charCodeAt(b.state.pos);if(i===F.charCodes.dot&&(++b.state.pos,Ca(),i=b.input.charCodeAt(b.state.pos)),(i===F.charCodes.uppercaseE||i===F.charCodes.lowercaseE)&&(i=b.input.charCodeAt(++b.state.pos),(i===F.charCodes.plusSign||i===F.charCodes.dash)&&++b.state.pos,Ca(),i=b.input.charCodeAt(b.state.pos)),i===F.charCodes.lowercaseN?(++b.state.pos,t=!0):i===F.charCodes.lowercaseM&&(++b.state.pos,s=!0),t){Ve(ne.TokenType.bigint);return}if(s){Ve(ne.TokenType.decimal);return}Ve(ne.TokenType.num)}function qm(e){for(b.state.pos++;;){if(b.state.pos>=b.input.length){ci.unexpected.call(void 0,\\"Unterminated string constant\\");return}let t=b.input.charCodeAt(b.state.pos);if(t===F.charCodes.backslash)b.state.pos++;else if(t===e)break;b.state.pos++}b.state.pos++,Ve(ne.TokenType.string)}function Km(){for(;;){if(b.state.pos>=b.input.length){ci.unexpected.call(void 0,\\"Unterminated template\\");return}let e=b.input.charCodeAt(b.state.pos);if(e===F.charCodes.graveAccent||e===F.charCodes.dollarSign&&b.input.charCodeAt(b.state.pos+1)===F.charCodes.leftCurlyBrace){if(b.state.pos===b.state.start&&Sa(ne.TokenType.template))if(e===F.charCodes.dollarSign){b.state.pos+=2,Ve(ne.TokenType.dollarBraceL);return}else{++b.state.pos,Ve(ne.TokenType.backQuote);return}Ve(ne.TokenType.template);return}e===F.charCodes.backslash&&b.state.pos++,b.state.pos++}}function C1(){for(;b.state.pos{\\"use strict\\";Object.defineProperty(Ia,\\"__esModule\\",{value:!0});var w1=be();function Um(e,t=e.currentIndex()){let s=t+1;if(Xr(e,s)){let i=e.identifierNameAtIndex(t);return{isType:!1,leftName:i,rightName:i,endIndex:s}}if(s++,Xr(e,s))return{isType:!0,leftName:null,rightName:null,endIndex:s};if(s++,Xr(e,s))return{isType:!1,leftName:e.identifierNameAtIndex(t),rightName:e.identifierNameAtIndex(t+2),endIndex:s};if(s++,Xr(e,s))return{isType:!0,leftName:null,rightName:null,endIndex:s};throw new Error(`Unexpected import/export specifier at ${t}`)}Ia.default=Um;function Xr(e,t){let s=e.tokens[t];return s.type===w1.TokenType.braceR||s.type===w1.TokenType.comma}});var S1=Z(Ea=>{\\"use strict\\";Object.defineProperty(Ea,\\"__esModule\\",{value:!0});Ea.default=new Map([[\\"quot\\",\'\\"\'],[\\"amp\\",\\"&\\"],[\\"apos\\",\\"\'\\"],[\\"lt\\",\\"<\\"],[\\"gt\\",\\">\\"],[\\"nbsp\\",\\"\\\\xA0\\"],[\\"iexcl\\",\\"\\\\xA1\\"],[\\"cent\\",\\"\\\\xA2\\"],[\\"pound\\",\\"\\\\xA3\\"],[\\"curren\\",\\"\\\\xA4\\"],[\\"yen\\",\\"\\\\xA5\\"],[\\"brvbar\\",\\"\\\\xA6\\"],[\\"sect\\",\\"\\\\xA7\\"],[\\"uml\\",\\"\\\\xA8\\"],[\\"copy\\",\\"\\\\xA9\\"],[\\"ordf\\",\\"\\\\xAA\\"],[\\"laquo\\",\\"\\\\xAB\\"],[\\"not\\",\\"\\\\xAC\\"],[\\"shy\\",\\"\\\\xAD\\"],[\\"reg\\",\\"\\\\xAE\\"],[\\"macr\\",\\"\\\\xAF\\"],[\\"deg\\",\\"\\\\xB0\\"],[\\"plusmn\\",\\"\\\\xB1\\"],[\\"sup2\\",\\"\\\\xB2\\"],[\\"sup3\\",\\"\\\\xB3\\"],[\\"acute\\",\\"\\\\xB4\\"],[\\"micro\\",\\"\\\\xB5\\"],[\\"para\\",\\"\\\\xB6\\"],[\\"middot\\",\\"\\\\xB7\\"],[\\"cedil\\",\\"\\\\xB8\\"],[\\"sup1\\",\\"\\\\xB9\\"],[\\"ordm\\",\\"\\\\xBA\\"],[\\"raquo\\",\\"\\\\xBB\\"],[\\"frac14\\",\\"\\\\xBC\\"],[\\"frac12\\",\\"\\\\xBD\\"],[\\"frac34\\",\\"\\\\xBE\\"],[\\"iquest\\",\\"\\\\xBF\\"],[\\"Agrave\\",\\"\\\\xC0\\"],[\\"Aacute\\",\\"\\\\xC1\\"],[\\"Acirc\\",\\"\\\\xC2\\"],[\\"Atilde\\",\\"\\\\xC3\\"],[\\"Auml\\",\\"\\\\xC4\\"],[\\"Aring\\",\\"\\\\xC5\\"],[\\"AElig\\",\\"\\\\xC6\\"],[\\"Ccedil\\",\\"\\\\xC7\\"],[\\"Egrave\\",\\"\\\\xC8\\"],[\\"Eacute\\",\\"\\\\xC9\\"],[\\"Ecirc\\",\\"\\\\xCA\\"],[\\"Euml\\",\\"\\\\xCB\\"],[\\"Igrave\\",\\"\\\\xCC\\"],[\\"Iacute\\",\\"\\\\xCD\\"],[\\"Icirc\\",\\"\\\\xCE\\"],[\\"Iuml\\",\\"\\\\xCF\\"],[\\"ETH\\",\\"\\\\xD0\\"],[\\"Ntilde\\",\\"\\\\xD1\\"],[\\"Ograve\\",\\"\\\\xD2\\"],[\\"Oacute\\",\\"\\\\xD3\\"],[\\"Ocirc\\",\\"\\\\xD4\\"],[\\"Otilde\\",\\"\\\\xD5\\"],[\\"Ouml\\",\\"\\\\xD6\\"],[\\"times\\",\\"\\\\xD7\\"],[\\"Oslash\\",\\"\\\\xD8\\"],[\\"Ugrave\\",\\"\\\\xD9\\"],[\\"Uacute\\",\\"\\\\xDA\\"],[\\"Ucirc\\",\\"\\\\xDB\\"],[\\"Uuml\\",\\"\\\\xDC\\"],[\\"Yacute\\",\\"\\\\xDD\\"],[\\"THORN\\",\\"\\\\xDE\\"],[\\"szlig\\",\\"\\\\xDF\\"],[\\"agrave\\",\\"\\\\xE0\\"],[\\"aacute\\",\\"\\\\xE1\\"],[\\"acirc\\",\\"\\\\xE2\\"],[\\"atilde\\",\\"\\\\xE3\\"],[\\"auml\\",\\"\\\\xE4\\"],[\\"aring\\",\\"\\\\xE5\\"],[\\"aelig\\",\\"\\\\xE6\\"],[\\"ccedil\\",\\"\\\\xE7\\"],[\\"egrave\\",\\"\\\\xE8\\"],[\\"eacute\\",\\"\\\\xE9\\"],[\\"ecirc\\",\\"\\\\xEA\\"],[\\"euml\\",\\"\\\\xEB\\"],[\\"igrave\\",\\"\\\\xEC\\"],[\\"iacute\\",\\"\\\\xED\\"],[\\"icirc\\",\\"\\\\xEE\\"],[\\"iuml\\",\\"\\\\xEF\\"],[\\"eth\\",\\"\\\\xF0\\"],[\\"ntilde\\",\\"\\\\xF1\\"],[\\"ograve\\",\\"\\\\xF2\\"],[\\"oacute\\",\\"\\\\xF3\\"],[\\"ocirc\\",\\"\\\\xF4\\"],[\\"otilde\\",\\"\\\\xF5\\"],[\\"ouml\\",\\"\\\\xF6\\"],[\\"divide\\",\\"\\\\xF7\\"],[\\"oslash\\",\\"\\\\xF8\\"],[\\"ugrave\\",\\"\\\\xF9\\"],[\\"uacute\\",\\"\\\\xFA\\"],[\\"ucirc\\",\\"\\\\xFB\\"],[\\"uuml\\",\\"\\\\xFC\\"],[\\"yacute\\",\\"\\\\xFD\\"],[\\"thorn\\",\\"\\\\xFE\\"],[\\"yuml\\",\\"\\\\xFF\\"],[\\"OElig\\",\\"\\\\u0152\\"],[\\"oelig\\",\\"\\\\u0153\\"],[\\"Scaron\\",\\"\\\\u0160\\"],[\\"scaron\\",\\"\\\\u0161\\"],[\\"Yuml\\",\\"\\\\u0178\\"],[\\"fnof\\",\\"\\\\u0192\\"],[\\"circ\\",\\"\\\\u02C6\\"],[\\"tilde\\",\\"\\\\u02DC\\"],[\\"Alpha\\",\\"\\\\u0391\\"],[\\"Beta\\",\\"\\\\u0392\\"],[\\"Gamma\\",\\"\\\\u0393\\"],[\\"Delta\\",\\"\\\\u0394\\"],[\\"Epsilon\\",\\"\\\\u0395\\"],[\\"Zeta\\",\\"\\\\u0396\\"],[\\"Eta\\",\\"\\\\u0397\\"],[\\"Theta\\",\\"\\\\u0398\\"],[\\"Iota\\",\\"\\\\u0399\\"],[\\"Kappa\\",\\"\\\\u039A\\"],[\\"Lambda\\",\\"\\\\u039B\\"],[\\"Mu\\",\\"\\\\u039C\\"],[\\"Nu\\",\\"\\\\u039D\\"],[\\"Xi\\",\\"\\\\u039E\\"],[\\"Omicron\\",\\"\\\\u039F\\"],[\\"Pi\\",\\"\\\\u03A0\\"],[\\"Rho\\",\\"\\\\u03A1\\"],[\\"Sigma\\",\\"\\\\u03A3\\"],[\\"Tau\\",\\"\\\\u03A4\\"],[\\"Upsilon\\",\\"\\\\u03A5\\"],[\\"Phi\\",\\"\\\\u03A6\\"],[\\"Chi\\",\\"\\\\u03A7\\"],[\\"Psi\\",\\"\\\\u03A8\\"],[\\"Omega\\",\\"\\\\u03A9\\"],[\\"alpha\\",\\"\\\\u03B1\\"],[\\"beta\\",\\"\\\\u03B2\\"],[\\"gamma\\",\\"\\\\u03B3\\"],[\\"delta\\",\\"\\\\u03B4\\"],[\\"epsilon\\",\\"\\\\u03B5\\"],[\\"zeta\\",\\"\\\\u03B6\\"],[\\"eta\\",\\"\\\\u03B7\\"],[\\"theta\\",\\"\\\\u03B8\\"],[\\"iota\\",\\"\\\\u03B9\\"],[\\"kappa\\",\\"\\\\u03BA\\"],[\\"lambda\\",\\"\\\\u03BB\\"],[\\"mu\\",\\"\\\\u03BC\\"],[\\"nu\\",\\"\\\\u03BD\\"],[\\"xi\\",\\"\\\\u03BE\\"],[\\"omicron\\",\\"\\\\u03BF\\"],[\\"pi\\",\\"\\\\u03C0\\"],[\\"rho\\",\\"\\\\u03C1\\"],[\\"sigmaf\\",\\"\\\\u03C2\\"],[\\"sigma\\",\\"\\\\u03C3\\"],[\\"tau\\",\\"\\\\u03C4\\"],[\\"upsilon\\",\\"\\\\u03C5\\"],[\\"phi\\",\\"\\\\u03C6\\"],[\\"chi\\",\\"\\\\u03C7\\"],[\\"psi\\",\\"\\\\u03C8\\"],[\\"omega\\",\\"\\\\u03C9\\"],[\\"thetasym\\",\\"\\\\u03D1\\"],[\\"upsih\\",\\"\\\\u03D2\\"],[\\"piv\\",\\"\\\\u03D6\\"],[\\"ensp\\",\\"\\\\u2002\\"],[\\"emsp\\",\\"\\\\u2003\\"],[\\"thinsp\\",\\"\\\\u2009\\"],[\\"zwnj\\",\\"\\\\u200C\\"],[\\"zwj\\",\\"\\\\u200D\\"],[\\"lrm\\",\\"\\\\u200E\\"],[\\"rlm\\",\\"\\\\u200F\\"],[\\"ndash\\",\\"\\\\u2013\\"],[\\"mdash\\",\\"\\\\u2014\\"],[\\"lsquo\\",\\"\\\\u2018\\"],[\\"rsquo\\",\\"\\\\u2019\\"],[\\"sbquo\\",\\"\\\\u201A\\"],[\\"ldquo\\",\\"\\\\u201C\\"],[\\"rdquo\\",\\"\\\\u201D\\"],[\\"bdquo\\",\\"\\\\u201E\\"],[\\"dagger\\",\\"\\\\u2020\\"],[\\"Dagger\\",\\"\\\\u2021\\"],[\\"bull\\",\\"\\\\u2022\\"],[\\"hellip\\",\\"\\\\u2026\\"],[\\"permil\\",\\"\\\\u2030\\"],[\\"prime\\",\\"\\\\u2032\\"],[\\"Prime\\",\\"\\\\u2033\\"],[\\"lsaquo\\",\\"\\\\u2039\\"],[\\"rsaquo\\",\\"\\\\u203A\\"],[\\"oline\\",\\"\\\\u203E\\"],[\\"frasl\\",\\"\\\\u2044\\"],[\\"euro\\",\\"\\\\u20AC\\"],[\\"image\\",\\"\\\\u2111\\"],[\\"weierp\\",\\"\\\\u2118\\"],[\\"real\\",\\"\\\\u211C\\"],[\\"trade\\",\\"\\\\u2122\\"],[\\"alefsym\\",\\"\\\\u2135\\"],[\\"larr\\",\\"\\\\u2190\\"],[\\"uarr\\",\\"\\\\u2191\\"],[\\"rarr\\",\\"\\\\u2192\\"],[\\"darr\\",\\"\\\\u2193\\"],[\\"harr\\",\\"\\\\u2194\\"],[\\"crarr\\",\\"\\\\u21B5\\"],[\\"lArr\\",\\"\\\\u21D0\\"],[\\"uArr\\",\\"\\\\u21D1\\"],[\\"rArr\\",\\"\\\\u21D2\\"],[\\"dArr\\",\\"\\\\u21D3\\"],[\\"hArr\\",\\"\\\\u21D4\\"],[\\"forall\\",\\"\\\\u2200\\"],[\\"part\\",\\"\\\\u2202\\"],[\\"exist\\",\\"\\\\u2203\\"],[\\"empty\\",\\"\\\\u2205\\"],[\\"nabla\\",\\"\\\\u2207\\"],[\\"isin\\",\\"\\\\u2208\\"],[\\"notin\\",\\"\\\\u2209\\"],[\\"ni\\",\\"\\\\u220B\\"],[\\"prod\\",\\"\\\\u220F\\"],[\\"sum\\",\\"\\\\u2211\\"],[\\"minus\\",\\"\\\\u2212\\"],[\\"lowast\\",\\"\\\\u2217\\"],[\\"radic\\",\\"\\\\u221A\\"],[\\"prop\\",\\"\\\\u221D\\"],[\\"infin\\",\\"\\\\u221E\\"],[\\"ang\\",\\"\\\\u2220\\"],[\\"and\\",\\"\\\\u2227\\"],[\\"or\\",\\"\\\\u2228\\"],[\\"cap\\",\\"\\\\u2229\\"],[\\"cup\\",\\"\\\\u222A\\"],[\\"int\\",\\"\\\\u222B\\"],[\\"there4\\",\\"\\\\u2234\\"],[\\"sim\\",\\"\\\\u223C\\"],[\\"cong\\",\\"\\\\u2245\\"],[\\"asymp\\",\\"\\\\u2248\\"],[\\"ne\\",\\"\\\\u2260\\"],[\\"equiv\\",\\"\\\\u2261\\"],[\\"le\\",\\"\\\\u2264\\"],[\\"ge\\",\\"\\\\u2265\\"],[\\"sub\\",\\"\\\\u2282\\"],[\\"sup\\",\\"\\\\u2283\\"],[\\"nsub\\",\\"\\\\u2284\\"],[\\"sube\\",\\"\\\\u2286\\"],[\\"supe\\",\\"\\\\u2287\\"],[\\"oplus\\",\\"\\\\u2295\\"],[\\"otimes\\",\\"\\\\u2297\\"],[\\"perp\\",\\"\\\\u22A5\\"],[\\"sdot\\",\\"\\\\u22C5\\"],[\\"lceil\\",\\"\\\\u2308\\"],[\\"rceil\\",\\"\\\\u2309\\"],[\\"lfloor\\",\\"\\\\u230A\\"],[\\"rfloor\\",\\"\\\\u230B\\"],[\\"lang\\",\\"\\\\u2329\\"],[\\"rang\\",\\"\\\\u232A\\"],[\\"loz\\",\\"\\\\u25CA\\"],[\\"spades\\",\\"\\\\u2660\\"],[\\"clubs\\",\\"\\\\u2663\\"],[\\"hearts\\",\\"\\\\u2665\\"],[\\"diams\\",\\"\\\\u2666\\"]])});var Pa=Z(Aa=>{\\"use strict\\";Object.defineProperty(Aa,\\"__esModule\\",{value:!0});function Hm(e){let[t,s]=I1(e.jsxPragma||\\"React.createElement\\"),[i,r]=I1(e.jsxFragmentPragma||\\"React.Fragment\\");return{base:t,suffix:s,fragmentBase:i,fragmentSuffix:r}}Aa.default=Hm;function I1(e){let t=e.indexOf(\\".\\");return t===-1&&(t=e.length),[e.slice(0,t),e.slice(t)]}});var hn=Z(Ra=>{\\"use strict\\";Object.defineProperty(Ra,\\"__esModule\\",{value:!0});var Na=class{getPrefixCode(){return\\"\\"}getHoistedCode(){return\\"\\"}getSuffixCode(){return\\"\\"}};Ra.default=Na});var Da=Z(Jr=>{\\"use strict\\";Object.defineProperty(Jr,\\"__esModule\\",{value:!0});function Oa(e){return e&&e.__esModule?e:{default:e}}var Wm=S1(),Gm=Oa(Wm),Yr=xt(),Re=be(),An=Qt(),zm=Pa(),Xm=Oa(zm),Ym=hn(),Jm=Oa(Ym),La=class e extends Jm.default{__init(){this.lastLineNumber=1}__init2(){this.lastIndex=0}__init3(){this.filenameVarName=null}__init4(){this.esmAutomaticImportNameResolutions={}}__init5(){this.cjsAutomaticModuleNameResolutions={}}constructor(t,s,i,r,a){super(),this.rootTransformer=t,this.tokens=s,this.importProcessor=i,this.nameManager=r,this.options=a,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this),this.jsxPragmaInfo=Xm.default.call(void 0,a),this.isAutomaticRuntime=a.jsxRuntime===\\"automatic\\",this.jsxImportSource=a.jsxImportSource||\\"react\\"}process(){return this.tokens.matches1(Re.TokenType.jsxTagStart)?(this.processJSXTag(),!0):!1}getPrefixCode(){let t=\\"\\";if(this.filenameVarName&&(t+=`const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath||\\"\\")};`),this.isAutomaticRuntime)if(this.importProcessor)for(let[s,i]of Object.entries(this.cjsAutomaticModuleNameResolutions))t+=`var ${i} = require(\\"${s}\\");`;else{let{createElement:s,...i}=this.esmAutomaticImportNameResolutions;s&&(t+=`import {createElement as ${s}} from \\"${this.jsxImportSource}\\";`);let r=Object.entries(i).map(([a,u])=>`${a} as ${u}`).join(\\", \\");if(r){let a=this.jsxImportSource+(this.options.production?\\"/jsx-runtime\\":\\"/jsx-dev-runtime\\");t+=`import {${r}} from \\"${a}\\";`}}return t}processJSXTag(){let{jsxRole:t,start:s}=this.tokens.currentToken(),i=this.options.production?null:this.getElementLocationCode(s);this.isAutomaticRuntime&&t!==Yr.JSXRole.KeyAfterPropSpread?this.transformTagToJSXFunc(i,t):this.transformTagToCreateElement(i)}getElementLocationCode(t){return`lineNumber: ${this.getLineNumberForIndex(t)}`}getLineNumberForIndex(t){let s=this.tokens.code;for(;this.lastIndex or > at the end of the tag.\\");r&&this.tokens.appendCode(`, ${r}`)}for(this.options.production||(r===null&&this.tokens.appendCode(\\", void 0\\"),this.tokens.appendCode(`, ${i}, ${this.getDevSource(t)}, this`)),this.tokens.removeInitialToken();!this.tokens.matches1(Re.TokenType.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(\\")\\")}transformTagToCreateElement(t){if(this.tokens.replaceToken(this.getCreateElementInvocationCode()),this.tokens.matches1(Re.TokenType.jsxTagEnd))this.tokens.replaceToken(`${this.getFragmentCode()}, null`),this.processChildren(!0);else if(this.processTagIntro(),this.processPropsObjectWithDevInfo(t),!this.tokens.matches2(Re.TokenType.slash,Re.TokenType.jsxTagEnd))if(this.tokens.matches1(Re.TokenType.jsxTagEnd))this.tokens.removeToken(),this.processChildren(!0);else throw new Error(\\"Expected either /> or > at the end of the tag.\\");for(this.tokens.removeInitialToken();!this.tokens.matches1(Re.TokenType.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(\\")\\")}getJSXFuncInvocationCode(t){return this.options.production?t?this.claimAutoImportedFuncInvocation(\\"jsxs\\",\\"/jsx-runtime\\"):this.claimAutoImportedFuncInvocation(\\"jsx\\",\\"/jsx-runtime\\"):this.claimAutoImportedFuncInvocation(\\"jsxDEV\\",\\"/jsx-dev-runtime\\")}getCreateElementInvocationCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedFuncInvocation(\\"createElement\\",\\"\\");{let{jsxPragmaInfo:t}=this;return`${this.importProcessor&&this.importProcessor.getIdentifierReplacement(t.base)||t.base}${t.suffix}(`}}getFragmentCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedName(\\"Fragment\\",this.options.production?\\"/jsx-runtime\\":\\"/jsx-dev-runtime\\");{let{jsxPragmaInfo:t}=this;return(this.importProcessor&&this.importProcessor.getIdentifierReplacement(t.fragmentBase)||t.fragmentBase)+t.fragmentSuffix}}claimAutoImportedFuncInvocation(t,s){let i=this.claimAutoImportedName(t,s);return this.importProcessor?`${i}.call(void 0, `:`${i}(`}claimAutoImportedName(t,s){if(this.importProcessor){let i=this.jsxImportSource+s;return this.cjsAutomaticModuleNameResolutions[i]||(this.cjsAutomaticModuleNameResolutions[i]=this.importProcessor.getFreeIdentifierForPath(i)),`${this.cjsAutomaticModuleNameResolutions[i]}.${t}`}else return this.esmAutomaticImportNameResolutions[t]||(this.esmAutomaticImportNameResolutions[t]=this.nameManager.claimFreeName(`_${t}`)),this.esmAutomaticImportNameResolutions[t]}processTagIntro(){let t=this.tokens.currentIndex()+1;for(;this.tokens.tokens[t].isType||!this.tokens.matches2AtIndex(t-1,Re.TokenType.jsxName,Re.TokenType.jsxName)&&!this.tokens.matches2AtIndex(t-1,Re.TokenType.greaterThan,Re.TokenType.jsxName)&&!this.tokens.matches1AtIndex(t,Re.TokenType.braceL)&&!this.tokens.matches1AtIndex(t,Re.TokenType.jsxTagEnd)&&!this.tokens.matches2AtIndex(t,Re.TokenType.slash,Re.TokenType.jsxTagEnd);)t++;if(t===this.tokens.currentIndex()+1){let s=this.tokens.identifierName();A1(s)&&this.tokens.replaceToken(`\'${s}\'`)}for(;this.tokens.currentIndex()=An.charCodes.lowercaseA&&t<=An.charCodes.lowercaseZ}Jr.startsWithLowerCase=A1;function Qm(e){let t=\\"\\",s=\\"\\",i=!1,r=!1;for(let a=0;a=An.charCodes.digit0&&e<=An.charCodes.digit9}function ty(e){return e>=An.charCodes.digit0&&e<=An.charCodes.digit9||e>=An.charCodes.lowercaseA&&e<=An.charCodes.lowercaseF||e>=An.charCodes.uppercaseA&&e<=An.charCodes.uppercaseF}});var Fa=Z(Ma=>{\\"use strict\\";Object.defineProperty(Ma,\\"__esModule\\",{value:!0});function ny(e){return e&&e.__esModule?e:{default:e}}var Qr=xt(),ui=be(),sy=Da(),iy=Pa(),ry=ny(iy);function oy(e,t){let s=ry.default.call(void 0,t),i=new Set;for(let r=0;r{\\"use strict\\";Object.defineProperty(Va,\\"__esModule\\",{value:!0});function ay(e){return e&&e.__esModule?e:{default:e}}var ly=xt(),Zr=It(),me=be(),cy=Wi(),uy=ay(cy),py=Fa(),Ba=class e{__init(){this.nonTypeIdentifiers=new Set}__init2(){this.importInfoByPath=new Map}__init3(){this.importsToReplace=new Map}__init4(){this.identifierReplacements=new Map}__init5(){this.exportBindingsByLocalName=new Map}constructor(t,s,i,r,a,u){this.nameManager=t,this.tokens=s,this.enableLegacyTypeScriptModuleInterop=i,this.options=r,this.isTypeScriptTransformEnabled=a,this.helperManager=u,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this)}preprocessTokens(){for(let t=0;t0||s.namedExports.length>0)continue;[...s.defaultNames,...s.wildcardNames,...s.namedImports.map(({localName:r})=>r)].every(r=>this.isTypeName(r))&&this.importsToReplace.set(t,\\"\\")}}isTypeName(t){return this.isTypeScriptTransformEnabled&&!this.nonTypeIdentifiers.has(t)}generateImportReplacements(){for(let[t,s]of this.importInfoByPath.entries()){let{defaultNames:i,wildcardNames:r,namedImports:a,namedExports:u,exportStarNames:d,hasStarExport:y}=s;if(i.length===0&&r.length===0&&a.length===0&&u.length===0&&d.length===0&&!y){this.importsToReplace.set(t,`require(\'${t}\');`);continue}let g=this.getFreeIdentifierForPath(t),L;this.enableLegacyTypeScriptModuleInterop?L=g:L=r.length>0?r[0]:this.getFreeIdentifierForPath(t);let p=`var ${g} = require(\'${t}\');`;if(r.length>0)for(let h of r){let T=this.enableLegacyTypeScriptModuleInterop?g:`${this.helperManager.getHelperName(\\"interopRequireWildcard\\")}(${g})`;p+=` var ${h} = ${T};`}else d.length>0&&L!==g?p+=` var ${L} = ${this.helperManager.getHelperName(\\"interopRequireWildcard\\")}(${g});`:i.length>0&&L!==g&&(p+=` var ${L} = ${this.helperManager.getHelperName(\\"interopRequireDefault\\")}(${g});`);for(let{importedName:h,localName:T}of u)p+=` ${this.helperManager.getHelperName(\\"createNamedExportFrom\\")}(${g}, \'${T}\', \'${h}\');`;for(let h of d)p+=` exports.${h} = ${L};`;y&&(p+=` ${this.helperManager.getHelperName(\\"createStarExport\\")}(${g});`),this.importsToReplace.set(t,p);for(let h of i)this.identifierReplacements.set(h,`${L}.default`);for(let{importedName:h,localName:T}of a)this.identifierReplacements.set(T,`${g}.${h}`)}}getFreeIdentifierForPath(t){let s=t.split(\\"/\\"),r=s[s.length-1].replace(/\\\\W/g,\\"\\");return this.nameManager.claimFreeName(`_${r}`)}preprocessImportAtIndex(t){let s=[],i=[],r=[];if(t++,(this.tokens.matchesContextualAtIndex(t,Zr.ContextualKeyword._type)||this.tokens.matches1AtIndex(t,me.TokenType._typeof))&&!this.tokens.matches1AtIndex(t+1,me.TokenType.comma)&&!this.tokens.matchesContextualAtIndex(t+1,Zr.ContextualKeyword._from)||this.tokens.matches1AtIndex(t,me.TokenType.parenL))return;if(this.tokens.matches1AtIndex(t,me.TokenType.name)&&(s.push(this.tokens.identifierNameAtIndex(t)),t++,this.tokens.matches1AtIndex(t,me.TokenType.comma)&&t++),this.tokens.matches1AtIndex(t,me.TokenType.star)&&(t+=2,i.push(this.tokens.identifierNameAtIndex(t)),t++),this.tokens.matches1AtIndex(t,me.TokenType.braceL)){let d=this.getNamedImports(t+1);t=d.newIndex;for(let y of d.namedImports)y.importedName===\\"default\\"?s.push(y.localName):r.push(y)}if(this.tokens.matchesContextualAtIndex(t,Zr.ContextualKeyword._from)&&t++,!this.tokens.matches1AtIndex(t,me.TokenType.string))throw new Error(\\"Expected string token at the end of import statement.\\");let a=this.tokens.stringValueAtIndex(t),u=this.getImportInfo(a);u.defaultNames.push(...s),u.wildcardNames.push(...i),u.namedImports.push(...r),s.length===0&&i.length===0&&r.length===0&&(u.hasBareImport=!0)}preprocessExportAtIndex(t){if(this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType._var)||this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType._let)||this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType._const))this.preprocessVarExportAtIndex(t);else if(this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType._function)||this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType._class)){let s=this.tokens.identifierNameAtIndex(t+2);this.addExportBinding(s,s)}else if(this.tokens.matches3AtIndex(t,me.TokenType._export,me.TokenType.name,me.TokenType._function)){let s=this.tokens.identifierNameAtIndex(t+3);this.addExportBinding(s,s)}else this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType.braceL)?this.preprocessNamedExportAtIndex(t):this.tokens.matches2AtIndex(t,me.TokenType._export,me.TokenType.star)&&this.preprocessExportStarAtIndex(t)}preprocessVarExportAtIndex(t){let s=0;for(let i=t+2;;i++)if(this.tokens.matches1AtIndex(i,me.TokenType.braceL)||this.tokens.matches1AtIndex(i,me.TokenType.dollarBraceL)||this.tokens.matches1AtIndex(i,me.TokenType.bracketL))s++;else if(this.tokens.matches1AtIndex(i,me.TokenType.braceR)||this.tokens.matches1AtIndex(i,me.TokenType.bracketR))s--;else{if(s===0&&!this.tokens.matches1AtIndex(i,me.TokenType.name))break;if(this.tokens.matches1AtIndex(1,me.TokenType.eq)){let r=this.tokens.currentToken().rhsEndIndex;if(r==null)throw new Error(\\"Expected = token with an end index.\\");i=r-1}else{let r=this.tokens.tokens[i];if(ly.isDeclaration.call(void 0,r)){let a=this.tokens.identifierNameAtIndex(i);this.identifierReplacements.set(a,`exports.${a}`)}}}}preprocessNamedExportAtIndex(t){t+=2;let{newIndex:s,namedImports:i}=this.getNamedImports(t);if(t=s,this.tokens.matchesContextualAtIndex(t,Zr.ContextualKeyword._from))t++;else{for(let{importedName:u,localName:d}of i)this.addExportBinding(u,d);return}if(!this.tokens.matches1AtIndex(t,me.TokenType.string))throw new Error(\\"Expected string token at the end of import statement.\\");let r=this.tokens.stringValueAtIndex(t);this.getImportInfo(r).namedExports.push(...i)}preprocessExportStarAtIndex(t){let s=null;if(this.tokens.matches3AtIndex(t,me.TokenType._export,me.TokenType.star,me.TokenType._as)?(t+=3,s=this.tokens.identifierNameAtIndex(t),t+=2):t+=3,!this.tokens.matches1AtIndex(t,me.TokenType.string))throw new Error(\\"Expected string token at the end of star export statement.\\");let i=this.tokens.stringValueAtIndex(t),r=this.getImportInfo(i);s!==null?r.exportStarNames.push(s):r.hasStarExport=!0}getNamedImports(t){let s=[];for(;;){if(this.tokens.matches1AtIndex(t,me.TokenType.braceR)){t++;break}let i=uy.default.call(void 0,this.tokens,t);if(t=i.endIndex,i.isType||s.push({importedName:i.leftName,localName:i.rightName}),this.tokens.matches2AtIndex(t,me.TokenType.comma,me.TokenType.braceR)){t+=2;break}else if(this.tokens.matches1AtIndex(t,me.TokenType.braceR)){t++;break}else if(this.tokens.matches1AtIndex(t,me.TokenType.comma))t++;else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[t])}`)}return{newIndex:t,namedImports:s}}getImportInfo(t){let s=this.importInfoByPath.get(t);if(s)return s;let i={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(t,i),i}addExportBinding(t,s){this.exportBindingsByLocalName.has(t)||this.exportBindingsByLocalName.set(t,[]),this.exportBindingsByLocalName.get(t).push(s)}claimImportCode(t){let s=this.importsToReplace.get(t);return this.importsToReplace.set(t,\\"\\"),s||\\"\\"}getIdentifierReplacement(t){return this.identifierReplacements.get(t)||null}resolveExportBinding(t){let s=this.exportBindingsByLocalName.get(t);return!s||s.length===0?null:s.map(i=>`exports.${i}`).join(\\" = \\")}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}};Va.default=Ba});var L1=Z((eo,R1)=>{(function(e,t){typeof eo==\\"object\\"&&typeof R1<\\"u\\"?t(eo):typeof define==\\"function\\"&&define.amd?define([\\"exports\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t(e.setArray={}))})(eo,function(e){\\"use strict\\";e.get=void 0,e.put=void 0,e.pop=void 0;class t{constructor(){this._indexes={__proto__:null},this.array=[]}}e.get=(s,i)=>s._indexes[i],e.put=(s,i)=>{let r=e.get(s,i);if(r!==void 0)return r;let{array:a,_indexes:u}=s;return u[i]=a.push(i)-1},e.pop=s=>{let{array:i,_indexes:r}=s;if(i.length===0)return;let a=i.pop();r[a]=void 0},e.SetArray=t,Object.defineProperty(e,\\"__esModule\\",{value:!0})})});var ja=Z((to,O1)=>{(function(e,t){typeof to==\\"object\\"&&typeof O1<\\"u\\"?t(to):typeof define==\\"function\\"&&define.amd?define([\\"exports\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t(e.sourcemapCodec={}))})(to,function(e){\\"use strict\\";let i=\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\",r=new Uint8Array(64),a=new Uint8Array(128);for(let w=0;w>>=1,W&&(M=-2147483648|-M),A[U]+=M,S}function L(w,S,A){return S>=A?!1:w.charCodeAt(S)!==44}function p(w){w.sort(h)}function h(w,S){return w[0]-S[0]}function T(w){let S=new Int32Array(5),A=1024*16,U=A-36,M=new Uint8Array(A),c=M.subarray(0,U),R=0,W=\\"\\";for(let X=0;X0&&(R===A&&(W+=u.decode(M),R=0),M[R++]=59),ie.length!==0){S[0]=0;for(let pe=0;peU&&(W+=u.decode(c),M.copyWithin(0,U,R),R-=U),pe>0&&(M[R++]=44),R=x(M,R,S,ae,0),ae.length!==1&&(R=x(M,R,S,ae,1),R=x(M,R,S,ae,2),R=x(M,R,S,ae,3),ae.length!==4&&(R=x(M,R,S,ae,4)))}}}return W+u.decode(M.subarray(0,R))}function x(w,S,A,U,M){let c=U[M],R=c-A[M];A[M]=c,R=R<0?-R<<1|1:R<<1;do{let W=R&31;R>>>=5,R>0&&(W|=32),w[S++]=r[W]}while(R>0);return S}e.decode=d,e.encode=T,Object.defineProperty(e,\\"__esModule\\",{value:!0})})});var D1=Z(($a,qa)=>{(function(e,t){typeof $a==\\"object\\"&&typeof qa<\\"u\\"?qa.exports=t():typeof define==\\"function\\"&&define.amd?define(t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,e.resolveURI=t())})($a,function(){\\"use strict\\";let e=/^[\\\\w+.-]+:\\\\/\\\\//,t=/^([\\\\w+.-]+:)\\\\/\\\\/([^@/#?]*@)?([^:/#?]*)(:\\\\d+)?(\\\\/[^#?]*)?(\\\\?[^#]*)?(#.*)?/,s=/^file:(?:\\\\/\\\\/((?![a-z]:)[^/#?]*)?)?(\\\\/?[^#?]*)(\\\\?[^#]*)?(#.*)?/i;var i;(function(A){A[A.Empty=1]=\\"Empty\\",A[A.Hash=2]=\\"Hash\\",A[A.Query=3]=\\"Query\\",A[A.RelativePath=4]=\\"RelativePath\\",A[A.AbsolutePath=5]=\\"AbsolutePath\\",A[A.SchemeRelative=6]=\\"SchemeRelative\\",A[A.Absolute=7]=\\"Absolute\\"})(i||(i={}));function r(A){return e.test(A)}function a(A){return A.startsWith(\\"//\\")}function u(A){return A.startsWith(\\"/\\")}function d(A){return A.startsWith(\\"file:\\")}function y(A){return/^[.?#]/.test(A)}function g(A){let U=t.exec(A);return p(U[1],U[2]||\\"\\",U[3],U[4]||\\"\\",U[5]||\\"/\\",U[6]||\\"\\",U[7]||\\"\\")}function L(A){let U=s.exec(A),M=U[2];return p(\\"file:\\",\\"\\",U[1]||\\"\\",\\"\\",u(M)?M:\\"/\\"+M,U[3]||\\"\\",U[4]||\\"\\")}function p(A,U,M,c,R,W,X){return{scheme:A,user:U,host:M,port:c,path:R,query:W,hash:X,type:i.Absolute}}function h(A){if(a(A)){let M=g(\\"http:\\"+A);return M.scheme=\\"\\",M.type=i.SchemeRelative,M}if(u(A)){let M=g(\\"http://foo.com\\"+A);return M.scheme=\\"\\",M.host=\\"\\",M.type=i.AbsolutePath,M}if(d(A))return L(A);if(r(A))return g(A);let U=g(\\"http://foo.com/\\"+A);return U.scheme=\\"\\",U.host=\\"\\",U.type=A?A.startsWith(\\"?\\")?i.Query:A.startsWith(\\"#\\")?i.Hash:i.RelativePath:i.Empty,U}function T(A){if(A.endsWith(\\"/..\\"))return A;let U=A.lastIndexOf(\\"/\\");return A.slice(0,U+1)}function x(A,U){w(U,U.type),A.path===\\"/\\"?A.path=U.path:A.path=T(U.path)+A.path}function w(A,U){let M=U<=i.RelativePath,c=A.path.split(\\"/\\"),R=1,W=0,X=!1;for(let pe=1;pec&&(c=X)}w(M,c);let R=M.query+M.hash;switch(c){case i.Hash:case i.Query:return R;case i.RelativePath:{let W=M.path.slice(1);return W?y(U||A)&&!y(W)?\\"./\\"+W+R:W+R:R||\\".\\"}case i.AbsolutePath:return M.path+R;default:return M.scheme+\\"//\\"+M.user+M.host+M.port+M.path+R}}return S})});var F1=Z((no,M1)=>{(function(e,t){typeof no==\\"object\\"&&typeof M1<\\"u\\"?t(no,ja(),D1()):typeof define==\\"function\\"&&define.amd?define([\\"exports\\",\\"@jridgewell/sourcemap-codec\\",\\"@jridgewell/resolve-uri\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t(e.traceMapping={},e.sourcemapCodec,e.resolveURI))})(no,function(e,t,s){\\"use strict\\";function i(V){return V&&typeof V==\\"object\\"&&\\"default\\"in V?V:{default:V}}var r=i(s);function a(V,G){return G&&!G.endsWith(\\"/\\")&&(G+=\\"/\\"),r.default(V,G)}function u(V){if(!V)return\\"\\";let G=V.lastIndexOf(\\"/\\");return V.slice(0,G+1)}let d=0,y=1,g=2,L=3,p=4,h=1,T=2;function x(V,G){let J=w(V,0);if(J===V.length)return V;G||(V=V.slice());for(let re=J;re>1),he=V[ve][d]-G;if(he===0)return M=!0,ve;he<0?J=ve+1:re=ve-1}return M=!1,J-1}function R(V,G,J){for(let re=J+1;re=0&&V[re][d]===G;J=re--);return J}function X(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function ie(V,G,J,re){let{lastKey:ve,lastNeedle:he,lastIndex:Ie}=J,Ee=0,Le=V.length-1;if(re===ve){if(G===he)return M=Ie!==-1&&V[Ie][d]===G,Ie;G>=he?Ee=Ie===-1?0:Ie:Le=Ie}return J.lastKey=re,J.lastNeedle=G,J.lastIndex=c(V,G,Ee,Le)}function pe(V,G){let J=G.map(He);for(let re=0;reG;re--)V[re]=V[re-1];V[G]=J}function He(){return{__proto__:null}}let qe=function(V,G){let J=typeof V==\\"string\\"?JSON.parse(V):V;if(!(\\"sections\\"in J))return new wt(J,G);let re=[],ve=[],he=[],Ie=[];Bt(J,G,re,ve,he,Ie,0,0,1/0,1/0);let Ee={version:3,file:J.file,names:Ie,sources:ve,sourcesContent:he,mappings:re};return e.presortedDecodedMap(Ee)};function Bt(V,G,J,re,ve,he,Ie,Ee,Le,Xe){let{sections:We}=V;for(let Ke=0;KeLe)return;let Dn=At(J,bn),Ge=vt===0?Ee:0,St=pt[vt];for(let ot=0;ot=Xe)return;if(zt.length===1){Dn.push([Xt]);continue}let te=Ke+zt[y],Cn=zt[g],Zn=zt[L];Dn.push(zt.length===4?[Xt,te,Cn,Zn]:[Xt,te,Cn,Zn,ut+zt[p]])}}}function kt(V,G){for(let J=0;Ja(pt||\\"\\",Ke));let{mappings:ut}=ve;typeof ut==\\"string\\"?(this._encoded=ut,this._decoded=void 0):(this._encoded=void 0,this._decoded=x(ut,re)),this._decodedMemo=X(),this._bySources=void 0,this._bySourceMemos=void 0}}e.encodedMappings=V=>{var G;return(G=V._encoded)!==null&&G!==void 0?G:V._encoded=t.encode(V._decoded)},e.decodedMappings=V=>V._decoded||(V._decoded=t.decode(V._encoded)),e.traceSegment=(V,G,J)=>{let re=e.decodedMappings(V);return G>=re.length?null:Tn(re[G],V._decodedMemo,G,J,ct)},e.originalPositionFor=(V,{line:G,column:J,bias:re})=>{if(G--,G<0)throw new Error(tt);if(J<0)throw new Error(nt);let ve=e.decodedMappings(V);if(G>=ve.length)return Pt(null,null,null,null);let he=Tn(ve[G],V._decodedMemo,G,J,re||ct);if(he==null||he.length==1)return Pt(null,null,null,null);let{names:Ie,resolvedSources:Ee}=V;return Pt(Ee[he[y]],he[g]+1,he[L],he.length===5?Ie[he[p]]:null)},e.generatedPositionFor=(V,{source:G,line:J,column:re,bias:ve})=>{if(J--,J<0)throw new Error(tt);if(re<0)throw new Error(nt);let{sources:he,resolvedSources:Ie}=V,Ee=he.indexOf(G);if(Ee===-1&&(Ee=Ie.indexOf(G)),Ee===-1)return qt(null,null);let Le=V._bySources||(V._bySources=pe(e.decodedMappings(V),V._bySourceMemos=he.map(X))),Xe=V._bySourceMemos,We=Le[Ee][J];if(We==null)return qt(null,null);let Ke=Tn(We,Xe[Ee],J,re,ve||ct);return Ke==null?qt(null,null):qt(Ke[h]+1,Ke[T])},e.eachMapping=(V,G)=>{let J=e.decodedMappings(V),{names:re,resolvedSources:ve}=V;for(let he=0;he{let{sources:J,resolvedSources:re,sourcesContent:ve}=V;if(ve==null)return null;let he=J.indexOf(G);return he===-1&&(he=re.indexOf(G)),he===-1?null:ve[he]},e.presortedDecodedMap=(V,G)=>{let J=new wt($t(V,[]),G);return J._decoded=V.mappings,J},e.decodedMap=V=>$t(V,e.decodedMappings(V)),e.encodedMap=V=>$t(V,e.encodedMappings(V));function $t(V,G){return{version:V.version,file:V.file,names:V.names,sourceRoot:V.sourceRoot,sources:V.sources,sourcesContent:V.sourcesContent,mappings:G}}function Pt(V,G,J,re){return{source:V,line:G,column:J,name:re}}function qt(V,G){return{line:V,column:G}}function Tn(V,G,J,re,ve){let he=ie(V,re,G,J);return M?he=(ve===_t?R:W)(V,re,he):ve===_t&&he++,he===-1||he===V.length?null:V[he]}e.AnyMap=qe,e.GREATEST_LOWER_BOUND=ct,e.LEAST_UPPER_BOUND=_t,e.TraceMap=wt,Object.defineProperty(e,\\"__esModule\\",{value:!0})})});var V1=Z((so,B1)=>{(function(e,t){typeof so==\\"object\\"&&typeof B1<\\"u\\"?t(so,L1(),ja(),F1()):typeof define==\\"function\\"&&define.amd?define([\\"exports\\",\\"@jridgewell/set-array\\",\\"@jridgewell/sourcemap-codec\\",\\"@jridgewell/trace-mapping\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t(e.genMapping={},e.setArray,e.sourcemapCodec,e.traceMapping))})(so,function(e,t,s,i){\\"use strict\\";e.addSegment=void 0,e.addMapping=void 0,e.maybeAddSegment=void 0,e.maybeAddMapping=void 0,e.setSourceContent=void 0,e.toDecodedMap=void 0,e.toEncodedMap=void 0,e.fromMap=void 0,e.allMappings=void 0;let L;class p{constructor({file:R,sourceRoot:W}={}){this._names=new t.SetArray,this._sources=new t.SetArray,this._sourcesContent=[],this._mappings=[],this.file=R,this.sourceRoot=W}}e.addSegment=(c,R,W,X,ie,pe,ae,He)=>L(!1,c,R,W,X,ie,pe,ae,He),e.maybeAddSegment=(c,R,W,X,ie,pe,ae,He)=>L(!0,c,R,W,X,ie,pe,ae,He),e.addMapping=(c,R)=>M(!1,c,R),e.maybeAddMapping=(c,R)=>M(!0,c,R),e.setSourceContent=(c,R,W)=>{let{_sources:X,_sourcesContent:ie}=c;ie[t.put(X,R)]=W},e.toDecodedMap=c=>{let{file:R,sourceRoot:W,_mappings:X,_sources:ie,_sourcesContent:pe,_names:ae}=c;return w(X),{version:3,file:R||void 0,names:ae.array,sourceRoot:W||void 0,sources:ie.array,sourcesContent:pe,mappings:X}},e.toEncodedMap=c=>{let R=e.toDecodedMap(c);return Object.assign(Object.assign({},R),{mappings:s.encode(R.mappings)})},e.allMappings=c=>{let R=[],{_mappings:W,_sources:X,_names:ie}=c;for(let pe=0;pe{let R=new i.TraceMap(c),W=new p({file:R.file,sourceRoot:R.sourceRoot});return S(W._names,R.names),S(W._sources,R.sources),W._sourcesContent=R.sourcesContent||R.sources.map(()=>null),W._mappings=i.decodedMappings(R),W},L=(c,R,W,X,ie,pe,ae,He,qe)=>{let{_mappings:Bt,_sources:mt,_sourcesContent:kt,_names:At}=R,tt=h(Bt,W),nt=T(tt,X);if(!ie)return c&&A(tt,nt)?void 0:x(tt,nt,[X]);let _t=t.put(mt,ie),ct=He?t.put(At,He):-1;if(_t===kt.length&&(kt[_t]=qe??null),!(c&&U(tt,nt,_t,pe,ae,ct)))return x(tt,nt,He?[X,_t,pe,ae,ct]:[X,_t,pe,ae])};function h(c,R){for(let W=c.length;W<=R;W++)c[W]=[];return c[R]}function T(c,R){let W=c.length;for(let X=W-1;X>=0;W=X--){let ie=c[X];if(R>=ie[0])break}return W}function x(c,R,W){for(let X=c.length;X>R;X--)c[X]=c[X-1];c[R]=W}function w(c){let{length:R}=c,W=R;for(let X=W-1;X>=0&&!(c[X].length>0);W=X,X--);W{\\"use strict\\";Object.defineProperty(Ka,\\"__esModule\\",{value:!0});var Gi=V1(),j1=Qt();function hy({code:e,mappings:t},s,i,r,a){let u=fy(r,a),d=new Gi.GenMapping({file:i.compiledFilename}),y=0,g=t[0];for(;g===void 0&&y{\\"use strict\\";Object.defineProperty(Ha,\\"__esModule\\",{value:!0});var dy={require:`\\n import {createRequire as CREATE_REQUIRE_NAME} from \\"module\\";\\n const require = CREATE_REQUIRE_NAME(import.meta.url);\\n `,interopRequireWildcard:`\\n function interopRequireWildcard(obj) {\\n if (obj && obj.__esModule) {\\n return obj;\\n } else {\\n var newObj = {};\\n if (obj != null) {\\n for (var key in obj) {\\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\\n newObj[key] = obj[key];\\n }\\n }\\n }\\n newObj.default = obj;\\n return newObj;\\n }\\n }\\n `,interopRequireDefault:`\\n function interopRequireDefault(obj) {\\n return obj && obj.__esModule ? obj : { default: obj };\\n }\\n `,createNamedExportFrom:`\\n function createNamedExportFrom(obj, localName, importedName) {\\n Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]});\\n }\\n `,createStarExport:`\\n function createStarExport(obj) {\\n Object.keys(obj)\\n .filter((key) => key !== \\"default\\" && key !== \\"__esModule\\")\\n .forEach((key) => {\\n if (exports.hasOwnProperty(key)) {\\n return;\\n }\\n Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]});\\n });\\n }\\n `,nullishCoalesce:`\\n function nullishCoalesce(lhs, rhsFn) {\\n if (lhs != null) {\\n return lhs;\\n } else {\\n return rhsFn();\\n }\\n }\\n `,asyncNullishCoalesce:`\\n async function asyncNullishCoalesce(lhs, rhsFn) {\\n if (lhs != null) {\\n return lhs;\\n } else {\\n return await rhsFn();\\n }\\n }\\n `,optionalChain:`\\n function optionalChain(ops) {\\n let lastAccessLHS = undefined;\\n let value = ops[0];\\n let i = 1;\\n while (i < ops.length) {\\n const op = ops[i];\\n const fn = ops[i + 1];\\n i += 2;\\n if ((op === \'optionalAccess\' || op === \'optionalCall\') && value == null) {\\n return undefined;\\n }\\n if (op === \'access\' || op === \'optionalAccess\') {\\n lastAccessLHS = value;\\n value = fn(value);\\n } else if (op === \'call\' || op === \'optionalCall\') {\\n value = fn((...args) => value.call(lastAccessLHS, ...args));\\n lastAccessLHS = undefined;\\n }\\n }\\n return value;\\n }\\n `,asyncOptionalChain:`\\n async function asyncOptionalChain(ops) {\\n let lastAccessLHS = undefined;\\n let value = ops[0];\\n let i = 1;\\n while (i < ops.length) {\\n const op = ops[i];\\n const fn = ops[i + 1];\\n i += 2;\\n if ((op === \'optionalAccess\' || op === \'optionalCall\') && value == null) {\\n return undefined;\\n }\\n if (op === \'access\' || op === \'optionalAccess\') {\\n lastAccessLHS = value;\\n value = await fn(value);\\n } else if (op === \'call\' || op === \'optionalCall\') {\\n value = await fn((...args) => value.call(lastAccessLHS, ...args));\\n lastAccessLHS = undefined;\\n }\\n }\\n return value;\\n }\\n `,optionalChainDelete:`\\n function optionalChainDelete(ops) {\\n const result = OPTIONAL_CHAIN_NAME(ops);\\n return result == null ? true : result;\\n }\\n `,asyncOptionalChainDelete:`\\n async function asyncOptionalChainDelete(ops) {\\n const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);\\n return result == null ? true : result;\\n }\\n `},Ua=class e{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(t){this.nameManager=t,e.prototype.__init.call(this),e.prototype.__init2.call(this)}getHelperName(t){let s=this.helperNames[t];return s||(s=this.nameManager.claimFreeName(`_${t}`),this.helperNames[t]=s,s)}emitHelpers(){let t=\\"\\";this.helperNames.optionalChainDelete&&this.getHelperName(\\"optionalChain\\"),this.helperNames.asyncOptionalChainDelete&&this.getHelperName(\\"asyncOptionalChain\\");for(let[s,i]of Object.entries(dy)){let r=this.helperNames[s],a=i;s===\\"optionalChainDelete\\"?a=a.replace(\\"OPTIONAL_CHAIN_NAME\\",this.helperNames.optionalChain):s===\\"asyncOptionalChainDelete\\"?a=a.replace(\\"ASYNC_OPTIONAL_CHAIN_NAME\\",this.helperNames.asyncOptionalChain):s===\\"require\\"&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName(\\"_createRequire\\")),a=a.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),r&&(t+=\\" \\",t+=a.replace(s,r).replace(/\\\\s+/g,\\" \\").trim())}return t}};Ha.HelperManager=Ua});var H1=Z(ro=>{\\"use strict\\";Object.defineProperty(ro,\\"__esModule\\",{value:!0});var Wa=xt(),io=be();function my(e,t,s){U1(e,s)&&yy(e,t,s)}ro.default=my;function U1(e,t){for(let s of e.tokens)if(s.type===io.TokenType.name&&Wa.isNonTopLevelDeclaration.call(void 0,s)&&t.has(e.identifierNameForToken(s)))return!0;return!1}ro.hasShadowedGlobals=U1;function yy(e,t,s){let i=[],r=t.length-1;for(let a=e.tokens.length-1;;a--){for(;i.length>0&&i[i.length-1].startTokenIndex===a+1;)i.pop();for(;r>=0&&t[r].endTokenIndex===a+1;)i.push(t[r]),r--;if(a<0)break;let u=e.tokens[a],d=e.identifierNameForToken(u);if(i.length>1&&u.type===io.TokenType.name&&s.has(d)){if(Wa.isBlockScopedDeclaration.call(void 0,u))K1(i[i.length-1],e,d);else if(Wa.isFunctionScopedDeclaration.call(void 0,u)){let y=i.length-1;for(;y>0&&!i[y].isFunctionScope;)y--;if(y<0)throw new Error(\\"Did not find parent function scope.\\");K1(i[y],e,d)}}}if(i.length>0)throw new Error(\\"Expected empty scope stack after processing file.\\")}function K1(e,t,s){for(let i=e.startTokenIndex;i{\\"use strict\\";Object.defineProperty(Ga,\\"__esModule\\",{value:!0});var Ty=be();function ky(e,t){let s=[];for(let i of t)i.type===Ty.TokenType.name&&s.push(e.slice(i.start,i.end));return s}Ga.default=ky});var G1=Z(Xa=>{\\"use strict\\";Object.defineProperty(Xa,\\"__esModule\\",{value:!0});function vy(e){return e&&e.__esModule?e:{default:e}}var xy=W1(),gy=vy(xy),za=class e{__init(){this.usedNames=new Set}constructor(t,s){e.prototype.__init.call(this),this.usedNames=new Set(gy.default.call(void 0,t,s))}claimFreeName(t){let s=this.findFreeName(t);return this.usedNames.add(s),s}findFreeName(t){if(!this.usedNames.has(t))return t;let s=2;for(;this.usedNames.has(t+String(s));)s++;return t+String(s)}};Xa.default=za});var oo=Z(Pn=>{\\"use strict\\";var _y=Pn&&Pn.__extends||function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])},e(t,s)};return function(t,s){e(t,s);function i(){this.constructor=t}t.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}();Object.defineProperty(Pn,\\"__esModule\\",{value:!0});Pn.DetailContext=Pn.NoopContext=Pn.VError=void 0;var z1=function(e){_y(t,e);function t(s,i){var r=e.call(this,i)||this;return r.path=s,Object.setPrototypeOf(r,t.prototype),r}return t}(Error);Pn.VError=z1;var by=function(){function e(){}return e.prototype.fail=function(t,s,i){return!1},e.prototype.unionResolver=function(){return this},e.prototype.createContext=function(){return this},e.prototype.resolveUnion=function(t){},e}();Pn.NoopContext=by;var X1=function(){function e(){this._propNames=[\\"\\"],this._messages=[null],this._score=0}return e.prototype.fail=function(t,s,i){return this._propNames.push(t),this._messages.push(s),this._score+=i,!1},e.prototype.unionResolver=function(){return new Cy},e.prototype.resolveUnion=function(t){for(var s,i,r=t,a=null,u=0,d=r.contexts;u=a._score)&&(a=y)}a&&a._score>0&&((s=this._propNames).push.apply(s,a._propNames),(i=this._messages).push.apply(i,a._messages))},e.prototype.getError=function(t){for(var s=[],i=this._propNames.length-1;i>=0;i--){var r=this._propNames[i];t+=typeof r==\\"number\\"?\\"[\\"+r+\\"]\\":r?\\".\\"+r:\\"\\";var a=this._messages[i];a&&s.push(t+\\" \\"+a)}return new z1(t,s.join(\\"; \\"))},e.prototype.getErrorDetail=function(t){for(var s=[],i=this._propNames.length-1;i>=0;i--){var r=this._propNames[i];t+=typeof r==\\"number\\"?\\"[\\"+r+\\"]\\":r?\\".\\"+r:\\"\\";var a=this._messages[i];a&&s.push({path:t,message:a})}for(var u=null,i=s.length-1;i>=0;i--)u&&(s[i].nested=[u]),u=s[i];return u},e}();Pn.DetailContext=X1;var Cy=function(){function e(){this.contexts=[]}return e.prototype.createContext=function(){var t=new X1;return this.contexts.push(t),t},e}()});var sl=Z(ce=>{\\"use strict\\";var nn=ce&&ce.__extends||function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])},e(t,s)};return function(t,s){e(t,s);function i(){this.constructor=t}t.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}();Object.defineProperty(ce,\\"__esModule\\",{value:!0});ce.basicTypes=ce.BasicType=ce.TParamList=ce.TParam=ce.param=ce.TFunc=ce.func=ce.TProp=ce.TOptional=ce.opt=ce.TIface=ce.iface=ce.TEnumLiteral=ce.enumlit=ce.TEnumType=ce.enumtype=ce.TIntersection=ce.intersection=ce.TUnion=ce.union=ce.TTuple=ce.tuple=ce.TArray=ce.array=ce.TLiteral=ce.lit=ce.TName=ce.name=ce.TType=void 0;var Q1=oo(),Ht=function(){function e(){}return e}();ce.TType=Ht;function ps(e){return typeof e==\\"string\\"?Z1(e):e}function Qa(e,t){var s=e[t];if(!s)throw new Error(\\"Unknown type \\"+t);return s}function Z1(e){return new Za(e)}ce.name=Z1;var Za=function(e){nn(t,e);function t(s){var i=e.call(this)||this;return i.name=s,i._failMsg=\\"is not a \\"+s,i}return t.prototype.getChecker=function(s,i,r){var a=this,u=Qa(s,this.name),d=u.getChecker(s,i,r);return u instanceof Dt||u instanceof t?d:function(y,g){return d(y,g)?!0:g.fail(null,a._failMsg,0)}},t}(Ht);ce.TName=Za;function wy(e){return new el(e)}ce.lit=wy;var el=function(e){nn(t,e);function t(s){var i=e.call(this)||this;return i.value=s,i.name=JSON.stringify(s),i._failMsg=\\"is not \\"+i.name,i}return t.prototype.getChecker=function(s,i){var r=this;return function(a,u){return a===r.value?!0:u.fail(null,r._failMsg,-1)}},t}(Ht);ce.TLiteral=el;function Sy(e){return new ep(ps(e))}ce.array=Sy;var ep=function(e){nn(t,e);function t(s){var i=e.call(this)||this;return i.ttype=s,i}return t.prototype.getChecker=function(s,i){var r=this.ttype.getChecker(s,i);return function(a,u){if(!Array.isArray(a))return u.fail(null,\\"is not an array\\",0);for(var d=0;d0&&r.push(a+\\" more\\"),i._failMsg=\\"is none of \\"+r.join(\\", \\")):i._failMsg=\\"is none of \\"+a+\\" types\\",i}return t.prototype.getChecker=function(s,i){var r=this,a=this.ttypes.map(function(u){return u.getChecker(s,i)});return function(u,d){for(var y=d.unionResolver(),g=0;g{\\"use strict\\";var jy=we&&we.__spreadArrays||function(){for(var e=0,t=0,s=arguments.length;t{\\"use strict\\";Object.defineProperty(Gn,\\"__esModule\\",{value:!0});function Ky(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t.default=e,t}var Uy=il(),Qe=Ky(Uy),Hy=Qe.union(Qe.lit(\\"jsx\\"),Qe.lit(\\"typescript\\"),Qe.lit(\\"flow\\"),Qe.lit(\\"imports\\"),Qe.lit(\\"react-hot-loader\\"),Qe.lit(\\"jest\\"));Gn.Transform=Hy;var Wy=Qe.iface([],{compiledFilename:\\"string\\"});Gn.SourceMapOptions=Wy;var Gy=Qe.iface([],{transforms:Qe.array(\\"Transform\\"),disableESTransforms:Qe.opt(\\"boolean\\"),jsxRuntime:Qe.opt(Qe.union(Qe.lit(\\"classic\\"),Qe.lit(\\"automatic\\"),Qe.lit(\\"preserve\\"))),production:Qe.opt(\\"boolean\\"),jsxImportSource:Qe.opt(\\"string\\"),jsxPragma:Qe.opt(\\"string\\"),jsxFragmentPragma:Qe.opt(\\"string\\"),preserveDynamicImport:Qe.opt(\\"boolean\\"),injectCreateRequireForImportRequire:Qe.opt(\\"boolean\\"),enableLegacyTypeScriptModuleInterop:Qe.opt(\\"boolean\\"),enableLegacyBabel5ModuleInterop:Qe.opt(\\"boolean\\"),sourceMapOptions:Qe.opt(\\"SourceMapOptions\\"),filePath:Qe.opt(\\"string\\")});Gn.Options=Gy;var zy={Transform:Gn.Transform,SourceMapOptions:Gn.SourceMapOptions,Options:Gn.Options};Gn.default=zy});var pp=Z(rl=>{\\"use strict\\";Object.defineProperty(rl,\\"__esModule\\",{value:!0});function Xy(e){return e&&e.__esModule?e:{default:e}}var Yy=il(),Jy=up(),Qy=Xy(Jy),{Options:Zy}=Yy.createCheckers.call(void 0,Qy.default);function eT(e){Zy.strictCheck(e)}rl.validateOptions=eT});var lo=Z(Nn=>{\\"use strict\\";Object.defineProperty(Nn,\\"__esModule\\",{value:!0});var tT=Ji(),hp=hi(),Mt=xt(),Xi=It(),fn=be(),gt=Zt(),Yi=Ns(),ol=cs();function nT(){Mt.next.call(void 0),Yi.parseMaybeAssign.call(void 0,!1)}Nn.parseSpread=nT;function fp(e){Mt.next.call(void 0),ll(e)}Nn.parseRest=fp;function dp(e){Yi.parseIdentifier.call(void 0),mp(e)}Nn.parseBindingIdentifier=dp;function sT(){Yi.parseIdentifier.call(void 0),gt.state.tokens[gt.state.tokens.length-1].identifierRole=Mt.IdentifierRole.ImportDeclaration}Nn.parseImportedIdentifier=sT;function mp(e){let t;gt.state.scopeDepth===0?t=Mt.IdentifierRole.TopLevelDeclaration:e?t=Mt.IdentifierRole.BlockScopedDeclaration:t=Mt.IdentifierRole.FunctionScopedDeclaration,gt.state.tokens[gt.state.tokens.length-1].identifierRole=t}Nn.markPriorBindingIdentifier=mp;function ll(e){switch(gt.state.type){case fn.TokenType._this:{let t=Mt.pushTypeContext.call(void 0,0);Mt.next.call(void 0),Mt.popTypeContext.call(void 0,t);return}case fn.TokenType._yield:case fn.TokenType.name:{gt.state.type=fn.TokenType.name,dp(e);return}case fn.TokenType.bracketL:{Mt.next.call(void 0),yp(fn.TokenType.bracketR,e,!0);return}case fn.TokenType.braceL:Yi.parseObj.call(void 0,!0,e);return;default:ol.unexpected.call(void 0)}}Nn.parseBindingAtom=ll;function yp(e,t,s=!1,i=!1,r=0){let a=!0,u=!1,d=gt.state.tokens.length;for(;!Mt.eat.call(void 0,e)&&!gt.state.error;)if(a?a=!1:(ol.expect.call(void 0,fn.TokenType.comma),gt.state.tokens[gt.state.tokens.length-1].contextId=r,!u&>.state.tokens[d].isType&&(gt.state.tokens[gt.state.tokens.length-1].isType=!0,u=!0)),!(s&&Mt.match.call(void 0,fn.TokenType.comma))){if(Mt.eat.call(void 0,e))break;if(Mt.match.call(void 0,fn.TokenType.ellipsis)){fp(t),Tp(),Mt.eat.call(void 0,fn.TokenType.comma),ol.expect.call(void 0,e);break}else iT(i,t)}}Nn.parseBindingList=yp;function iT(e,t){e&&hp.tsParseModifiers.call(void 0,[Xi.ContextualKeyword._public,Xi.ContextualKeyword._protected,Xi.ContextualKeyword._private,Xi.ContextualKeyword._readonly,Xi.ContextualKeyword._override]),al(t),Tp(),al(t,!0)}function Tp(){gt.isFlowEnabled?tT.flowParseAssignableListItemTypes.call(void 0):gt.isTypeScriptEnabled&&hp.tsParseAssignableListItemTypes.call(void 0)}function al(e,t=!1){if(t||ll(e),!Mt.eat.call(void 0,fn.TokenType.eq))return;let s=gt.state.tokens.length-1;Yi.parseMaybeAssign.call(void 0),gt.state.tokens[s].rhsEndIndex=gt.state.tokens.length}Nn.parseMaybeDefault=al});var hi=Z(Oe=>{\\"use strict\\";Object.defineProperty(Oe,\\"__esModule\\",{value:!0});var v=xt(),oe=It(),k=be(),I=Zt(),_e=Ns(),di=lo(),Rn=nr(),H=cs(),rT=vl();function ul(){return v.match.call(void 0,k.TokenType.name)}function oT(){return v.match.call(void 0,k.TokenType.name)||!!(I.state.type&k.TokenType.IS_KEYWORD)||v.match.call(void 0,k.TokenType.string)||v.match.call(void 0,k.TokenType.num)||v.match.call(void 0,k.TokenType.bigint)||v.match.call(void 0,k.TokenType.decimal)}function _p(){let e=I.state.snapshot();return v.next.call(void 0),(v.match.call(void 0,k.TokenType.bracketL)||v.match.call(void 0,k.TokenType.braceL)||v.match.call(void 0,k.TokenType.star)||v.match.call(void 0,k.TokenType.ellipsis)||v.match.call(void 0,k.TokenType.hash)||oT())&&!H.hasPrecedingLineBreak.call(void 0)?!0:(I.state.restoreFromSnapshot(e),!1)}function bp(e){for(;dl(e)!==null;);}Oe.tsParseModifiers=bp;function dl(e){if(!v.match.call(void 0,k.TokenType.name))return null;let t=I.state.contextualKeyword;if(e.indexOf(t)!==-1&&_p()){switch(t){case oe.ContextualKeyword._readonly:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._readonly;break;case oe.ContextualKeyword._abstract:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._abstract;break;case oe.ContextualKeyword._static:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._static;break;case oe.ContextualKeyword._public:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._public;break;case oe.ContextualKeyword._private:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._private;break;case oe.ContextualKeyword._protected:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._protected;break;case oe.ContextualKeyword._override:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._override;break;case oe.ContextualKeyword._declare:I.state.tokens[I.state.tokens.length-1].type=k.TokenType._declare;break;default:break}return t}return null}Oe.tsParseModifier=dl;function Zi(){for(_e.parseIdentifier.call(void 0);v.eat.call(void 0,k.TokenType.dot);)_e.parseIdentifier.call(void 0)}function aT(){Zi(),!H.hasPrecedingLineBreak.call(void 0)&&v.match.call(void 0,k.TokenType.lessThan)&&yi()}function lT(){v.next.call(void 0),tr()}function cT(){v.next.call(void 0)}function uT(){H.expect.call(void 0,k.TokenType._typeof),v.match.call(void 0,k.TokenType._import)?Cp():Zi(),!H.hasPrecedingLineBreak.call(void 0)&&v.match.call(void 0,k.TokenType.lessThan)&&yi()}function Cp(){H.expect.call(void 0,k.TokenType._import),H.expect.call(void 0,k.TokenType.parenL),H.expect.call(void 0,k.TokenType.string),H.expect.call(void 0,k.TokenType.parenR),v.eat.call(void 0,k.TokenType.dot)&&Zi(),v.match.call(void 0,k.TokenType.lessThan)&&yi()}function pT(){v.eat.call(void 0,k.TokenType._const);let e=v.eat.call(void 0,k.TokenType._in),t=H.eatContextual.call(void 0,oe.ContextualKeyword._out);v.eat.call(void 0,k.TokenType._const),(e||t)&&!v.match.call(void 0,k.TokenType.name)?I.state.tokens[I.state.tokens.length-1].type=k.TokenType.name:_e.parseIdentifier.call(void 0),v.eat.call(void 0,k.TokenType._extends)&&rt(),v.eat.call(void 0,k.TokenType.eq)&&rt()}function mi(){v.match.call(void 0,k.TokenType.lessThan)&&uo()}Oe.tsTryParseTypeParameters=mi;function uo(){let e=v.pushTypeContext.call(void 0,0);for(v.match.call(void 0,k.TokenType.lessThan)||v.match.call(void 0,k.TokenType.typeParameterStart)?v.next.call(void 0):H.unexpected.call(void 0);!v.eat.call(void 0,k.TokenType.greaterThan)&&!I.state.error;)pT(),v.eat.call(void 0,k.TokenType.comma);v.popTypeContext.call(void 0,e)}function ml(e){let t=e===k.TokenType.arrow;mi(),H.expect.call(void 0,k.TokenType.parenL),I.state.scopeDepth++,hT(!1),I.state.scopeDepth--,(t||v.match.call(void 0,e))&&Qi(e)}function hT(e){di.parseBindingList.call(void 0,k.TokenType.parenR,e)}function co(){v.eat.call(void 0,k.TokenType.comma)||H.semicolon.call(void 0)}function kp(){ml(k.TokenType.colon),co()}function fT(){let e=I.state.snapshot();v.next.call(void 0);let t=v.eat.call(void 0,k.TokenType.name)&&v.match.call(void 0,k.TokenType.colon);return I.state.restoreFromSnapshot(e),t}function wp(){if(!(v.match.call(void 0,k.TokenType.bracketL)&&fT()))return!1;let e=v.pushTypeContext.call(void 0,0);return H.expect.call(void 0,k.TokenType.bracketL),_e.parseIdentifier.call(void 0),tr(),H.expect.call(void 0,k.TokenType.bracketR),er(),co(),v.popTypeContext.call(void 0,e),!0}function vp(e){v.eat.call(void 0,k.TokenType.question),!e&&(v.match.call(void 0,k.TokenType.parenL)||v.match.call(void 0,k.TokenType.lessThan))?(ml(k.TokenType.colon),co()):(er(),co())}function dT(){if(v.match.call(void 0,k.TokenType.parenL)||v.match.call(void 0,k.TokenType.lessThan)){kp();return}if(v.match.call(void 0,k.TokenType._new)){v.next.call(void 0),v.match.call(void 0,k.TokenType.parenL)||v.match.call(void 0,k.TokenType.lessThan)?kp():vp(!1);return}let e=!!dl([oe.ContextualKeyword._readonly]);wp()||((H.isContextual.call(void 0,oe.ContextualKeyword._get)||H.isContextual.call(void 0,oe.ContextualKeyword._set))&&_p(),_e.parsePropertyName.call(void 0,-1),vp(e))}function mT(){Sp()}function Sp(){for(H.expect.call(void 0,k.TokenType.braceL);!v.eat.call(void 0,k.TokenType.braceR)&&!I.state.error;)dT()}function yT(){let e=I.state.snapshot(),t=TT();return I.state.restoreFromSnapshot(e),t}function TT(){return v.next.call(void 0),v.eat.call(void 0,k.TokenType.plus)||v.eat.call(void 0,k.TokenType.minus)?H.isContextual.call(void 0,oe.ContextualKeyword._readonly):(H.isContextual.call(void 0,oe.ContextualKeyword._readonly)&&v.next.call(void 0),!v.match.call(void 0,k.TokenType.bracketL)||(v.next.call(void 0),!ul())?!1:(v.next.call(void 0),v.match.call(void 0,k.TokenType._in)))}function kT(){_e.parseIdentifier.call(void 0),H.expect.call(void 0,k.TokenType._in),rt()}function vT(){H.expect.call(void 0,k.TokenType.braceL),v.match.call(void 0,k.TokenType.plus)||v.match.call(void 0,k.TokenType.minus)?(v.next.call(void 0),H.expectContextual.call(void 0,oe.ContextualKeyword._readonly)):H.eatContextual.call(void 0,oe.ContextualKeyword._readonly),H.expect.call(void 0,k.TokenType.bracketL),kT(),H.eatContextual.call(void 0,oe.ContextualKeyword._as)&&rt(),H.expect.call(void 0,k.TokenType.bracketR),v.match.call(void 0,k.TokenType.plus)||v.match.call(void 0,k.TokenType.minus)?(v.next.call(void 0),H.expect.call(void 0,k.TokenType.question)):v.eat.call(void 0,k.TokenType.question),LT(),H.semicolon.call(void 0),H.expect.call(void 0,k.TokenType.braceR)}function xT(){for(H.expect.call(void 0,k.TokenType.bracketL);!v.eat.call(void 0,k.TokenType.bracketR)&&!I.state.error;)gT(),v.eat.call(void 0,k.TokenType.comma)}function gT(){v.eat.call(void 0,k.TokenType.ellipsis)?rt():(rt(),v.eat.call(void 0,k.TokenType.question)),v.eat.call(void 0,k.TokenType.colon)&&rt()}function _T(){H.expect.call(void 0,k.TokenType.parenL),rt(),H.expect.call(void 0,k.TokenType.parenR)}function bT(){for(v.nextTemplateToken.call(void 0),v.nextTemplateToken.call(void 0);!v.match.call(void 0,k.TokenType.backQuote)&&!I.state.error;)H.expect.call(void 0,k.TokenType.dollarBraceL),rt(),v.nextTemplateToken.call(void 0),v.nextTemplateToken.call(void 0);v.next.call(void 0)}var hs;(function(e){e[e.TSFunctionType=0]=\\"TSFunctionType\\";let s=1;e[e.TSConstructorType=s]=\\"TSConstructorType\\";let i=s+1;e[e.TSAbstractConstructorType=i]=\\"TSAbstractConstructorType\\"})(hs||(hs={}));function cl(e){e===hs.TSAbstractConstructorType&&H.expectContextual.call(void 0,oe.ContextualKeyword._abstract),(e===hs.TSConstructorType||e===hs.TSAbstractConstructorType)&&H.expect.call(void 0,k.TokenType._new);let t=I.state.inDisallowConditionalTypesContext;I.state.inDisallowConditionalTypesContext=!1,ml(k.TokenType.arrow),I.state.inDisallowConditionalTypesContext=t}function CT(){switch(I.state.type){case k.TokenType.name:aT();return;case k.TokenType._void:case k.TokenType._null:v.next.call(void 0);return;case k.TokenType.string:case k.TokenType.num:case k.TokenType.bigint:case k.TokenType.decimal:case k.TokenType._true:case k.TokenType._false:_e.parseLiteral.call(void 0);return;case k.TokenType.minus:v.next.call(void 0),_e.parseLiteral.call(void 0);return;case k.TokenType._this:{cT(),H.isContextual.call(void 0,oe.ContextualKeyword._is)&&!H.hasPrecedingLineBreak.call(void 0)&&lT();return}case k.TokenType._typeof:uT();return;case k.TokenType._import:Cp();return;case k.TokenType.braceL:yT()?vT():mT();return;case k.TokenType.bracketL:xT();return;case k.TokenType.parenL:_T();return;case k.TokenType.backQuote:bT();return;default:if(I.state.type&k.TokenType.IS_KEYWORD){v.next.call(void 0),I.state.tokens[I.state.tokens.length-1].type=k.TokenType.name;return}break}H.unexpected.call(void 0)}function wT(){for(CT();!H.hasPrecedingLineBreak.call(void 0)&&v.eat.call(void 0,k.TokenType.bracketL);)v.eat.call(void 0,k.TokenType.bracketR)||(rt(),H.expect.call(void 0,k.TokenType.bracketR))}function ST(){if(H.expectContextual.call(void 0,oe.ContextualKeyword._infer),_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType._extends)){let e=I.state.snapshot();H.expect.call(void 0,k.TokenType._extends);let t=I.state.inDisallowConditionalTypesContext;I.state.inDisallowConditionalTypesContext=!0,rt(),I.state.inDisallowConditionalTypesContext=t,(I.state.error||!I.state.inDisallowConditionalTypesContext&&v.match.call(void 0,k.TokenType.question))&&I.state.restoreFromSnapshot(e)}}function pl(){if(H.isContextual.call(void 0,oe.ContextualKeyword._keyof)||H.isContextual.call(void 0,oe.ContextualKeyword._unique)||H.isContextual.call(void 0,oe.ContextualKeyword._readonly))v.next.call(void 0),pl();else if(H.isContextual.call(void 0,oe.ContextualKeyword._infer))ST();else{let e=I.state.inDisallowConditionalTypesContext;I.state.inDisallowConditionalTypesContext=!1,wT(),I.state.inDisallowConditionalTypesContext=e}}function xp(){if(v.eat.call(void 0,k.TokenType.bitwiseAND),pl(),v.match.call(void 0,k.TokenType.bitwiseAND))for(;v.eat.call(void 0,k.TokenType.bitwiseAND);)pl()}function IT(){if(v.eat.call(void 0,k.TokenType.bitwiseOR),xp(),v.match.call(void 0,k.TokenType.bitwiseOR))for(;v.eat.call(void 0,k.TokenType.bitwiseOR);)xp()}function ET(){return v.match.call(void 0,k.TokenType.lessThan)?!0:v.match.call(void 0,k.TokenType.parenL)&&PT()}function AT(){if(v.match.call(void 0,k.TokenType.name)||v.match.call(void 0,k.TokenType._this))return v.next.call(void 0),!0;if(v.match.call(void 0,k.TokenType.braceL)||v.match.call(void 0,k.TokenType.bracketL)){let e=1;for(v.next.call(void 0);e>0&&!I.state.error;)v.match.call(void 0,k.TokenType.braceL)||v.match.call(void 0,k.TokenType.bracketL)?e++:(v.match.call(void 0,k.TokenType.braceR)||v.match.call(void 0,k.TokenType.bracketR))&&e--,v.next.call(void 0);return!0}return!1}function PT(){let e=I.state.snapshot(),t=NT();return I.state.restoreFromSnapshot(e),t}function NT(){return v.next.call(void 0),!!(v.match.call(void 0,k.TokenType.parenR)||v.match.call(void 0,k.TokenType.ellipsis)||AT()&&(v.match.call(void 0,k.TokenType.colon)||v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.question)||v.match.call(void 0,k.TokenType.eq)||v.match.call(void 0,k.TokenType.parenR)&&(v.next.call(void 0),v.match.call(void 0,k.TokenType.arrow))))}function Qi(e){let t=v.pushTypeContext.call(void 0,0);H.expect.call(void 0,e),OT()||rt(),v.popTypeContext.call(void 0,t)}function RT(){v.match.call(void 0,k.TokenType.colon)&&Qi(k.TokenType.colon)}function er(){v.match.call(void 0,k.TokenType.colon)&&tr()}Oe.tsTryParseTypeAnnotation=er;function LT(){v.eat.call(void 0,k.TokenType.colon)&&rt()}function OT(){let e=I.state.snapshot();return H.isContextual.call(void 0,oe.ContextualKeyword._asserts)?(v.next.call(void 0),H.eatContextual.call(void 0,oe.ContextualKeyword._is)?(rt(),!0):ul()||v.match.call(void 0,k.TokenType._this)?(v.next.call(void 0),H.eatContextual.call(void 0,oe.ContextualKeyword._is)&&rt(),!0):(I.state.restoreFromSnapshot(e),!1)):ul()||v.match.call(void 0,k.TokenType._this)?(v.next.call(void 0),H.isContextual.call(void 0,oe.ContextualKeyword._is)&&!H.hasPrecedingLineBreak.call(void 0)?(v.next.call(void 0),rt(),!0):(I.state.restoreFromSnapshot(e),!1)):!1}function tr(){let e=v.pushTypeContext.call(void 0,0);H.expect.call(void 0,k.TokenType.colon),rt(),v.popTypeContext.call(void 0,e)}Oe.tsParseTypeAnnotation=tr;function rt(){if(hl(),I.state.inDisallowConditionalTypesContext||H.hasPrecedingLineBreak.call(void 0)||!v.eat.call(void 0,k.TokenType._extends))return;let e=I.state.inDisallowConditionalTypesContext;I.state.inDisallowConditionalTypesContext=!0,hl(),I.state.inDisallowConditionalTypesContext=e,H.expect.call(void 0,k.TokenType.question),rt(),H.expect.call(void 0,k.TokenType.colon),rt()}Oe.tsParseType=rt;function DT(){return H.isContextual.call(void 0,oe.ContextualKeyword._abstract)&&v.lookaheadType.call(void 0)===k.TokenType._new}function hl(){if(ET()){cl(hs.TSFunctionType);return}if(v.match.call(void 0,k.TokenType._new)){cl(hs.TSConstructorType);return}else if(DT()){cl(hs.TSAbstractConstructorType);return}IT()}Oe.tsParseNonConditionalType=hl;function MT(){let e=v.pushTypeContext.call(void 0,1);rt(),H.expect.call(void 0,k.TokenType.greaterThan),v.popTypeContext.call(void 0,e),_e.parseMaybeUnary.call(void 0)}Oe.tsParseTypeAssertion=MT;function FT(){if(v.eat.call(void 0,k.TokenType.jsxTagStart)){I.state.tokens[I.state.tokens.length-1].type=k.TokenType.typeParameterStart;let e=v.pushTypeContext.call(void 0,1);for(;!v.match.call(void 0,k.TokenType.greaterThan)&&!I.state.error;)rt(),v.eat.call(void 0,k.TokenType.comma);rT.nextJSXTagToken.call(void 0),v.popTypeContext.call(void 0,e)}}Oe.tsTryParseJSXTypeArgument=FT;function Ip(){for(;!v.match.call(void 0,k.TokenType.braceL)&&!I.state.error;)BT(),v.eat.call(void 0,k.TokenType.comma)}function BT(){Zi(),v.match.call(void 0,k.TokenType.lessThan)&&yi()}function VT(){di.parseBindingIdentifier.call(void 0,!1),mi(),v.eat.call(void 0,k.TokenType._extends)&&Ip(),Sp()}function jT(){di.parseBindingIdentifier.call(void 0,!1),mi(),H.expect.call(void 0,k.TokenType.eq),rt(),H.semicolon.call(void 0)}function $T(){if(v.match.call(void 0,k.TokenType.string)?_e.parseLiteral.call(void 0):_e.parseIdentifier.call(void 0),v.eat.call(void 0,k.TokenType.eq)){let e=I.state.tokens.length-1;_e.parseMaybeAssign.call(void 0),I.state.tokens[e].rhsEndIndex=I.state.tokens.length}}function yl(){for(di.parseBindingIdentifier.call(void 0,!1),H.expect.call(void 0,k.TokenType.braceL);!v.eat.call(void 0,k.TokenType.braceR)&&!I.state.error;)$T(),v.eat.call(void 0,k.TokenType.comma)}function Tl(){H.expect.call(void 0,k.TokenType.braceL),Rn.parseBlockBody.call(void 0,k.TokenType.braceR)}function fl(){di.parseBindingIdentifier.call(void 0,!1),v.eat.call(void 0,k.TokenType.dot)?fl():Tl()}function Ep(){H.isContextual.call(void 0,oe.ContextualKeyword._global)?_e.parseIdentifier.call(void 0):v.match.call(void 0,k.TokenType.string)?_e.parseExprAtom.call(void 0):H.unexpected.call(void 0),v.match.call(void 0,k.TokenType.braceL)?Tl():H.semicolon.call(void 0)}function Ap(){di.parseImportedIdentifier.call(void 0),H.expect.call(void 0,k.TokenType.eq),KT(),H.semicolon.call(void 0)}Oe.tsParseImportEqualsDeclaration=Ap;function qT(){return H.isContextual.call(void 0,oe.ContextualKeyword._require)&&v.lookaheadType.call(void 0)===k.TokenType.parenL}function KT(){qT()?UT():Zi()}function UT(){H.expectContextual.call(void 0,oe.ContextualKeyword._require),H.expect.call(void 0,k.TokenType.parenL),v.match.call(void 0,k.TokenType.string)||H.unexpected.call(void 0),_e.parseLiteral.call(void 0),H.expect.call(void 0,k.TokenType.parenR)}function HT(){if(H.isLineTerminator.call(void 0))return!1;switch(I.state.type){case k.TokenType._function:{let e=v.pushTypeContext.call(void 0,1);v.next.call(void 0);let t=I.state.start;return Rn.parseFunction.call(void 0,t,!0),v.popTypeContext.call(void 0,e),!0}case k.TokenType._class:{let e=v.pushTypeContext.call(void 0,1);return Rn.parseClass.call(void 0,!0,!1),v.popTypeContext.call(void 0,e),!0}case k.TokenType._const:if(v.match.call(void 0,k.TokenType._const)&&H.isLookaheadContextual.call(void 0,oe.ContextualKeyword._enum)){let e=v.pushTypeContext.call(void 0,1);return H.expect.call(void 0,k.TokenType._const),H.expectContextual.call(void 0,oe.ContextualKeyword._enum),I.state.tokens[I.state.tokens.length-1].type=k.TokenType._enum,yl(),v.popTypeContext.call(void 0,e),!0}case k.TokenType._var:case k.TokenType._let:{let e=v.pushTypeContext.call(void 0,1);return Rn.parseVarStatement.call(void 0,I.state.type!==k.TokenType._var),v.popTypeContext.call(void 0,e),!0}case k.TokenType.name:{let e=v.pushTypeContext.call(void 0,1),t=I.state.contextualKeyword,s=!1;return t===oe.ContextualKeyword._global?(Ep(),s=!0):s=po(t,!0),v.popTypeContext.call(void 0,e),s}default:return!1}}function gp(){return po(I.state.contextualKeyword,!0)}function WT(e){switch(e){case oe.ContextualKeyword._declare:{let t=I.state.tokens.length-1;if(HT())return I.state.tokens[t].type=k.TokenType._declare,!0;break}case oe.ContextualKeyword._global:if(v.match.call(void 0,k.TokenType.braceL))return Tl(),!0;break;default:return po(e,!1)}return!1}function po(e,t){switch(e){case oe.ContextualKeyword._abstract:if(fi(t)&&v.match.call(void 0,k.TokenType._class))return I.state.tokens[I.state.tokens.length-1].type=k.TokenType._abstract,Rn.parseClass.call(void 0,!0,!1),!0;break;case oe.ContextualKeyword._enum:if(fi(t)&&v.match.call(void 0,k.TokenType.name))return I.state.tokens[I.state.tokens.length-1].type=k.TokenType._enum,yl(),!0;break;case oe.ContextualKeyword._interface:if(fi(t)&&v.match.call(void 0,k.TokenType.name)){let s=v.pushTypeContext.call(void 0,t?2:1);return VT(),v.popTypeContext.call(void 0,s),!0}break;case oe.ContextualKeyword._module:if(fi(t)){if(v.match.call(void 0,k.TokenType.string)){let s=v.pushTypeContext.call(void 0,t?2:1);return Ep(),v.popTypeContext.call(void 0,s),!0}else if(v.match.call(void 0,k.TokenType.name)){let s=v.pushTypeContext.call(void 0,t?2:1);return fl(),v.popTypeContext.call(void 0,s),!0}}break;case oe.ContextualKeyword._namespace:if(fi(t)&&v.match.call(void 0,k.TokenType.name)){let s=v.pushTypeContext.call(void 0,t?2:1);return fl(),v.popTypeContext.call(void 0,s),!0}break;case oe.ContextualKeyword._type:if(fi(t)&&v.match.call(void 0,k.TokenType.name)){let s=v.pushTypeContext.call(void 0,t?2:1);return jT(),v.popTypeContext.call(void 0,s),!0}break;default:break}return!1}function fi(e){return e?(v.next.call(void 0),!0):!H.isLineTerminator.call(void 0)}function GT(){let e=I.state.snapshot();return uo(),Rn.parseFunctionParams.call(void 0),RT(),H.expect.call(void 0,k.TokenType.arrow),I.state.error?(I.state.restoreFromSnapshot(e),!1):(_e.parseFunctionBody.call(void 0,!0),!0)}function kl(){I.state.type===k.TokenType.bitShiftL&&(I.state.pos-=1,v.finishToken.call(void 0,k.TokenType.lessThan)),yi()}function yi(){let e=v.pushTypeContext.call(void 0,0);for(H.expect.call(void 0,k.TokenType.lessThan);!v.eat.call(void 0,k.TokenType.greaterThan)&&!I.state.error;)rt(),v.eat.call(void 0,k.TokenType.comma);v.popTypeContext.call(void 0,e)}function zT(){if(v.match.call(void 0,k.TokenType.name))switch(I.state.contextualKeyword){case oe.ContextualKeyword._abstract:case oe.ContextualKeyword._declare:case oe.ContextualKeyword._enum:case oe.ContextualKeyword._interface:case oe.ContextualKeyword._module:case oe.ContextualKeyword._namespace:case oe.ContextualKeyword._type:return!0;default:break}return!1}Oe.tsIsDeclarationStart=zT;function XT(e,t){if(v.match.call(void 0,k.TokenType.colon)&&Qi(k.TokenType.colon),!v.match.call(void 0,k.TokenType.braceL)&&H.isLineTerminator.call(void 0)){let s=I.state.tokens.length-1;for(;s>=0&&(I.state.tokens[s].start>=e||I.state.tokens[s].type===k.TokenType._default||I.state.tokens[s].type===k.TokenType._export);)I.state.tokens[s].isType=!0,s--;return}_e.parseFunctionBody.call(void 0,!1,t)}Oe.tsParseFunctionBodyAndFinish=XT;function YT(e,t,s){if(!H.hasPrecedingLineBreak.call(void 0)&&v.eat.call(void 0,k.TokenType.bang)){I.state.tokens[I.state.tokens.length-1].type=k.TokenType.nonNullAssertion;return}if(v.match.call(void 0,k.TokenType.lessThan)||v.match.call(void 0,k.TokenType.bitShiftL)){let i=I.state.snapshot();if(!t&&_e.atPossibleAsync.call(void 0)&>())return;if(kl(),!t&&v.eat.call(void 0,k.TokenType.parenL)?(I.state.tokens[I.state.tokens.length-1].subscriptStartIndex=e,_e.parseCallExpressionArguments.call(void 0)):v.match.call(void 0,k.TokenType.backQuote)?_e.parseTemplate.call(void 0):(I.state.type===k.TokenType.greaterThan||I.state.type!==k.TokenType.parenL&&I.state.type&k.TokenType.IS_EXPRESSION_START&&!H.hasPrecedingLineBreak.call(void 0))&&H.unexpected.call(void 0),I.state.error)I.state.restoreFromSnapshot(i);else return}else!t&&v.match.call(void 0,k.TokenType.questionDot)&&v.lookaheadType.call(void 0)===k.TokenType.lessThan&&(v.next.call(void 0),I.state.tokens[e].isOptionalChainStart=!0,I.state.tokens[I.state.tokens.length-1].subscriptStartIndex=e,yi(),H.expect.call(void 0,k.TokenType.parenL),_e.parseCallExpressionArguments.call(void 0));_e.baseParseSubscript.call(void 0,e,t,s)}Oe.tsParseSubscript=YT;function JT(){if(v.eat.call(void 0,k.TokenType._import))return H.isContextual.call(void 0,oe.ContextualKeyword._type)&&v.lookaheadType.call(void 0)!==k.TokenType.eq&&H.expectContextual.call(void 0,oe.ContextualKeyword._type),Ap(),!0;if(v.eat.call(void 0,k.TokenType.eq))return _e.parseExpression.call(void 0),H.semicolon.call(void 0),!0;if(H.eatContextual.call(void 0,oe.ContextualKeyword._as))return H.expectContextual.call(void 0,oe.ContextualKeyword._namespace),_e.parseIdentifier.call(void 0),H.semicolon.call(void 0),!0;if(H.isContextual.call(void 0,oe.ContextualKeyword._type)){let e=v.lookaheadType.call(void 0);(e===k.TokenType.braceL||e===k.TokenType.star)&&v.next.call(void 0)}return!1}Oe.tsTryParseExport=JT;function QT(){if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ImportDeclaration;return}if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ImportDeclaration,I.state.tokens[I.state.tokens.length-2].isType=!0,I.state.tokens[I.state.tokens.length-1].isType=!0;return}if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-3].identifierRole=v.IdentifierRole.ImportAccess,I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ImportDeclaration;return}_e.parseIdentifier.call(void 0),I.state.tokens[I.state.tokens.length-3].identifierRole=v.IdentifierRole.ImportAccess,I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ImportDeclaration,I.state.tokens[I.state.tokens.length-4].isType=!0,I.state.tokens[I.state.tokens.length-3].isType=!0,I.state.tokens[I.state.tokens.length-2].isType=!0,I.state.tokens[I.state.tokens.length-1].isType=!0}Oe.tsParseImportSpecifier=QT;function ZT(){if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ExportAccess;return}if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-1].identifierRole=v.IdentifierRole.ExportAccess,I.state.tokens[I.state.tokens.length-2].isType=!0,I.state.tokens[I.state.tokens.length-1].isType=!0;return}if(_e.parseIdentifier.call(void 0),v.match.call(void 0,k.TokenType.comma)||v.match.call(void 0,k.TokenType.braceR)){I.state.tokens[I.state.tokens.length-3].identifierRole=v.IdentifierRole.ExportAccess;return}_e.parseIdentifier.call(void 0),I.state.tokens[I.state.tokens.length-3].identifierRole=v.IdentifierRole.ExportAccess,I.state.tokens[I.state.tokens.length-4].isType=!0,I.state.tokens[I.state.tokens.length-3].isType=!0,I.state.tokens[I.state.tokens.length-2].isType=!0,I.state.tokens[I.state.tokens.length-1].isType=!0}Oe.tsParseExportSpecifier=ZT;function ek(){if(H.isContextual.call(void 0,oe.ContextualKeyword._abstract)&&v.lookaheadType.call(void 0)===k.TokenType._class)return I.state.type=k.TokenType._abstract,v.next.call(void 0),Rn.parseClass.call(void 0,!0,!0),!0;if(H.isContextual.call(void 0,oe.ContextualKeyword._interface)){let e=v.pushTypeContext.call(void 0,2);return po(oe.ContextualKeyword._interface,!0),v.popTypeContext.call(void 0,e),!0}return!1}Oe.tsTryParseExportDefaultExpression=ek;function tk(){if(I.state.type===k.TokenType._const){let e=v.lookaheadTypeAndKeyword.call(void 0);if(e.type===k.TokenType.name&&e.contextualKeyword===oe.ContextualKeyword._enum)return H.expect.call(void 0,k.TokenType._const),H.expectContextual.call(void 0,oe.ContextualKeyword._enum),I.state.tokens[I.state.tokens.length-1].type=k.TokenType._enum,yl(),!0}return!1}Oe.tsTryParseStatementContent=tk;function nk(e){let t=I.state.tokens.length;bp([oe.ContextualKeyword._abstract,oe.ContextualKeyword._readonly,oe.ContextualKeyword._declare,oe.ContextualKeyword._static,oe.ContextualKeyword._override]);let s=I.state.tokens.length;if(wp()){let r=e?t-1:t;for(let a=r;a{\\"use strict\\";Object.defineProperty(fo,\\"__esModule\\",{value:!0});var Se=xt(),Me=be(),fe=Zt(),ho=Ns(),fs=cs(),at=Qt(),Rp=li(),dk=hi();function mk(){let e=!1,t=!1;for(;;){if(fe.state.pos>=fe.input.length){fs.unexpected.call(void 0,\\"Unterminated JSX contents\\");return}let s=fe.input.charCodeAt(fe.state.pos);if(s===at.charCodes.lessThan||s===at.charCodes.leftCurlyBrace){if(fe.state.pos===fe.state.start){if(s===at.charCodes.lessThan){fe.state.pos++,Se.finishToken.call(void 0,Me.TokenType.jsxTagStart);return}Se.getTokenFromCode.call(void 0,s);return}e&&!t?Se.finishToken.call(void 0,Me.TokenType.jsxEmptyText):Se.finishToken.call(void 0,Me.TokenType.jsxText);return}s===at.charCodes.lineFeed?e=!0:s!==at.charCodes.space&&s!==at.charCodes.carriageReturn&&s!==at.charCodes.tab&&(t=!0),fe.state.pos++}}function yk(e){for(fe.state.pos++;;){if(fe.state.pos>=fe.input.length){fs.unexpected.call(void 0,\\"Unterminated string constant\\");return}if(fe.input.charCodeAt(fe.state.pos)===e){fe.state.pos++;break}fe.state.pos++}Se.finishToken.call(void 0,Me.TokenType.string)}function Tk(){let e;do{if(fe.state.pos>fe.input.length){fs.unexpected.call(void 0,\\"Unexpectedly reached the end of input.\\");return}e=fe.input.charCodeAt(++fe.state.pos)}while(Rp.IS_IDENTIFIER_CHAR[e]||e===at.charCodes.dash);Se.finishToken.call(void 0,Me.TokenType.jsxName)}function xl(){dn()}function Lp(e){if(xl(),!Se.eat.call(void 0,Me.TokenType.colon)){fe.state.tokens[fe.state.tokens.length-1].identifierRole=e;return}xl()}function Op(){let e=fe.state.tokens.length;Lp(Se.IdentifierRole.Access);let t=!1;for(;Se.match.call(void 0,Me.TokenType.dot);)t=!0,dn(),xl();if(!t){let s=fe.state.tokens[e],i=fe.input.charCodeAt(s.start);i>=at.charCodes.lowercaseA&&i<=at.charCodes.lowercaseZ&&(s.identifierRole=null)}}function kk(){switch(fe.state.type){case Me.TokenType.braceL:Se.next.call(void 0),ho.parseExpression.call(void 0),dn();return;case Me.TokenType.jsxTagStart:Mp(),dn();return;case Me.TokenType.string:dn();return;default:fs.unexpected.call(void 0,\\"JSX value should be either an expression or a quoted JSX text\\")}}function vk(){fs.expect.call(void 0,Me.TokenType.ellipsis),ho.parseExpression.call(void 0)}function xk(e){if(Se.match.call(void 0,Me.TokenType.jsxTagEnd))return!1;Op(),fe.isTypeScriptEnabled&&dk.tsTryParseJSXTypeArgument.call(void 0);let t=!1;for(;!Se.match.call(void 0,Me.TokenType.slash)&&!Se.match.call(void 0,Me.TokenType.jsxTagEnd)&&!fe.state.error;){if(Se.eat.call(void 0,Me.TokenType.braceL)){t=!0,fs.expect.call(void 0,Me.TokenType.ellipsis),ho.parseMaybeAssign.call(void 0),dn();continue}t&&fe.state.end-fe.state.start===3&&fe.input.charCodeAt(fe.state.start)===at.charCodes.lowercaseK&&fe.input.charCodeAt(fe.state.start+1)===at.charCodes.lowercaseE&&fe.input.charCodeAt(fe.state.start+2)===at.charCodes.lowercaseY&&(fe.state.tokens[e].jsxRole=Se.JSXRole.KeyAfterPropSpread),Lp(Se.IdentifierRole.ObjectKey),Se.match.call(void 0,Me.TokenType.eq)&&(dn(),kk())}let s=Se.match.call(void 0,Me.TokenType.slash);return s&&dn(),s}function gk(){Se.match.call(void 0,Me.TokenType.jsxTagEnd)||Op()}function Dp(){let e=fe.state.tokens.length-1;fe.state.tokens[e].jsxRole=Se.JSXRole.NoChildren;let t=0;if(!xk(e))for(Ti();;)switch(fe.state.type){case Me.TokenType.jsxTagStart:if(dn(),Se.match.call(void 0,Me.TokenType.slash)){dn(),gk(),fe.state.tokens[e].jsxRole!==Se.JSXRole.KeyAfterPropSpread&&(t===1?fe.state.tokens[e].jsxRole=Se.JSXRole.OneChild:t>1&&(fe.state.tokens[e].jsxRole=Se.JSXRole.StaticChildren));return}t++,Dp(),Ti();break;case Me.TokenType.jsxText:t++,Ti();break;case Me.TokenType.jsxEmptyText:Ti();break;case Me.TokenType.braceL:Se.next.call(void 0),Se.match.call(void 0,Me.TokenType.ellipsis)?(vk(),Ti(),t+=2):(Se.match.call(void 0,Me.TokenType.braceR)||(t++,ho.parseExpression.call(void 0)),Ti());break;default:fs.unexpected.call(void 0);return}}function Mp(){dn(),Dp()}fo.jsxParseElement=Mp;function dn(){fe.state.tokens.push(new Se.Token),Se.skipSpace.call(void 0),fe.state.start=fe.state.pos;let e=fe.input.charCodeAt(fe.state.pos);if(Rp.IS_IDENTIFIER_START[e])Tk();else if(e===at.charCodes.quotationMark||e===at.charCodes.apostrophe)yk(e);else switch(++fe.state.pos,e){case at.charCodes.greaterThan:Se.finishToken.call(void 0,Me.TokenType.jsxTagEnd);break;case at.charCodes.lessThan:Se.finishToken.call(void 0,Me.TokenType.jsxTagStart);break;case at.charCodes.slash:Se.finishToken.call(void 0,Me.TokenType.slash);break;case at.charCodes.equalsTo:Se.finishToken.call(void 0,Me.TokenType.eq);break;case at.charCodes.leftCurlyBrace:Se.finishToken.call(void 0,Me.TokenType.braceL);break;case at.charCodes.dot:Se.finishToken.call(void 0,Me.TokenType.dot);break;case at.charCodes.colon:Se.finishToken.call(void 0,Me.TokenType.colon);break;default:fs.unexpected.call(void 0)}}fo.nextJSXTagToken=dn;function Ti(){fe.state.tokens.push(new Se.Token),fe.state.start=fe.state.pos,mk()}});var Bp=Z(yo=>{\\"use strict\\";Object.defineProperty(yo,\\"__esModule\\",{value:!0});var mo=xt(),ki=be(),Fp=Zt(),_k=Ns(),bk=Ji(),Ck=hi();function wk(e){if(mo.match.call(void 0,ki.TokenType.question)){let t=mo.lookaheadType.call(void 0);if(t===ki.TokenType.colon||t===ki.TokenType.comma||t===ki.TokenType.parenR)return}_k.baseParseConditional.call(void 0,e)}yo.typedParseConditional=wk;function Sk(){mo.eatTypeToken.call(void 0,ki.TokenType.question),mo.match.call(void 0,ki.TokenType.colon)&&(Fp.isTypeScriptEnabled?Ck.tsParseTypeAnnotation.call(void 0):Fp.isFlowEnabled&&bk.flowParseTypeAnnotation.call(void 0))}yo.typedParseParenItem=Sk});var Ns=Z(et=>{\\"use strict\\";Object.defineProperty(et,\\"__esModule\\",{value:!0});var Yn=Ji(),Ik=vl(),Vp=Bp(),ms=hi(),K=xt(),zn=It(),jp=qr(),B=be(),$p=Qt(),Ek=li(),j=Zt(),ds=lo(),gn=nr(),Pe=cs(),vo=class{constructor(t){this.stop=t}};et.StopState=vo;function sr(e=!1){if(mn(e),K.match.call(void 0,B.TokenType.comma))for(;K.eat.call(void 0,B.TokenType.comma);)mn(e)}et.parseExpression=sr;function mn(e=!1,t=!1){return j.isTypeScriptEnabled?ms.tsParseMaybeAssign.call(void 0,e,t):j.isFlowEnabled?Yn.flowParseMaybeAssign.call(void 0,e,t):qp(e,t)}et.parseMaybeAssign=mn;function qp(e,t){if(K.match.call(void 0,B.TokenType._yield))return Hk(),!1;(K.match.call(void 0,B.TokenType.parenL)||K.match.call(void 0,B.TokenType.name)||K.match.call(void 0,B.TokenType._yield))&&(j.state.potentialArrowAt=j.state.start);let s=Ak(e);return t&&wl(),j.state.type&B.TokenType.IS_ASSIGN?(K.next.call(void 0),mn(e),!1):s}et.baseParseMaybeAssign=qp;function Ak(e){return Nk(e)?!0:(Pk(e),!1)}function Pk(e){j.isTypeScriptEnabled||j.isFlowEnabled?Vp.typedParseConditional.call(void 0,e):Kp(e)}function Kp(e){K.eat.call(void 0,B.TokenType.question)&&(mn(),Pe.expect.call(void 0,B.TokenType.colon),mn(e))}et.baseParseConditional=Kp;function Nk(e){let t=j.state.tokens.length;return rr()?!0:(To(t,-1,e),!1)}function To(e,t,s){if(j.isTypeScriptEnabled&&(B.TokenType._in&B.TokenType.PRECEDENCE_MASK)>t&&!Pe.hasPrecedingLineBreak.call(void 0)&&(Pe.eatContextual.call(void 0,zn.ContextualKeyword._as)||Pe.eatContextual.call(void 0,zn.ContextualKeyword._satisfies))){let r=K.pushTypeContext.call(void 0,1);ms.tsParseType.call(void 0),K.popTypeContext.call(void 0,r),K.rescan_gt.call(void 0),To(e,t,s);return}let i=j.state.type&B.TokenType.PRECEDENCE_MASK;if(i>0&&(!s||!K.match.call(void 0,B.TokenType._in))&&i>t){let r=j.state.type;K.next.call(void 0),r===B.TokenType.nullishCoalescing&&(j.state.tokens[j.state.tokens.length-1].nullishStartIndex=e);let a=j.state.tokens.length;rr(),To(a,r&B.TokenType.IS_RIGHT_ASSOCIATIVE?i-1:i,s),r===B.TokenType.nullishCoalescing&&(j.state.tokens[e].numNullishCoalesceStarts++,j.state.tokens[j.state.tokens.length-1].numNullishCoalesceEnds++),To(e,t,s)}}function rr(){if(j.isTypeScriptEnabled&&!j.isJSXEnabled&&K.eat.call(void 0,B.TokenType.lessThan))return ms.tsParseTypeAssertion.call(void 0),!1;if(Pe.isContextual.call(void 0,zn.ContextualKeyword._module)&&K.lookaheadCharCode.call(void 0)===$p.charCodes.leftCurlyBrace&&!Pe.hasFollowingLineBreak.call(void 0))return Wk(),!1;if(j.state.type&B.TokenType.IS_PREFIX)return K.next.call(void 0),rr(),!1;if(Up())return!0;for(;j.state.type&B.TokenType.IS_POSTFIX&&!Pe.canInsertSemicolon.call(void 0);)j.state.type===B.TokenType.preIncDec&&(j.state.type=B.TokenType.postIncDec),K.next.call(void 0);return!1}et.parseMaybeUnary=rr;function Up(){let e=j.state.tokens.length;return _o()?!0:(bl(e),j.state.tokens.length>e&&j.state.tokens[e].isOptionalChainStart&&(j.state.tokens[j.state.tokens.length-1].isOptionalChainEnd=!0),!1)}et.parseExprSubscripts=Up;function bl(e,t=!1){j.isFlowEnabled?Yn.flowParseSubscripts.call(void 0,e,t):Hp(e,t)}function Hp(e,t=!1){let s=new vo(!1);do Rk(e,t,s);while(!s.stop&&!j.state.error)}et.baseParseSubscripts=Hp;function Rk(e,t,s){j.isTypeScriptEnabled?ms.tsParseSubscript.call(void 0,e,t,s):j.isFlowEnabled?Yn.flowParseSubscript.call(void 0,e,t,s):Wp(e,t,s)}function Wp(e,t,s){if(!t&&K.eat.call(void 0,B.TokenType.doubleColon))Cl(),s.stop=!0,bl(e,t);else if(K.match.call(void 0,B.TokenType.questionDot)){if(j.state.tokens[e].isOptionalChainStart=!0,t&&K.lookaheadType.call(void 0)===B.TokenType.parenL){s.stop=!0;return}K.next.call(void 0),j.state.tokens[j.state.tokens.length-1].subscriptStartIndex=e,K.eat.call(void 0,B.TokenType.bracketL)?(sr(),Pe.expect.call(void 0,B.TokenType.bracketR)):K.eat.call(void 0,B.TokenType.parenL)?ko():xo()}else if(K.eat.call(void 0,B.TokenType.dot))j.state.tokens[j.state.tokens.length-1].subscriptStartIndex=e,xo();else if(K.eat.call(void 0,B.TokenType.bracketL))j.state.tokens[j.state.tokens.length-1].subscriptStartIndex=e,sr(),Pe.expect.call(void 0,B.TokenType.bracketR);else if(!t&&K.match.call(void 0,B.TokenType.parenL))if(Gp()){let i=j.state.snapshot(),r=j.state.tokens.length;K.next.call(void 0),j.state.tokens[j.state.tokens.length-1].subscriptStartIndex=e;let a=j.getNextContextId.call(void 0);j.state.tokens[j.state.tokens.length-1].contextId=a,ko(),j.state.tokens[j.state.tokens.length-1].contextId=a,Lk()&&(j.state.restoreFromSnapshot(i),s.stop=!0,j.state.scopeDepth++,gn.parseFunctionParams.call(void 0),Ok(r))}else{K.next.call(void 0),j.state.tokens[j.state.tokens.length-1].subscriptStartIndex=e;let i=j.getNextContextId.call(void 0);j.state.tokens[j.state.tokens.length-1].contextId=i,ko(),j.state.tokens[j.state.tokens.length-1].contextId=i}else K.match.call(void 0,B.TokenType.backQuote)?Sl():s.stop=!0}et.baseParseSubscript=Wp;function Gp(){return j.state.tokens[j.state.tokens.length-1].contextualKeyword===zn.ContextualKeyword._async&&!Pe.canInsertSemicolon.call(void 0)}et.atPossibleAsync=Gp;function ko(){let e=!0;for(;!K.eat.call(void 0,B.TokenType.parenR)&&!j.state.error;){if(e)e=!1;else if(Pe.expect.call(void 0,B.TokenType.comma),K.eat.call(void 0,B.TokenType.parenR))break;Zp(!1)}}et.parseCallExpressionArguments=ko;function Lk(){return K.match.call(void 0,B.TokenType.colon)||K.match.call(void 0,B.TokenType.arrow)}function Ok(e){j.isTypeScriptEnabled?ms.tsStartParseAsyncArrowFromCallExpression.call(void 0):j.isFlowEnabled&&Yn.flowStartParseAsyncArrowFromCallExpression.call(void 0),Pe.expect.call(void 0,B.TokenType.arrow),ir(e)}function Cl(){let e=j.state.tokens.length;_o(),bl(e,!0)}function _o(){if(K.eat.call(void 0,B.TokenType.modulo))return Xn(),!1;if(K.match.call(void 0,B.TokenType.jsxText)||K.match.call(void 0,B.TokenType.jsxEmptyText))return zp(),!1;if(K.match.call(void 0,B.TokenType.lessThan)&&j.isJSXEnabled)return j.state.type=B.TokenType.jsxTagStart,Ik.jsxParseElement.call(void 0),K.next.call(void 0),!1;let e=j.state.potentialArrowAt===j.state.start;switch(j.state.type){case B.TokenType.slash:case B.TokenType.assign:K.retokenizeSlashAsRegex.call(void 0);case B.TokenType._super:case B.TokenType._this:case B.TokenType.regexp:case B.TokenType.num:case B.TokenType.bigint:case B.TokenType.decimal:case B.TokenType.string:case B.TokenType._null:case B.TokenType._true:case B.TokenType._false:return K.next.call(void 0),!1;case B.TokenType._import:return K.next.call(void 0),K.match.call(void 0,B.TokenType.dot)&&(j.state.tokens[j.state.tokens.length-1].type=B.TokenType.name,K.next.call(void 0),Xn()),!1;case B.TokenType.name:{let t=j.state.tokens.length,s=j.state.start,i=j.state.contextualKeyword;return Xn(),i===zn.ContextualKeyword._await?(Uk(),!1):i===zn.ContextualKeyword._async&&K.match.call(void 0,B.TokenType._function)&&!Pe.canInsertSemicolon.call(void 0)?(K.next.call(void 0),gn.parseFunction.call(void 0,s,!1),!1):e&&i===zn.ContextualKeyword._async&&!Pe.canInsertSemicolon.call(void 0)&&K.match.call(void 0,B.TokenType.name)?(j.state.scopeDepth++,ds.parseBindingIdentifier.call(void 0,!1),Pe.expect.call(void 0,B.TokenType.arrow),ir(t),!0):K.match.call(void 0,B.TokenType._do)&&!Pe.canInsertSemicolon.call(void 0)?(K.next.call(void 0),gn.parseBlock.call(void 0),!1):e&&!Pe.canInsertSemicolon.call(void 0)&&K.match.call(void 0,B.TokenType.arrow)?(j.state.scopeDepth++,ds.markPriorBindingIdentifier.call(void 0,!1),Pe.expect.call(void 0,B.TokenType.arrow),ir(t),!0):(j.state.tokens[j.state.tokens.length-1].identifierRole=K.IdentifierRole.Access,!1)}case B.TokenType._do:return K.next.call(void 0),gn.parseBlock.call(void 0),!1;case B.TokenType.parenL:return Xp(e);case B.TokenType.bracketL:return K.next.call(void 0),Qp(B.TokenType.bracketR,!0),!1;case B.TokenType.braceL:return Yp(!1,!1),!1;case B.TokenType._function:return Dk(),!1;case B.TokenType.at:gn.parseDecorators.call(void 0);case B.TokenType._class:return gn.parseClass.call(void 0,!1),!1;case B.TokenType._new:return Bk(),!1;case B.TokenType.backQuote:return Sl(),!1;case B.TokenType.doubleColon:return K.next.call(void 0),Cl(),!1;case B.TokenType.hash:{let t=K.lookaheadCharCode.call(void 0);return Ek.IS_IDENTIFIER_START[t]||t===$p.charCodes.backslash?xo():K.next.call(void 0),!1}default:return Pe.unexpected.call(void 0),!1}}et.parseExprAtom=_o;function xo(){K.eat.call(void 0,B.TokenType.hash),Xn()}function Dk(){let e=j.state.start;Xn(),K.eat.call(void 0,B.TokenType.dot)&&Xn(),gn.parseFunction.call(void 0,e,!1)}function zp(){K.next.call(void 0)}et.parseLiteral=zp;function Mk(){Pe.expect.call(void 0,B.TokenType.parenL),sr(),Pe.expect.call(void 0,B.TokenType.parenR)}et.parseParenExpression=Mk;function Xp(e){let t=j.state.snapshot(),s=j.state.tokens.length;Pe.expect.call(void 0,B.TokenType.parenL);let i=!0;for(;!K.match.call(void 0,B.TokenType.parenR)&&!j.state.error;){if(i)i=!1;else if(Pe.expect.call(void 0,B.TokenType.comma),K.match.call(void 0,B.TokenType.parenR))break;if(K.match.call(void 0,B.TokenType.ellipsis)){ds.parseRest.call(void 0,!1),wl();break}else mn(!1,!0)}return Pe.expect.call(void 0,B.TokenType.parenR),e&&Fk()&&gl()?(j.state.restoreFromSnapshot(t),j.state.scopeDepth++,gn.parseFunctionParams.call(void 0),gl(),ir(s),j.state.error?(j.state.restoreFromSnapshot(t),Xp(!1),!1):!0):!1}function Fk(){return K.match.call(void 0,B.TokenType.colon)||!Pe.canInsertSemicolon.call(void 0)}function gl(){return j.isTypeScriptEnabled?ms.tsParseArrow.call(void 0):j.isFlowEnabled?Yn.flowParseArrow.call(void 0):K.eat.call(void 0,B.TokenType.arrow)}et.parseArrow=gl;function wl(){(j.isTypeScriptEnabled||j.isFlowEnabled)&&Vp.typedParseParenItem.call(void 0)}function Bk(){if(Pe.expect.call(void 0,B.TokenType._new),K.eat.call(void 0,B.TokenType.dot)){Xn();return}Vk(),j.isFlowEnabled&&Yn.flowStartParseNewArguments.call(void 0),K.eat.call(void 0,B.TokenType.parenL)&&Qp(B.TokenType.parenR)}function Vk(){Cl(),K.eat.call(void 0,B.TokenType.questionDot)}function Sl(){for(K.nextTemplateToken.call(void 0),K.nextTemplateToken.call(void 0);!K.match.call(void 0,B.TokenType.backQuote)&&!j.state.error;)Pe.expect.call(void 0,B.TokenType.dollarBraceL),sr(),K.nextTemplateToken.call(void 0),K.nextTemplateToken.call(void 0);K.next.call(void 0)}et.parseTemplate=Sl;function Yp(e,t){let s=j.getNextContextId.call(void 0),i=!0;for(K.next.call(void 0),j.state.tokens[j.state.tokens.length-1].contextId=s;!K.eat.call(void 0,B.TokenType.braceR)&&!j.state.error;){if(i)i=!1;else if(Pe.expect.call(void 0,B.TokenType.comma),K.eat.call(void 0,B.TokenType.braceR))break;let r=!1;if(K.match.call(void 0,B.TokenType.ellipsis)){let a=j.state.tokens.length;if(ds.parseSpread.call(void 0),e&&(j.state.tokens.length===a+2&&ds.markPriorBindingIdentifier.call(void 0,t),K.eat.call(void 0,B.TokenType.braceR)))break;continue}e||(r=K.eat.call(void 0,B.TokenType.star)),!e&&Pe.isContextual.call(void 0,zn.ContextualKeyword._async)?(r&&Pe.unexpected.call(void 0),Xn(),K.match.call(void 0,B.TokenType.colon)||K.match.call(void 0,B.TokenType.parenL)||K.match.call(void 0,B.TokenType.braceR)||K.match.call(void 0,B.TokenType.eq)||K.match.call(void 0,B.TokenType.comma)||(K.match.call(void 0,B.TokenType.star)&&(K.next.call(void 0),r=!0),go(s))):go(s),Kk(e,t,s)}j.state.tokens[j.state.tokens.length-1].contextId=s}et.parseObj=Yp;function jk(e){return!e&&(K.match.call(void 0,B.TokenType.string)||K.match.call(void 0,B.TokenType.num)||K.match.call(void 0,B.TokenType.bracketL)||K.match.call(void 0,B.TokenType.name)||!!(j.state.type&B.TokenType.IS_KEYWORD))}function $k(e,t){let s=j.state.start;return K.match.call(void 0,B.TokenType.parenL)?(e&&Pe.unexpected.call(void 0),_l(s,!1),!0):jk(e)?(go(t),_l(s,!1),!0):!1}function qk(e,t){if(K.eat.call(void 0,B.TokenType.colon)){e?ds.parseMaybeDefault.call(void 0,t):mn(!1);return}let s;e?j.state.scopeDepth===0?s=K.IdentifierRole.ObjectShorthandTopLevelDeclaration:t?s=K.IdentifierRole.ObjectShorthandBlockScopedDeclaration:s=K.IdentifierRole.ObjectShorthandFunctionScopedDeclaration:s=K.IdentifierRole.ObjectShorthand,j.state.tokens[j.state.tokens.length-1].identifierRole=s,ds.parseMaybeDefault.call(void 0,t,!0)}function Kk(e,t,s){j.isTypeScriptEnabled?ms.tsStartParseObjPropValue.call(void 0):j.isFlowEnabled&&Yn.flowStartParseObjPropValue.call(void 0),$k(e,s)||qk(e,t)}function go(e){j.isFlowEnabled&&Yn.flowParseVariance.call(void 0),K.eat.call(void 0,B.TokenType.bracketL)?(j.state.tokens[j.state.tokens.length-1].contextId=e,mn(),Pe.expect.call(void 0,B.TokenType.bracketR),j.state.tokens[j.state.tokens.length-1].contextId=e):(K.match.call(void 0,B.TokenType.num)||K.match.call(void 0,B.TokenType.string)||K.match.call(void 0,B.TokenType.bigint)||K.match.call(void 0,B.TokenType.decimal)?_o():xo(),j.state.tokens[j.state.tokens.length-1].identifierRole=K.IdentifierRole.ObjectKey,j.state.tokens[j.state.tokens.length-1].contextId=e)}et.parsePropertyName=go;function _l(e,t){let s=j.getNextContextId.call(void 0);j.state.scopeDepth++;let i=j.state.tokens.length,r=t;gn.parseFunctionParams.call(void 0,r,s),Jp(e,s);let a=j.state.tokens.length;j.state.scopes.push(new jp.Scope(i,a,!0)),j.state.scopeDepth--}et.parseMethod=_l;function ir(e){Il(!0);let t=j.state.tokens.length;j.state.scopes.push(new jp.Scope(e,t,!0)),j.state.scopeDepth--}et.parseArrowExpression=ir;function Jp(e,t=0){j.isTypeScriptEnabled?ms.tsParseFunctionBodyAndFinish.call(void 0,e,t):j.isFlowEnabled?Yn.flowParseFunctionBodyAndFinish.call(void 0,t):Il(!1,t)}et.parseFunctionBodyAndFinish=Jp;function Il(e,t=0){e&&!K.match.call(void 0,B.TokenType.braceL)?mn():gn.parseBlock.call(void 0,!0,t)}et.parseFunctionBody=Il;function Qp(e,t=!1){let s=!0;for(;!K.eat.call(void 0,e)&&!j.state.error;){if(s)s=!1;else if(Pe.expect.call(void 0,B.TokenType.comma),K.eat.call(void 0,e))break;Zp(t)}}function Zp(e){e&&K.match.call(void 0,B.TokenType.comma)||(K.match.call(void 0,B.TokenType.ellipsis)?(ds.parseSpread.call(void 0),wl()):K.match.call(void 0,B.TokenType.question)?K.next.call(void 0):mn(!1,!0))}function Xn(){K.next.call(void 0),j.state.tokens[j.state.tokens.length-1].type=B.TokenType.name}et.parseIdentifier=Xn;function Uk(){rr()}function Hk(){K.next.call(void 0),!K.match.call(void 0,B.TokenType.semi)&&!Pe.canInsertSemicolon.call(void 0)&&(K.eat.call(void 0,B.TokenType.star),mn())}function Wk(){Pe.expectContextual.call(void 0,zn.ContextualKeyword._module),Pe.expect.call(void 0,B.TokenType.braceL),gn.parseBlockBody.call(void 0,B.TokenType.braceR)}});var Ji=Z(Je=>{\\"use strict\\";Object.defineProperty(Je,\\"__esModule\\",{value:!0});var C=xt(),ye=It(),_=be(),ue=Zt(),je=Ns(),ys=nr(),z=cs();function Gk(e){return(e.type===_.TokenType.name||!!(e.type&_.TokenType.IS_KEYWORD))&&e.contextualKeyword!==ye.ContextualKeyword._from}function Ln(e){let t=C.pushTypeContext.call(void 0,0);z.expect.call(void 0,e||_.TokenType.colon),Wt(),C.popTypeContext.call(void 0,t)}function eh(){z.expect.call(void 0,_.TokenType.modulo),z.expectContextual.call(void 0,ye.ContextualKeyword._checks),C.eat.call(void 0,_.TokenType.parenL)&&(je.parseExpression.call(void 0),z.expect.call(void 0,_.TokenType.parenR))}function Pl(){let e=C.pushTypeContext.call(void 0,0);z.expect.call(void 0,_.TokenType.colon),C.match.call(void 0,_.TokenType.modulo)?eh():(Wt(),C.match.call(void 0,_.TokenType.modulo)&&eh()),C.popTypeContext.call(void 0,e)}function zk(){C.next.call(void 0),Nl(!0)}function Xk(){C.next.call(void 0),je.parseIdentifier.call(void 0),C.match.call(void 0,_.TokenType.lessThan)&&On(),z.expect.call(void 0,_.TokenType.parenL),Al(),z.expect.call(void 0,_.TokenType.parenR),Pl(),z.semicolon.call(void 0)}function El(){C.match.call(void 0,_.TokenType._class)?zk():C.match.call(void 0,_.TokenType._function)?Xk():C.match.call(void 0,_.TokenType._var)?Yk():z.eatContextual.call(void 0,ye.ContextualKeyword._module)?C.eat.call(void 0,_.TokenType.dot)?Zk():Jk():z.isContextual.call(void 0,ye.ContextualKeyword._type)?e0():z.isContextual.call(void 0,ye.ContextualKeyword._opaque)?t0():z.isContextual.call(void 0,ye.ContextualKeyword._interface)?n0():C.match.call(void 0,_.TokenType._export)?Qk():z.unexpected.call(void 0)}function Yk(){C.next.call(void 0),oh(),z.semicolon.call(void 0)}function Jk(){for(C.match.call(void 0,_.TokenType.string)?je.parseExprAtom.call(void 0):je.parseIdentifier.call(void 0),z.expect.call(void 0,_.TokenType.braceL);!C.match.call(void 0,_.TokenType.braceR)&&!ue.state.error;)C.match.call(void 0,_.TokenType._import)?(C.next.call(void 0),ys.parseImport.call(void 0)):z.unexpected.call(void 0);z.expect.call(void 0,_.TokenType.braceR)}function Qk(){z.expect.call(void 0,_.TokenType._export),C.eat.call(void 0,_.TokenType._default)?C.match.call(void 0,_.TokenType._function)||C.match.call(void 0,_.TokenType._class)?El():(Wt(),z.semicolon.call(void 0)):C.match.call(void 0,_.TokenType._var)||C.match.call(void 0,_.TokenType._function)||C.match.call(void 0,_.TokenType._class)||z.isContextual.call(void 0,ye.ContextualKeyword._opaque)?El():C.match.call(void 0,_.TokenType.star)||C.match.call(void 0,_.TokenType.braceL)||z.isContextual.call(void 0,ye.ContextualKeyword._interface)||z.isContextual.call(void 0,ye.ContextualKeyword._type)||z.isContextual.call(void 0,ye.ContextualKeyword._opaque)?ys.parseExport.call(void 0):z.unexpected.call(void 0)}function Zk(){z.expectContextual.call(void 0,ye.ContextualKeyword._exports),vi(),z.semicolon.call(void 0)}function e0(){C.next.call(void 0),Ll()}function t0(){C.next.call(void 0),Ol(!0)}function n0(){C.next.call(void 0),Nl()}function Nl(e=!1){if(So(),C.match.call(void 0,_.TokenType.lessThan)&&On(),C.eat.call(void 0,_.TokenType._extends))do bo();while(!e&&C.eat.call(void 0,_.TokenType.comma));if(z.isContextual.call(void 0,ye.ContextualKeyword._mixins)){C.next.call(void 0);do bo();while(C.eat.call(void 0,_.TokenType.comma))}if(z.isContextual.call(void 0,ye.ContextualKeyword._implements)){C.next.call(void 0);do bo();while(C.eat.call(void 0,_.TokenType.comma))}Co(e,!1,e)}function bo(){sh(!1),C.match.call(void 0,_.TokenType.lessThan)&&Rs()}function Rl(){Nl()}function So(){je.parseIdentifier.call(void 0)}function Ll(){So(),C.match.call(void 0,_.TokenType.lessThan)&&On(),Ln(_.TokenType.eq),z.semicolon.call(void 0)}function Ol(e){z.expectContextual.call(void 0,ye.ContextualKeyword._type),So(),C.match.call(void 0,_.TokenType.lessThan)&&On(),C.match.call(void 0,_.TokenType.colon)&&Ln(_.TokenType.colon),e||Ln(_.TokenType.eq),z.semicolon.call(void 0)}function s0(){Fl(),oh(),C.eat.call(void 0,_.TokenType.eq)&&Wt()}function On(){let e=C.pushTypeContext.call(void 0,0);C.match.call(void 0,_.TokenType.lessThan)||C.match.call(void 0,_.TokenType.typeParameterStart)?C.next.call(void 0):z.unexpected.call(void 0);do s0(),C.match.call(void 0,_.TokenType.greaterThan)||z.expect.call(void 0,_.TokenType.comma);while(!C.match.call(void 0,_.TokenType.greaterThan)&&!ue.state.error);z.expect.call(void 0,_.TokenType.greaterThan),C.popTypeContext.call(void 0,e)}Je.flowParseTypeParameterDeclaration=On;function Rs(){let e=C.pushTypeContext.call(void 0,0);for(z.expect.call(void 0,_.TokenType.lessThan);!C.match.call(void 0,_.TokenType.greaterThan)&&!ue.state.error;)Wt(),C.match.call(void 0,_.TokenType.greaterThan)||z.expect.call(void 0,_.TokenType.comma);z.expect.call(void 0,_.TokenType.greaterThan),C.popTypeContext.call(void 0,e)}function i0(){if(z.expectContextual.call(void 0,ye.ContextualKeyword._interface),C.eat.call(void 0,_.TokenType._extends))do bo();while(C.eat.call(void 0,_.TokenType.comma));Co(!1,!1,!1)}function Dl(){C.match.call(void 0,_.TokenType.num)||C.match.call(void 0,_.TokenType.string)?je.parseExprAtom.call(void 0):je.parseIdentifier.call(void 0)}function r0(){C.lookaheadType.call(void 0)===_.TokenType.colon?(Dl(),Ln()):Wt(),z.expect.call(void 0,_.TokenType.bracketR),Ln()}function o0(){Dl(),z.expect.call(void 0,_.TokenType.bracketR),z.expect.call(void 0,_.TokenType.bracketR),C.match.call(void 0,_.TokenType.lessThan)||C.match.call(void 0,_.TokenType.parenL)?Ml():(C.eat.call(void 0,_.TokenType.question),Ln())}function Ml(){for(C.match.call(void 0,_.TokenType.lessThan)&&On(),z.expect.call(void 0,_.TokenType.parenL);!C.match.call(void 0,_.TokenType.parenR)&&!C.match.call(void 0,_.TokenType.ellipsis)&&!ue.state.error;)wo(),C.match.call(void 0,_.TokenType.parenR)||z.expect.call(void 0,_.TokenType.comma);C.eat.call(void 0,_.TokenType.ellipsis)&&wo(),z.expect.call(void 0,_.TokenType.parenR),Ln()}function a0(){Ml()}function Co(e,t,s){let i;for(t&&C.match.call(void 0,_.TokenType.braceBarL)?(z.expect.call(void 0,_.TokenType.braceBarL),i=_.TokenType.braceBarR):(z.expect.call(void 0,_.TokenType.braceL),i=_.TokenType.braceR);!C.match.call(void 0,i)&&!ue.state.error;){if(s&&z.isContextual.call(void 0,ye.ContextualKeyword._proto)){let r=C.lookaheadType.call(void 0);r!==_.TokenType.colon&&r!==_.TokenType.question&&(C.next.call(void 0),e=!1)}if(e&&z.isContextual.call(void 0,ye.ContextualKeyword._static)){let r=C.lookaheadType.call(void 0);r!==_.TokenType.colon&&r!==_.TokenType.question&&C.next.call(void 0)}if(Fl(),C.eat.call(void 0,_.TokenType.bracketL))C.eat.call(void 0,_.TokenType.bracketL)?o0():r0();else if(C.match.call(void 0,_.TokenType.parenL)||C.match.call(void 0,_.TokenType.lessThan))a0();else{if(z.isContextual.call(void 0,ye.ContextualKeyword._get)||z.isContextual.call(void 0,ye.ContextualKeyword._set)){let r=C.lookaheadType.call(void 0);(r===_.TokenType.name||r===_.TokenType.string||r===_.TokenType.num)&&C.next.call(void 0)}l0()}c0()}z.expect.call(void 0,i)}function l0(){if(C.match.call(void 0,_.TokenType.ellipsis)){if(z.expect.call(void 0,_.TokenType.ellipsis),C.eat.call(void 0,_.TokenType.comma)||C.eat.call(void 0,_.TokenType.semi),C.match.call(void 0,_.TokenType.braceR))return;Wt()}else Dl(),C.match.call(void 0,_.TokenType.lessThan)||C.match.call(void 0,_.TokenType.parenL)?Ml():(C.eat.call(void 0,_.TokenType.question),Ln())}function c0(){!C.eat.call(void 0,_.TokenType.semi)&&!C.eat.call(void 0,_.TokenType.comma)&&!C.match.call(void 0,_.TokenType.braceR)&&!C.match.call(void 0,_.TokenType.braceBarR)&&z.unexpected.call(void 0)}function sh(e){for(e||je.parseIdentifier.call(void 0);C.eat.call(void 0,_.TokenType.dot);)je.parseIdentifier.call(void 0)}function u0(){sh(!0),C.match.call(void 0,_.TokenType.lessThan)&&Rs()}function p0(){z.expect.call(void 0,_.TokenType._typeof),ih()}function h0(){for(z.expect.call(void 0,_.TokenType.bracketL);ue.state.pos{\\"use strict\\";Object.defineProperty(Tt,\\"__esModule\\",{value:!0});var $0=Ul(),Ft=Ji(),dt=hi(),$=xt(),ke=It(),Ts=qr(),D=be(),lh=Qt(),P=Zt(),De=Ns(),ks=lo(),ee=cs();function q0(){if(ql(D.TokenType.eof),P.state.scopes.push(new Ts.Scope(0,P.state.tokens.length,!0)),P.state.scopeDepth!==0)throw new Error(`Invalid scope depth at end of file: ${P.state.scopeDepth}`);return new $0.File(P.state.tokens,P.state.scopes)}Tt.parseTopLevel=q0;function _n(e){P.isFlowEnabled&&Ft.flowTryParseStatement.call(void 0)||($.match.call(void 0,D.TokenType.at)&&$l(),K0(e))}Tt.parseStatement=_n;function K0(e){if(P.isTypeScriptEnabled&&dt.tsTryParseStatementContent.call(void 0))return;let t=P.state.type;switch(t){case D.TokenType._break:case D.TokenType._continue:H0();return;case D.TokenType._debugger:W0();return;case D.TokenType._do:G0();return;case D.TokenType._for:z0();return;case D.TokenType._function:if($.lookaheadType.call(void 0)===D.TokenType.dot)break;e||ee.unexpected.call(void 0),J0();return;case D.TokenType._class:e||ee.unexpected.call(void 0),Io(!0);return;case D.TokenType._if:Q0();return;case D.TokenType._return:Z0();return;case D.TokenType._switch:ev();return;case D.TokenType._throw:tv();return;case D.TokenType._try:sv();return;case D.TokenType._let:case D.TokenType._const:e||ee.unexpected.call(void 0);case D.TokenType._var:Vl(t!==D.TokenType._var);return;case D.TokenType._while:iv();return;case D.TokenType.braceL:gi();return;case D.TokenType.semi:rv();return;case D.TokenType._export:case D.TokenType._import:{let r=$.lookaheadType.call(void 0);if(r===D.TokenType.parenL||r===D.TokenType.dot)break;$.next.call(void 0),t===D.TokenType._import?xh():Th();return}case D.TokenType.name:if(P.state.contextualKeyword===ke.ContextualKeyword._async){let r=P.state.start,a=P.state.snapshot();if($.next.call(void 0),$.match.call(void 0,D.TokenType._function)&&!ee.canInsertSemicolon.call(void 0)){ee.expect.call(void 0,D.TokenType._function),lr(r,!0);return}else P.state.restoreFromSnapshot(a)}else if(P.state.contextualKeyword===ke.ContextualKeyword._using&&!ee.hasFollowingLineBreak.call(void 0)&&$.lookaheadType.call(void 0)===D.TokenType.name){Vl(!0);return}default:break}let s=P.state.tokens.length;De.parseExpression.call(void 0);let i=null;if(P.state.tokens.length===s+1){let r=P.state.tokens[P.state.tokens.length-1];r.type===D.TokenType.name&&(i=r.contextualKeyword)}if(i==null){ee.semicolon.call(void 0);return}$.eat.call(void 0,D.TokenType.colon)?ov():av(i)}function $l(){for(;$.match.call(void 0,D.TokenType.at);)ph()}Tt.parseDecorators=$l;function ph(){if($.next.call(void 0),$.eat.call(void 0,D.TokenType.parenL))De.parseExpression.call(void 0),ee.expect.call(void 0,D.TokenType.parenR);else{for(De.parseIdentifier.call(void 0);$.eat.call(void 0,D.TokenType.dot);)De.parseIdentifier.call(void 0);U0()}}function U0(){P.isTypeScriptEnabled?dt.tsParseMaybeDecoratorArguments.call(void 0):hh()}function hh(){$.eat.call(void 0,D.TokenType.parenL)&&De.parseCallExpressionArguments.call(void 0)}Tt.baseParseMaybeDecoratorArguments=hh;function H0(){$.next.call(void 0),ee.isLineTerminator.call(void 0)||(De.parseIdentifier.call(void 0),ee.semicolon.call(void 0))}function W0(){$.next.call(void 0),ee.semicolon.call(void 0)}function G0(){$.next.call(void 0),_n(!1),ee.expect.call(void 0,D.TokenType._while),De.parseParenExpression.call(void 0),$.eat.call(void 0,D.TokenType.semi)}function z0(){P.state.scopeDepth++;let e=P.state.tokens.length;Y0();let t=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(e,t,!1)),P.state.scopeDepth--}function X0(){return!(!ee.isContextual.call(void 0,ke.ContextualKeyword._using)||ee.isLookaheadContextual.call(void 0,ke.ContextualKeyword._of))}function Y0(){$.next.call(void 0);let e=!1;if(ee.isContextual.call(void 0,ke.ContextualKeyword._await)&&(e=!0,$.next.call(void 0)),ee.expect.call(void 0,D.TokenType.parenL),$.match.call(void 0,D.TokenType.semi)){e&&ee.unexpected.call(void 0),Bl();return}if($.match.call(void 0,D.TokenType._var)||$.match.call(void 0,D.TokenType._let)||$.match.call(void 0,D.TokenType._const)||X0()){if($.next.call(void 0),fh(!0,P.state.type!==D.TokenType._var),$.match.call(void 0,D.TokenType._in)||ee.isContextual.call(void 0,ke.ContextualKeyword._of)){ch(e);return}Bl();return}if(De.parseExpression.call(void 0,!0),$.match.call(void 0,D.TokenType._in)||ee.isContextual.call(void 0,ke.ContextualKeyword._of)){ch(e);return}e&&ee.unexpected.call(void 0),Bl()}function J0(){let e=P.state.start;$.next.call(void 0),lr(e,!0)}function Q0(){$.next.call(void 0),De.parseParenExpression.call(void 0),_n(!1),$.eat.call(void 0,D.TokenType._else)&&_n(!1)}function Z0(){$.next.call(void 0),ee.isLineTerminator.call(void 0)||(De.parseExpression.call(void 0),ee.semicolon.call(void 0))}function ev(){$.next.call(void 0),De.parseParenExpression.call(void 0),P.state.scopeDepth++;let e=P.state.tokens.length;for(ee.expect.call(void 0,D.TokenType.braceL);!$.match.call(void 0,D.TokenType.braceR)&&!P.state.error;)if($.match.call(void 0,D.TokenType._case)||$.match.call(void 0,D.TokenType._default)){let s=$.match.call(void 0,D.TokenType._case);$.next.call(void 0),s&&De.parseExpression.call(void 0),ee.expect.call(void 0,D.TokenType.colon)}else _n(!0);$.next.call(void 0);let t=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(e,t,!1)),P.state.scopeDepth--}function tv(){$.next.call(void 0),De.parseExpression.call(void 0),ee.semicolon.call(void 0)}function nv(){ks.parseBindingAtom.call(void 0,!0),P.isTypeScriptEnabled&&dt.tsTryParseTypeAnnotation.call(void 0)}function sv(){if($.next.call(void 0),gi(),$.match.call(void 0,D.TokenType._catch)){$.next.call(void 0);let e=null;if($.match.call(void 0,D.TokenType.parenL)&&(P.state.scopeDepth++,e=P.state.tokens.length,ee.expect.call(void 0,D.TokenType.parenL),nv(),ee.expect.call(void 0,D.TokenType.parenR)),gi(),e!=null){let t=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(e,t,!1)),P.state.scopeDepth--}}$.eat.call(void 0,D.TokenType._finally)&&gi()}function Vl(e){$.next.call(void 0),fh(!1,e),ee.semicolon.call(void 0)}Tt.parseVarStatement=Vl;function iv(){$.next.call(void 0),De.parseParenExpression.call(void 0),_n(!1)}function rv(){$.next.call(void 0)}function ov(){_n(!0)}function av(e){P.isTypeScriptEnabled?dt.tsParseIdentifierStatement.call(void 0,e):P.isFlowEnabled?Ft.flowParseIdentifierStatement.call(void 0,e):ee.semicolon.call(void 0)}function gi(e=!1,t=0){let s=P.state.tokens.length;P.state.scopeDepth++,ee.expect.call(void 0,D.TokenType.braceL),t&&(P.state.tokens[P.state.tokens.length-1].contextId=t),ql(D.TokenType.braceR),t&&(P.state.tokens[P.state.tokens.length-1].contextId=t);let i=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(s,i,e)),P.state.scopeDepth--}Tt.parseBlock=gi;function ql(e){for(;!$.eat.call(void 0,e)&&!P.state.error;)_n(!0)}Tt.parseBlockBody=ql;function Bl(){ee.expect.call(void 0,D.TokenType.semi),$.match.call(void 0,D.TokenType.semi)||De.parseExpression.call(void 0),ee.expect.call(void 0,D.TokenType.semi),$.match.call(void 0,D.TokenType.parenR)||De.parseExpression.call(void 0),ee.expect.call(void 0,D.TokenType.parenR),_n(!1)}function ch(e){e?ee.eatContextual.call(void 0,ke.ContextualKeyword._of):$.next.call(void 0),De.parseExpression.call(void 0),ee.expect.call(void 0,D.TokenType.parenR),_n(!1)}function fh(e,t){for(;;){if(lv(t),$.eat.call(void 0,D.TokenType.eq)){let s=P.state.tokens.length-1;De.parseMaybeAssign.call(void 0,e),P.state.tokens[s].rhsEndIndex=P.state.tokens.length}if(!$.eat.call(void 0,D.TokenType.comma))break}}function lv(e){ks.parseBindingAtom.call(void 0,e),P.isTypeScriptEnabled?dt.tsAfterParseVarHead.call(void 0):P.isFlowEnabled&&Ft.flowAfterParseVarHead.call(void 0)}function lr(e,t,s=!1){$.match.call(void 0,D.TokenType.star)&&$.next.call(void 0),t&&!s&&!$.match.call(void 0,D.TokenType.name)&&!$.match.call(void 0,D.TokenType._yield)&&ee.unexpected.call(void 0);let i=null;$.match.call(void 0,D.TokenType.name)&&(t||(i=P.state.tokens.length,P.state.scopeDepth++),ks.parseBindingIdentifier.call(void 0,!1));let r=P.state.tokens.length;P.state.scopeDepth++,dh(),De.parseFunctionBodyAndFinish.call(void 0,e);let a=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(r,a,!0)),P.state.scopeDepth--,i!==null&&(P.state.scopes.push(new Ts.Scope(i,a,!0)),P.state.scopeDepth--)}Tt.parseFunction=lr;function dh(e=!1,t=0){P.isTypeScriptEnabled?dt.tsStartParseFunctionParams.call(void 0):P.isFlowEnabled&&Ft.flowStartParseFunctionParams.call(void 0),ee.expect.call(void 0,D.TokenType.parenL),t&&(P.state.tokens[P.state.tokens.length-1].contextId=t),ks.parseBindingList.call(void 0,D.TokenType.parenR,!1,!1,e,t),t&&(P.state.tokens[P.state.tokens.length-1].contextId=t)}Tt.parseFunctionParams=dh;function Io(e,t=!1){let s=P.getNextContextId.call(void 0);$.next.call(void 0),P.state.tokens[P.state.tokens.length-1].contextId=s,P.state.tokens[P.state.tokens.length-1].isExpression=!e;let i=null;e||(i=P.state.tokens.length,P.state.scopeDepth++),hv(e,t),fv();let r=P.state.tokens.length;if(cv(s),!P.state.error&&(P.state.tokens[r].contextId=s,P.state.tokens[P.state.tokens.length-1].contextId=s,i!==null)){let a=P.state.tokens.length;P.state.scopes.push(new Ts.Scope(i,a,!1)),P.state.scopeDepth--}}Tt.parseClass=Io;function mh(){return $.match.call(void 0,D.TokenType.eq)||$.match.call(void 0,D.TokenType.semi)||$.match.call(void 0,D.TokenType.braceR)||$.match.call(void 0,D.TokenType.bang)||$.match.call(void 0,D.TokenType.colon)}function yh(){return $.match.call(void 0,D.TokenType.parenL)||$.match.call(void 0,D.TokenType.lessThan)}function cv(e){for(ee.expect.call(void 0,D.TokenType.braceL);!$.eat.call(void 0,D.TokenType.braceR)&&!P.state.error;){if($.eat.call(void 0,D.TokenType.semi))continue;if($.match.call(void 0,D.TokenType.at)){ph();continue}let t=P.state.start;uv(t,e)}}function uv(e,t){P.isTypeScriptEnabled&&dt.tsParseModifiers.call(void 0,[ke.ContextualKeyword._declare,ke.ContextualKeyword._public,ke.ContextualKeyword._protected,ke.ContextualKeyword._private,ke.ContextualKeyword._override]);let s=!1;if($.match.call(void 0,D.TokenType.name)&&P.state.contextualKeyword===ke.ContextualKeyword._static){if(De.parseIdentifier.call(void 0),yh()){or(e,!1);return}else if(mh()){ar();return}if(P.state.tokens[P.state.tokens.length-1].type=D.TokenType._static,s=!0,$.match.call(void 0,D.TokenType.braceL)){P.state.tokens[P.state.tokens.length-1].contextId=t,gi();return}}pv(e,s,t)}function pv(e,t,s){if(P.isTypeScriptEnabled&&dt.tsTryParseClassMemberWithIsStatic.call(void 0,t))return;if($.eat.call(void 0,D.TokenType.star)){xi(s),or(e,!1);return}xi(s);let i=!1,r=P.state.tokens[P.state.tokens.length-1];r.contextualKeyword===ke.ContextualKeyword._constructor&&(i=!0),jl(),yh()?or(e,i):mh()?ar():r.contextualKeyword===ke.ContextualKeyword._async&&!ee.isLineTerminator.call(void 0)?(P.state.tokens[P.state.tokens.length-1].type=D.TokenType._async,$.match.call(void 0,D.TokenType.star)&&$.next.call(void 0),xi(s),jl(),or(e,!1)):(r.contextualKeyword===ke.ContextualKeyword._get||r.contextualKeyword===ke.ContextualKeyword._set)&&!(ee.isLineTerminator.call(void 0)&&$.match.call(void 0,D.TokenType.star))?(r.contextualKeyword===ke.ContextualKeyword._get?P.state.tokens[P.state.tokens.length-1].type=D.TokenType._get:P.state.tokens[P.state.tokens.length-1].type=D.TokenType._set,xi(s),or(e,!1)):r.contextualKeyword===ke.ContextualKeyword._accessor&&!ee.isLineTerminator.call(void 0)?(xi(s),ar()):ee.isLineTerminator.call(void 0)?ar():ee.unexpected.call(void 0)}function or(e,t){P.isTypeScriptEnabled?dt.tsTryParseTypeParameters.call(void 0):P.isFlowEnabled&&$.match.call(void 0,D.TokenType.lessThan)&&Ft.flowParseTypeParameterDeclaration.call(void 0),De.parseMethod.call(void 0,e,t)}function xi(e){De.parsePropertyName.call(void 0,e)}Tt.parseClassPropertyName=xi;function jl(){if(P.isTypeScriptEnabled){let e=$.pushTypeContext.call(void 0,0);$.eat.call(void 0,D.TokenType.question),$.popTypeContext.call(void 0,e)}}Tt.parsePostMemberNameModifiers=jl;function ar(){if(P.isTypeScriptEnabled?($.eatTypeToken.call(void 0,D.TokenType.bang),dt.tsTryParseTypeAnnotation.call(void 0)):P.isFlowEnabled&&$.match.call(void 0,D.TokenType.colon)&&Ft.flowParseTypeAnnotation.call(void 0),$.match.call(void 0,D.TokenType.eq)){let e=P.state.tokens.length;$.next.call(void 0),De.parseMaybeAssign.call(void 0),P.state.tokens[e].rhsEndIndex=P.state.tokens.length}ee.semicolon.call(void 0)}Tt.parseClassProperty=ar;function hv(e,t=!1){P.isTypeScriptEnabled&&(!e||t)&&ee.isContextual.call(void 0,ke.ContextualKeyword._implements)||($.match.call(void 0,D.TokenType.name)&&ks.parseBindingIdentifier.call(void 0,!0),P.isTypeScriptEnabled?dt.tsTryParseTypeParameters.call(void 0):P.isFlowEnabled&&$.match.call(void 0,D.TokenType.lessThan)&&Ft.flowParseTypeParameterDeclaration.call(void 0))}function fv(){let e=!1;$.eat.call(void 0,D.TokenType._extends)?(De.parseExprSubscripts.call(void 0),e=!0):e=!1,P.isTypeScriptEnabled?dt.tsAfterParseClassSuper.call(void 0,e):P.isFlowEnabled&&Ft.flowAfterParseClassSuper.call(void 0,e)}function Th(){let e=P.state.tokens.length-1;P.isTypeScriptEnabled&&dt.tsTryParseExport.call(void 0)||(Tv()?kv():yv()?(De.parseIdentifier.call(void 0),$.match.call(void 0,D.TokenType.comma)&&$.lookaheadType.call(void 0)===D.TokenType.star?(ee.expect.call(void 0,D.TokenType.comma),ee.expect.call(void 0,D.TokenType.star),ee.expectContextual.call(void 0,ke.ContextualKeyword._as),De.parseIdentifier.call(void 0)):kh(),cr()):$.eat.call(void 0,D.TokenType._default)?dv():xv()?mv():(Kl(),cr()),P.state.tokens[e].rhsEndIndex=P.state.tokens.length)}Tt.parseExport=Th;function dv(){if(P.isTypeScriptEnabled&&dt.tsTryParseExportDefaultExpression.call(void 0)||P.isFlowEnabled&&Ft.flowTryParseExportDefaultExpression.call(void 0))return;let e=P.state.start;$.eat.call(void 0,D.TokenType._function)?lr(e,!0,!0):ee.isContextual.call(void 0,ke.ContextualKeyword._async)&&$.lookaheadType.call(void 0)===D.TokenType._function?(ee.eatContextual.call(void 0,ke.ContextualKeyword._async),$.eat.call(void 0,D.TokenType._function),lr(e,!0,!0)):$.match.call(void 0,D.TokenType._class)?Io(!0,!0):$.match.call(void 0,D.TokenType.at)?($l(),Io(!0,!0)):(De.parseMaybeAssign.call(void 0),ee.semicolon.call(void 0))}function mv(){P.isTypeScriptEnabled?dt.tsParseExportDeclaration.call(void 0):P.isFlowEnabled?Ft.flowParseExportDeclaration.call(void 0):_n(!0)}function yv(){if(P.isTypeScriptEnabled&&dt.tsIsDeclarationStart.call(void 0))return!1;if(P.isFlowEnabled&&Ft.flowShouldDisallowExportDefaultSpecifier.call(void 0))return!1;if($.match.call(void 0,D.TokenType.name))return P.state.contextualKeyword!==ke.ContextualKeyword._async;if(!$.match.call(void 0,D.TokenType._default))return!1;let e=$.nextTokenStart.call(void 0),t=$.lookaheadTypeAndKeyword.call(void 0),s=t.type===D.TokenType.name&&t.contextualKeyword===ke.ContextualKeyword._from;if(t.type===D.TokenType.comma)return!0;if(s){let i=P.input.charCodeAt($.nextTokenStartSince.call(void 0,e+4));return i===lh.charCodes.quotationMark||i===lh.charCodes.apostrophe}return!1}function kh(){$.eat.call(void 0,D.TokenType.comma)&&Kl()}function cr(){ee.eatContextual.call(void 0,ke.ContextualKeyword._from)&&(De.parseExprAtom.call(void 0),gh()),ee.semicolon.call(void 0)}Tt.parseExportFrom=cr;function Tv(){return P.isFlowEnabled?Ft.flowShouldParseExportStar.call(void 0):$.match.call(void 0,D.TokenType.star)}function kv(){P.isFlowEnabled?Ft.flowParseExportStar.call(void 0):vh()}function vh(){ee.expect.call(void 0,D.TokenType.star),ee.isContextual.call(void 0,ke.ContextualKeyword._as)?vv():cr()}Tt.baseParseExportStar=vh;function vv(){$.next.call(void 0),P.state.tokens[P.state.tokens.length-1].type=D.TokenType._as,De.parseIdentifier.call(void 0),kh(),cr()}function xv(){return P.isTypeScriptEnabled&&dt.tsIsDeclarationStart.call(void 0)||P.isFlowEnabled&&Ft.flowShouldParseExportDeclaration.call(void 0)||P.state.type===D.TokenType._var||P.state.type===D.TokenType._const||P.state.type===D.TokenType._let||P.state.type===D.TokenType._function||P.state.type===D.TokenType._class||ee.isContextual.call(void 0,ke.ContextualKeyword._async)||$.match.call(void 0,D.TokenType.at)}function Kl(){let e=!0;for(ee.expect.call(void 0,D.TokenType.braceL);!$.eat.call(void 0,D.TokenType.braceR)&&!P.state.error;){if(e)e=!1;else if(ee.expect.call(void 0,D.TokenType.comma),$.eat.call(void 0,D.TokenType.braceR))break;gv()}}Tt.parseExportSpecifiers=Kl;function gv(){if(P.isTypeScriptEnabled){dt.tsParseExportSpecifier.call(void 0);return}De.parseIdentifier.call(void 0),P.state.tokens[P.state.tokens.length-1].identifierRole=$.IdentifierRole.ExportAccess,ee.eatContextual.call(void 0,ke.ContextualKeyword._as)&&De.parseIdentifier.call(void 0)}function _v(){let e=P.state.snapshot();return ee.expectContextual.call(void 0,ke.ContextualKeyword._module),ee.eatContextual.call(void 0,ke.ContextualKeyword._from)?ee.isContextual.call(void 0,ke.ContextualKeyword._from)?(P.state.restoreFromSnapshot(e),!0):(P.state.restoreFromSnapshot(e),!1):$.match.call(void 0,D.TokenType.comma)?(P.state.restoreFromSnapshot(e),!1):(P.state.restoreFromSnapshot(e),!0)}function bv(){ee.isContextual.call(void 0,ke.ContextualKeyword._module)&&_v()&&$.next.call(void 0)}function xh(){if(P.isTypeScriptEnabled&&$.match.call(void 0,D.TokenType.name)&&$.lookaheadType.call(void 0)===D.TokenType.eq){dt.tsParseImportEqualsDeclaration.call(void 0);return}if(P.isTypeScriptEnabled&&ee.isContextual.call(void 0,ke.ContextualKeyword._type)){let e=$.lookaheadTypeAndKeyword.call(void 0);if(e.type===D.TokenType.name&&e.contextualKeyword!==ke.ContextualKeyword._from){if(ee.expectContextual.call(void 0,ke.ContextualKeyword._type),$.lookaheadType.call(void 0)===D.TokenType.eq){dt.tsParseImportEqualsDeclaration.call(void 0);return}}else(e.type===D.TokenType.star||e.type===D.TokenType.braceL)&&ee.expectContextual.call(void 0,ke.ContextualKeyword._type)}$.match.call(void 0,D.TokenType.string)||(bv(),wv(),ee.expectContextual.call(void 0,ke.ContextualKeyword._from)),De.parseExprAtom.call(void 0),gh(),ee.semicolon.call(void 0)}Tt.parseImport=xh;function Cv(){return $.match.call(void 0,D.TokenType.name)}function uh(){ks.parseImportedIdentifier.call(void 0)}function wv(){P.isFlowEnabled&&Ft.flowStartParseImportSpecifiers.call(void 0);let e=!0;if(!(Cv()&&(uh(),!$.eat.call(void 0,D.TokenType.comma)))){if($.match.call(void 0,D.TokenType.star)){$.next.call(void 0),ee.expectContextual.call(void 0,ke.ContextualKeyword._as),uh();return}for(ee.expect.call(void 0,D.TokenType.braceL);!$.eat.call(void 0,D.TokenType.braceR)&&!P.state.error;){if(e)e=!1;else if($.eat.call(void 0,D.TokenType.colon)&&ee.unexpected.call(void 0,\\"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\\"),ee.expect.call(void 0,D.TokenType.comma),$.eat.call(void 0,D.TokenType.braceR))break;Sv()}}}function Sv(){if(P.isTypeScriptEnabled){dt.tsParseImportSpecifier.call(void 0);return}if(P.isFlowEnabled){Ft.flowParseImportSpecifier.call(void 0);return}ks.parseImportedIdentifier.call(void 0),ee.isContextual.call(void 0,ke.ContextualKeyword._as)&&(P.state.tokens[P.state.tokens.length-1].identifierRole=$.IdentifierRole.ImportAccess,$.next.call(void 0),ks.parseImportedIdentifier.call(void 0))}function gh(){ee.isContextual.call(void 0,ke.ContextualKeyword._assert)&&!ee.hasPrecedingLineBreak.call(void 0)&&($.next.call(void 0),De.parseObj.call(void 0,!1,!1))}});var Ch=Z(Wl=>{\\"use strict\\";Object.defineProperty(Wl,\\"__esModule\\",{value:!0});var _h=xt(),bh=Qt(),Hl=Zt(),Iv=nr();function Ev(){return Hl.state.pos===0&&Hl.input.charCodeAt(0)===bh.charCodes.numberSign&&Hl.input.charCodeAt(1)===bh.charCodes.exclamationMark&&_h.skipLineComment.call(void 0,2),_h.nextToken.call(void 0),Iv.parseTopLevel.call(void 0)}Wl.parseFile=Ev});var Ul=Z(Ao=>{\\"use strict\\";Object.defineProperty(Ao,\\"__esModule\\",{value:!0});var Eo=Zt(),Av=Ch(),Gl=class{constructor(t,s){this.tokens=t,this.scopes=s}};Ao.File=Gl;function Pv(e,t,s,i){if(i&&s)throw new Error(\\"Cannot combine flow and typescript plugins.\\");Eo.initParser.call(void 0,e,t,s,i);let r=Av.parseFile.call(void 0);if(Eo.state.error)throw Eo.augmentError.call(void 0,Eo.state.error);return r}Ao.parse=Pv});var wh=Z(zl=>{\\"use strict\\";Object.defineProperty(zl,\\"__esModule\\",{value:!0});var Nv=It();function Rv(e){let t=e.currentIndex(),s=0,i=e.currentToken();do{let r=e.tokens[t];if(r.isOptionalChainStart&&s++,r.isOptionalChainEnd&&s--,s+=r.numNullishCoalesceStarts,s-=r.numNullishCoalesceEnds,r.contextualKeyword===Nv.ContextualKeyword._await&&r.identifierRole==null&&r.scopeDepth===i.scopeDepth)return!0;t+=1}while(s>0&&t{\\"use strict\\";Object.defineProperty(Yl,\\"__esModule\\",{value:!0});function Lv(e){return e&&e.__esModule?e:{default:e}}var Po=be(),Ov=wh(),Dv=Lv(Ov),Xl=class e{__init(){this.resultCode=\\"\\"}__init2(){this.resultMappings=new Array(this.tokens.length)}__init3(){this.tokenIndex=0}constructor(t,s,i,r,a){this.code=t,this.tokens=s,this.isFlowEnabled=i,this.disableESTransforms=r,this.helperManager=a,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this)}snapshot(){return{resultCode:this.resultCode,tokenIndex:this.tokenIndex}}restoreToSnapshot(t){this.resultCode=t.resultCode,this.tokenIndex=t.tokenIndex}dangerouslyGetAndRemoveCodeSinceSnapshot(t){let s=this.resultCode.slice(t.resultCode.length);return this.resultCode=t.resultCode,s}reset(){this.resultCode=\\"\\",this.resultMappings=new Array(this.tokens.length),this.tokenIndex=0}matchesContextualAtIndex(t,s){return this.matches1AtIndex(t,Po.TokenType.name)&&this.tokens[t].contextualKeyword===s}identifierNameAtIndex(t){return this.identifierNameForToken(this.tokens[t])}identifierNameAtRelativeIndex(t){return this.identifierNameForToken(this.tokenAtRelativeIndex(t))}identifierName(){return this.identifierNameForToken(this.currentToken())}identifierNameForToken(t){return this.code.slice(t.start,t.end)}rawCodeForToken(t){return this.code.slice(t.start,t.end)}stringValueAtIndex(t){return this.stringValueForToken(this.tokens[t])}stringValue(){return this.stringValueForToken(this.currentToken())}stringValueForToken(t){return this.code.slice(t.start+1,t.end-1)}matches1AtIndex(t,s){return this.tokens[t].type===s}matches2AtIndex(t,s,i){return this.tokens[t].type===s&&this.tokens[t+1].type===i}matches3AtIndex(t,s,i,r){return this.tokens[t].type===s&&this.tokens[t+1].type===i&&this.tokens[t+2].type===r}matches1(t){return this.tokens[this.tokenIndex].type===t}matches2(t,s){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===s}matches3(t,s,i){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===i}matches4(t,s,i,r){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===i&&this.tokens[this.tokenIndex+3].type===r}matches5(t,s,i,r,a){return this.tokens[this.tokenIndex].type===t&&this.tokens[this.tokenIndex+1].type===s&&this.tokens[this.tokenIndex+2].type===i&&this.tokens[this.tokenIndex+3].type===r&&this.tokens[this.tokenIndex+4].type===a}matchesContextual(t){return this.matchesContextualAtIndex(this.tokenIndex,t)}matchesContextIdAndLabel(t,s){return this.matches1(t)&&this.currentToken().contextId===s}previousWhitespaceAndComments(){let t=this.code.slice(this.tokenIndex>0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex0&&this.tokenAtRelativeIndex(-1).type===Po.TokenType._delete?t.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(\\"asyncOptionalChainDelete\\"):this.resultCode+=this.helperManager.getHelperName(\\"optionalChainDelete\\"):t.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(\\"asyncOptionalChain\\"):this.resultCode+=this.helperManager.getHelperName(\\"optionalChain\\"),this.resultCode+=\\"([\\")}}appendTokenSuffix(){let t=this.currentToken();if(t.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+=\\"])\\"),t.numNullishCoalesceEnds&&!this.disableESTransforms)for(let s=0;s{\\"use strict\\";Object.defineProperty(Ql,\\"__esModule\\",{value:!0});var Ih=It(),Ne=be();function Mv(e,t,s,i){let r=t.snapshot(),a=Fv(t),u=[],d=[],y=[],g=null,L=[],p=[],h=t.currentToken().contextId;if(h==null)throw new Error(\\"Expected non-null class context ID on class open-brace.\\");for(t.nextToken();!t.matchesContextIdAndLabel(Ne.TokenType.braceR,h);)if(t.matchesContextual(Ih.ContextualKeyword._constructor)&&!t.currentToken().isType)({constructorInitializerStatements:u,constructorInsertPos:g}=Eh(t));else if(t.matches1(Ne.TokenType.semi))i||p.push({start:t.currentIndex(),end:t.currentIndex()+1}),t.nextToken();else if(t.currentToken().isType)t.nextToken();else{let T=t.currentIndex(),x=!1,w=!1,S=!1;for(;No(t.currentToken());)t.matches1(Ne.TokenType._static)&&(x=!0),t.matches1(Ne.TokenType.hash)&&(w=!0),(t.matches1(Ne.TokenType._declare)||t.matches1(Ne.TokenType._abstract))&&(S=!0),t.nextToken();if(x&&t.matches1(Ne.TokenType.braceL)){Jl(t,h);continue}if(w){Jl(t,h);continue}if(t.matchesContextual(Ih.ContextualKeyword._constructor)&&!t.currentToken().isType){({constructorInitializerStatements:u,constructorInsertPos:g}=Eh(t));continue}let A=t.currentIndex();if(Bv(t),t.matches1(Ne.TokenType.lessThan)||t.matches1(Ne.TokenType.parenL)){Jl(t,h);continue}for(;t.currentToken().isType;)t.nextToken();if(t.matches1(Ne.TokenType.eq)){let U=t.currentIndex(),M=t.currentToken().rhsEndIndex;if(M==null)throw new Error(\\"Expected rhsEndIndex on class field assignment.\\");for(t.nextToken();t.currentIndex(){\\"use strict\\";Object.defineProperty(Zl,\\"__esModule\\",{value:!0});var Ph=be();function Vv(e){if(e.removeInitialToken(),e.removeToken(),e.removeToken(),e.removeToken(),e.matches1(Ph.TokenType.parenL))e.removeToken(),e.removeToken(),e.removeToken();else for(;e.matches1(Ph.TokenType.dot);)e.removeToken(),e.removeToken()}Zl.default=Vv});var tc=Z(Ro=>{\\"use strict\\";Object.defineProperty(Ro,\\"__esModule\\",{value:!0});var jv=xt(),$v=be(),qv={typeDeclarations:new Set,valueDeclarations:new Set};Ro.EMPTY_DECLARATION_INFO=qv;function Kv(e){let t=new Set,s=new Set;for(let i=0;i{\\"use strict\\";Object.defineProperty(nc,\\"__esModule\\",{value:!0});var Uv=It(),Nh=be();function Hv(e){e.matches2(Nh.TokenType.name,Nh.TokenType.braceL)&&e.matchesContextual(Uv.ContextualKeyword._assert)&&(e.removeToken(),e.removeToken(),e.removeBalancedCode(),e.removeToken())}nc.removeMaybeImportAssertion=Hv});var rc=Z(ic=>{\\"use strict\\";Object.defineProperty(ic,\\"__esModule\\",{value:!0});var Rh=be();function Wv(e,t,s){if(!e)return!1;let i=t.currentToken();if(i.rhsEndIndex==null)throw new Error(\\"Expected non-null rhsEndIndex on export token.\\");let r=i.rhsEndIndex-t.currentIndex();if(r!==3&&!(r===4&&t.matches1AtIndex(i.rhsEndIndex-1,Rh.TokenType.semi)))return!1;let a=t.tokenAtRelativeIndex(2);if(a.type!==Rh.TokenType.name)return!1;let u=t.identifierNameForToken(a);return s.typeDeclarations.has(u)&&!s.valueDeclarations.has(u)}ic.default=Wv});var Oh=Z(ac=>{\\"use strict\\";Object.defineProperty(ac,\\"__esModule\\",{value:!0});function ur(e){return e&&e.__esModule?e:{default:e}}var Lo=xt(),Ls=It(),N=be(),Gv=ec(),zv=ur(Gv),Lh=tc(),Xv=ur(Lh),Yv=Wi(),Jv=ur(Yv),Oo=sc(),Qv=rc(),Zv=ur(Qv),ex=hn(),tx=ur(ex),oc=class e extends tx.default{__init(){this.hadExport=!1}__init2(){this.hadNamedExport=!1}__init3(){this.hadDefaultExport=!1}constructor(t,s,i,r,a,u,d,y,g,L){super(),this.rootTransformer=t,this.tokens=s,this.importProcessor=i,this.nameManager=r,this.helperManager=a,this.reactHotLoaderTransformer=u,this.enableLegacyBabel5ModuleInterop=d,this.enableLegacyTypeScriptModuleInterop=y,this.isTypeScriptTransformEnabled=g,this.preserveDynamicImport=L,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),this.declarationInfo=g?Xv.default.call(void 0,s):Lh.EMPTY_DECLARATION_INFO}getPrefixCode(){let t=\\"\\";return this.hadExport&&(t+=\'Object.defineProperty(exports, \\"__esModule\\", {value: true});\'),t}getSuffixCode(){return this.enableLegacyBabel5ModuleInterop&&this.hadDefaultExport&&!this.hadNamedExport?`\\nmodule.exports = exports.default;\\n`:\\"\\"}process(){return this.tokens.matches3(N.TokenType._import,N.TokenType.name,N.TokenType.eq)?this.processImportEquals():this.tokens.matches1(N.TokenType._import)?(this.processImport(),!0):this.tokens.matches2(N.TokenType._export,N.TokenType.eq)?(this.tokens.replaceToken(\\"module.exports\\"),!0):this.tokens.matches1(N.TokenType._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(N.TokenType.name,N.TokenType.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(N.TokenType.name)||this.tokens.matches1(N.TokenType.jsxName)?this.processIdentifier():this.tokens.matches1(N.TokenType.eq)?this.processAssignment():this.tokens.matches1(N.TokenType.assign)?this.processComplexAssignment():this.tokens.matches1(N.TokenType.preIncDec)?this.processPreIncDec():!1}processImportEquals(){let t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.isTypeName(t)?zv.default.call(void 0,this.tokens):this.tokens.replaceToken(\\"const\\"),!0}processImport(){if(this.tokens.matches2(N.TokenType._import,N.TokenType.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}let s=this.enableLegacyTypeScriptModuleInterop?\\"\\":`${this.helperManager.getHelperName(\\"interopRequireWildcard\\")}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${s}require`);let i=this.tokens.currentToken().contextId;if(i==null)throw new Error(\\"Expected context ID on dynamic import invocation.\\");for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(N.TokenType.parenR,i);)this.rootTransformer.processToken();this.tokens.replaceToken(s?\\")))\\":\\"))\\");return}if(this.removeImportAndDetectIfType())this.tokens.removeToken();else{let s=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(s)),this.tokens.appendCode(this.importProcessor.claimImportCode(s))}Oo.removeMaybeImportAssertion.call(void 0,this.tokens),this.tokens.matches1(N.TokenType.semi)&&this.tokens.removeToken()}removeImportAndDetectIfType(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(Ls.ContextualKeyword._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,N.TokenType.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,Ls.ContextualKeyword._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(N.TokenType.name)||this.tokens.matches1(N.TokenType.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(N.TokenType.string))return!1;let t=!1;for(;!this.tokens.matches1(N.TokenType.string);)(!t&&this.tokens.matches1(N.TokenType.braceL)||this.tokens.matches1(N.TokenType.comma))&&(this.tokens.removeToken(),(this.tokens.matches2(N.TokenType.name,N.TokenType.comma)||this.tokens.matches2(N.TokenType.name,N.TokenType.braceR)||this.tokens.matches4(N.TokenType.name,N.TokenType.name,N.TokenType.name,N.TokenType.comma)||this.tokens.matches4(N.TokenType.name,N.TokenType.name,N.TokenType.name,N.TokenType.braceR))&&(t=!0)),this.tokens.removeToken();return!t}removeRemainingImport(){for(;!this.tokens.matches1(N.TokenType.string);)this.tokens.removeToken()}processIdentifier(){let t=this.tokens.currentToken();if(t.shadowsGlobal)return!1;if(t.identifierRole===Lo.IdentifierRole.ObjectShorthand)return this.processObjectShorthand();if(t.identifierRole!==Lo.IdentifierRole.Access)return!1;let s=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(t));if(!s)return!1;let i=this.tokens.currentIndex()+1;for(;i=2&&this.tokens.matches1AtIndex(t-2,N.TokenType.dot)||t>=2&&[N.TokenType._var,N.TokenType._let,N.TokenType._const].includes(this.tokens.tokens[t-2].type))return!1;let i=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return i?(this.tokens.copyToken(),this.tokens.appendCode(` ${i} =`),!0):!1}processComplexAssignment(){let t=this.tokens.currentIndex(),s=this.tokens.tokens[t-1];if(s.type!==N.TokenType.name||s.shadowsGlobal||t>=2&&this.tokens.matches1AtIndex(t-2,N.TokenType.dot))return!1;let i=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(s));return i?(this.tokens.appendCode(` = ${i}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){let t=this.tokens.currentIndex(),s=this.tokens.tokens[t+1];if(s.type!==N.TokenType.name||s.shadowsGlobal||t+2=1&&this.tokens.matches1AtIndex(t-1,N.TokenType.dot))return!1;let r=this.tokens.identifierNameForToken(s),a=this.importProcessor.resolveExportBinding(r);if(!a)return!1;let u=this.tokens.rawCodeForToken(i),d=this.importProcessor.getIdentifierReplacement(r)||r;if(u===\\"++\\")this.tokens.replaceToken(`(${d} = ${a} = ${d} + 1, ${d} - 1)`);else if(u===\\"--\\")this.tokens.replaceToken(`(${d} = ${a} = ${d} - 1, ${d} + 1)`);else throw new Error(`Unexpected operator: ${u}`);return this.tokens.removeToken(),!0}processExportDefault(){if(this.tokens.matches4(N.TokenType._export,N.TokenType._default,N.TokenType._function,N.TokenType.name)||this.tokens.matches5(N.TokenType._export,N.TokenType._default,N.TokenType.name,N.TokenType._function,N.TokenType.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,Ls.ContextualKeyword._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();let t=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${t};`)}else if(this.tokens.matches4(N.TokenType._export,N.TokenType._default,N.TokenType._class,N.TokenType.name)||this.tokens.matches5(N.TokenType._export,N.TokenType._default,N.TokenType._abstract,N.TokenType._class,N.TokenType.name)||this.tokens.matches3(N.TokenType._export,N.TokenType._default,N.TokenType.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(N.TokenType._abstract)&&this.tokens.removeToken();let t=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${t};`)}else if(Zv.default.call(void 0,this.isTypeScriptTransformEnabled,this.tokens,this.declarationInfo))this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){let t=this.nameManager.claimFreeName(\\"_default\\");this.tokens.replaceToken(`let ${t}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${t} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(t)}else this.tokens.replaceToken(\\"exports.\\"),this.tokens.copyToken(),this.tokens.appendCode(\\" =\\")}copyDecorators(){for(;this.tokens.matches1(N.TokenType.at);)if(this.tokens.copyToken(),this.tokens.matches1(N.TokenType.parenL))this.tokens.copyExpectedToken(N.TokenType.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(N.TokenType.parenR);else{for(this.tokens.copyExpectedToken(N.TokenType.name);this.tokens.matches1(N.TokenType.dot);)this.tokens.copyExpectedToken(N.TokenType.dot),this.tokens.copyExpectedToken(N.TokenType.name);this.tokens.matches1(N.TokenType.parenL)&&(this.tokens.copyExpectedToken(N.TokenType.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(N.TokenType.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let t=this.tokens.currentIndex();if(t++,t++,!this.tokens.matches1AtIndex(t,N.TokenType.name))return!1;for(t++;t{\\"use strict\\";Object.defineProperty(cc,\\"__esModule\\",{value:!0});function pr(e){return e&&e.__esModule?e:{default:e}}var Jn=It(),se=be(),nx=ec(),sx=pr(nx),Fh=tc(),ix=pr(Fh),rx=Wi(),Dh=pr(rx),ox=Fa(),Mh=sc(),ax=rc(),lx=pr(ax),cx=hn(),ux=pr(cx),lc=class extends ux.default{constructor(t,s,i,r,a,u){super(),this.tokens=t,this.nameManager=s,this.helperManager=i,this.reactHotLoaderTransformer=r,this.isTypeScriptTransformEnabled=a,this.nonTypeIdentifiers=a?ox.getNonTypeIdentifiers.call(void 0,t,u):new Set,this.declarationInfo=a?ix.default.call(void 0,t):Fh.EMPTY_DECLARATION_INFO,this.injectCreateRequireForImportRequire=!!u.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(se.TokenType._import,se.TokenType.name,se.TokenType.eq))return this.processImportEquals();if(this.tokens.matches4(se.TokenType._import,se.TokenType.name,se.TokenType.name,se.TokenType.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,Jn.ContextualKeyword._type)){this.tokens.removeInitialToken();for(let t=0;t<7;t++)this.tokens.removeToken();return!0}if(this.tokens.matches2(se.TokenType._export,se.TokenType.eq))return this.tokens.replaceToken(\\"module.exports\\"),!0;if(this.tokens.matches5(se.TokenType._export,se.TokenType._import,se.TokenType.name,se.TokenType.name,se.TokenType.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,Jn.ContextualKeyword._type)){this.tokens.removeInitialToken();for(let t=0;t<8;t++)this.tokens.removeToken();return!0}if(this.tokens.matches1(se.TokenType._import))return this.processImport();if(this.tokens.matches2(se.TokenType._export,se.TokenType._default))return this.processExportDefault();if(this.tokens.matches2(se.TokenType._export,se.TokenType.braceL))return this.processNamedExports();if(this.tokens.matches2(se.TokenType._export,se.TokenType.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,Jn.ContextualKeyword._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(se.TokenType.braceL)){for(;!this.tokens.matches1(se.TokenType.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(se.TokenType._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(Jn.ContextualKeyword._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,se.TokenType.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),Mh.removeMaybeImportAssertion.call(void 0,this.tokens)),!0}return!1}processImportEquals(){let t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.isTypeName(t)?sx.default.call(void 0,this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken(\\"const\\"),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName(\\"require\\"))):this.tokens.replaceToken(\\"const\\"),!0}processImport(){if(this.tokens.matches2(se.TokenType._import,se.TokenType.parenL))return!1;let t=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(t);!this.tokens.matches1(se.TokenType.string);)this.tokens.removeToken();this.tokens.removeToken(),Mh.removeMaybeImportAssertion.call(void 0,this.tokens),this.tokens.matches1(se.TokenType.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(se.TokenType._import),this.tokens.matchesContextual(Jn.ContextualKeyword._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,se.TokenType.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,Jn.ContextualKeyword._from))return!0;if(this.tokens.matches1(se.TokenType.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(Jn.ContextualKeyword._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,Jn.ContextualKeyword._from)&&this.tokens.copyToken();let t=!1,s=!1;if(this.tokens.matches1(se.TokenType.name)&&(this.isTypeName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(se.TokenType.comma)&&this.tokens.removeToken()):(t=!0,this.tokens.copyToken(),this.tokens.matches1(se.TokenType.comma)&&(s=!0,this.tokens.removeToken()))),this.tokens.matches1(se.TokenType.star))this.isTypeName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(s&&this.tokens.appendCode(\\",\\"),t=!0,this.tokens.copyExpectedToken(se.TokenType.star),this.tokens.copyExpectedToken(se.TokenType.name),this.tokens.copyExpectedToken(se.TokenType.name));else if(this.tokens.matches1(se.TokenType.braceL)){for(s&&this.tokens.appendCode(\\",\\"),this.tokens.copyToken();!this.tokens.matches1(se.TokenType.braceR);){let i=Dh.default.call(void 0,this.tokens);if(i.isType||this.isTypeName(i.rightName)){for(;this.tokens.currentIndex(){\\"use strict\\";Object.defineProperty(pc,\\"__esModule\\",{value:!0});function px(e){return e&&e.__esModule?e:{default:e}}var Vh=It(),sn=be(),hx=hn(),fx=px(hx),uc=class extends fx.default{constructor(t,s,i){super(),this.rootTransformer=t,this.tokens=s,this.isImportsTransformEnabled=i}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(sn.TokenType._enum)?(this.processEnum(),!0):this.tokens.matches2(sn.TokenType._export,sn.TokenType._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(sn.TokenType._export,sn.TokenType._default,sn.TokenType._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();let t=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${t} = ${t};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();let t=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${t};`):this.tokens.appendCode(` export default ${t};`)}processEnum(){this.tokens.replaceToken(\\"const\\"),this.tokens.copyExpectedToken(sn.TokenType.name);let t=!1;this.tokens.matchesContextual(Vh.ContextualKeyword._of)&&(this.tokens.removeToken(),t=this.tokens.matchesContextual(Vh.ContextualKeyword._symbol),this.tokens.removeToken());let s=this.tokens.matches3(sn.TokenType.braceL,sn.TokenType.name,sn.TokenType.eq);this.tokens.appendCode(\' = require(\\"flow-enums-runtime\\")\');let i=!t&&!s;for(this.tokens.replaceTokenTrimmingLeftWhitespace(i?\\".Mirrored([\\":\\"({\\");!this.tokens.matches1(sn.TokenType.braceR);){if(this.tokens.matches1(sn.TokenType.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(t,s),this.tokens.matches1(sn.TokenType.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(i?\\"]);\\":\\"});\\")}processEnumElement(t,s){if(t){let i=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol(\\"${i}\\")`)}else s?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(\\":\\"),this.tokens.copyToken()):this.tokens.replaceToken(`\\"${this.tokens.identifierName()}\\"`)}};pc.default=uc});var $h=Z(fc=>{\\"use strict\\";Object.defineProperty(fc,\\"__esModule\\",{value:!0});function dx(e){return e&&e.__esModule?e:{default:e}}function mx(e){let t,s=e[0],i=1;for(;is.call(t,...u)),t=void 0)}return s}var Qn=be(),yx=hn(),Tx=dx(yx),Do=\\"jest\\",kx=[\\"mock\\",\\"unmock\\",\\"enableAutomock\\",\\"disableAutomock\\"],hc=class e extends Tx.default{__init(){this.hoistedFunctionNames=[]}constructor(t,s,i,r){super(),this.rootTransformer=t,this.tokens=s,this.nameManager=i,this.importProcessor=r,e.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(Qn.TokenType.name,Qn.TokenType.dot,Qn.TokenType.name,Qn.TokenType.parenL)&&this.tokens.identifierName()===Do?mx([this,\\"access\\",t=>t.importProcessor,\\"optionalAccess\\",t=>t.getGlobalNames,\\"call\\",t=>t(),\\"optionalAccess\\",t=>t.has,\\"call\\",t=>t(Do)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(t=>`${t}();`).join(\\"\\"):\\"\\"}extractHoistedCalls(){this.tokens.removeToken();let t=!1;for(;this.tokens.matches3(Qn.TokenType.dot,Qn.TokenType.name,Qn.TokenType.parenL);){let s=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(kx.includes(s)){let r=this.nameManager.claimFreeName(\\"__jestHoist\\");this.hoistedFunctionNames.push(r),this.tokens.replaceToken(`function ${r}(){${Do}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(Qn.TokenType.parenR),this.tokens.appendCode(\\";}\\"),t=!1}else t?this.tokens.copyToken():this.tokens.replaceToken(`${Do}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(Qn.TokenType.parenR),t=!0}return!0}};fc.default=hc});var qh=Z(mc=>{\\"use strict\\";Object.defineProperty(mc,\\"__esModule\\",{value:!0});function vx(e){return e&&e.__esModule?e:{default:e}}var xx=be(),gx=hn(),_x=vx(gx),dc=class extends _x.default{constructor(t){super(),this.tokens=t}process(){if(this.tokens.matches1(xx.TokenType.num)){let t=this.tokens.currentTokenCode();if(t.includes(\\"_\\"))return this.tokens.replaceToken(t.replace(/_/g,\\"\\")),!0}return!1}};mc.default=dc});var Uh=Z(Tc=>{\\"use strict\\";Object.defineProperty(Tc,\\"__esModule\\",{value:!0});function bx(e){return e&&e.__esModule?e:{default:e}}var Kh=be(),Cx=hn(),wx=bx(Cx),yc=class extends wx.default{constructor(t,s){super(),this.tokens=t,this.nameManager=s}process(){return this.tokens.matches2(Kh.TokenType._catch,Kh.TokenType.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName(\\"e\\")})`),!0):!1}};Tc.default=yc});var Hh=Z(vc=>{\\"use strict\\";Object.defineProperty(vc,\\"__esModule\\",{value:!0});function Sx(e){return e&&e.__esModule?e:{default:e}}var jt=be(),Ix=hn(),Ex=Sx(Ix),kc=class extends Ex.default{constructor(t,s){super(),this.tokens=t,this.nameManager=s}process(){if(this.tokens.matches1(jt.TokenType.nullishCoalescing)){let i=this.tokens.currentToken();return this.tokens.tokens[i.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(\\", async () => (\\"):this.tokens.replaceTokenTrimmingLeftWhitespace(\\", () => (\\"),!0}if(this.tokens.matches1(jt.TokenType._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;let s=this.tokens.currentToken().subscriptStartIndex;if(s!=null&&this.tokens.tokens[s].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==jt.TokenType._super){let i=this.nameManager.claimFreeName(\\"_\\"),r;if(s>0&&this.tokens.matches1AtIndex(s-1,jt.TokenType._delete)&&this.isLastSubscriptInChain()?r=`${i} => delete ${i}`:r=`${i} => ${i}`,this.tokens.tokens[s].isAsyncOperation&&(r=`async ${r}`),this.tokens.matches2(jt.TokenType.questionDot,jt.TokenType.parenL)||this.tokens.matches2(jt.TokenType.questionDot,jt.TokenType.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(\\".bind(this)\\"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'optionalCall\', ${r}`);else if(this.tokens.matches2(jt.TokenType.questionDot,jt.TokenType.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'optionalAccess\', ${r}`);else if(this.tokens.matches1(jt.TokenType.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'optionalAccess\', ${r}.`);else if(this.tokens.matches1(jt.TokenType.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'access\', ${r}.`);else if(this.tokens.matches1(jt.TokenType.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'access\', ${r}[`);else if(this.tokens.matches1(jt.TokenType.parenL))this.justSkippedSuper()&&this.tokens.appendCode(\\".bind(this)\\"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, \'call\', ${r}(`);else throw new Error(\\"Unexpected subscript operator in optional chain.\\");return!0}return!1}isLastSubscriptInChain(){let t=0;for(let s=this.tokens.currentIndex()+1;;s++){if(s>=this.tokens.tokens.length)throw new Error(\\"Reached the end of the code while finding the end of the access chain.\\");if(this.tokens.tokens[s].isOptionalChainStart?t++:this.tokens.tokens[s].isOptionalChainEnd&&t--,t<0)return!0;if(t===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let t=0,s=this.tokens.currentIndex()-1;for(;;){if(s<0)throw new Error(\\"Reached the start of the code while finding the start of the access chain.\\");if(this.tokens.tokens[s].isOptionalChainStart?t--:this.tokens.tokens[s].isOptionalChainEnd&&t++,t<0)return!1;if(t===0&&this.tokens.tokens[s].subscriptStartIndex!=null)return this.tokens.tokens[s-1].type===jt.TokenType._super;s--}}};vc.default=kc});var Gh=Z(gc=>{\\"use strict\\";Object.defineProperty(gc,\\"__esModule\\",{value:!0});function Ax(e){return e&&e.__esModule?e:{default:e}}var Wh=xt(),Et=be(),Px=hn(),Nx=Ax(Px),xc=class extends Nx.default{constructor(t,s,i,r){super(),this.rootTransformer=t,this.tokens=s,this.importProcessor=i,this.options=r}process(){let t=this.tokens.currentIndex();if(this.tokens.identifierName()===\\"createReactClass\\"){let s=this.importProcessor&&this.importProcessor.getIdentifierReplacement(\\"createReactClass\\");return s?this.tokens.replaceToken(`(0, ${s})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(t),!0}if(this.tokens.matches3(Et.TokenType.name,Et.TokenType.dot,Et.TokenType.name)&&this.tokens.identifierName()===\\"React\\"&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)===\\"createClass\\"){let s=this.importProcessor&&this.importProcessor.getIdentifierReplacement(\\"React\\")||\\"React\\";return s?(this.tokens.replaceToken(s),this.tokens.copyToken(),this.tokens.copyToken()):(this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.copyToken()),this.tryProcessCreateClassCall(t),!0}return!1}tryProcessCreateClassCall(t){let s=this.findDisplayName(t);s&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(Et.TokenType.parenL),this.tokens.copyExpectedToken(Et.TokenType.braceL),this.tokens.appendCode(`displayName: \'${s}\',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(Et.TokenType.braceR),this.tokens.copyExpectedToken(Et.TokenType.parenR))}findDisplayName(t){return t<2?null:this.tokens.matches2AtIndex(t-2,Et.TokenType.name,Et.TokenType.eq)?this.tokens.identifierNameAtIndex(t-2):t>=2&&this.tokens.tokens[t-2].identifierRole===Wh.IdentifierRole.ObjectKey?this.tokens.identifierNameAtIndex(t-2):this.tokens.matches2AtIndex(t-2,Et.TokenType._export,Et.TokenType._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){let s=(this.options.filePath||\\"unknown\\").split(\\"/\\"),i=s[s.length-1],r=i.lastIndexOf(\\".\\"),a=r===-1?i:i.slice(0,r);return a===\\"index\\"&&s[s.length-2]?s[s.length-2]:a}classNeedsDisplayName(){let t=this.tokens.currentIndex();if(!this.tokens.matches2(Et.TokenType.parenL,Et.TokenType.braceL))return!1;let s=t+1,i=this.tokens.tokens[s].contextId;if(i==null)throw new Error(\\"Expected non-null context ID on object open-brace.\\");for(;t{\\"use strict\\";Object.defineProperty(bc,\\"__esModule\\",{value:!0});function Rx(e){return e&&e.__esModule?e:{default:e}}var zh=xt(),Lx=hn(),Ox=Rx(Lx),_c=class e extends Ox.default{__init(){this.extractedDefaultExportName=null}constructor(t,s){super(),this.tokens=t,this.filePath=s,e.prototype.__init.call(this)}setExtractedDefaultExportName(t){this.extractedDefaultExportName=t}getPrefixCode(){return`\\n (function () {\\n var enterModule = require(\'react-hot-loader\').enterModule;\\n enterModule && enterModule(module);\\n })();`.replace(/\\\\s+/g,\\" \\").trim()}getSuffixCode(){let t=new Set;for(let i of this.tokens.tokens)!i.isType&&zh.isTopLevelDeclaration.call(void 0,i)&&i.identifierRole!==zh.IdentifierRole.ImportDeclaration&&t.add(this.tokens.identifierNameForToken(i));let s=Array.from(t).map(i=>({variableName:i,uniqueLocalName:i}));return this.extractedDefaultExportName&&s.push({variableName:this.extractedDefaultExportName,uniqueLocalName:\\"default\\"}),`\\n;(function () {\\n var reactHotLoader = require(\'react-hot-loader\').default;\\n var leaveModule = require(\'react-hot-loader\').leaveModule;\\n if (!reactHotLoader) {\\n return;\\n }\\n${s.map(({variableName:i,uniqueLocalName:r})=>` reactHotLoader.register(${i}, \\"${r}\\", ${JSON.stringify(this.filePath||\\"\\")});`).join(`\\n`)}\\n leaveModule(module);\\n})();`}process(){return!1}};bc.default=_c});var Jh=Z(Cc=>{\\"use strict\\";Object.defineProperty(Cc,\\"__esModule\\",{value:!0});var Yh=li(),Dx=new Set([\\"break\\",\\"case\\",\\"catch\\",\\"class\\",\\"const\\",\\"continue\\",\\"debugger\\",\\"default\\",\\"delete\\",\\"do\\",\\"else\\",\\"export\\",\\"extends\\",\\"finally\\",\\"for\\",\\"function\\",\\"if\\",\\"import\\",\\"in\\",\\"instanceof\\",\\"new\\",\\"return\\",\\"super\\",\\"switch\\",\\"this\\",\\"throw\\",\\"try\\",\\"typeof\\",\\"var\\",\\"void\\",\\"while\\",\\"with\\",\\"yield\\",\\"enum\\",\\"implements\\",\\"interface\\",\\"let\\",\\"package\\",\\"private\\",\\"protected\\",\\"public\\",\\"static\\",\\"await\\",\\"false\\",\\"null\\",\\"true\\"]);function Mx(e){if(e.length===0||!Yh.IS_IDENTIFIER_START[e.charCodeAt(0)])return!1;for(let t=1;t{\\"use strict\\";Object.defineProperty(Sc,\\"__esModule\\",{value:!0});function Zh(e){return e&&e.__esModule?e:{default:e}}var $e=be(),Fx=Jh(),Qh=Zh(Fx),Bx=hn(),Vx=Zh(Bx),wc=class extends Vx.default{constructor(t,s,i){super(),this.rootTransformer=t,this.tokens=s,this.isImportsTransformEnabled=i}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1($e.TokenType._public)||this.tokens.matches1($e.TokenType._protected)||this.tokens.matches1($e.TokenType._private)||this.tokens.matches1($e.TokenType._abstract)||this.tokens.matches1($e.TokenType._readonly)||this.tokens.matches1($e.TokenType._override)||this.tokens.matches1($e.TokenType.nonNullAssertion)?(this.tokens.removeInitialToken(),!0):this.tokens.matches1($e.TokenType._enum)||this.tokens.matches2($e.TokenType._const,$e.TokenType._enum)?(this.processEnum(),!0):this.tokens.matches2($e.TokenType._export,$e.TokenType._enum)||this.tokens.matches3($e.TokenType._export,$e.TokenType._const,$e.TokenType._enum)?(this.processEnum(!0),!0):!1}processEnum(t=!1){for(this.tokens.removeInitialToken();this.tokens.matches1($e.TokenType._const)||this.tokens.matches1($e.TokenType._enum);)this.tokens.removeToken();let s=this.tokens.identifierName();this.tokens.removeToken(),t&&!this.isImportsTransformEnabled&&this.tokens.appendCode(\\"export \\"),this.tokens.appendCode(`var ${s}; (function (${s})`),this.tokens.copyExpectedToken($e.TokenType.braceL),this.processEnumBody(s),this.tokens.copyExpectedToken($e.TokenType.braceR),t&&this.isImportsTransformEnabled?this.tokens.appendCode(`)(${s} || (exports.${s} = ${s} = {}));`):this.tokens.appendCode(`)(${s} || (${s} = {}));`)}processEnumBody(t){let s=null;for(;!this.tokens.matches1($e.TokenType.braceR);){let{nameStringCode:i,variableName:r}=this.extractEnumKeyInfo(this.tokens.currentToken());this.tokens.removeInitialToken(),this.tokens.matches3($e.TokenType.eq,$e.TokenType.string,$e.TokenType.comma)||this.tokens.matches3($e.TokenType.eq,$e.TokenType.string,$e.TokenType.braceR)?this.processStringLiteralEnumMember(t,i,r):this.tokens.matches1($e.TokenType.eq)?this.processExplicitValueEnumMember(t,i,r):this.processImplicitValueEnumMember(t,i,r,s),this.tokens.matches1($e.TokenType.comma)&&this.tokens.removeToken(),r!=null?s=r:s=`${t}[${i}]`}}extractEnumKeyInfo(t){if(t.type===$e.TokenType.name){let s=this.tokens.identifierNameForToken(t);return{nameStringCode:`\\"${s}\\"`,variableName:Qh.default.call(void 0,s)?s:null}}else if(t.type===$e.TokenType.string){let s=this.tokens.stringValueForToken(t);return{nameStringCode:this.tokens.code.slice(t.start,t.end),variableName:Qh.default.call(void 0,s)?s:null}}else throw new Error(\\"Expected name or string at beginning of enum element.\\")}processStringLiteralEnumMember(t,s,i){i!=null?(this.tokens.appendCode(`const ${i}`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(`; ${t}[${s}] = ${i};`)):(this.tokens.appendCode(`${t}[${s}]`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.appendCode(\\";\\"))}processExplicitValueEnumMember(t,s,i){let r=this.tokens.currentToken().rhsEndIndex;if(r==null)throw new Error(\\"Expected rhsEndIndex on enum assign.\\");if(i!=null){for(this.tokens.appendCode(`const ${i}`),this.tokens.copyToken();this.tokens.currentIndex(){\\"use strict\\";Object.defineProperty(Ec,\\"__esModule\\",{value:!0});function yn(e){return e&&e.__esModule?e:{default:e}}var jx=It(),lt=be(),$x=Ah(),qx=yn($x),Kx=Oh(),Ux=yn(Kx),Hx=Bh(),Wx=yn(Hx),Gx=jh(),zx=yn(Gx),Xx=$h(),Yx=yn(Xx),Jx=Da(),Qx=yn(Jx),Zx=qh(),eg=yn(Zx),tg=Uh(),ng=yn(tg),sg=Hh(),ig=yn(sg),rg=Gh(),og=yn(rg),ag=Xh(),lg=yn(ag),cg=ef(),ug=yn(cg),Ic=class e{__init(){this.transformers=[]}__init2(){this.generatedVariables=[]}constructor(t,s,i,r){e.prototype.__init.call(this),e.prototype.__init2.call(this),this.nameManager=t.nameManager,this.helperManager=t.helperManager;let{tokenProcessor:a,importProcessor:u}=t;this.tokens=a,this.isImportsTransformEnabled=s.includes(\\"imports\\"),this.isReactHotLoaderTransformEnabled=s.includes(\\"react-hot-loader\\"),this.disableESTransforms=!!r.disableESTransforms,r.disableESTransforms||(this.transformers.push(new ig.default(a,this.nameManager)),this.transformers.push(new eg.default(a)),this.transformers.push(new ng.default(a,this.nameManager))),s.includes(\\"jsx\\")&&(r.jsxRuntime!==\\"preserve\\"&&this.transformers.push(new Qx.default(this,a,u,this.nameManager,r)),this.transformers.push(new og.default(this,a,u,r)));let d=null;if(s.includes(\\"react-hot-loader\\")){if(!r.filePath)throw new Error(\\"filePath is required when using the react-hot-loader transform.\\");d=new lg.default(a,r.filePath),this.transformers.push(d)}if(s.includes(\\"imports\\")){if(u===null)throw new Error(\\"Expected non-null importProcessor with imports transform enabled.\\");this.transformers.push(new Ux.default(this,a,u,this.nameManager,this.helperManager,d,i,!!r.enableLegacyTypeScriptModuleInterop,s.includes(\\"typescript\\"),!!r.preserveDynamicImport))}else this.transformers.push(new Wx.default(a,this.nameManager,this.helperManager,d,s.includes(\\"typescript\\"),r));s.includes(\\"flow\\")&&this.transformers.push(new zx.default(this,a,s.includes(\\"imports\\"))),s.includes(\\"typescript\\")&&this.transformers.push(new ug.default(this,a,s.includes(\\"imports\\"))),s.includes(\\"jest\\")&&this.transformers.push(new Yx.default(this,a,this.nameManager,u))}transform(){this.tokens.reset(),this.processBalancedCode();let s=this.isImportsTransformEnabled?\'\\"use strict\\";\':\\"\\";for(let u of this.transformers)s+=u.getPrefixCode();s+=this.helperManager.emitHelpers(),s+=this.generatedVariables.map(u=>` var ${u};`).join(\\"\\");for(let u of this.transformers)s+=u.getHoistedCode();let i=\\"\\";for(let u of this.transformers)i+=u.getSuffixCode();let r=this.tokens.finish(),{code:a}=r;if(a.startsWith(\\"#!\\")){let u=a.indexOf(`\\n`);return u===-1&&(u=a.length,a+=`\\n`),{code:a.slice(0,u+1)+s+a.slice(u+1)+i,mappings:this.shiftMappings(r.mappings,s.length)}}else return{code:s+a+i,mappings:this.shiftMappings(r.mappings,s.length)}}processBalancedCode(){let t=0,s=0;for(;!this.tokens.isAtEnd();){if(this.tokens.matches1(lt.TokenType.braceL)||this.tokens.matches1(lt.TokenType.dollarBraceL))t++;else if(this.tokens.matches1(lt.TokenType.braceR)){if(t===0)return;t--}if(this.tokens.matches1(lt.TokenType.parenL))s++;else if(this.tokens.matches1(lt.TokenType.parenR)){if(s===0)return;s--}this.processToken()}}processToken(){if(this.tokens.matches1(lt.TokenType._class)){this.processClass();return}for(let t of this.transformers)if(t.process())return;this.tokens.copyToken()}processNamedClass(){if(!this.tokens.matches2(lt.TokenType._class,lt.TokenType.name))throw new Error(\\"Expected identifier for exported class name.\\");let t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.processClass(),t}processClass(){let t=qx.default.call(void 0,this,this.tokens,this.nameManager,this.disableESTransforms),s=(t.headerInfo.isExpression||!t.headerInfo.className)&&t.staticInitializerNames.length+t.instanceInitializerNames.length>0,i=t.headerInfo.className;s&&(i=this.nameManager.claimFreeName(\\"_class\\"),this.generatedVariables.push(i),this.tokens.appendCode(` (${i} =`));let a=this.tokens.currentToken().contextId;if(a==null)throw new Error(\\"Expected class to have a context ID.\\");for(this.tokens.copyExpectedToken(lt.TokenType._class);!this.tokens.matchesContextIdAndLabel(lt.TokenType.braceL,a);)this.processToken();this.processClassBody(t,i);let u=t.staticInitializerNames.map(d=>`${i}.${d}()`);s?this.tokens.appendCode(`, ${u.map(d=>`${d}, `).join(\\"\\")}${i})`):t.staticInitializerNames.length>0&&this.tokens.appendCode(` ${u.map(d=>`${d};`).join(\\" \\")}`)}processClassBody(t,s){let{headerInfo:i,constructorInsertPos:r,constructorInitializerStatements:a,fields:u,instanceInitializerNames:d,rangesToRemove:y}=t,g=0,L=0,p=this.tokens.currentToken().contextId;if(p==null)throw new Error(\\"Expected non-null context ID on class.\\");this.tokens.copyExpectedToken(lt.TokenType.braceL),this.isReactHotLoaderTransformEnabled&&this.tokens.appendCode(\\"__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}\\");let h=a.length+d.length>0;if(r===null&&h){let T=this.makeConstructorInitCode(a,d,s);if(i.hasSuperclass){let x=this.nameManager.claimFreeName(\\"args\\");this.tokens.appendCode(`constructor(...${x}) { super(...${x}); ${T}; }`)}else this.tokens.appendCode(`constructor() { ${T}; }`)}for(;!this.tokens.matchesContextIdAndLabel(lt.TokenType.braceR,p);)if(g=y[L].start){for(this.tokens.currentIndex()`${i}.prototype.${r}.call(this)`)].join(\\";\\")}processPossibleArrowParamEnd(){if(this.tokens.matches2(lt.TokenType.parenR,lt.TokenType.colon)&&this.tokens.tokenAtRelativeIndex(1).isType){let t=this.tokens.currentIndex()+1;for(;this.tokens.tokens[t].isType;)t++;if(this.tokens.matches1AtIndex(t,lt.TokenType.arrow)){for(this.tokens.removeInitialToken();this.tokens.currentIndex()\\"),!0}}return!1}processPossibleAsyncArrowWithTypeParams(){if(!this.tokens.matchesContextual(jx.ContextualKeyword._async)&&!this.tokens.matches1(lt.TokenType._async))return!1;let t=this.tokens.tokenAtRelativeIndex(1);if(t.type!==lt.TokenType.lessThan||!t.isType)return!1;let s=this.tokens.currentIndex()+1;for(;this.tokens.tokens[s].isType;)s++;if(this.tokens.matches1AtIndex(s,lt.TokenType.parenL)){for(this.tokens.replaceToken(\\"async (\\"),this.tokens.removeInitialToken();this.tokens.currentIndex(){\\"use strict\\";hr.__esModule=!0;hr.LinesAndColumns=void 0;var Mo=`\\n`,nf=\\"\\\\r\\",sf=function(){function e(t){this.string=t;for(var s=[0],i=0;ithis.string.length)return null;for(var s=0,i=this.offsets;i[s+1]<=t;)s++;var r=t-i[s];return{line:s,column:r}},e.prototype.indexForLocation=function(t){var s=t.line,i=t.column;return s<0||s>=this.offsets.length||i<0||i>this.lengthOfLine(s)?null:this.offsets[s]+i},e.prototype.lengthOfLine=function(t){var s=this.offsets[t],i=t===this.offsets.length-1?this.string.length:this.offsets[t+1];return i-s},e}();hr.LinesAndColumns=sf;hr.default=sf});var of=Z(Ac=>{\\"use strict\\";Object.defineProperty(Ac,\\"__esModule\\",{value:!0});function pg(e){return e&&e.__esModule?e:{default:e}}var hg=rf(),fg=pg(hg),dg=be();function mg(e,t){if(t.length===0)return\\"\\";let s=Object.keys(t[0]).filter(h=>h!==\\"type\\"&&h!==\\"value\\"&&h!==\\"start\\"&&h!==\\"end\\"&&h!==\\"loc\\"),i=Object.keys(t[0].type).filter(h=>h!==\\"label\\"&&h!==\\"keyword\\"),r=[\\"Location\\",\\"Label\\",\\"Raw\\",...s,...i],a=new fg.default(e),u=[r,...t.map(y)],d=r.map(()=>0);for(let h of u)for(let T=0;Th.map((T,x)=>T.padEnd(d[x])).join(\\" \\")).join(`\\n`);function y(h){let T=e.slice(h.start,h.end);return[L(h.start,h.end),dg.formatTokenType.call(void 0,h.type),yg(String(T),14),...s.map(x=>g(h[x],x)),...i.map(x=>g(h.type[x],x))]}function g(h,T){return h===!0?T:h===!1||h===null?\\"\\":String(h)}function L(h,T){return`${p(h)}-${p(T)}`}function p(h){let T=a.locationForIndex(h);return T?`${T.line+1}:${T.column+1}`:\\"Unknown\\"}}Ac.default=mg;function yg(e,t){return e.length>t?`${e.slice(0,t-3)}...`:e}});var af=Z(Pc=>{\\"use strict\\";Object.defineProperty(Pc,\\"__esModule\\",{value:!0});function Tg(e){return e&&e.__esModule?e:{default:e}}var Gt=be(),kg=Wi(),vg=Tg(kg);function xg(e){let t=new Set;for(let s=0;s{\\"use strict\\";Object.defineProperty(fr,\\"__esModule\\",{value:!0});function vs(e){return e&&e.__esModule?e:{default:e}}var bg=N1(),Cg=vs(bg),wg=$1(),Sg=vs(wg),Ig=q1(),Eg=H1(),lf=vs(Eg),Ag=G1(),Pg=vs(Ag),Ng=pp(),Rg=Ul(),Lg=Sh(),Og=vs(Lg),Dg=tf(),Mg=vs(Dg),Fg=of(),Bg=vs(Fg),Vg=af(),jg=vs(Vg);function $g(){return\\"3.32.0\\"}fr.getVersion=$g;function qg(e,t){Ng.validateOptions.call(void 0,t);try{let s=cf(e,t),r=new Mg.default(s,t.transforms,!!t.enableLegacyBabel5ModuleInterop,t).transform(),a={code:r.code};if(t.sourceMapOptions){if(!t.filePath)throw new Error(\\"filePath must be specified when generating a source map.\\");a={...a,sourceMap:Sg.default.call(void 0,r,t.filePath,t.sourceMapOptions,e,s.tokenProcessor.tokens)}}return a}catch(s){throw t.filePath&&(s.message=`Error transforming ${t.filePath}: ${s.message}`),s}}fr.transform=qg;function Kg(e,t){let s=cf(e,t).tokenProcessor.tokens;return Bg.default.call(void 0,e,s)}fr.getFormattedTokens=Kg;function cf(e,t){let s=t.transforms.includes(\\"jsx\\"),i=t.transforms.includes(\\"typescript\\"),r=t.transforms.includes(\\"flow\\"),a=t.disableESTransforms===!0,u=Rg.parse.call(void 0,e,s,i,r),d=u.tokens,y=u.scopes,g=new Pg.default(e,d),L=new Ig.HelperManager(g),p=new Og.default(e,d,r,a,L),h=!!t.enableLegacyTypeScriptModuleInterop,T=null;return t.transforms.includes(\\"imports\\")?(T=new Cg.default(g,p,h,t,t.transforms.includes(\\"typescript\\"),L),T.preprocessTokens(),lf.default.call(void 0,p,y,T.getGlobalNames()),t.transforms.includes(\\"typescript\\")&&T.pruneTypeOnlyImports()):t.transforms.includes(\\"typescript\\")&&lf.default.call(void 0,p,y,jg.default.call(void 0,p)),{tokenProcessor:p,scopes:y,nameManager:g,importProcessor:T,helperManager:L}}});var hf=Z((Fo,pf)=>{(function(e,t){typeof Fo==\\"object\\"&&typeof pf<\\"u\\"?t(Fo):typeof define==\\"function\\"&&define.amd?define([\\"exports\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t(e.acorn={}))})(Fo,function(e){\\"use strict\\";var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],i=\\"\\\\u200C\\\\u200D\\\\xB7\\\\u0300-\\\\u036F\\\\u0387\\\\u0483-\\\\u0487\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u0610-\\\\u061A\\\\u064B-\\\\u0669\\\\u0670\\\\u06D6-\\\\u06DC\\\\u06DF-\\\\u06E4\\\\u06E7\\\\u06E8\\\\u06EA-\\\\u06ED\\\\u06F0-\\\\u06F9\\\\u0711\\\\u0730-\\\\u074A\\\\u07A6-\\\\u07B0\\\\u07C0-\\\\u07C9\\\\u07EB-\\\\u07F3\\\\u07FD\\\\u0816-\\\\u0819\\\\u081B-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082D\\\\u0859-\\\\u085B\\\\u0897-\\\\u089F\\\\u08CA-\\\\u08E1\\\\u08E3-\\\\u0903\\\\u093A-\\\\u093C\\\\u093E-\\\\u094F\\\\u0951-\\\\u0957\\\\u0962\\\\u0963\\\\u0966-\\\\u096F\\\\u0981-\\\\u0983\\\\u09BC\\\\u09BE-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CD\\\\u09D7\\\\u09E2\\\\u09E3\\\\u09E6-\\\\u09EF\\\\u09FE\\\\u0A01-\\\\u0A03\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A66-\\\\u0A71\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0ABC\\\\u0ABE-\\\\u0AC5\\\\u0AC7-\\\\u0AC9\\\\u0ACB-\\\\u0ACD\\\\u0AE2\\\\u0AE3\\\\u0AE6-\\\\u0AEF\\\\u0AFA-\\\\u0AFF\\\\u0B01-\\\\u0B03\\\\u0B3C\\\\u0B3E-\\\\u0B44\\\\u0B47\\\\u0B48\\\\u0B4B-\\\\u0B4D\\\\u0B55-\\\\u0B57\\\\u0B62\\\\u0B63\\\\u0B66-\\\\u0B6F\\\\u0B82\\\\u0BBE-\\\\u0BC2\\\\u0BC6-\\\\u0BC8\\\\u0BCA-\\\\u0BCD\\\\u0BD7\\\\u0BE6-\\\\u0BEF\\\\u0C00-\\\\u0C04\\\\u0C3C\\\\u0C3E-\\\\u0C44\\\\u0C46-\\\\u0C48\\\\u0C4A-\\\\u0C4D\\\\u0C55\\\\u0C56\\\\u0C62\\\\u0C63\\\\u0C66-\\\\u0C6F\\\\u0C81-\\\\u0C83\\\\u0CBC\\\\u0CBE-\\\\u0CC4\\\\u0CC6-\\\\u0CC8\\\\u0CCA-\\\\u0CCD\\\\u0CD5\\\\u0CD6\\\\u0CE2\\\\u0CE3\\\\u0CE6-\\\\u0CEF\\\\u0CF3\\\\u0D00-\\\\u0D03\\\\u0D3B\\\\u0D3C\\\\u0D3E-\\\\u0D44\\\\u0D46-\\\\u0D48\\\\u0D4A-\\\\u0D4D\\\\u0D57\\\\u0D62\\\\u0D63\\\\u0D66-\\\\u0D6F\\\\u0D81-\\\\u0D83\\\\u0DCA\\\\u0DCF-\\\\u0DD4\\\\u0DD6\\\\u0DD8-\\\\u0DDF\\\\u0DE6-\\\\u0DEF\\\\u0DF2\\\\u0DF3\\\\u0E31\\\\u0E34-\\\\u0E3A\\\\u0E47-\\\\u0E4E\\\\u0E50-\\\\u0E59\\\\u0EB1\\\\u0EB4-\\\\u0EBC\\\\u0EC8-\\\\u0ECE\\\\u0ED0-\\\\u0ED9\\\\u0F18\\\\u0F19\\\\u0F20-\\\\u0F29\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E\\\\u0F3F\\\\u0F71-\\\\u0F84\\\\u0F86\\\\u0F87\\\\u0F8D-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u102B-\\\\u103E\\\\u1040-\\\\u1049\\\\u1056-\\\\u1059\\\\u105E-\\\\u1060\\\\u1062-\\\\u1064\\\\u1067-\\\\u106D\\\\u1071-\\\\u1074\\\\u1082-\\\\u108D\\\\u108F-\\\\u109D\\\\u135D-\\\\u135F\\\\u1369-\\\\u1371\\\\u1712-\\\\u1715\\\\u1732-\\\\u1734\\\\u1752\\\\u1753\\\\u1772\\\\u1773\\\\u17B4-\\\\u17D3\\\\u17DD\\\\u17E0-\\\\u17E9\\\\u180B-\\\\u180D\\\\u180F-\\\\u1819\\\\u18A9\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u1946-\\\\u194F\\\\u19D0-\\\\u19DA\\\\u1A17-\\\\u1A1B\\\\u1A55-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1AB0-\\\\u1ABD\\\\u1ABF-\\\\u1ACE\\\\u1B00-\\\\u1B04\\\\u1B34-\\\\u1B44\\\\u1B50-\\\\u1B59\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1B82\\\\u1BA1-\\\\u1BAD\\\\u1BB0-\\\\u1BB9\\\\u1BE6-\\\\u1BF3\\\\u1C24-\\\\u1C37\\\\u1C40-\\\\u1C49\\\\u1C50-\\\\u1C59\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CE8\\\\u1CED\\\\u1CF4\\\\u1CF7-\\\\u1CF9\\\\u1DC0-\\\\u1DFF\\\\u200C\\\\u200D\\\\u203F\\\\u2040\\\\u2054\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2CEF-\\\\u2CF1\\\\u2D7F\\\\u2DE0-\\\\u2DFF\\\\u302A-\\\\u302F\\\\u3099\\\\u309A\\\\u30FB\\\\uA620-\\\\uA629\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA69E\\\\uA69F\\\\uA6F0\\\\uA6F1\\\\uA802\\\\uA806\\\\uA80B\\\\uA823-\\\\uA827\\\\uA82C\\\\uA880\\\\uA881\\\\uA8B4-\\\\uA8C5\\\\uA8D0-\\\\uA8D9\\\\uA8E0-\\\\uA8F1\\\\uA8FF-\\\\uA909\\\\uA926-\\\\uA92D\\\\uA947-\\\\uA953\\\\uA980-\\\\uA983\\\\uA9B3-\\\\uA9C0\\\\uA9D0-\\\\uA9D9\\\\uA9E5\\\\uA9F0-\\\\uA9F9\\\\uAA29-\\\\uAA36\\\\uAA43\\\\uAA4C\\\\uAA4D\\\\uAA50-\\\\uAA59\\\\uAA7B-\\\\uAA7D\\\\uAAB0\\\\uAAB2-\\\\uAAB4\\\\uAAB7\\\\uAAB8\\\\uAABE\\\\uAABF\\\\uAAC1\\\\uAAEB-\\\\uAAEF\\\\uAAF5\\\\uAAF6\\\\uABE3-\\\\uABEA\\\\uABEC\\\\uABED\\\\uABF0-\\\\uABF9\\\\uFB1E\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE2F\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF10-\\\\uFF19\\\\uFF3F\\\\uFF65\\",r=\\"\\\\xAA\\\\xB5\\\\xBA\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u037F\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u052F\\\\u0531-\\\\u0556\\\\u0559\\\\u0560-\\\\u0588\\\\u05D0-\\\\u05EA\\\\u05EF-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u0860-\\\\u086A\\\\u0870-\\\\u0887\\\\u0889-\\\\u088E\\\\u08A0-\\\\u08C9\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0980\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u09FC\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0AF9\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\\\u0C10\\\\u0C12-\\\\u0C28\\\\u0C2A-\\\\u0C39\\\\u0C3D\\\\u0C58-\\\\u0C5A\\\\u0C5D\\\\u0C60\\\\u0C61\\\\u0C80\\\\u0C85-\\\\u0C8C\\\\u0C8E-\\\\u0C90\\\\u0C92-\\\\u0CA8\\\\u0CAA-\\\\u0CB3\\\\u0CB5-\\\\u0CB9\\\\u0CBD\\\\u0CDD\\\\u0CDE\\\\u0CE0\\\\u0CE1\\\\u0CF1\\\\u0CF2\\\\u0D04-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D54-\\\\u0D56\\\\u0D5F-\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E86-\\\\u0E8A\\\\u0E8C-\\\\u0EA3\\\\u0EA5\\\\u0EA7-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F5\\\\u13F8-\\\\u13FD\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F8\\\\u1700-\\\\u1711\\\\u171F-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1878\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191E\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19B0-\\\\u19C9\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4C\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1C80-\\\\u1C8A\\\\u1C90-\\\\u1CBA\\\\u1CBD-\\\\u1CBF\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF3\\\\u1CF5\\\\u1CF6\\\\u1CFA\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2118-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309B-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312F\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BF\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DBF\\\\u4E00-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA69D\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA7CD\\\\uA7D0\\\\uA7D1\\\\uA7D3\\\\uA7D5-\\\\uA7DC\\\\uA7F2-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA8FD\\\\uA8FE\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uA9E0-\\\\uA9E4\\\\uA9E6-\\\\uA9EF\\\\uA9FA-\\\\uA9FE\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA7E-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uAB30-\\\\uAB5A\\\\uAB5C-\\\\uAB69\\\\uAB70-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC\\",a={3:\\"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\\",5:\\"class enum extends super const export import\\",6:\\"enum\\",strict:\\"implements interface let package private protected public static yield\\",strictBind:\\"eval arguments\\"},u=\\"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\\",d={5:u,\\"5module\\":u+\\" export import\\",6:u+\\" const class extends export import super\\"},y=/^in(stanceof)?$/,g=new RegExp(\\"[\\"+r+\\"]\\"),L=new RegExp(\\"[\\"+r+i+\\"]\\");function p(n,o){for(var l=65536,f=0;fn)return!1;if(l+=o[f+1],l>=n)return!0}return!1}function h(n,o){return n<65?n===36:n<91?!0:n<97?n===95:n<123?!0:n<=65535?n>=170&&g.test(String.fromCharCode(n)):o===!1?!1:p(n,s)}function T(n,o){return n<48?n===36:n<58?!0:n<65?!1:n<91?!0:n<97?n===95:n<123?!0:n<=65535?n>=170&&L.test(String.fromCharCode(n)):o===!1?!1:p(n,s)||p(n,t)}var x=function(o,l){l===void 0&&(l={}),this.label=o,this.keyword=l.keyword,this.beforeExpr=!!l.beforeExpr,this.startsExpr=!!l.startsExpr,this.isLoop=!!l.isLoop,this.isAssign=!!l.isAssign,this.prefix=!!l.prefix,this.postfix=!!l.postfix,this.binop=l.binop||null,this.updateContext=null};function w(n,o){return new x(n,{beforeExpr:!0,binop:o})}var S={beforeExpr:!0},A={startsExpr:!0},U={};function M(n,o){return o===void 0&&(o={}),o.keyword=n,U[n]=new x(n,o)}var c={num:new x(\\"num\\",A),regexp:new x(\\"regexp\\",A),string:new x(\\"string\\",A),name:new x(\\"name\\",A),privateId:new x(\\"privateId\\",A),eof:new x(\\"eof\\"),bracketL:new x(\\"[\\",{beforeExpr:!0,startsExpr:!0}),bracketR:new x(\\"]\\"),braceL:new x(\\"{\\",{beforeExpr:!0,startsExpr:!0}),braceR:new x(\\"}\\"),parenL:new x(\\"(\\",{beforeExpr:!0,startsExpr:!0}),parenR:new x(\\")\\"),comma:new x(\\",\\",S),semi:new x(\\";\\",S),colon:new x(\\":\\",S),dot:new x(\\".\\"),question:new x(\\"?\\",S),questionDot:new x(\\"?.\\"),arrow:new x(\\"=>\\",S),template:new x(\\"template\\"),invalidTemplate:new x(\\"invalidTemplate\\"),ellipsis:new x(\\"...\\",S),backQuote:new x(\\"`\\",A),dollarBraceL:new x(\\"${\\",{beforeExpr:!0,startsExpr:!0}),eq:new x(\\"=\\",{beforeExpr:!0,isAssign:!0}),assign:new x(\\"_=\\",{beforeExpr:!0,isAssign:!0}),incDec:new x(\\"++/--\\",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new x(\\"!/~\\",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:w(\\"||\\",1),logicalAND:w(\\"&&\\",2),bitwiseOR:w(\\"|\\",3),bitwiseXOR:w(\\"^\\",4),bitwiseAND:w(\\"&\\",5),equality:w(\\"==/!=/===/!==\\",6),relational:w(\\">/<=/>=\\",7),bitShift:w(\\"<>>/>>>\\",8),plusMin:new x(\\"+/-\\",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:w(\\"%\\",10),star:w(\\"*\\",10),slash:w(\\"/\\",10),starstar:new x(\\"**\\",{beforeExpr:!0}),coalesce:w(\\"??\\",1),_break:M(\\"break\\"),_case:M(\\"case\\",S),_catch:M(\\"catch\\"),_continue:M(\\"continue\\"),_debugger:M(\\"debugger\\"),_default:M(\\"default\\",S),_do:M(\\"do\\",{isLoop:!0,beforeExpr:!0}),_else:M(\\"else\\",S),_finally:M(\\"finally\\"),_for:M(\\"for\\",{isLoop:!0}),_function:M(\\"function\\",A),_if:M(\\"if\\"),_return:M(\\"return\\",S),_switch:M(\\"switch\\"),_throw:M(\\"throw\\",S),_try:M(\\"try\\"),_var:M(\\"var\\"),_const:M(\\"const\\"),_while:M(\\"while\\",{isLoop:!0}),_with:M(\\"with\\"),_new:M(\\"new\\",{beforeExpr:!0,startsExpr:!0}),_this:M(\\"this\\",A),_super:M(\\"super\\",A),_class:M(\\"class\\",A),_extends:M(\\"extends\\",S),_export:M(\\"export\\"),_import:M(\\"import\\",A),_null:M(\\"null\\",A),_true:M(\\"true\\",A),_false:M(\\"false\\",A),_in:M(\\"in\\",{beforeExpr:!0,binop:7}),_instanceof:M(\\"instanceof\\",{beforeExpr:!0,binop:7}),_typeof:M(\\"typeof\\",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M(\\"void\\",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M(\\"delete\\",{beforeExpr:!0,prefix:!0,startsExpr:!0})},R=/\\\\r\\\\n?|\\\\n|\\\\u2028|\\\\u2029/,W=new RegExp(R.source,\\"g\\");function X(n){return n===10||n===13||n===8232||n===8233}function ie(n,o,l){l===void 0&&(l=n.length);for(var f=o;f>10)+55296,(n&1023)+56320))}var _t=/(?:[\\\\uD800-\\\\uDBFF](?![\\\\uDC00-\\\\uDFFF])|(?:[^\\\\uD800-\\\\uDBFF]|^)[\\\\uDC00-\\\\uDFFF])/,ct=function(o,l){this.line=o,this.column=l};ct.prototype.offset=function(o){return new ct(this.line,this.column+o)};var wt=function(o,l,f){this.start=l,this.end=f,o.sourceFile!==null&&(this.source=o.sourceFile)};function $t(n,o){for(var l=1,f=0;;){var m=ie(n,f,o);if(m<0)return new ct(l,o-f);++l,f=m}}var Pt={ecmaVersion:null,sourceType:\\"script\\",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qt=!1;function Tn(n){var o={};for(var l in Pt)o[l]=n&&mt(n,l)?n[l]:Pt[l];if(o.ecmaVersion===\\"latest\\"?o.ecmaVersion=1e8:o.ecmaVersion==null?(!qt&&typeof console==\\"object\\"&&console.warn&&(qt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.`)),o.ecmaVersion=11):o.ecmaVersion>=2015&&(o.ecmaVersion-=2009),o.allowReserved==null&&(o.allowReserved=o.ecmaVersion<5),(!n||n.allowHashBang==null)&&(o.allowHashBang=o.ecmaVersion>=14),kt(o.onToken)){var f=o.onToken;o.onToken=function(m){return f.push(m)}}return kt(o.onComment)&&(o.onComment=V(o,o.onComment)),o}function V(n,o){return function(l,f,m,E,O,Y){var Q={type:l?\\"Block\\":\\"Line\\",value:f,start:m,end:E};n.locations&&(Q.loc=new wt(this,O,Y)),n.ranges&&(Q.range=[m,E]),o.push(Q)}}var G=1,J=2,re=4,ve=8,he=16,Ie=32,Ee=64,Le=128,Xe=256,We=512,Ke=G|J|Xe;function ut(n,o){return J|(n?re:0)|(o?ve:0)}var pt=0,bt=1,yt=2,vt=3,bn=4,Dn=5,Ge=function(o,l,f){this.options=o=Tn(o),this.sourceFile=o.sourceFile,this.keywords=tt(d[o.ecmaVersion>=6?6:o.sourceType===\\"module\\"?\\"5module\\":5]);var m=\\"\\";o.allowReserved!==!0&&(m=a[o.ecmaVersion>=6?6:o.ecmaVersion===5?5:3],o.sourceType===\\"module\\"&&(m+=\\" await\\")),this.reservedWords=tt(m);var E=(m?m+\\" \\":\\"\\")+a.strict;this.reservedWordsStrict=tt(E),this.reservedWordsStrictBind=tt(E+\\" \\"+a.strictBind),this.input=String(l),this.containsEsc=!1,f?(this.pos=f,this.lineStart=this.input.lastIndexOf(`\\n`,f-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(R).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=c.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=o.sourceType===\\"module\\",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&o.allowHashBang&&this.input.slice(0,2)===\\"#!\\"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(G),this.regexpState=null,this.privateNameStack=[]},St={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Ge.prototype.parse=function(){var o=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(o)},St.inFunction.get=function(){return(this.currentVarScope().flags&J)>0},St.inGenerator.get=function(){return(this.currentVarScope().flags&ve)>0},St.inAsync.get=function(){return(this.currentVarScope().flags&re)>0},St.canAwait.get=function(){for(var n=this.scopeStack.length-1;n>=0;n--){var o=this.scopeStack[n],l=o.flags;if(l&(Xe|We))return!1;if(l&J)return(l&re)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},St.allowSuper.get=function(){var n=this.currentThisScope(),o=n.flags;return(o&Ee)>0||this.options.allowSuperOutsideMethod},St.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Le)>0},St.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},St.allowNewDotTarget.get=function(){for(var n=this.scopeStack.length-1;n>=0;n--){var o=this.scopeStack[n],l=o.flags;if(l&(Xe|We)||l&J&&!(l&he))return!0}return!1},St.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Xe)>0},Ge.extend=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];for(var f=this,m=0;m=,?^&]/.test(m)||m===\\"!\\"&&this.input.charAt(f+1)===\\"=\\")}n+=o[0].length,ae.lastIndex=n,n+=ae.exec(this.input)[0].length,this.input[n]===\\";\\"&&n++}},ot.eat=function(n){return this.type===n?(this.next(),!0):!1},ot.isContextual=function(n){return this.type===c.name&&this.value===n&&!this.containsEsc},ot.eatContextual=function(n){return this.isContextual(n)?(this.next(),!0):!1},ot.expectContextual=function(n){this.eatContextual(n)||this.unexpected()},ot.canInsertSemicolon=function(){return this.type===c.eof||this.type===c.braceR||R.test(this.input.slice(this.lastTokEnd,this.start))},ot.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ot.semicolon=function(){!this.eat(c.semi)&&!this.insertSemicolon()&&this.unexpected()},ot.afterTrailingComma=function(n,o){if(this.type===n)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),o||this.next(),!0},ot.expect=function(n){this.eat(n)||this.unexpected()},ot.unexpected=function(n){this.raise(n??this.start,\\"Unexpected token\\")};var Xt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ot.checkPatternErrors=function(n,o){if(n){n.trailingComma>-1&&this.raiseRecoverable(n.trailingComma,\\"Comma is not permitted after the rest element\\");var l=o?n.parenthesizedAssign:n.parenthesizedBind;l>-1&&this.raiseRecoverable(l,o?\\"Assigning to rvalue\\":\\"Parenthesized pattern\\")}},ot.checkExpressionErrors=function(n,o){if(!n)return!1;var l=n.shorthandAssign,f=n.doubleProto;if(!o)return l>=0||f>=0;l>=0&&this.raise(l,\\"Shorthand property assignments are valid only in destructuring patterns\\"),f>=0&&this.raiseRecoverable(f,\\"Redefinition of __proto__ property\\")},ot.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&f<56320)return!0;if(h(f,!0)){for(var m=l+1;T(f=this.input.charCodeAt(m),!0);)++m;if(f===92||f>55295&&f<56320)return!0;var E=this.input.slice(l,m);if(!y.test(E))return!0}return!1},te.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(\\"async\\"))return!1;ae.lastIndex=this.pos;var n=ae.exec(this.input),o=this.pos+n[0].length,l;return!R.test(this.input.slice(this.pos,o))&&this.input.slice(o,o+8)===\\"function\\"&&(o+8===this.input.length||!(T(l=this.input.charCodeAt(o+8))||l>55295&&l<56320))},te.isUsingKeyword=function(n,o){if(this.options.ecmaVersion<17||!this.isContextual(n?\\"await\\":\\"using\\"))return!1;ae.lastIndex=this.pos;var l=ae.exec(this.input),f=this.pos+l[0].length;if(R.test(this.input.slice(this.pos,f)))return!1;if(n){var m=f+5,E;if(this.input.slice(f,m)!==\\"using\\"||m===this.input.length||T(E=this.input.charCodeAt(m))||E>55295&&E<56320)return!1;ae.lastIndex=m;var O=ae.exec(this.input);if(O&&R.test(this.input.slice(m,m+O[0].length)))return!1}if(o){var Y=f+2,Q;if(this.input.slice(f,Y)===\\"of\\"&&(Y===this.input.length||!T(Q=this.input.charCodeAt(Y))&&!(Q>55295&&Q<56320)))return!1}var Te=this.input.charCodeAt(f);return h(Te,!0)||Te===92},te.isAwaitUsing=function(n){return this.isUsingKeyword(!0,n)},te.isUsing=function(n){return this.isUsingKeyword(!1,n)},te.parseStatement=function(n,o,l){var f=this.type,m=this.startNode(),E;switch(this.isLet(n)&&(f=c._var,E=\\"let\\"),f){case c._break:case c._continue:return this.parseBreakContinueStatement(m,f.keyword);case c._debugger:return this.parseDebuggerStatement(m);case c._do:return this.parseDoStatement(m);case c._for:return this.parseForStatement(m);case c._function:return n&&(this.strict||n!==\\"if\\"&&n!==\\"label\\")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(m,!1,!n);case c._class:return n&&this.unexpected(),this.parseClass(m,!0);case c._if:return this.parseIfStatement(m);case c._return:return this.parseReturnStatement(m);case c._switch:return this.parseSwitchStatement(m);case c._throw:return this.parseThrowStatement(m);case c._try:return this.parseTryStatement(m);case c._const:case c._var:return E=E||this.value,n&&E!==\\"var\\"&&this.unexpected(),this.parseVarStatement(m,E);case c._while:return this.parseWhileStatement(m);case c._with:return this.parseWithStatement(m);case c.braceL:return this.parseBlock(!0,m);case c.semi:return this.parseEmptyStatement(m);case c._export:case c._import:if(this.options.ecmaVersion>10&&f===c._import){ae.lastIndex=this.pos;var O=ae.exec(this.input),Y=this.pos+O[0].length,Q=this.input.charCodeAt(Y);if(Q===40||Q===46)return this.parseExpressionStatement(m,this.parseExpression())}return this.options.allowImportExportEverywhere||(o||this.raise(this.start,\\"\'import\' and \'export\' may only appear at the top level\\"),this.inModule||this.raise(this.start,\\"\'import\' and \'export\' may appear only with \'sourceType: module\'\\")),f===c._import?this.parseImport(m):this.parseExport(m,l);default:if(this.isAsyncFunction())return n&&this.unexpected(),this.next(),this.parseFunctionStatement(m,!0,!n);var Te=this.isAwaitUsing(!1)?\\"await using\\":this.isUsing(!1)?\\"using\\":null;if(Te)return o&&this.options.sourceType===\\"script\\"&&this.raise(this.start,\\"Using declaration cannot appear in the top level when source type is `script`\\"),Te===\\"await using\\"&&(this.canAwait||this.raise(this.start,\\"Await using cannot appear outside of async function\\"),this.next()),this.next(),this.parseVar(m,!1,Te),this.semicolon(),this.finishNode(m,\\"VariableDeclaration\\");var xe=this.value,Ze=this.parseExpression();return f===c.name&&Ze.type===\\"Identifier\\"&&this.eat(c.colon)?this.parseLabeledStatement(m,xe,Ze,n):this.parseExpressionStatement(m,Ze)}},te.parseBreakContinueStatement=function(n,o){var l=o===\\"break\\";this.next(),this.eat(c.semi)||this.insertSemicolon()?n.label=null:this.type!==c.name?this.unexpected():(n.label=this.parseIdent(),this.semicolon());for(var f=0;f=6?this.eat(c.semi):this.semicolon(),this.finishNode(n,\\"DoWhileStatement\\")},te.parseForStatement=function(n){this.next();var o=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(\\"await\\")?this.lastTokStart:-1;if(this.labels.push(Cn),this.enterScope(0),this.expect(c.parenL),this.type===c.semi)return o>-1&&this.unexpected(o),this.parseFor(n,null);var l=this.isLet();if(this.type===c._var||this.type===c._const||l){var f=this.startNode(),m=l?\\"let\\":this.value;return this.next(),this.parseVar(f,!0,m),this.finishNode(f,\\"VariableDeclaration\\"),this.parseForAfterInit(n,f,o)}var E=this.isContextual(\\"let\\"),O=!1,Y=this.isUsing(!0)?\\"using\\":this.isAwaitUsing(!0)?\\"await using\\":null;if(Y){var Q=this.startNode();return this.next(),Y===\\"await using\\"&&this.next(),this.parseVar(Q,!0,Y),this.finishNode(Q,\\"VariableDeclaration\\"),this.parseForAfterInit(n,Q,o)}var Te=this.containsEsc,xe=new Xt,Ze=this.start,Lt=o>-1?this.parseExprSubscripts(xe,\\"await\\"):this.parseExpression(!0,xe);return this.type===c._in||(O=this.options.ecmaVersion>=6&&this.isContextual(\\"of\\"))?(o>-1?(this.type===c._in&&this.unexpected(o),n.await=!0):O&&this.options.ecmaVersion>=8&&(Lt.start===Ze&&!Te&&Lt.type===\\"Identifier\\"&&Lt.name===\\"async\\"?this.unexpected():this.options.ecmaVersion>=9&&(n.await=!1)),E&&O&&this.raise(Lt.start,\\"The left-hand side of a for-of loop may not start with \'let\'.\\"),this.toAssignable(Lt,!1,xe),this.checkLValPattern(Lt),this.parseForIn(n,Lt)):(this.checkExpressionErrors(xe,!0),o>-1&&this.unexpected(o),this.parseFor(n,Lt))},te.parseForAfterInit=function(n,o,l){return(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual(\\"of\\"))&&o.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===c._in?l>-1&&this.unexpected(l):n.await=l>-1),this.parseForIn(n,o)):(l>-1&&this.unexpected(l),this.parseFor(n,o))},te.parseFunctionStatement=function(n,o,l){return this.next(),this.parseFunction(n,Mn|(l?0:xs),!1,o)},te.parseIfStatement=function(n){return this.next(),n.test=this.parseParenExpression(),n.consequent=this.parseStatement(\\"if\\"),n.alternate=this.eat(c._else)?this.parseStatement(\\"if\\"):null,this.finishNode(n,\\"IfStatement\\")},te.parseReturnStatement=function(n){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,\\"\'return\' outside of function\\"),this.next(),this.eat(c.semi)||this.insertSemicolon()?n.argument=null:(n.argument=this.parseExpression(),this.semicolon()),this.finishNode(n,\\"ReturnStatement\\")},te.parseSwitchStatement=function(n){this.next(),n.discriminant=this.parseParenExpression(),n.cases=[],this.expect(c.braceL),this.labels.push(Zn),this.enterScope(0);for(var o,l=!1;this.type!==c.braceR;)if(this.type===c._case||this.type===c._default){var f=this.type===c._case;o&&this.finishNode(o,\\"SwitchCase\\"),n.cases.push(o=this.startNode()),o.consequent=[],this.next(),f?o.test=this.parseExpression():(l&&this.raiseRecoverable(this.lastTokStart,\\"Multiple default clauses\\"),l=!0,o.test=null),this.expect(c.colon)}else o||this.unexpected(),o.consequent.push(this.parseStatement(null));return this.exitScope(),o&&this.finishNode(o,\\"SwitchCase\\"),this.next(),this.labels.pop(),this.finishNode(n,\\"SwitchStatement\\")},te.parseThrowStatement=function(n){return this.next(),R.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,\\"Illegal newline after throw\\"),n.argument=this.parseExpression(),this.semicolon(),this.finishNode(n,\\"ThrowStatement\\")};var _i=[];te.parseCatchClauseParam=function(){var n=this.parseBindingAtom(),o=n.type===\\"Identifier\\";return this.enterScope(o?Ie:0),this.checkLValPattern(n,o?bn:yt),this.expect(c.parenR),n},te.parseTryStatement=function(n){if(this.next(),n.block=this.parseBlock(),n.handler=null,this.type===c._catch){var o=this.startNode();this.next(),this.eat(c.parenL)?o.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),o.param=null,this.enterScope(0)),o.body=this.parseBlock(!1),this.exitScope(),n.handler=this.finishNode(o,\\"CatchClause\\")}return n.finalizer=this.eat(c._finally)?this.parseBlock():null,!n.handler&&!n.finalizer&&this.raise(n.start,\\"Missing catch or finally clause\\"),this.finishNode(n,\\"TryStatement\\")},te.parseVarStatement=function(n,o,l){return this.next(),this.parseVar(n,!1,o,l),this.semicolon(),this.finishNode(n,\\"VariableDeclaration\\")},te.parseWhileStatement=function(n){return this.next(),n.test=this.parseParenExpression(),this.labels.push(Cn),n.body=this.parseStatement(\\"while\\"),this.labels.pop(),this.finishNode(n,\\"WhileStatement\\")},te.parseWithStatement=function(n){return this.strict&&this.raise(this.start,\\"\'with\' in strict mode\\"),this.next(),n.object=this.parseParenExpression(),n.body=this.parseStatement(\\"with\\"),this.finishNode(n,\\"WithStatement\\")},te.parseEmptyStatement=function(n){return this.next(),this.finishNode(n,\\"EmptyStatement\\")},te.parseLabeledStatement=function(n,o,l,f){for(var m=0,E=this.labels;m=0;Q--){var Te=this.labels[Q];if(Te.statementStart===n.start)Te.statementStart=this.start,Te.kind=Y;else break}return this.labels.push({name:o,kind:Y,statementStart:this.start}),n.body=this.parseStatement(f?f.indexOf(\\"label\\")===-1?f+\\"label\\":f:\\"label\\"),this.labels.pop(),n.label=l,this.finishNode(n,\\"LabeledStatement\\")},te.parseExpressionStatement=function(n,o){return n.expression=o,this.semicolon(),this.finishNode(n,\\"ExpressionStatement\\")},te.parseBlock=function(n,o,l){for(n===void 0&&(n=!0),o===void 0&&(o=this.startNode()),o.body=[],this.expect(c.braceL),n&&this.enterScope(0);this.type!==c.braceR;){var f=this.parseStatement(null);o.body.push(f)}return l&&(this.strict=!1),this.next(),n&&this.exitScope(),this.finishNode(o,\\"BlockStatement\\")},te.parseFor=function(n,o){return n.init=o,this.expect(c.semi),n.test=this.type===c.semi?null:this.parseExpression(),this.expect(c.semi),n.update=this.type===c.parenR?null:this.parseExpression(),this.expect(c.parenR),n.body=this.parseStatement(\\"for\\"),this.exitScope(),this.labels.pop(),this.finishNode(n,\\"ForStatement\\")},te.parseForIn=function(n,o){var l=this.type===c._in;return this.next(),o.type===\\"VariableDeclaration\\"&&o.declarations[0].init!=null&&(!l||this.options.ecmaVersion<8||this.strict||o.kind!==\\"var\\"||o.declarations[0].id.type!==\\"Identifier\\")&&this.raise(o.start,(l?\\"for-in\\":\\"for-of\\")+\\" loop variable declaration may not have an initializer\\"),n.left=o,n.right=l?this.parseExpression():this.parseMaybeAssign(),this.expect(c.parenR),n.body=this.parseStatement(\\"for\\"),this.exitScope(),this.labels.pop(),this.finishNode(n,l?\\"ForInStatement\\":\\"ForOfStatement\\")},te.parseVar=function(n,o,l,f){for(n.declarations=[],n.kind=l;;){var m=this.startNode();if(this.parseVarId(m,l),this.eat(c.eq)?m.init=this.parseMaybeAssign(o):!f&&l===\\"const\\"&&!(this.type===c._in||this.options.ecmaVersion>=6&&this.isContextual(\\"of\\"))?this.unexpected():!f&&(l===\\"using\\"||l===\\"await using\\")&&this.options.ecmaVersion>=17&&this.type!==c._in&&!this.isContextual(\\"of\\")?this.raise(this.lastTokEnd,\\"Missing initializer in \\"+l+\\" declaration\\"):!f&&m.id.type!==\\"Identifier\\"&&!(o&&(this.type===c._in||this.isContextual(\\"of\\")))?this.raise(this.lastTokEnd,\\"Complex binding patterns require an initialization value\\"):m.init=null,n.declarations.push(this.finishNode(m,\\"VariableDeclarator\\")),!this.eat(c.comma))break}return n},te.parseVarId=function(n,o){n.id=o===\\"using\\"||o===\\"await using\\"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(n.id,o===\\"var\\"?bt:yt,!1)};var Mn=1,xs=2,Ds=4;te.parseFunction=function(n,o,l,f,m){this.initFunction(n),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!f)&&(this.type===c.star&&o&xs&&this.unexpected(),n.generator=this.eat(c.star)),this.options.ecmaVersion>=8&&(n.async=!!f),o&Mn&&(n.id=o&Ds&&this.type!==c.name?null:this.parseIdent(),n.id&&!(o&xs)&&this.checkLValSimple(n.id,this.strict||n.generator||n.async?this.treatFunctionsAsVar?bt:yt:vt));var E=this.yieldPos,O=this.awaitPos,Y=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ut(n.async,n.generator)),o&Mn||(n.id=this.type===c.name?this.parseIdent():null),this.parseFunctionParams(n),this.parseFunctionBody(n,l,!1,m),this.yieldPos=E,this.awaitPos=O,this.awaitIdentPos=Y,this.finishNode(n,o&Mn?\\"FunctionDeclaration\\":\\"FunctionExpression\\")},te.parseFunctionParams=function(n){this.expect(c.parenL),n.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},te.parseClass=function(n,o){this.next();var l=this.strict;this.strict=!0,this.parseClassId(n,o),this.parseClassSuper(n);var f=this.enterClassBody(),m=this.startNode(),E=!1;for(m.body=[],this.expect(c.braceL);this.type!==c.braceR;){var O=this.parseClassElement(n.superClass!==null);O&&(m.body.push(O),O.type===\\"MethodDefinition\\"&&O.kind===\\"constructor\\"?(E&&this.raiseRecoverable(O.start,\\"Duplicate constructor in the same class\\"),E=!0):O.key&&O.key.type===\\"PrivateIdentifier\\"&&bi(f,O)&&this.raiseRecoverable(O.key.start,\\"Identifier \'#\\"+O.key.name+\\"\' has already been declared\\"))}return this.strict=l,this.next(),n.body=this.finishNode(m,\\"ClassBody\\"),this.exitClassBody(),this.finishNode(n,o?\\"ClassDeclaration\\":\\"ClassExpression\\")},te.parseClassElement=function(n){if(this.eat(c.semi))return null;var o=this.options.ecmaVersion,l=this.startNode(),f=\\"\\",m=!1,E=!1,O=\\"method\\",Y=!1;if(this.eatContextual(\\"static\\")){if(o>=13&&this.eat(c.braceL))return this.parseClassStaticBlock(l),l;this.isClassElementNameStart()||this.type===c.star?Y=!0:f=\\"static\\"}if(l.static=Y,!f&&o>=8&&this.eatContextual(\\"async\\")&&((this.isClassElementNameStart()||this.type===c.star)&&!this.canInsertSemicolon()?E=!0:f=\\"async\\"),!f&&(o>=9||!E)&&this.eat(c.star)&&(m=!0),!f&&!E&&!m){var Q=this.value;(this.eatContextual(\\"get\\")||this.eatContextual(\\"set\\"))&&(this.isClassElementNameStart()?O=Q:f=Q)}if(f?(l.computed=!1,l.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),l.key.name=f,this.finishNode(l.key,\\"Identifier\\")):this.parseClassElementName(l),o<13||this.type===c.parenL||O!==\\"method\\"||m||E){var Te=!l.static&&es(l,\\"constructor\\"),xe=Te&&n;Te&&O!==\\"method\\"&&this.raise(l.key.start,\\"Constructor can\'t have get/set modifier\\"),l.kind=Te?\\"constructor\\":O,this.parseClassMethod(l,m,E,xe)}else this.parseClassField(l);return l},te.isClassElementNameStart=function(){return this.type===c.name||this.type===c.privateId||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword},te.parseClassElementName=function(n){this.type===c.privateId?(this.value===\\"constructor\\"&&this.raise(this.start,\\"Classes can\'t have an element named \'#constructor\'\\"),n.computed=!1,n.key=this.parsePrivateIdent()):this.parsePropertyName(n)},te.parseClassMethod=function(n,o,l,f){var m=n.key;n.kind===\\"constructor\\"?(o&&this.raise(m.start,\\"Constructor can\'t be a generator\\"),l&&this.raise(m.start,\\"Constructor can\'t be an async method\\")):n.static&&es(n,\\"prototype\\")&&this.raise(m.start,\\"Classes may not have a static property named prototype\\");var E=n.value=this.parseMethod(o,l,f);return n.kind===\\"get\\"&&E.params.length!==0&&this.raiseRecoverable(E.start,\\"getter should have no params\\"),n.kind===\\"set\\"&&E.params.length!==1&&this.raiseRecoverable(E.start,\\"setter should have exactly one param\\"),n.kind===\\"set\\"&&E.params[0].type===\\"RestElement\\"&&this.raiseRecoverable(E.params[0].start,\\"Setter cannot use rest params\\"),this.finishNode(n,\\"MethodDefinition\\")},te.parseClassField=function(n){return es(n,\\"constructor\\")?this.raise(n.key.start,\\"Classes can\'t have a field named \'constructor\'\\"):n.static&&es(n,\\"prototype\\")&&this.raise(n.key.start,\\"Classes can\'t have a static field named \'prototype\'\\"),this.eat(c.eq)?(this.enterScope(We|Ee),n.value=this.parseMaybeAssign(),this.exitScope()):n.value=null,this.semicolon(),this.finishNode(n,\\"PropertyDefinition\\")},te.parseClassStaticBlock=function(n){n.body=[];var o=this.labels;for(this.labels=[],this.enterScope(Xe|Ee);this.type!==c.braceR;){var l=this.parseStatement(null);n.body.push(l)}return this.next(),this.exitScope(),this.labels=o,this.finishNode(n,\\"StaticBlock\\")},te.parseClassId=function(n,o){this.type===c.name?(n.id=this.parseIdent(),o&&this.checkLValSimple(n.id,yt,!1)):(o===!0&&this.unexpected(),n.id=null)},te.parseClassSuper=function(n){n.superClass=this.eat(c._extends)?this.parseExprSubscripts(null,!1):null},te.enterClassBody=function(){var n={declared:Object.create(null),used:[]};return this.privateNameStack.push(n),n.declared},te.exitClassBody=function(){var n=this.privateNameStack.pop(),o=n.declared,l=n.used;if(this.options.checkPrivateFields)for(var f=this.privateNameStack.length,m=f===0?null:this.privateNameStack[f-1],E=0;E=11&&(this.eatContextual(\\"as\\")?(n.exported=this.parseModuleExportName(),this.checkExport(o,n.exported,this.lastTokStart)):n.exported=null),this.expectContextual(\\"from\\"),this.type!==c.string&&this.unexpected(),n.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(n.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(n,\\"ExportAllDeclaration\\")},te.parseExport=function(n,o){if(this.next(),this.eat(c.star))return this.parseExportAllDeclaration(n,o);if(this.eat(c._default))return this.checkExport(o,\\"default\\",this.lastTokStart),n.declaration=this.parseExportDefaultDeclaration(),this.finishNode(n,\\"ExportDefaultDeclaration\\");if(this.shouldParseExportStatement())n.declaration=this.parseExportDeclaration(n),n.declaration.type===\\"VariableDeclaration\\"?this.checkVariableExport(o,n.declaration.declarations):this.checkExport(o,n.declaration.id,n.declaration.id.start),n.specifiers=[],n.source=null,this.options.ecmaVersion>=16&&(n.attributes=[]);else{if(n.declaration=null,n.specifiers=this.parseExportSpecifiers(o),this.eatContextual(\\"from\\"))this.type!==c.string&&this.unexpected(),n.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(n.attributes=this.parseWithClause());else{for(var l=0,f=n.specifiers;l=16&&(n.attributes=[])}this.semicolon()}return this.finishNode(n,\\"ExportNamedDeclaration\\")},te.parseExportDeclaration=function(n){return this.parseStatement(null)},te.parseExportDefaultDeclaration=function(){var n;if(this.type===c._function||(n=this.isAsyncFunction())){var o=this.startNode();return this.next(),n&&this.next(),this.parseFunction(o,Mn|Ds,!1,n)}else if(this.type===c._class){var l=this.startNode();return this.parseClass(l,\\"nullableID\\")}else{var f=this.parseMaybeAssign();return this.semicolon(),f}},te.checkExport=function(n,o,l){n&&(typeof o!=\\"string\\"&&(o=o.type===\\"Identifier\\"?o.name:o.value),mt(n,o)&&this.raiseRecoverable(l,\\"Duplicate export \'\\"+o+\\"\'\\"),n[o]=!0)},te.checkPatternExport=function(n,o){var l=o.type;if(l===\\"Identifier\\")this.checkExport(n,o,o.start);else if(l===\\"ObjectPattern\\")for(var f=0,m=o.properties;f=16&&(n.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(n,\\"ImportDeclaration\\")},te.parseImportSpecifier=function(){var n=this.startNode();return n.imported=this.parseModuleExportName(),this.eatContextual(\\"as\\")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLValSimple(n.local,yt),this.finishNode(n,\\"ImportSpecifier\\")},te.parseImportDefaultSpecifier=function(){var n=this.startNode();return n.local=this.parseIdent(),this.checkLValSimple(n.local,yt),this.finishNode(n,\\"ImportDefaultSpecifier\\")},te.parseImportNamespaceSpecifier=function(){var n=this.startNode();return this.next(),this.expectContextual(\\"as\\"),n.local=this.parseIdent(),this.checkLValSimple(n.local,yt),this.finishNode(n,\\"ImportNamespaceSpecifier\\")},te.parseImportSpecifiers=function(){var n=[],o=!0;if(this.type===c.name&&(n.push(this.parseImportDefaultSpecifier()),!this.eat(c.comma)))return n;if(this.type===c.star)return n.push(this.parseImportNamespaceSpecifier()),n;for(this.expect(c.braceL);!this.eat(c.braceR);){if(o)o=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;n.push(this.parseImportSpecifier())}return n},te.parseWithClause=function(){var n=[];if(!this.eat(c._with))return n;this.expect(c.braceL);for(var o={},l=!0;!this.eat(c.braceR);){if(l)l=!1;else if(this.expect(c.comma),this.afterTrailingComma(c.braceR))break;var f=this.parseImportAttribute(),m=f.key.type===\\"Identifier\\"?f.key.name:f.key.value;mt(o,m)&&this.raiseRecoverable(f.key.start,\\"Duplicate attribute key \'\\"+m+\\"\'\\"),o[m]=!0,n.push(f)}return n},te.parseImportAttribute=function(){var n=this.startNode();return n.key=this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==\\"never\\"),this.expect(c.colon),this.type!==c.string&&this.unexpected(),n.value=this.parseExprAtom(),this.finishNode(n,\\"ImportAttribute\\")},te.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===c.string){var n=this.parseLiteral(this.value);return _t.test(n.value)&&this.raise(n.start,\\"An export name cannot include a lone surrogate.\\"),n}return this.parseIdent(!0)},te.adaptDirectivePrologue=function(n){for(var o=0;o=5&&n.type===\\"ExpressionStatement\\"&&n.expression.type===\\"Literal\\"&&typeof n.expression.value==\\"string\\"&&(this.input[n.start]===\'\\"\'||this.input[n.start]===\\"\'\\")};var Nt=Ge.prototype;Nt.toAssignable=function(n,o,l){if(this.options.ecmaVersion>=6&&n)switch(n.type){case\\"Identifier\\":this.inAsync&&n.name===\\"await\\"&&this.raise(n.start,\\"Cannot use \'await\' as identifier inside an async function\\");break;case\\"ObjectPattern\\":case\\"ArrayPattern\\":case\\"AssignmentPattern\\":case\\"RestElement\\":break;case\\"ObjectExpression\\":n.type=\\"ObjectPattern\\",l&&this.checkPatternErrors(l,!0);for(var f=0,m=n.properties;f=6)switch(this.type){case c.bracketL:var n=this.startNode();return this.next(),n.elements=this.parseBindingList(c.bracketR,!0,!0),this.finishNode(n,\\"ArrayPattern\\");case c.braceL:return this.parseObj(!0)}return this.parseIdent()},Nt.parseBindingList=function(n,o,l,f){for(var m=[],E=!0;!this.eat(n);)if(E?E=!1:this.expect(c.comma),o&&this.type===c.comma)m.push(null);else{if(l&&this.afterTrailingComma(n))break;if(this.type===c.ellipsis){var O=this.parseRestBinding();this.parseBindingListItem(O),m.push(O),this.type===c.comma&&this.raiseRecoverable(this.start,\\"Comma is not permitted after the rest element\\"),this.expect(n);break}else m.push(this.parseAssignableListItem(f))}return m},Nt.parseAssignableListItem=function(n){var o=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(o),o},Nt.parseBindingListItem=function(n){return n},Nt.parseMaybeDefault=function(n,o,l){if(l=l||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(c.eq))return l;var f=this.startNodeAt(n,o);return f.left=l,f.right=this.parseMaybeAssign(),this.finishNode(f,\\"AssignmentPattern\\")},Nt.checkLValSimple=function(n,o,l){o===void 0&&(o=pt);var f=o!==pt;switch(n.type){case\\"Identifier\\":this.strict&&this.reservedWordsStrictBind.test(n.name)&&this.raiseRecoverable(n.start,(f?\\"Binding \\":\\"Assigning to \\")+n.name+\\" in strict mode\\"),f&&(o===yt&&n.name===\\"let\\"&&this.raiseRecoverable(n.start,\\"let is disallowed as a lexically bound name\\"),l&&(mt(l,n.name)&&this.raiseRecoverable(n.start,\\"Argument name clash\\"),l[n.name]=!0),o!==Dn&&this.declareName(n.name,o,n.start));break;case\\"ChainExpression\\":this.raiseRecoverable(n.start,\\"Optional chaining cannot appear in left-hand side\\");break;case\\"MemberExpression\\":f&&this.raiseRecoverable(n.start,\\"Binding member expression\\");break;case\\"ParenthesizedExpression\\":return f&&this.raiseRecoverable(n.start,\\"Binding parenthesized expression\\"),this.checkLValSimple(n.expression,o,l);default:this.raise(n.start,(f?\\"Binding\\":\\"Assigning to\\")+\\" rvalue\\")}},Nt.checkLValPattern=function(n,o,l){switch(o===void 0&&(o=pt),n.type){case\\"ObjectPattern\\":for(var f=0,m=n.properties;f=1;n--){var o=this.context[n];if(o.token===\\"function\\")return o.generator}return!1},wn.updateContext=function(n){var o,l=this.type;l.keyword&&n===c.dot?this.exprAllowed=!1:(o=l.updateContext)?o.call(this,n):this.exprAllowed=l.beforeExpr},wn.overrideContext=function(n){this.curContext()!==n&&(this.context[this.context.length-1]=n)},c.parenR.updateContext=c.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var n=this.context.pop();n===Ue.b_stat&&this.curContext().token===\\"function\\"&&(n=this.context.pop()),this.exprAllowed=!n.isExpr},c.braceL.updateContext=function(n){this.context.push(this.braceIsBlock(n)?Ue.b_stat:Ue.b_expr),this.exprAllowed=!0},c.dollarBraceL.updateContext=function(){this.context.push(Ue.b_tmpl),this.exprAllowed=!0},c.parenL.updateContext=function(n){var o=n===c._if||n===c._for||n===c._with||n===c._while;this.context.push(o?Ue.p_stat:Ue.p_expr),this.exprAllowed=!0},c.incDec.updateContext=function(){},c._function.updateContext=c._class.updateContext=function(n){n.beforeExpr&&n!==c._else&&!(n===c.semi&&this.curContext()!==Ue.p_stat)&&!(n===c._return&&R.test(this.input.slice(this.lastTokEnd,this.start)))&&!((n===c.colon||n===c.braceL)&&this.curContext()===Ue.b_stat)?this.context.push(Ue.f_expr):this.context.push(Ue.f_stat),this.exprAllowed=!1},c.colon.updateContext=function(){this.curContext().token===\\"function\\"&&this.context.pop(),this.exprAllowed=!0},c.backQuote.updateContext=function(){this.curContext()===Ue.q_tmpl?this.context.pop():this.context.push(Ue.q_tmpl),this.exprAllowed=!1},c.star.updateContext=function(n){if(n===c._function){var o=this.context.length-1;this.context[o]===Ue.f_expr?this.context[o]=Ue.f_expr_gen:this.context[o]=Ue.f_gen}this.exprAllowed=!0},c.name.updateContext=function(n){var o=!1;this.options.ecmaVersion>=6&&n!==c.dot&&(this.value===\\"of\\"&&!this.exprAllowed||this.value===\\"yield\\"&&this.inGeneratorContext())&&(o=!0),this.exprAllowed=o};var de=Ge.prototype;de.checkPropClash=function(n,o,l){if(!(this.options.ecmaVersion>=9&&n.type===\\"SpreadElement\\")&&!(this.options.ecmaVersion>=6&&(n.computed||n.method||n.shorthand))){var f=n.key,m;switch(f.type){case\\"Identifier\\":m=f.name;break;case\\"Literal\\":m=String(f.value);break;default:return}var E=n.kind;if(this.options.ecmaVersion>=6){m===\\"__proto__\\"&&E===\\"init\\"&&(o.proto&&(l?l.doubleProto<0&&(l.doubleProto=f.start):this.raiseRecoverable(f.start,\\"Redefinition of __proto__ property\\")),o.proto=!0);return}m=\\"$\\"+m;var O=o[m];if(O){var Y;E===\\"init\\"?Y=this.strict&&O.init||O.get||O.set:Y=O.init||O[E],Y&&this.raiseRecoverable(f.start,\\"Redefinition of property\\")}else O=o[m]={init:!1,get:!1,set:!1};O[E]=!0}},de.parseExpression=function(n,o){var l=this.start,f=this.startLoc,m=this.parseMaybeAssign(n,o);if(this.type===c.comma){var E=this.startNodeAt(l,f);for(E.expressions=[m];this.eat(c.comma);)E.expressions.push(this.parseMaybeAssign(n,o));return this.finishNode(E,\\"SequenceExpression\\")}return m},de.parseMaybeAssign=function(n,o,l){if(this.isContextual(\\"yield\\")){if(this.inGenerator)return this.parseYield(n);this.exprAllowed=!1}var f=!1,m=-1,E=-1,O=-1;o?(m=o.parenthesizedAssign,E=o.trailingComma,O=o.doubleProto,o.parenthesizedAssign=o.trailingComma=-1):(o=new Xt,f=!0);var Y=this.start,Q=this.startLoc;(this.type===c.parenL||this.type===c.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=n===\\"await\\");var Te=this.parseMaybeConditional(n,o);if(l&&(Te=l.call(this,Te,Y,Q)),this.type.isAssign){var xe=this.startNodeAt(Y,Q);return xe.operator=this.value,this.type===c.eq&&(Te=this.toAssignable(Te,!1,o)),f||(o.parenthesizedAssign=o.trailingComma=o.doubleProto=-1),o.shorthandAssign>=Te.start&&(o.shorthandAssign=-1),this.type===c.eq?this.checkLValPattern(Te):this.checkLValSimple(Te),xe.left=Te,this.next(),xe.right=this.parseMaybeAssign(n),O>-1&&(o.doubleProto=O),this.finishNode(xe,\\"AssignmentExpression\\")}else f&&this.checkExpressionErrors(o,!0);return m>-1&&(o.parenthesizedAssign=m),E>-1&&(o.trailingComma=E),Te},de.parseMaybeConditional=function(n,o){var l=this.start,f=this.startLoc,m=this.parseExprOps(n,o);if(this.checkExpressionErrors(o))return m;if(this.eat(c.question)){var E=this.startNodeAt(l,f);return E.test=m,E.consequent=this.parseMaybeAssign(),this.expect(c.colon),E.alternate=this.parseMaybeAssign(n),this.finishNode(E,\\"ConditionalExpression\\")}return m},de.parseExprOps=function(n,o){var l=this.start,f=this.startLoc,m=this.parseMaybeUnary(o,!1,!1,n);return this.checkExpressionErrors(o)||m.start===l&&m.type===\\"ArrowFunctionExpression\\"?m:this.parseExprOp(m,l,f,-1,n)},de.parseExprOp=function(n,o,l,f,m){var E=this.type.binop;if(E!=null&&(!m||this.type!==c._in)&&E>f){var O=this.type===c.logicalOR||this.type===c.logicalAND,Y=this.type===c.coalesce;Y&&(E=c.logicalAND.binop);var Q=this.value;this.next();var Te=this.start,xe=this.startLoc,Ze=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,m),Te,xe,E,m),Lt=this.buildBinary(o,l,n,Ze,Q,O||Y);return(O&&this.type===c.coalesce||Y&&(this.type===c.logicalOR||this.type===c.logicalAND))&&this.raiseRecoverable(this.start,\\"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\\"),this.parseExprOp(Lt,o,l,f,m)}return n},de.buildBinary=function(n,o,l,f,m,E){f.type===\\"PrivateIdentifier\\"&&this.raise(f.start,\\"Private identifier can only be left side of binary expression\\");var O=this.startNodeAt(n,o);return O.left=l,O.operator=m,O.right=f,this.finishNode(O,E?\\"LogicalExpression\\":\\"BinaryExpression\\")},de.parseMaybeUnary=function(n,o,l,f){var m=this.start,E=this.startLoc,O;if(this.isContextual(\\"await\\")&&this.canAwait)O=this.parseAwait(f),o=!0;else if(this.type.prefix){var Y=this.startNode(),Q=this.type===c.incDec;Y.operator=this.value,Y.prefix=!0,this.next(),Y.argument=this.parseMaybeUnary(null,!0,Q,f),this.checkExpressionErrors(n,!0),Q?this.checkLValSimple(Y.argument):this.strict&&Y.operator===\\"delete\\"&&Ms(Y.argument)?this.raiseRecoverable(Y.start,\\"Deleting local variable in strict mode\\"):Y.operator===\\"delete\\"&&gs(Y.argument)?this.raiseRecoverable(Y.start,\\"Private fields can not be deleted\\"):o=!0,O=this.finishNode(Y,Q?\\"UpdateExpression\\":\\"UnaryExpression\\")}else if(!o&&this.type===c.privateId)(f||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),O=this.parsePrivateIdent(),this.type!==c._in&&this.unexpected();else{if(O=this.parseExprSubscripts(n,f),this.checkExpressionErrors(n))return O;for(;this.type.postfix&&!this.canInsertSemicolon();){var Te=this.startNodeAt(m,E);Te.operator=this.value,Te.prefix=!1,Te.argument=O,this.checkLValSimple(O),this.next(),O=this.finishNode(Te,\\"UpdateExpression\\")}}if(!l&&this.eat(c.starstar))if(o)this.unexpected(this.lastTokStart);else return this.buildBinary(m,E,O,this.parseMaybeUnary(null,!1,!1,f),\\"**\\",!1);else return O};function Ms(n){return n.type===\\"Identifier\\"||n.type===\\"ParenthesizedExpression\\"&&Ms(n.expression)}function gs(n){return n.type===\\"MemberExpression\\"&&n.property.type===\\"PrivateIdentifier\\"||n.type===\\"ChainExpression\\"&&gs(n.expression)||n.type===\\"ParenthesizedExpression\\"&&gs(n.expression)}de.parseExprSubscripts=function(n,o){var l=this.start,f=this.startLoc,m=this.parseExprAtom(n,o);if(m.type===\\"ArrowFunctionExpression\\"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==\\")\\")return m;var E=this.parseSubscripts(m,l,f,!1,o);return n&&E.type===\\"MemberExpression\\"&&(n.parenthesizedAssign>=E.start&&(n.parenthesizedAssign=-1),n.parenthesizedBind>=E.start&&(n.parenthesizedBind=-1),n.trailingComma>=E.start&&(n.trailingComma=-1)),E},de.parseSubscripts=function(n,o,l,f,m){for(var E=this.options.ecmaVersion>=8&&n.type===\\"Identifier\\"&&n.name===\\"async\\"&&this.lastTokEnd===n.end&&!this.canInsertSemicolon()&&n.end-n.start===5&&this.potentialArrowAt===n.start,O=!1;;){var Y=this.parseSubscript(n,o,l,f,E,O,m);if(Y.optional&&(O=!0),Y===n||Y.type===\\"ArrowFunctionExpression\\"){if(O){var Q=this.startNodeAt(o,l);Q.expression=Y,Y=this.finishNode(Q,\\"ChainExpression\\")}return Y}n=Y}},de.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(c.arrow)},de.parseSubscriptAsyncArrow=function(n,o,l,f){return this.parseArrowExpression(this.startNodeAt(n,o),l,!0,f)},de.parseSubscript=function(n,o,l,f,m,E,O){var Y=this.options.ecmaVersion>=11,Q=Y&&this.eat(c.questionDot);f&&Q&&this.raise(this.lastTokStart,\\"Optional chaining cannot appear in the callee of new expressions\\");var Te=this.eat(c.bracketL);if(Te||Q&&this.type!==c.parenL&&this.type!==c.backQuote||this.eat(c.dot)){var xe=this.startNodeAt(o,l);xe.object=n,Te?(xe.property=this.parseExpression(),this.expect(c.bracketR)):this.type===c.privateId&&n.type!==\\"Super\\"?xe.property=this.parsePrivateIdent():xe.property=this.parseIdent(this.options.allowReserved!==\\"never\\"),xe.computed=!!Te,Y&&(xe.optional=Q),n=this.finishNode(xe,\\"MemberExpression\\")}else if(!f&&this.eat(c.parenL)){var Ze=new Xt,Lt=this.yieldPos,Ri=this.awaitPos,Ys=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var gr=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1,Ze);if(m&&!Q&&this.shouldParseAsyncArrow())return this.checkPatternErrors(Ze,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,\\"Cannot use \'await\' as identifier inside an async function\\"),this.yieldPos=Lt,this.awaitPos=Ri,this.awaitIdentPos=Ys,this.parseSubscriptAsyncArrow(o,l,gr,O);this.checkExpressionErrors(Ze,!0),this.yieldPos=Lt||this.yieldPos,this.awaitPos=Ri||this.awaitPos,this.awaitIdentPos=Ys||this.awaitIdentPos;var Js=this.startNodeAt(o,l);Js.callee=n,Js.arguments=gr,Y&&(Js.optional=Q),n=this.finishNode(Js,\\"CallExpression\\")}else if(this.type===c.backQuote){(Q||E)&&this.raise(this.start,\\"Optional chaining cannot appear in the tag of tagged template expressions\\");var Qs=this.startNodeAt(o,l);Qs.tag=n,Qs.quasi=this.parseTemplate({isTagged:!0}),n=this.finishNode(Qs,\\"TaggedTemplateExpression\\")}return n},de.parseExprAtom=function(n,o,l){this.type===c.slash&&this.readRegexp();var f,m=this.potentialArrowAt===this.start;switch(this.type){case c._super:return this.allowSuper||this.raise(this.start,\\"\'super\' keyword outside a method\\"),f=this.startNode(),this.next(),this.type===c.parenL&&!this.allowDirectSuper&&this.raise(f.start,\\"super() call outside constructor of a subclass\\"),this.type!==c.dot&&this.type!==c.bracketL&&this.type!==c.parenL&&this.unexpected(),this.finishNode(f,\\"Super\\");case c._this:return f=this.startNode(),this.next(),this.finishNode(f,\\"ThisExpression\\");case c.name:var E=this.start,O=this.startLoc,Y=this.containsEsc,Q=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Y&&Q.name===\\"async\\"&&!this.canInsertSemicolon()&&this.eat(c._function))return this.overrideContext(Ue.f_expr),this.parseFunction(this.startNodeAt(E,O),0,!1,!0,o);if(m&&!this.canInsertSemicolon()){if(this.eat(c.arrow))return this.parseArrowExpression(this.startNodeAt(E,O),[Q],!1,o);if(this.options.ecmaVersion>=8&&Q.name===\\"async\\"&&this.type===c.name&&!Y&&(!this.potentialArrowInForAwait||this.value!==\\"of\\"||this.containsEsc))return Q=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(c.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(E,O),[Q],!0,o)}return Q;case c.regexp:var Te=this.value;return f=this.parseLiteral(Te.value),f.regex={pattern:Te.pattern,flags:Te.flags},f;case c.num:case c.string:return this.parseLiteral(this.value);case c._null:case c._true:case c._false:return f=this.startNode(),f.value=this.type===c._null?null:this.type===c._true,f.raw=this.type.keyword,this.next(),this.finishNode(f,\\"Literal\\");case c.parenL:var xe=this.start,Ze=this.parseParenAndDistinguishExpression(m,o);return n&&(n.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ze)&&(n.parenthesizedAssign=xe),n.parenthesizedBind<0&&(n.parenthesizedBind=xe)),Ze;case c.bracketL:return f=this.startNode(),this.next(),f.elements=this.parseExprList(c.bracketR,!0,!0,n),this.finishNode(f,\\"ArrayExpression\\");case c.braceL:return this.overrideContext(Ue.b_expr),this.parseObj(!1,n);case c._function:return f=this.startNode(),this.next(),this.parseFunction(f,0);case c._class:return this.parseClass(this.startNode(),!1);case c._new:return this.parseNew();case c.backQuote:return this.parseTemplate();case c._import:return this.options.ecmaVersion>=11?this.parseExprImport(l):this.unexpected();default:return this.parseExprAtomDefault()}},de.parseExprAtomDefault=function(){this.unexpected()},de.parseExprImport=function(n){var o=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,\\"Escape sequence in keyword import\\"),this.next(),this.type===c.parenL&&!n)return this.parseDynamicImport(o);if(this.type===c.dot){var l=this.startNodeAt(o.start,o.loc&&o.loc.start);return l.name=\\"import\\",o.meta=this.finishNode(l,\\"Identifier\\"),this.parseImportMeta(o)}else this.unexpected()},de.parseDynamicImport=function(n){if(this.next(),n.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(c.parenR)?n.options=null:(this.expect(c.comma),this.afterTrailingComma(c.parenR)?n.options=null:(n.options=this.parseMaybeAssign(),this.eat(c.parenR)||(this.expect(c.comma),this.afterTrailingComma(c.parenR)||this.unexpected())));else if(!this.eat(c.parenR)){var o=this.start;this.eat(c.comma)&&this.eat(c.parenR)?this.raiseRecoverable(o,\\"Trailing comma is not allowed in import()\\"):this.unexpected(o)}return this.finishNode(n,\\"ImportExpression\\")},de.parseImportMeta=function(n){this.next();var o=this.containsEsc;return n.property=this.parseIdent(!0),n.property.name!==\\"meta\\"&&this.raiseRecoverable(n.property.start,\\"The only valid meta property for import is \'import.meta\'\\"),o&&this.raiseRecoverable(n.start,\\"\'import.meta\' must not contain escaped characters\\"),this.options.sourceType!==\\"module\\"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(n.start,\\"Cannot use \'import.meta\' outside a module\\"),this.finishNode(n,\\"MetaProperty\\")},de.parseLiteral=function(n){var o=this.startNode();return o.value=n,o.raw=this.input.slice(this.start,this.end),o.raw.charCodeAt(o.raw.length-1)===110&&(o.bigint=o.value!=null?o.value.toString():o.raw.slice(0,-1).replace(/_/g,\\"\\")),this.next(),this.finishNode(o,\\"Literal\\")},de.parseParenExpression=function(){this.expect(c.parenL);var n=this.parseExpression();return this.expect(c.parenR),n},de.shouldParseArrow=function(n){return!this.canInsertSemicolon()},de.parseParenAndDistinguishExpression=function(n,o){var l=this.start,f=this.startLoc,m,E=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var O=this.start,Y=this.startLoc,Q=[],Te=!0,xe=!1,Ze=new Xt,Lt=this.yieldPos,Ri=this.awaitPos,Ys;for(this.yieldPos=0,this.awaitPos=0;this.type!==c.parenR;)if(Te?Te=!1:this.expect(c.comma),E&&this.afterTrailingComma(c.parenR,!0)){xe=!0;break}else if(this.type===c.ellipsis){Ys=this.start,Q.push(this.parseParenItem(this.parseRestBinding())),this.type===c.comma&&this.raiseRecoverable(this.start,\\"Comma is not permitted after the rest element\\");break}else Q.push(this.parseMaybeAssign(!1,Ze,this.parseParenItem));var gr=this.lastTokEnd,Js=this.lastTokEndLoc;if(this.expect(c.parenR),n&&this.shouldParseArrow(Q)&&this.eat(c.arrow))return this.checkPatternErrors(Ze,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Lt,this.awaitPos=Ri,this.parseParenArrowList(l,f,Q,o);(!Q.length||xe)&&this.unexpected(this.lastTokStart),Ys&&this.unexpected(Ys),this.checkExpressionErrors(Ze,!0),this.yieldPos=Lt||this.yieldPos,this.awaitPos=Ri||this.awaitPos,Q.length>1?(m=this.startNodeAt(O,Y),m.expressions=Q,this.finishNodeAt(m,\\"SequenceExpression\\",gr,Js)):m=Q[0]}else m=this.parseParenExpression();if(this.options.preserveParens){var Qs=this.startNodeAt(l,f);return Qs.expression=m,this.finishNode(Qs,\\"ParenthesizedExpression\\")}else return m},de.parseParenItem=function(n){return n},de.parseParenArrowList=function(n,o,l,f){return this.parseArrowExpression(this.startNodeAt(n,o),l,!1,f)};var Ci=[];de.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,\\"Escape sequence in keyword new\\");var n=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===c.dot){var o=this.startNodeAt(n.start,n.loc&&n.loc.start);o.name=\\"new\\",n.meta=this.finishNode(o,\\"Identifier\\"),this.next();var l=this.containsEsc;return n.property=this.parseIdent(!0),n.property.name!==\\"target\\"&&this.raiseRecoverable(n.property.start,\\"The only valid meta property for new is \'new.target\'\\"),l&&this.raiseRecoverable(n.start,\\"\'new.target\' must not contain escaped characters\\"),this.allowNewDotTarget||this.raiseRecoverable(n.start,\\"\'new.target\' can only be used in functions and class static block\\"),this.finishNode(n,\\"MetaProperty\\")}var f=this.start,m=this.startLoc;return n.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),f,m,!0,!1),this.eat(c.parenL)?n.arguments=this.parseExprList(c.parenR,this.options.ecmaVersion>=8,!1):n.arguments=Ci,this.finishNode(n,\\"NewExpression\\")},de.parseTemplateElement=function(n){var o=n.isTagged,l=this.startNode();return this.type===c.invalidTemplate?(o||this.raiseRecoverable(this.start,\\"Bad escape sequence in untagged template literal\\"),l.value={raw:this.value.replace(/\\\\r\\\\n?/g,`\\n`),cooked:null}):l.value={raw:this.input.slice(this.start,this.end).replace(/\\\\r\\\\n?/g,`\\n`),cooked:this.value},this.next(),l.tail=this.type===c.backQuote,this.finishNode(l,\\"TemplateElement\\")},de.parseTemplate=function(n){n===void 0&&(n={});var o=n.isTagged;o===void 0&&(o=!1);var l=this.startNode();this.next(),l.expressions=[];var f=this.parseTemplateElement({isTagged:o});for(l.quasis=[f];!f.tail;)this.type===c.eof&&this.raise(this.pos,\\"Unterminated template literal\\"),this.expect(c.dollarBraceL),l.expressions.push(this.parseExpression()),this.expect(c.braceR),l.quasis.push(f=this.parseTemplateElement({isTagged:o}));return this.next(),this.finishNode(l,\\"TemplateLiteral\\")},de.isAsyncProp=function(n){return!n.computed&&n.key.type===\\"Identifier\\"&&n.key.name===\\"async\\"&&(this.type===c.name||this.type===c.num||this.type===c.string||this.type===c.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===c.star)&&!R.test(this.input.slice(this.lastTokEnd,this.start))},de.parseObj=function(n,o){var l=this.startNode(),f=!0,m={};for(l.properties=[],this.next();!this.eat(c.braceR);){if(f)f=!1;else if(this.expect(c.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(c.braceR))break;var E=this.parseProperty(n,o);n||this.checkPropClash(E,m,o),l.properties.push(E)}return this.finishNode(l,n?\\"ObjectPattern\\":\\"ObjectExpression\\")},de.parseProperty=function(n,o){var l=this.startNode(),f,m,E,O;if(this.options.ecmaVersion>=9&&this.eat(c.ellipsis))return n?(l.argument=this.parseIdent(!1),this.type===c.comma&&this.raiseRecoverable(this.start,\\"Comma is not permitted after the rest element\\"),this.finishNode(l,\\"RestElement\\")):(l.argument=this.parseMaybeAssign(!1,o),this.type===c.comma&&o&&o.trailingComma<0&&(o.trailingComma=this.start),this.finishNode(l,\\"SpreadElement\\"));this.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(n||o)&&(E=this.start,O=this.startLoc),n||(f=this.eat(c.star)));var Y=this.containsEsc;return this.parsePropertyName(l),!n&&!Y&&this.options.ecmaVersion>=8&&!f&&this.isAsyncProp(l)?(m=!0,f=this.options.ecmaVersion>=9&&this.eat(c.star),this.parsePropertyName(l)):m=!1,this.parsePropertyValue(l,n,f,m,E,O,o,Y),this.finishNode(l,\\"Property\\")},de.parseGetterSetter=function(n){var o=n.key.name;this.parsePropertyName(n),n.value=this.parseMethod(!1),n.kind=o;var l=n.kind===\\"get\\"?0:1;if(n.value.params.length!==l){var f=n.value.start;n.kind===\\"get\\"?this.raiseRecoverable(f,\\"getter should have no params\\"):this.raiseRecoverable(f,\\"setter should have exactly one param\\")}else n.kind===\\"set\\"&&n.value.params[0].type===\\"RestElement\\"&&this.raiseRecoverable(n.value.params[0].start,\\"Setter cannot use rest params\\")},de.parsePropertyValue=function(n,o,l,f,m,E,O,Y){(l||f)&&this.type===c.colon&&this.unexpected(),this.eat(c.colon)?(n.value=o?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,O),n.kind=\\"init\\"):this.options.ecmaVersion>=6&&this.type===c.parenL?(o&&this.unexpected(),n.method=!0,n.value=this.parseMethod(l,f),n.kind=\\"init\\"):!o&&!Y&&this.options.ecmaVersion>=5&&!n.computed&&n.key.type===\\"Identifier\\"&&(n.key.name===\\"get\\"||n.key.name===\\"set\\")&&this.type!==c.comma&&this.type!==c.braceR&&this.type!==c.eq?((l||f)&&this.unexpected(),this.parseGetterSetter(n)):this.options.ecmaVersion>=6&&!n.computed&&n.key.type===\\"Identifier\\"?((l||f)&&this.unexpected(),this.checkUnreserved(n.key),n.key.name===\\"await\\"&&!this.awaitIdentPos&&(this.awaitIdentPos=m),o?n.value=this.parseMaybeDefault(m,E,this.copyNode(n.key)):this.type===c.eq&&O?(O.shorthandAssign<0&&(O.shorthandAssign=this.start),n.value=this.parseMaybeDefault(m,E,this.copyNode(n.key))):n.value=this.copyNode(n.key),n.kind=\\"init\\",n.shorthand=!0):this.unexpected()},de.parsePropertyName=function(n){if(this.options.ecmaVersion>=6){if(this.eat(c.bracketL))return n.computed=!0,n.key=this.parseMaybeAssign(),this.expect(c.bracketR),n.key;n.computed=!1}return n.key=this.type===c.num||this.type===c.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==\\"never\\")},de.initFunction=function(n){n.id=null,this.options.ecmaVersion>=6&&(n.generator=n.expression=!1),this.options.ecmaVersion>=8&&(n.async=!1)},de.parseMethod=function(n,o,l){var f=this.startNode(),m=this.yieldPos,E=this.awaitPos,O=this.awaitIdentPos;return this.initFunction(f),this.options.ecmaVersion>=6&&(f.generator=n),this.options.ecmaVersion>=8&&(f.async=!!o),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ut(o,f.generator)|Ee|(l?Le:0)),this.expect(c.parenL),f.params=this.parseBindingList(c.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(f,!1,!0,!1),this.yieldPos=m,this.awaitPos=E,this.awaitIdentPos=O,this.finishNode(f,\\"FunctionExpression\\")},de.parseArrowExpression=function(n,o,l,f){var m=this.yieldPos,E=this.awaitPos,O=this.awaitIdentPos;return this.enterScope(ut(l,!1)|he),this.initFunction(n),this.options.ecmaVersion>=8&&(n.async=!!l),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,n.params=this.toAssignableList(o,!0),this.parseFunctionBody(n,!0,!1,f),this.yieldPos=m,this.awaitPos=E,this.awaitIdentPos=O,this.finishNode(n,\\"ArrowFunctionExpression\\")},de.parseFunctionBody=function(n,o,l,f){var m=o&&this.type!==c.braceL,E=this.strict,O=!1;if(m)n.body=this.parseMaybeAssign(f),n.expression=!0,this.checkParams(n,!1);else{var Y=this.options.ecmaVersion>=7&&!this.isSimpleParamList(n.params);(!E||Y)&&(O=this.strictDirective(this.end),O&&Y&&this.raiseRecoverable(n.start,\\"Illegal \'use strict\' directive in function with non-simple parameter list\\"));var Q=this.labels;this.labels=[],O&&(this.strict=!0),this.checkParams(n,!E&&!O&&!o&&!l&&this.isSimpleParamList(n.params)),this.strict&&n.id&&this.checkLValSimple(n.id,Dn),n.body=this.parseBlock(!1,void 0,O&&!E),n.expression=!1,this.adaptDirectivePrologue(n.body.body),this.labels=Q}this.exitScope()},de.isSimpleParamList=function(n){for(var o=0,l=n;o-1||m.functions.indexOf(n)>-1||m.var.indexOf(n)>-1,m.lexical.push(n),this.inModule&&m.flags&G&&delete this.undefinedExports[n]}else if(o===bn){var E=this.currentScope();E.lexical.push(n)}else if(o===vt){var O=this.currentScope();this.treatFunctionsAsVar?f=O.lexical.indexOf(n)>-1:f=O.lexical.indexOf(n)>-1||O.var.indexOf(n)>-1,O.functions.push(n)}else for(var Y=this.scopeStack.length-1;Y>=0;--Y){var Q=this.scopeStack[Y];if(Q.lexical.indexOf(n)>-1&&!(Q.flags&Ie&&Q.lexical[0]===n)||!this.treatFunctionsAsVarInScope(Q)&&Q.functions.indexOf(n)>-1){f=!0;break}if(Q.var.push(n),this.inModule&&Q.flags&G&&delete this.undefinedExports[n],Q.flags&Ke)break}f&&this.raiseRecoverable(l,\\"Identifier \'\\"+n+\\"\' has already been declared\\")},rn.checkLocalExport=function(n){this.scopeStack[0].lexical.indexOf(n.name)===-1&&this.scopeStack[0].var.indexOf(n.name)===-1&&(this.undefinedExports[n.name]=n)},rn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},rn.currentVarScope=function(){for(var n=this.scopeStack.length-1;;n--){var o=this.scopeStack[n];if(o.flags&(Ke|We|Xe))return o}},rn.currentThisScope=function(){for(var n=this.scopeStack.length-1;;n--){var o=this.scopeStack[n];if(o.flags&(Ke|We|Xe)&&!(o.flags&he))return o}};var Fn=function(o,l,f){this.type=\\"\\",this.start=l,this.end=0,o.options.locations&&(this.loc=new wt(o,f)),o.options.directSourceFile&&(this.sourceFile=o.options.directSourceFile),o.options.ranges&&(this.range=[l,0])},Bn=Ge.prototype;Bn.startNode=function(){return new Fn(this,this.start,this.startLoc)},Bn.startNodeAt=function(n,o){return new Fn(this,n,o)};function Fs(n,o,l,f){return n.type=o,n.end=l,this.options.locations&&(n.loc.end=f),this.options.ranges&&(n.range[1]=l),n}Bn.finishNode=function(n,o){return Fs.call(this,n,o,this.lastTokEnd,this.lastTokEndLoc)},Bn.finishNodeAt=function(n,o,l,f){return Fs.call(this,n,o,l,f)},Bn.copyNode=function(n){var o=new Fn(this,n.start,this.startLoc);for(var l in n)o[l]=n[l];return o};var Si=\\"Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz\\",Bs=\\"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\\",Vs=Bs+\\" Extended_Pictographic\\",js=Vs,$s=js+\\" EBase EComp EMod EPres ExtPict\\",qs=$s,Ii=qs,Ei={9:Bs,10:Vs,11:js,12:$s,13:qs,14:Ii},Ai=\\"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji\\",Pi={9:\\"\\",10:\\"\\",11:\\"\\",12:\\"\\",13:\\"\\",14:Ai},Ks=\\"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\\",Us=\\"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\\",Hs=Us+\\" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\\",Ws=Hs+\\" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\\",Gs=Ws+\\" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\\",zs=Gs+\\" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\\",jo=zs+\\" \\"+Si,$o={9:Us,10:Hs,11:Ws,12:Gs,13:zs,14:jo},mr={};function qo(n){var o=mr[n]={binary:tt(Ei[n]+\\" \\"+Ks),binaryOfStrings:tt(Pi[n]),nonBinary:{General_Category:tt(Ks),Script:tt($o[n])}};o.nonBinary.Script_Extensions=o.nonBinary.Script,o.nonBinary.gc=o.nonBinary.General_Category,o.nonBinary.sc=o.nonBinary.Script,o.nonBinary.scx=o.nonBinary.Script_Extensions}for(var Ni=0,yr=[9,10,11,12,13,14];Ni=6?\\"uy\\":\\"\\")+(o.options.ecmaVersion>=9?\\"s\\":\\"\\")+(o.options.ecmaVersion>=13?\\"d\\":\\"\\")+(o.options.ecmaVersion>=15?\\"v\\":\\"\\"),this.unicodeProperties=mr[o.options.ecmaVersion>=14?14:o.options.ecmaVersion],this.source=\\"\\",this.flags=\\"\\",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=\\"\\",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};on.prototype.reset=function(o,l,f){var m=f.indexOf(\\"v\\")!==-1,E=f.indexOf(\\"u\\")!==-1;this.start=o|0,this.source=l+\\"\\",this.flags=f,m&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=E&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=E&&this.parser.options.ecmaVersion>=9)},on.prototype.raise=function(o){this.parser.raiseRecoverable(this.start,\\"Invalid regular expression: /\\"+this.source+\\"/: \\"+o)},on.prototype.at=function(o,l){l===void 0&&(l=!1);var f=this.source,m=f.length;if(o>=m)return-1;var E=f.charCodeAt(o);if(!(l||this.switchU)||E<=55295||E>=57344||o+1>=m)return E;var O=f.charCodeAt(o+1);return O>=56320&&O<=57343?(E<<10)+O-56613888:E},on.prototype.nextIndex=function(o,l){l===void 0&&(l=!1);var f=this.source,m=f.length;if(o>=m)return m;var E=f.charCodeAt(o),O;return!(l||this.switchU)||E<=55295||E>=57344||o+1>=m||(O=f.charCodeAt(o+1))<56320||O>57343?o+1:o+2},on.prototype.current=function(o){return o===void 0&&(o=!1),this.at(this.pos,o)},on.prototype.lookahead=function(o){return o===void 0&&(o=!1),this.at(this.nextIndex(this.pos,o),o)},on.prototype.advance=function(o){o===void 0&&(o=!1),this.pos=this.nextIndex(this.pos,o)},on.prototype.eat=function(o,l){return l===void 0&&(l=!1),this.current(l)===o?(this.advance(l),!0):!1},on.prototype.eatChars=function(o,l){l===void 0&&(l=!1);for(var f=this.pos,m=0,E=o;m-1&&this.raise(n.start,\\"Duplicate regular expression flag\\"),O===\\"u\\"&&(f=!0),O===\\"v\\"&&(m=!0)}this.options.ecmaVersion>=15&&f&&m&&this.raise(n.start,\\"Invalid regular expression flag\\")};function Uo(n){for(var o in n)return!0;return!1}le.validateRegExpPattern=function(n){this.regexp_pattern(n),!n.switchN&&this.options.ecmaVersion>=9&&Uo(n.groupNames)&&(n.switchN=!0,this.regexp_pattern(n))},le.regexp_pattern=function(n){n.pos=0,n.lastIntValue=0,n.lastStringValue=\\"\\",n.lastAssertionIsQuantifiable=!1,n.numCapturingParens=0,n.maxBackReference=0,n.groupNames=Object.create(null),n.backReferenceNames.length=0,n.branchID=null,this.regexp_disjunction(n),n.pos!==n.source.length&&(n.eat(41)&&n.raise(\\"Unmatched \')\'\\"),(n.eat(93)||n.eat(125))&&n.raise(\\"Lone quantifier brackets\\")),n.maxBackReference>n.numCapturingParens&&n.raise(\\"Invalid escape\\");for(var o=0,l=n.backReferenceNames;o=16;for(o&&(n.branchID=new Xs(n.branchID,null)),this.regexp_alternative(n);n.eat(124);)o&&(n.branchID=n.branchID.sibling()),this.regexp_alternative(n);o&&(n.branchID=n.branchID.parent),this.regexp_eatQuantifier(n,!0)&&n.raise(\\"Nothing to repeat\\"),n.eat(123)&&n.raise(\\"Lone quantifier brackets\\")},le.regexp_alternative=function(n){for(;n.pos=9&&(l=n.eat(60)),n.eat(61)||n.eat(33))return this.regexp_disjunction(n),n.eat(41)||n.raise(\\"Unterminated group\\"),n.lastAssertionIsQuantifiable=!l,!0}return n.pos=o,!1},le.regexp_eatQuantifier=function(n,o){return o===void 0&&(o=!1),this.regexp_eatQuantifierPrefix(n,o)?(n.eat(63),!0):!1},le.regexp_eatQuantifierPrefix=function(n,o){return n.eat(42)||n.eat(43)||n.eat(63)||this.regexp_eatBracedQuantifier(n,o)},le.regexp_eatBracedQuantifier=function(n,o){var l=n.pos;if(n.eat(123)){var f=0,m=-1;if(this.regexp_eatDecimalDigits(n)&&(f=n.lastIntValue,n.eat(44)&&this.regexp_eatDecimalDigits(n)&&(m=n.lastIntValue),n.eat(125)))return m!==-1&&m=16){var l=this.regexp_eatModifiers(n),f=n.eat(45);if(l||f){for(var m=0;m-1&&n.raise(\\"Duplicate regular expression modifiers\\")}if(f){var O=this.regexp_eatModifiers(n);!l&&!O&&n.current()===58&&n.raise(\\"Invalid regular expression modifiers\\");for(var Y=0;Y-1||l.indexOf(Q)>-1)&&n.raise(\\"Duplicate regular expression modifiers\\")}}}}if(n.eat(58)){if(this.regexp_disjunction(n),n.eat(41))return!0;n.raise(\\"Unterminated group\\")}}n.pos=o}return!1},le.regexp_eatCapturingGroup=function(n){if(n.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(n):n.current()===63&&n.raise(\\"Invalid group\\"),this.regexp_disjunction(n),n.eat(41))return n.numCapturingParens+=1,!0;n.raise(\\"Unterminated group\\")}return!1},le.regexp_eatModifiers=function(n){for(var o=\\"\\",l=0;(l=n.current())!==-1&&Ho(l);)o+=nt(l),n.advance();return o};function Ho(n){return n===105||n===109||n===115}le.regexp_eatExtendedAtom=function(n){return n.eat(46)||this.regexp_eatReverseSolidusAtomEscape(n)||this.regexp_eatCharacterClass(n)||this.regexp_eatUncapturingGroup(n)||this.regexp_eatCapturingGroup(n)||this.regexp_eatInvalidBracedQuantifier(n)||this.regexp_eatExtendedPatternCharacter(n)},le.regexp_eatInvalidBracedQuantifier=function(n){return this.regexp_eatBracedQuantifier(n,!0)&&n.raise(\\"Nothing to repeat\\"),!1},le.regexp_eatSyntaxCharacter=function(n){var o=n.current();return Tr(o)?(n.lastIntValue=o,n.advance(),!0):!1};function Tr(n){return n===36||n>=40&&n<=43||n===46||n===63||n>=91&&n<=94||n>=123&&n<=125}le.regexp_eatPatternCharacters=function(n){for(var o=n.pos,l=0;(l=n.current())!==-1&&!Tr(l);)n.advance();return n.pos!==o},le.regexp_eatExtendedPatternCharacter=function(n){var o=n.current();return o!==-1&&o!==36&&!(o>=40&&o<=43)&&o!==46&&o!==63&&o!==91&&o!==94&&o!==124?(n.advance(),!0):!1},le.regexp_groupSpecifier=function(n){if(n.eat(63)){this.regexp_eatGroupName(n)||n.raise(\\"Invalid group\\");var o=this.options.ecmaVersion>=16,l=n.groupNames[n.lastStringValue];if(l)if(o)for(var f=0,m=l;f=11,f=n.current(l);return n.advance(l),f===92&&this.regexp_eatRegExpUnicodeEscapeSequence(n,l)&&(f=n.lastIntValue),Wo(f)?(n.lastIntValue=f,!0):(n.pos=o,!1)};function Wo(n){return h(n,!0)||n===36||n===95}le.regexp_eatRegExpIdentifierPart=function(n){var o=n.pos,l=this.options.ecmaVersion>=11,f=n.current(l);return n.advance(l),f===92&&this.regexp_eatRegExpUnicodeEscapeSequence(n,l)&&(f=n.lastIntValue),Go(f)?(n.lastIntValue=f,!0):(n.pos=o,!1)};function Go(n){return T(n,!0)||n===36||n===95||n===8204||n===8205}le.regexp_eatAtomEscape=function(n){return this.regexp_eatBackReference(n)||this.regexp_eatCharacterClassEscape(n)||this.regexp_eatCharacterEscape(n)||n.switchN&&this.regexp_eatKGroupName(n)?!0:(n.switchU&&(n.current()===99&&n.raise(\\"Invalid unicode escape\\"),n.raise(\\"Invalid escape\\")),!1)},le.regexp_eatBackReference=function(n){var o=n.pos;if(this.regexp_eatDecimalEscape(n)){var l=n.lastIntValue;if(n.switchU)return l>n.maxBackReference&&(n.maxBackReference=l),!0;if(l<=n.numCapturingParens)return!0;n.pos=o}return!1},le.regexp_eatKGroupName=function(n){if(n.eat(107)){if(this.regexp_eatGroupName(n))return n.backReferenceNames.push(n.lastStringValue),!0;n.raise(\\"Invalid named reference\\")}return!1},le.regexp_eatCharacterEscape=function(n){return this.regexp_eatControlEscape(n)||this.regexp_eatCControlLetter(n)||this.regexp_eatZero(n)||this.regexp_eatHexEscapeSequence(n)||this.regexp_eatRegExpUnicodeEscapeSequence(n,!1)||!n.switchU&&this.regexp_eatLegacyOctalEscapeSequence(n)||this.regexp_eatIdentityEscape(n)},le.regexp_eatCControlLetter=function(n){var o=n.pos;if(n.eat(99)){if(this.regexp_eatControlLetter(n))return!0;n.pos=o}return!1},le.regexp_eatZero=function(n){return n.current()===48&&!vr(n.lookahead())?(n.lastIntValue=0,n.advance(),!0):!1},le.regexp_eatControlEscape=function(n){var o=n.current();return o===116?(n.lastIntValue=9,n.advance(),!0):o===110?(n.lastIntValue=10,n.advance(),!0):o===118?(n.lastIntValue=11,n.advance(),!0):o===102?(n.lastIntValue=12,n.advance(),!0):o===114?(n.lastIntValue=13,n.advance(),!0):!1},le.regexp_eatControlLetter=function(n){var o=n.current();return kr(o)?(n.lastIntValue=o%32,n.advance(),!0):!1};function kr(n){return n>=65&&n<=90||n>=97&&n<=122}le.regexp_eatRegExpUnicodeEscapeSequence=function(n,o){o===void 0&&(o=!1);var l=n.pos,f=o||n.switchU;if(n.eat(117)){if(this.regexp_eatFixedHexDigits(n,4)){var m=n.lastIntValue;if(f&&m>=55296&&m<=56319){var E=n.pos;if(n.eat(92)&&n.eat(117)&&this.regexp_eatFixedHexDigits(n,4)){var O=n.lastIntValue;if(O>=56320&&O<=57343)return n.lastIntValue=(m-55296)*1024+(O-56320)+65536,!0}n.pos=E,n.lastIntValue=m}return!0}if(f&&n.eat(123)&&this.regexp_eatHexDigits(n)&&n.eat(125)&&vf(n.lastIntValue))return!0;f&&n.raise(\\"Invalid unicode escape\\"),n.pos=l}return!1};function vf(n){return n>=0&&n<=1114111}le.regexp_eatIdentityEscape=function(n){if(n.switchU)return this.regexp_eatSyntaxCharacter(n)?!0:n.eat(47)?(n.lastIntValue=47,!0):!1;var o=n.current();return o!==99&&(!n.switchN||o!==107)?(n.lastIntValue=o,n.advance(),!0):!1},le.regexp_eatDecimalEscape=function(n){n.lastIntValue=0;var o=n.current();if(o>=49&&o<=57){do n.lastIntValue=10*n.lastIntValue+(o-48),n.advance();while((o=n.current())>=48&&o<=57);return!0}return!1};var Rc=0,Vn=1,an=2;le.regexp_eatCharacterClassEscape=function(n){var o=n.current();if(xf(o))return n.lastIntValue=-1,n.advance(),Vn;var l=!1;if(n.switchU&&this.options.ecmaVersion>=9&&((l=o===80)||o===112)){n.lastIntValue=-1,n.advance();var f;if(n.eat(123)&&(f=this.regexp_eatUnicodePropertyValueExpression(n))&&n.eat(125))return l&&f===an&&n.raise(\\"Invalid property name\\"),f;n.raise(\\"Invalid property name\\")}return Rc};function xf(n){return n===100||n===68||n===115||n===83||n===119||n===87}le.regexp_eatUnicodePropertyValueExpression=function(n){var o=n.pos;if(this.regexp_eatUnicodePropertyName(n)&&n.eat(61)){var l=n.lastStringValue;if(this.regexp_eatUnicodePropertyValue(n)){var f=n.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(n,l,f),Vn}}if(n.pos=o,this.regexp_eatLoneUnicodePropertyNameOrValue(n)){var m=n.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(n,m)}return Rc},le.regexp_validateUnicodePropertyNameAndValue=function(n,o,l){mt(n.unicodeProperties.nonBinary,o)||n.raise(\\"Invalid property name\\"),n.unicodeProperties.nonBinary[o].test(l)||n.raise(\\"Invalid property value\\")},le.regexp_validateUnicodePropertyNameOrValue=function(n,o){if(n.unicodeProperties.binary.test(o))return Vn;if(n.switchV&&n.unicodeProperties.binaryOfStrings.test(o))return an;n.raise(\\"Invalid property name\\")},le.regexp_eatUnicodePropertyName=function(n){var o=0;for(n.lastStringValue=\\"\\";Lc(o=n.current());)n.lastStringValue+=nt(o),n.advance();return n.lastStringValue!==\\"\\"};function Lc(n){return kr(n)||n===95}le.regexp_eatUnicodePropertyValue=function(n){var o=0;for(n.lastStringValue=\\"\\";gf(o=n.current());)n.lastStringValue+=nt(o),n.advance();return n.lastStringValue!==\\"\\"};function gf(n){return Lc(n)||vr(n)}le.regexp_eatLoneUnicodePropertyNameOrValue=function(n){return this.regexp_eatUnicodePropertyValue(n)},le.regexp_eatCharacterClass=function(n){if(n.eat(91)){var o=n.eat(94),l=this.regexp_classContents(n);return n.eat(93)||n.raise(\\"Unterminated character class\\"),o&&l===an&&n.raise(\\"Negated character class may contain strings\\"),!0}return!1},le.regexp_classContents=function(n){return n.current()===93?Vn:n.switchV?this.regexp_classSetExpression(n):(this.regexp_nonEmptyClassRanges(n),Vn)},le.regexp_nonEmptyClassRanges=function(n){for(;this.regexp_eatClassAtom(n);){var o=n.lastIntValue;if(n.eat(45)&&this.regexp_eatClassAtom(n)){var l=n.lastIntValue;n.switchU&&(o===-1||l===-1)&&n.raise(\\"Invalid character class\\"),o!==-1&&l!==-1&&o>l&&n.raise(\\"Range out of order in character class\\")}}},le.regexp_eatClassAtom=function(n){var o=n.pos;if(n.eat(92)){if(this.regexp_eatClassEscape(n))return!0;if(n.switchU){var l=n.current();(l===99||Mc(l))&&n.raise(\\"Invalid class escape\\"),n.raise(\\"Invalid escape\\")}n.pos=o}var f=n.current();return f!==93?(n.lastIntValue=f,n.advance(),!0):!1},le.regexp_eatClassEscape=function(n){var o=n.pos;if(n.eat(98))return n.lastIntValue=8,!0;if(n.switchU&&n.eat(45))return n.lastIntValue=45,!0;if(!n.switchU&&n.eat(99)){if(this.regexp_eatClassControlLetter(n))return!0;n.pos=o}return this.regexp_eatCharacterClassEscape(n)||this.regexp_eatCharacterEscape(n)},le.regexp_classSetExpression=function(n){var o=Vn,l;if(!this.regexp_eatClassSetRange(n))if(l=this.regexp_eatClassSetOperand(n)){l===an&&(o=an);for(var f=n.pos;n.eatChars([38,38]);){if(n.current()!==38&&(l=this.regexp_eatClassSetOperand(n))){l!==an&&(o=Vn);continue}n.raise(\\"Invalid character in character class\\")}if(f!==n.pos)return o;for(;n.eatChars([45,45]);)this.regexp_eatClassSetOperand(n)||n.raise(\\"Invalid character in character class\\");if(f!==n.pos)return o}else n.raise(\\"Invalid character in character class\\");for(;;)if(!this.regexp_eatClassSetRange(n)){if(l=this.regexp_eatClassSetOperand(n),!l)return o;l===an&&(o=an)}},le.regexp_eatClassSetRange=function(n){var o=n.pos;if(this.regexp_eatClassSetCharacter(n)){var l=n.lastIntValue;if(n.eat(45)&&this.regexp_eatClassSetCharacter(n)){var f=n.lastIntValue;return l!==-1&&f!==-1&&l>f&&n.raise(\\"Range out of order in character class\\"),!0}n.pos=o}return!1},le.regexp_eatClassSetOperand=function(n){return this.regexp_eatClassSetCharacter(n)?Vn:this.regexp_eatClassStringDisjunction(n)||this.regexp_eatNestedClass(n)},le.regexp_eatNestedClass=function(n){var o=n.pos;if(n.eat(91)){var l=n.eat(94),f=this.regexp_classContents(n);if(n.eat(93))return l&&f===an&&n.raise(\\"Negated character class may contain strings\\"),f;n.pos=o}if(n.eat(92)){var m=this.regexp_eatCharacterClassEscape(n);if(m)return m;n.pos=o}return null},le.regexp_eatClassStringDisjunction=function(n){var o=n.pos;if(n.eatChars([92,113])){if(n.eat(123)){var l=this.regexp_classStringDisjunctionContents(n);if(n.eat(125))return l}else n.raise(\\"Invalid escape\\");n.pos=o}return null},le.regexp_classStringDisjunctionContents=function(n){for(var o=this.regexp_classString(n);n.eat(124);)this.regexp_classString(n)===an&&(o=an);return o},le.regexp_classString=function(n){for(var o=0;this.regexp_eatClassSetCharacter(n);)o++;return o===1?Vn:an},le.regexp_eatClassSetCharacter=function(n){var o=n.pos;if(n.eat(92))return this.regexp_eatCharacterEscape(n)||this.regexp_eatClassSetReservedPunctuator(n)?!0:n.eat(98)?(n.lastIntValue=8,!0):(n.pos=o,!1);var l=n.current();return l<0||l===n.lookahead()&&_f(l)||bf(l)?!1:(n.advance(),n.lastIntValue=l,!0)};function _f(n){return n===33||n>=35&&n<=38||n>=42&&n<=44||n===46||n>=58&&n<=64||n===94||n===96||n===126}function bf(n){return n===40||n===41||n===45||n===47||n>=91&&n<=93||n>=123&&n<=125}le.regexp_eatClassSetReservedPunctuator=function(n){var o=n.current();return Cf(o)?(n.lastIntValue=o,n.advance(),!0):!1};function Cf(n){return n===33||n===35||n===37||n===38||n===44||n===45||n>=58&&n<=62||n===64||n===96||n===126}le.regexp_eatClassControlLetter=function(n){var o=n.current();return vr(o)||o===95?(n.lastIntValue=o%32,n.advance(),!0):!1},le.regexp_eatHexEscapeSequence=function(n){var o=n.pos;if(n.eat(120)){if(this.regexp_eatFixedHexDigits(n,2))return!0;n.switchU&&n.raise(\\"Invalid escape\\"),n.pos=o}return!1},le.regexp_eatDecimalDigits=function(n){var o=n.pos,l=0;for(n.lastIntValue=0;vr(l=n.current());)n.lastIntValue=10*n.lastIntValue+(l-48),n.advance();return n.pos!==o};function vr(n){return n>=48&&n<=57}le.regexp_eatHexDigits=function(n){var o=n.pos,l=0;for(n.lastIntValue=0;Oc(l=n.current());)n.lastIntValue=16*n.lastIntValue+Dc(l),n.advance();return n.pos!==o};function Oc(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}function Dc(n){return n>=65&&n<=70?10+(n-65):n>=97&&n<=102?10+(n-97):n-48}le.regexp_eatLegacyOctalEscapeSequence=function(n){if(this.regexp_eatOctalDigit(n)){var o=n.lastIntValue;if(this.regexp_eatOctalDigit(n)){var l=n.lastIntValue;o<=3&&this.regexp_eatOctalDigit(n)?n.lastIntValue=o*64+l*8+n.lastIntValue:n.lastIntValue=o*8+l}else n.lastIntValue=o;return!0}return!1},le.regexp_eatOctalDigit=function(n){var o=n.current();return Mc(o)?(n.lastIntValue=o-48,n.advance(),!0):(n.lastIntValue=0,!1)};function Mc(n){return n>=48&&n<=55}le.regexp_eatFixedHexDigits=function(n,o){var l=n.pos;n.lastIntValue=0;for(var f=0;f=this.input.length)return this.finishToken(c.eof);if(n.override)return n.override(this);this.readToken(this.fullCharCodeAtPos())},Ae.readToken=function(n){return h(n,this.options.ecmaVersion>=6)||n===92?this.readWord():this.getTokenFromCode(n)},Ae.fullCharCodeAtPos=function(){var n=this.input.charCodeAt(this.pos);if(n<=55295||n>=56320)return n;var o=this.input.charCodeAt(this.pos+1);return o<=56319||o>=57344?n:(n<<10)+o-56613888},Ae.skipBlockComment=function(){var n=this.options.onComment&&this.curPosition(),o=this.pos,l=this.input.indexOf(\\"*/\\",this.pos+=2);if(l===-1&&this.raise(this.pos-2,\\"Unterminated comment\\"),this.pos=l+2,this.options.locations)for(var f=void 0,m=o;(f=ie(this.input,m,this.pos))>-1;)++this.curLine,m=this.lineStart=f;this.options.onComment&&this.options.onComment(!0,this.input.slice(o+2,l),o,this.pos,n,this.curPosition())},Ae.skipLineComment=function(n){for(var o=this.pos,l=this.options.onComment&&this.curPosition(),f=this.input.charCodeAt(this.pos+=n);this.pos8&&n<14||n>=5760&&pe.test(String.fromCharCode(n)))++this.pos;else break e}}},Ae.finishToken=function(n,o){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var l=this.type;this.type=n,this.value=o,this.updateContext(l)},Ae.readToken_dot=function(){var n=this.input.charCodeAt(this.pos+1);if(n>=48&&n<=57)return this.readNumber(!0);var o=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&n===46&&o===46?(this.pos+=3,this.finishToken(c.ellipsis)):(++this.pos,this.finishToken(c.dot))},Ae.readToken_slash=function(){var n=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):n===61?this.finishOp(c.assign,2):this.finishOp(c.slash,1)},Ae.readToken_mult_modulo_exp=function(n){var o=this.input.charCodeAt(this.pos+1),l=1,f=n===42?c.star:c.modulo;return this.options.ecmaVersion>=7&&n===42&&o===42&&(++l,f=c.starstar,o=this.input.charCodeAt(this.pos+2)),o===61?this.finishOp(c.assign,l+1):this.finishOp(f,l)},Ae.readToken_pipe_amp=function(n){var o=this.input.charCodeAt(this.pos+1);if(o===n){if(this.options.ecmaVersion>=12){var l=this.input.charCodeAt(this.pos+2);if(l===61)return this.finishOp(c.assign,3)}return this.finishOp(n===124?c.logicalOR:c.logicalAND,2)}return o===61?this.finishOp(c.assign,2):this.finishOp(n===124?c.bitwiseOR:c.bitwiseAND,1)},Ae.readToken_caret=function(){var n=this.input.charCodeAt(this.pos+1);return n===61?this.finishOp(c.assign,2):this.finishOp(c.bitwiseXOR,1)},Ae.readToken_plus_min=function(n){var o=this.input.charCodeAt(this.pos+1);return o===n?o===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||R.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(c.incDec,2):o===61?this.finishOp(c.assign,2):this.finishOp(c.plusMin,1)},Ae.readToken_lt_gt=function(n){var o=this.input.charCodeAt(this.pos+1),l=1;return o===n?(l=n===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+l)===61?this.finishOp(c.assign,l+1):this.finishOp(c.bitShift,l)):o===33&&n===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(o===61&&(l=2),this.finishOp(c.relational,l))},Ae.readToken_eq_excl=function(n){var o=this.input.charCodeAt(this.pos+1);return o===61?this.finishOp(c.equality,this.input.charCodeAt(this.pos+2)===61?3:2):n===61&&o===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(c.arrow)):this.finishOp(n===61?c.eq:c.prefix,1)},Ae.readToken_question=function(){var n=this.options.ecmaVersion;if(n>=11){var o=this.input.charCodeAt(this.pos+1);if(o===46){var l=this.input.charCodeAt(this.pos+2);if(l<48||l>57)return this.finishOp(c.questionDot,2)}if(o===63){if(n>=12){var f=this.input.charCodeAt(this.pos+2);if(f===61)return this.finishOp(c.assign,3)}return this.finishOp(c.coalesce,2)}}return this.finishOp(c.question,1)},Ae.readToken_numberSign=function(){var n=this.options.ecmaVersion,o=35;if(n>=13&&(++this.pos,o=this.fullCharCodeAtPos(),h(o,!0)||o===92))return this.finishToken(c.privateId,this.readWord1());this.raise(this.pos,\\"Unexpected character \'\\"+nt(o)+\\"\'\\")},Ae.getTokenFromCode=function(n){switch(n){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(c.parenL);case 41:return++this.pos,this.finishToken(c.parenR);case 59:return++this.pos,this.finishToken(c.semi);case 44:return++this.pos,this.finishToken(c.comma);case 91:return++this.pos,this.finishToken(c.bracketL);case 93:return++this.pos,this.finishToken(c.bracketR);case 123:return++this.pos,this.finishToken(c.braceL);case 125:return++this.pos,this.finishToken(c.braceR);case 58:return++this.pos,this.finishToken(c.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(c.backQuote);case 48:var o=this.input.charCodeAt(this.pos+1);if(o===120||o===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(o===111||o===79)return this.readRadixNumber(8);if(o===98||o===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(n);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(n);case 124:case 38:return this.readToken_pipe_amp(n);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(n);case 60:case 62:return this.readToken_lt_gt(n);case 61:case 33:return this.readToken_eq_excl(n);case 63:return this.readToken_question();case 126:return this.finishOp(c.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,\\"Unexpected character \'\\"+nt(n)+\\"\'\\")},Ae.finishOp=function(n,o){var l=this.input.slice(this.pos,this.pos+o);return this.pos+=o,this.finishToken(n,l)},Ae.readRegexp=function(){for(var n,o,l=this.pos;;){this.pos>=this.input.length&&this.raise(l,\\"Unterminated regular expression\\");var f=this.input.charAt(this.pos);if(R.test(f)&&this.raise(l,\\"Unterminated regular expression\\"),n)n=!1;else{if(f===\\"[\\")o=!0;else if(f===\\"]\\"&&o)o=!1;else if(f===\\"/\\"&&!o)break;n=f===\\"\\\\\\\\\\"}++this.pos}var m=this.input.slice(l,this.pos);++this.pos;var E=this.pos,O=this.readWord1();this.containsEsc&&this.unexpected(E);var Y=this.regexpState||(this.regexpState=new on(this));Y.reset(l,m,O),this.validateRegExpFlags(Y),this.validateRegExpPattern(Y);var Q=null;try{Q=new RegExp(m,O)}catch{}return this.finishToken(c.regexp,{pattern:m,flags:O,value:Q})},Ae.readInt=function(n,o,l){for(var f=this.options.ecmaVersion>=12&&o===void 0,m=l&&this.input.charCodeAt(this.pos)===48,E=this.pos,O=0,Y=0,Q=0,Te=o??1/0;Q=97?Ze=xe-97+10:xe>=65?Ze=xe-65+10:xe>=48&&xe<=57?Ze=xe-48:Ze=1/0,Ze>=n)break;Y=xe,O=O*n+Ze}return f&&Y===95&&this.raiseRecoverable(this.pos-1,\\"Numeric separator is not allowed at the last of digits\\"),this.pos===E||o!=null&&this.pos-E!==o?null:O};function wf(n,o){return o?parseInt(n,8):parseFloat(n.replace(/_/g,\\"\\"))}function Fc(n){return typeof BigInt!=\\"function\\"?null:BigInt(n.replace(/_/g,\\"\\"))}Ae.readRadixNumber=function(n){var o=this.pos;this.pos+=2;var l=this.readInt(n);return l==null&&this.raise(this.start+2,\\"Expected number in radix \\"+n),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(l=Fc(this.input.slice(o,this.pos)),++this.pos):h(this.fullCharCodeAtPos())&&this.raise(this.pos,\\"Identifier directly after number\\"),this.finishToken(c.num,l)},Ae.readNumber=function(n){var o=this.pos;!n&&this.readInt(10,void 0,!0)===null&&this.raise(o,\\"Invalid number\\");var l=this.pos-o>=2&&this.input.charCodeAt(o)===48;l&&this.strict&&this.raise(o,\\"Invalid number\\");var f=this.input.charCodeAt(this.pos);if(!l&&!n&&this.options.ecmaVersion>=11&&f===110){var m=Fc(this.input.slice(o,this.pos));return++this.pos,h(this.fullCharCodeAtPos())&&this.raise(this.pos,\\"Identifier directly after number\\"),this.finishToken(c.num,m)}l&&/[89]/.test(this.input.slice(o,this.pos))&&(l=!1),f===46&&!l&&(++this.pos,this.readInt(10),f=this.input.charCodeAt(this.pos)),(f===69||f===101)&&!l&&(f=this.input.charCodeAt(++this.pos),(f===43||f===45)&&++this.pos,this.readInt(10)===null&&this.raise(o,\\"Invalid number\\")),h(this.fullCharCodeAtPos())&&this.raise(this.pos,\\"Identifier directly after number\\");var E=wf(this.input.slice(o,this.pos),l);return this.finishToken(c.num,E)},Ae.readCodePoint=function(){var n=this.input.charCodeAt(this.pos),o;if(n===123){this.options.ecmaVersion<6&&this.unexpected();var l=++this.pos;o=this.readHexChar(this.input.indexOf(\\"}\\",this.pos)-this.pos),++this.pos,o>1114111&&this.invalidStringToken(l,\\"Code point out of bounds\\")}else o=this.readHexChar(4);return o},Ae.readString=function(n){for(var o=\\"\\",l=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,\\"Unterminated string constant\\");var f=this.input.charCodeAt(this.pos);if(f===n)break;f===92?(o+=this.input.slice(l,this.pos),o+=this.readEscapedChar(!1),l=this.pos):f===8232||f===8233?(this.options.ecmaVersion<10&&this.raise(this.start,\\"Unterminated string constant\\"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(X(f)&&this.raise(this.start,\\"Unterminated string constant\\"),++this.pos)}return o+=this.input.slice(l,this.pos++),this.finishToken(c.string,o)};var Bc={};Ae.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(n){if(n===Bc)this.readInvalidTemplateToken();else throw n}this.inTemplateElement=!1},Ae.invalidStringToken=function(n,o){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Bc;this.raise(n,o)},Ae.readTmplToken=function(){for(var n=\\"\\",o=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,\\"Unterminated template\\");var l=this.input.charCodeAt(this.pos);if(l===96||l===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===c.template||this.type===c.invalidTemplate)?l===36?(this.pos+=2,this.finishToken(c.dollarBraceL)):(++this.pos,this.finishToken(c.backQuote)):(n+=this.input.slice(o,this.pos),this.finishToken(c.template,n));if(l===92)n+=this.input.slice(o,this.pos),n+=this.readEscapedChar(!0),o=this.pos;else if(X(l)){switch(n+=this.input.slice(o,this.pos),++this.pos,l){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:n+=`\\n`;break;default:n+=String.fromCharCode(l);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),o=this.pos}else++this.pos}},Ae.readInvalidTemplateToken=function(){for(;this.pos=48&&o<=55){var f=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],m=parseInt(f,8);return m>255&&(f=f.slice(0,-1),m=parseInt(f,8)),this.pos+=f.length-1,o=this.input.charCodeAt(this.pos),(f!==\\"0\\"||o===56||o===57)&&(this.strict||n)&&this.invalidStringToken(this.pos-1-f.length,n?\\"Octal literal in template string\\":\\"Octal literal in strict mode\\"),String.fromCharCode(m)}return X(o)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),\\"\\"):String.fromCharCode(o)}},Ae.readHexChar=function(n){var o=this.pos,l=this.readInt(16,n);return l===null&&this.invalidStringToken(o,\\"Bad character escape sequence\\"),l},Ae.readWord1=function(){this.containsEsc=!1;for(var n=\\"\\",o=!0,l=this.pos,f=this.options.ecmaVersion>=6;this.pos{(function(e,t){typeof Bo==\\"object\\"&&typeof ff<\\"u\\"?t(Bo,hf()):typeof define==\\"function\\"&&define.amd?define([\\"exports\\",\\"acorn\\"],t):(e=typeof globalThis<\\"u\\"?globalThis:e||self,t((e.acorn=e.acorn||{},e.acorn.loose={}),e.acorn))})(Bo,function(e,t){\\"use strict\\";var s=\\"\\\\u2716\\";function i(p){return p.name===s}function r(){}var a=function(h,T){if(T===void 0&&(T={}),this.toks=this.constructor.BaseParser.tokenizer(h,T),this.options=this.toks.options,this.input=this.toks.input,this.tok=this.last={type:t.tokTypes.eof,start:0,end:0},this.tok.validateRegExpFlags=r,this.tok.validateRegExpPattern=r,this.options.locations){var x=this.toks.curPosition();this.tok.loc=new t.SourceLocation(this.toks,x,x)}this.ahead=[],this.context=[],this.curIndent=0,this.curLineStart=0,this.nextLineStart=this.lineEnd(this.curLineStart)+1,this.inAsync=!1,this.inGenerator=!1,this.inFunction=!1};a.prototype.startNode=function(){return new t.Node(this.toks,this.tok.start,this.options.locations?this.tok.loc.start:null)},a.prototype.storeCurrentPos=function(){return this.options.locations?[this.tok.start,this.tok.loc.start]:this.tok.start},a.prototype.startNodeAt=function(h){return this.options.locations?new t.Node(this.toks,h[0],h[1]):new t.Node(this.toks,h)},a.prototype.finishNode=function(h,T){return h.type=T,h.end=this.last.end,this.options.locations&&(h.loc.end=this.last.loc.end),this.options.ranges&&(h.range[1]=this.last.end),h},a.prototype.dummyNode=function(h){var T=this.startNode();return T.type=h,T.end=T.start,this.options.locations&&(T.loc.end=T.loc.start),this.options.ranges&&(T.range[1]=T.start),this.last={type:t.tokTypes.name,start:T.start,end:T.start,loc:T.loc},T},a.prototype.dummyIdent=function(){var h=this.dummyNode(\\"Identifier\\");return h.name=s,h},a.prototype.dummyString=function(){var h=this.dummyNode(\\"Literal\\");return h.value=h.raw=s,h},a.prototype.eat=function(h){return this.tok.type===h?(this.next(),!0):!1},a.prototype.isContextual=function(h){return this.tok.type===t.tokTypes.name&&this.tok.value===h},a.prototype.eatContextual=function(h){return this.tok.value===h&&this.eat(t.tokTypes.name)},a.prototype.canInsertSemicolon=function(){return this.tok.type===t.tokTypes.eof||this.tok.type===t.tokTypes.braceR||t.lineBreak.test(this.input.slice(this.last.end,this.tok.start))},a.prototype.semicolon=function(){return this.eat(t.tokTypes.semi)},a.prototype.expect=function(h){if(this.eat(h))return!0;for(var T=1;T<=2;T++)if(this.lookAhead(T).type===h){for(var x=0;x=this.input.length||this.indentationAfter(this.nextLineStart)=this.curLineStart;--h){var T=this.input.charCodeAt(h);if(T!==9&&T!==32)return!1}return!0},a.prototype.extend=function(h,T){this[h]=T(this[h])},a.prototype.parse=function(){return this.next(),this.parseTopLevel()},a.extend=function(){for(var h=[],T=arguments.length;T--;)h[T]=arguments[T];for(var x=this,w=0;w8||p===32||p===160||t.isNewLine(p)}u.next=function(){if(this.last=this.tok,this.ahead.length?this.tok=this.ahead.shift():this.tok=this.readToken(),this.tok.start>=this.nextLineStart){for(;this.tok.start>=this.nextLineStart;)this.curLineStart=this.nextLineStart,this.nextLineStart=this.lineEnd(this.curLineStart)+1;this.curIndent=this.indentationAfter(this.curLineStart)}},u.readToken=function(){for(;;)try{return this.toks.next(),this.toks.type===t.tokTypes.dot&&this.input.substr(this.toks.end,1)===\\".\\"&&this.options.ecmaVersion>=6&&(this.toks.end++,this.toks.type=t.tokTypes.ellipsis),new t.Token(this.toks)}catch(S){if(!(S instanceof SyntaxError))throw S;var p=S.message,h=S.raisedAt,T=!0;if(/unterminated/i.test(p))if(h=this.lineEnd(S.pos+1),/string/.test(p))T={start:S.pos,end:h,type:t.tokTypes.string,value:this.input.slice(S.pos+1,h)};else if(/regular expr/i.test(p)){var x=this.input.slice(S.pos,h);try{x=new RegExp(x)}catch{}T={start:S.pos,end:h,type:t.tokTypes.regexp,value:x}}else/template/.test(p)?T={start:S.pos,end:h,type:t.tokTypes.template,value:this.input.slice(S.pos,h)}:T=!1;else if(/invalid (unicode|regexp|number)|expecting unicode|octal literal|is reserved|directly after number|expected number in radix|numeric separator/i.test(p))for(;h]/.test(h)||/[enwfd]/.test(h)&&/\\\\b(case|else|return|throw|new|in|(instance|type)?of|delete|void)$/.test(this.input.slice(p-10,p)),this.options.locations){this.toks.curLine=1,this.toks.lineStart=t.lineBreakG.lastIndex=0;for(var T;(T=t.lineBreakG.exec(this.input))&&T.index
this.ahead.length;)this.ahead.push(this.readToken());return this.ahead[p-1]};var y=a.prototype;y.parseTopLevel=function(){var p=this.startNodeAt(this.options.locations?[0,t.getLineInfo(this.input,0)]:0);for(p.body=[];this.tok.type!==t.tokTypes.eof;)p.body.push(this.parseStatement());return this.toks.adaptDirectivePrologue(p.body),this.last=this.tok,p.sourceType=this.options.sourceType===\\"commonjs\\"?\\"script\\":this.options.sourceType,this.finishNode(p,\\"Program\\")},y.parseStatement=function(){var p=this.tok.type,h=this.startNode(),T;switch(this.toks.isLet()&&(p=t.tokTypes._var,T=\\"let\\"),p){case t.tokTypes._break:case t.tokTypes._continue:this.next();var x=p===t.tokTypes._break;return this.semicolon()||this.canInsertSemicolon()?h.label=null:(h.label=this.tok.type===t.tokTypes.name?this.parseIdent():null,this.semicolon()),this.finishNode(h,x?\\"BreakStatement\\":\\"ContinueStatement\\");case t.tokTypes._debugger:return this.next(),this.semicolon(),this.finishNode(h,\\"DebuggerStatement\\");case t.tokTypes._do:return this.next(),h.body=this.parseStatement(),h.test=this.eat(t.tokTypes._while)?this.parseParenExpression():this.dummyIdent(),this.semicolon(),this.finishNode(h,\\"DoWhileStatement\\");case t.tokTypes._for:this.next();var w=this.options.ecmaVersion>=9&&this.eatContextual(\\"await\\");if(this.pushCx(),this.expect(t.tokTypes.parenL),this.tok.type===t.tokTypes.semi)return this.parseFor(h,null);var S=this.toks.isLet(),A=this.toks.isAwaitUsing(!0),U=!A&&this.toks.isUsing(!0);if(S||this.tok.type===t.tokTypes._var||this.tok.type===t.tokTypes._const||U||A){var M=S?\\"let\\":U?\\"using\\":A?\\"await using\\":this.tok.value,c=this.startNode();return U||A?(A&&this.next(),this.parseVar(c,!0,M)):c=this.parseVar(c,!0,M),c.declarations.length===1&&(this.tok.type===t.tokTypes._in||this.isContextual(\\"of\\"))?(this.options.ecmaVersion>=9&&this.tok.type!==t.tokTypes._in&&(h.await=w),this.parseForIn(h,c)):this.parseFor(h,c)}var R=this.parseExpression(!0);return this.tok.type===t.tokTypes._in||this.isContextual(\\"of\\")?(this.options.ecmaVersion>=9&&this.tok.type!==t.tokTypes._in&&(h.await=w),this.parseForIn(h,this.toAssignable(R))):this.parseFor(h,R);case t.tokTypes._function:return this.next(),this.parseFunction(h,!0);case t.tokTypes._if:return this.next(),h.test=this.parseParenExpression(),h.consequent=this.parseStatement(),h.alternate=this.eat(t.tokTypes._else)?this.parseStatement():null,this.finishNode(h,\\"IfStatement\\");case t.tokTypes._return:return this.next(),this.eat(t.tokTypes.semi)||this.canInsertSemicolon()?h.argument=null:(h.argument=this.parseExpression(),this.semicolon()),this.finishNode(h,\\"ReturnStatement\\");case t.tokTypes._switch:var W=this.curIndent,X=this.curLineStart;this.next(),h.discriminant=this.parseParenExpression(),h.cases=[],this.pushCx(),this.expect(t.tokTypes.braceL);for(var ie;!this.closes(t.tokTypes.braceR,W,X,!0);)if(this.tok.type===t.tokTypes._case||this.tok.type===t.tokTypes._default){var pe=this.tok.type===t.tokTypes._case;ie&&this.finishNode(ie,\\"SwitchCase\\"),h.cases.push(ie=this.startNode()),ie.consequent=[],this.next(),pe?ie.test=this.parseExpression():ie.test=null,this.expect(t.tokTypes.colon)}else ie||(h.cases.push(ie=this.startNode()),ie.consequent=[],ie.test=null),ie.consequent.push(this.parseStatement());return ie&&this.finishNode(ie,\\"SwitchCase\\"),this.popCx(),this.eat(t.tokTypes.braceR),this.finishNode(h,\\"SwitchStatement\\");case t.tokTypes._throw:return this.next(),h.argument=this.parseExpression(),this.semicolon(),this.finishNode(h,\\"ThrowStatement\\");case t.tokTypes._try:if(this.next(),h.block=this.parseBlock(),h.handler=null,this.tok.type===t.tokTypes._catch){var ae=this.startNode();this.next(),this.eat(t.tokTypes.parenL)?(ae.param=this.toAssignable(this.parseExprAtom(),!0),this.expect(t.tokTypes.parenR)):ae.param=null,ae.body=this.parseBlock(),h.handler=this.finishNode(ae,\\"CatchClause\\")}return h.finalizer=this.eat(t.tokTypes._finally)?this.parseBlock():null,!h.handler&&!h.finalizer?h.block:this.finishNode(h,\\"TryStatement\\");case t.tokTypes._var:case t.tokTypes._const:return this.parseVar(h,!1,T||this.tok.value);case t.tokTypes._while:return this.next(),h.test=this.parseParenExpression(),h.body=this.parseStatement(),this.finishNode(h,\\"WhileStatement\\");case t.tokTypes._with:return this.next(),h.object=this.parseParenExpression(),h.body=this.parseStatement(),this.finishNode(h,\\"WithStatement\\");case t.tokTypes.braceL:return this.parseBlock();case t.tokTypes.semi:return this.next(),this.finishNode(h,\\"EmptyStatement\\");case t.tokTypes._class:return this.parseClass(!0);case t.tokTypes._import:if(this.options.ecmaVersion>10){var He=this.lookAhead(1).type;if(He===t.tokTypes.parenL||He===t.tokTypes.dot)return h.expression=this.parseExpression(),this.semicolon(),this.finishNode(h,\\"ExpressionStatement\\")}return this.parseImport();case t.tokTypes._export:return this.parseExport();default:if(this.toks.isAsyncFunction())return this.next(),this.next(),this.parseFunction(h,!0,!0);if(this.toks.isUsing(!1))return this.parseVar(h,!1,\\"using\\");if(this.toks.isAwaitUsing(!1))return this.next(),this.parseVar(h,!1,\\"await using\\");var qe=this.parseExpression();return i(qe)?(this.next(),this.tok.type===t.tokTypes.eof?this.finishNode(h,\\"EmptyStatement\\"):this.parseStatement()):p===t.tokTypes.name&&qe.type===\\"Identifier\\"&&this.eat(t.tokTypes.colon)?(h.body=this.parseStatement(),h.label=qe,this.finishNode(h,\\"LabeledStatement\\")):(h.expression=qe,this.semicolon(),this.finishNode(h,\\"ExpressionStatement\\"))}},y.parseBlock=function(){var p=this.startNode();this.pushCx(),this.expect(t.tokTypes.braceL);var h=this.curIndent,T=this.curLineStart;for(p.body=[];!this.closes(t.tokTypes.braceR,h,T,!0);)p.body.push(this.parseStatement());return this.popCx(),this.eat(t.tokTypes.braceR),this.finishNode(p,\\"BlockStatement\\")},y.parseFor=function(p,h){return p.init=h,p.test=p.update=null,this.eat(t.tokTypes.semi)&&this.tok.type!==t.tokTypes.semi&&(p.test=this.parseExpression()),this.eat(t.tokTypes.semi)&&this.tok.type!==t.tokTypes.parenR&&(p.update=this.parseExpression()),this.popCx(),this.expect(t.tokTypes.parenR),p.body=this.parseStatement(),this.finishNode(p,\\"ForStatement\\")},y.parseForIn=function(p,h){var T=this.tok.type===t.tokTypes._in?\\"ForInStatement\\":\\"ForOfStatement\\";return this.next(),p.left=h,p.right=this.parseExpression(),this.popCx(),this.expect(t.tokTypes.parenR),p.body=this.parseStatement(),this.finishNode(p,T)},y.parseVar=function(p,h,T){p.kind=T,this.next(),p.declarations=[];do{var x=this.startNode();x.id=this.options.ecmaVersion>=6?this.toAssignable(this.parseExprAtom(),!0):this.parseIdent(),x.init=this.eat(t.tokTypes.eq)?this.parseMaybeAssign(h):null,p.declarations.push(this.finishNode(x,\\"VariableDeclarator\\"))}while(this.eat(t.tokTypes.comma));if(!p.declarations.length){var w=this.startNode();w.id=this.dummyIdent(),p.declarations.push(this.finishNode(w,\\"VariableDeclarator\\"))}return h||this.semicolon(),this.finishNode(p,\\"VariableDeclaration\\")},y.parseClass=function(p){var h=this.startNode();this.next(),this.tok.type===t.tokTypes.name?h.id=this.parseIdent():p===!0?h.id=this.dummyIdent():h.id=null,h.superClass=this.eat(t.tokTypes._extends)?this.parseExpression():null,h.body=this.startNode(),h.body.body=[],this.pushCx();var T=this.curIndent+1,x=this.curLineStart;for(this.eat(t.tokTypes.braceL),this.curIndent+1=13&&this.eat(t.tokTypes.braceL))return this.parseClassStaticBlock(S),S;this.isClassElementNameStart()||this.toks.type===t.tokTypes.star?R=!0:A=\\"static\\"}if(S.static=R,!A&&h>=8&&this.eatContextual(\\"async\\")&&((this.isClassElementNameStart()||this.toks.type===t.tokTypes.star)&&!this.canInsertSemicolon()?M=!0:A=\\"async\\"),!A){U=this.eat(t.tokTypes.star);var W=this.toks.value;(this.eatContextual(\\"get\\")||this.eatContextual(\\"set\\"))&&(this.isClassElementNameStart()?c=W:A=W)}if(A)S.computed=!1,S.key=this.startNodeAt(T?[this.toks.lastTokStart,this.toks.lastTokStartLoc]:this.toks.lastTokStart),S.key.name=A,this.finishNode(S.key,\\"Identifier\\");else if(this.parseClassElementName(S),i(S.key))return i(this.parseMaybeAssign())&&this.next(),this.eat(t.tokTypes.comma),null;if(h<13||this.toks.type===t.tokTypes.parenL||c!==\\"method\\"||U||M){var X=!S.computed&&!S.static&&!U&&!M&&c===\\"method\\"&&(S.key.type===\\"Identifier\\"&&S.key.name===\\"constructor\\"||S.key.type===\\"Literal\\"&&S.key.value===\\"constructor\\");S.kind=X?\\"constructor\\":c,S.value=this.parseMethod(U,M),this.finishNode(S,\\"MethodDefinition\\")}else{if(this.eat(t.tokTypes.eq))if(this.curLineStart!==w&&this.curIndent<=x&&this.tokenStartsLine())S.value=null;else{var ie=this.inAsync,pe=this.inGenerator;this.inAsync=!1,this.inGenerator=!1,S.value=this.parseMaybeAssign(),this.inAsync=ie,this.inGenerator=pe}else S.value=null;this.semicolon(),this.finishNode(S,\\"PropertyDefinition\\")}return S},y.parseClassStaticBlock=function(p){var h=this.curIndent,T=this.curLineStart;for(p.body=[],this.pushCx();!this.closes(t.tokTypes.braceR,h,T,!0);)p.body.push(this.parseStatement());return this.popCx(),this.eat(t.tokTypes.braceR),this.finishNode(p,\\"StaticBlock\\")},y.isClassElementNameStart=function(){return this.toks.isClassElementNameStart()},y.parseClassElementName=function(p){this.toks.type===t.tokTypes.privateId?(p.computed=!1,p.key=this.parsePrivateIdent()):this.parsePropertyName(p)},y.parseFunction=function(p,h,T){var x=this.inAsync,w=this.inGenerator,S=this.inFunction;return this.initFunction(p),this.options.ecmaVersion>=6&&(p.generator=this.eat(t.tokTypes.star)),this.options.ecmaVersion>=8&&(p.async=!!T),this.tok.type===t.tokTypes.name?p.id=this.parseIdent():h===!0&&(p.id=this.dummyIdent()),this.inAsync=p.async,this.inGenerator=p.generator,this.inFunction=!0,p.params=this.parseFunctionParams(),p.body=this.parseBlock(),this.toks.adaptDirectivePrologue(p.body.body),this.inAsync=x,this.inGenerator=w,this.inFunction=S,this.finishNode(p,h?\\"FunctionDeclaration\\":\\"FunctionExpression\\")},y.parseExport=function(){var p=this.startNode();if(this.next(),this.eat(t.tokTypes.star))return this.options.ecmaVersion>=11&&(this.eatContextual(\\"as\\")?p.exported=this.parseExprAtom():p.exported=null),p.source=this.eatContextual(\\"from\\")?this.parseExprAtom():this.dummyString(),this.options.ecmaVersion>=16&&(p.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(p,\\"ExportAllDeclaration\\");if(this.eat(t.tokTypes._default)){var h;if(this.tok.type===t.tokTypes._function||(h=this.toks.isAsyncFunction())){var T=this.startNode();this.next(),h&&this.next(),p.declaration=this.parseFunction(T,\\"nullableID\\",h)}else this.tok.type===t.tokTypes._class?p.declaration=this.parseClass(\\"nullableID\\"):(p.declaration=this.parseMaybeAssign(),this.semicolon());return this.finishNode(p,\\"ExportDefaultDeclaration\\")}return this.tok.type.keyword||this.toks.isLet()||this.toks.isAsyncFunction()?(p.declaration=this.parseStatement(),p.specifiers=[],p.source=null):(p.declaration=null,p.specifiers=this.parseExportSpecifierList(),p.source=this.eatContextual(\\"from\\")?this.parseExprAtom():null,this.options.ecmaVersion>=16&&(p.attributes=this.parseWithClause()),this.semicolon()),this.finishNode(p,\\"ExportNamedDeclaration\\")},y.parseImport=function(){var p=this.startNode();if(this.next(),this.tok.type===t.tokTypes.string)p.specifiers=[],p.source=this.parseExprAtom();else{var h;this.tok.type===t.tokTypes.name&&this.tok.value!==\\"from\\"&&(h=this.startNode(),h.local=this.parseIdent(),this.finishNode(h,\\"ImportDefaultSpecifier\\"),this.eat(t.tokTypes.comma)),p.specifiers=this.parseImportSpecifiers(),p.source=this.eatContextual(\\"from\\")&&this.tok.type===t.tokTypes.string?this.parseExprAtom():this.dummyString(),h&&p.specifiers.unshift(h)}return this.options.ecmaVersion>=16&&(p.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(p,\\"ImportDeclaration\\")},y.parseImportSpecifiers=function(){var p=[];if(this.tok.type===t.tokTypes.star){var h=this.startNode();this.next(),h.local=this.eatContextual(\\"as\\")?this.parseIdent():this.dummyIdent(),p.push(this.finishNode(h,\\"ImportNamespaceSpecifier\\"))}else{var T=this.curIndent,x=this.curLineStart,w=this.nextLineStart;for(this.pushCx(),this.eat(t.tokTypes.braceL),this.curLineStart>w&&(w=this.curLineStart);!this.closes(t.tokTypes.braceR,T+(this.curLineStart<=w?1:0),x);){var S=this.startNode();if(this.eat(t.tokTypes.star))S.local=this.eatContextual(\\"as\\")?this.parseModuleExportName():this.dummyIdent(),this.finishNode(S,\\"ImportNamespaceSpecifier\\");else{if(this.isContextual(\\"from\\")||(S.imported=this.parseModuleExportName(),i(S.imported)))break;S.local=this.eatContextual(\\"as\\")?this.parseModuleExportName():S.imported,this.finishNode(S,\\"ImportSpecifier\\")}p.push(S),this.eat(t.tokTypes.comma)}this.eat(t.tokTypes.braceR),this.popCx()}return p},y.parseWithClause=function(){var p=[];if(!this.eat(t.tokTypes._with))return p;var h=this.curIndent,T=this.curLineStart,x=this.nextLineStart;for(this.pushCx(),this.eat(t.tokTypes.braceL),this.curLineStart>x&&(x=this.curLineStart);!this.closes(t.tokTypes.braceR,h+(this.curLineStart<=x?1:0),T);){var w=this.startNode();if(w.key=this.tok.type===t.tokTypes.string?this.parseExprAtom():this.parseIdent(),this.eat(t.tokTypes.colon))this.tok.type===t.tokTypes.string?w.value=this.parseExprAtom():w.value=this.dummyString();else{if(i(w.key))break;if(this.tok.type===t.tokTypes.string)w.value=this.parseExprAtom();else break}p.push(this.finishNode(w,\\"ImportAttribute\\")),this.eat(t.tokTypes.comma)}return this.eat(t.tokTypes.braceR),this.popCx(),p},y.parseExportSpecifierList=function(){var p=[],h=this.curIndent,T=this.curLineStart,x=this.nextLineStart;for(this.pushCx(),this.eat(t.tokTypes.braceL),this.curLineStart>x&&(x=this.curLineStart);!this.closes(t.tokTypes.braceR,h+(this.curLineStart<=x?1:0),T)&&!this.isContextual(\\"from\\");){var w=this.startNode();if(w.local=this.parseModuleExportName(),i(w.local))break;w.exported=this.eatContextual(\\"as\\")?this.parseModuleExportName():w.local,this.finishNode(w,\\"ExportSpecifier\\"),p.push(w),this.eat(t.tokTypes.comma)}return this.eat(t.tokTypes.braceR),this.popCx(),p},y.parseModuleExportName=function(){return this.options.ecmaVersion>=13&&this.tok.type===t.tokTypes.string?this.parseExprAtom():this.parseIdent()};var g=a.prototype;g.checkLVal=function(p){if(!p)return p;switch(p.type){case\\"Identifier\\":case\\"MemberExpression\\":return p;case\\"ParenthesizedExpression\\":return p.expression=this.checkLVal(p.expression),p;default:return this.dummyIdent()}},g.parseExpression=function(p){var h=this.storeCurrentPos(),T=this.parseMaybeAssign(p);if(this.tok.type===t.tokTypes.comma){var x=this.startNodeAt(h);for(x.expressions=[T];this.eat(t.tokTypes.comma);)x.expressions.push(this.parseMaybeAssign(p));return this.finishNode(x,\\"SequenceExpression\\")}return T},g.parseParenExpression=function(){this.pushCx(),this.expect(t.tokTypes.parenL);var p=this.parseExpression();return this.popCx(),this.expect(t.tokTypes.parenR),p},g.parseMaybeAssign=function(p){if(this.inGenerator&&this.toks.isContextual(\\"yield\\")){var h=this.startNode();return this.next(),this.semicolon()||this.canInsertSemicolon()||this.tok.type!==t.tokTypes.star&&!this.tok.type.startsExpr?(h.delegate=!1,h.argument=null):(h.delegate=this.eat(t.tokTypes.star),h.argument=this.parseMaybeAssign()),this.finishNode(h,\\"YieldExpression\\")}var T=this.storeCurrentPos(),x=this.parseMaybeConditional(p);if(this.tok.type.isAssign){var w=this.startNodeAt(T);return w.operator=this.tok.value,w.left=this.tok.type===t.tokTypes.eq?this.toAssignable(x):this.checkLVal(x),this.next(),w.right=this.parseMaybeAssign(p),this.finishNode(w,\\"AssignmentExpression\\")}return x},g.parseMaybeConditional=function(p){var h=this.storeCurrentPos(),T=this.parseExprOps(p);if(this.eat(t.tokTypes.question)){var x=this.startNodeAt(h);return x.test=T,x.consequent=this.parseMaybeAssign(),x.alternate=this.expect(t.tokTypes.colon)?this.parseMaybeAssign(p):this.dummyIdent(),this.finishNode(x,\\"ConditionalExpression\\")}return T},g.parseExprOps=function(p){var h=this.storeCurrentPos(),T=this.curIndent,x=this.curLineStart;return this.parseExprOp(this.parseMaybeUnary(!1),h,-1,p,T,x)},g.parseExprOp=function(p,h,T,x,w,S){if(this.curLineStart!==S&&this.curIndentT){var U=this.startNodeAt(h);if(U.left=p,U.operator=this.tok.value,this.next(),this.curLineStart!==S&&this.curIndent=8&&this.toks.isContextual(\\"await\\")&&(this.inAsync||this.toks.inModule&&this.options.ecmaVersion>=13||!this.inFunction&&this.options.allowAwaitOutsideFunction))T=this.parseAwait(),p=!0;else if(this.tok.type.prefix){var x=this.startNode(),w=this.tok.type===t.tokTypes.incDec;w||(p=!0),x.operator=this.tok.value,x.prefix=!0,this.next(),x.argument=this.parseMaybeUnary(!0),w&&(x.argument=this.checkLVal(x.argument)),T=this.finishNode(x,w?\\"UpdateExpression\\":\\"UnaryExpression\\")}else if(this.tok.type===t.tokTypes.ellipsis){var S=this.startNode();this.next(),S.argument=this.parseMaybeUnary(p),T=this.finishNode(S,\\"SpreadElement\\")}else if(!p&&this.tok.type===t.tokTypes.privateId)T=this.parsePrivateIdent();else for(T=this.parseExprSubscripts();this.tok.type.postfix&&!this.canInsertSemicolon();){var A=this.startNodeAt(h);A.operator=this.tok.value,A.prefix=!1,A.argument=this.checkLVal(T),this.next(),T=this.finishNode(A,\\"UpdateExpression\\")}if(!p&&this.eat(t.tokTypes.starstar)){var U=this.startNodeAt(h);return U.operator=\\"**\\",U.left=T,U.right=this.parseMaybeUnary(!1),this.finishNode(U,\\"BinaryExpression\\")}return T},g.parseExprSubscripts=function(){var p=this.storeCurrentPos();return this.parseSubscripts(this.parseExprAtom(),p,!1,this.curIndent,this.curLineStart)},g.parseSubscripts=function(p,h,T,x,w){for(var S=this.options.ecmaVersion>=11,A=!1;;){if(this.curLineStart!==w&&this.curIndent<=x&&this.tokenStartsLine())if(this.tok.type===t.tokTypes.dot&&this.curIndent===x)--x;else break;var U=p.type===\\"Identifier\\"&&p.name===\\"async\\"&&!this.canInsertSemicolon(),M=S&&this.eat(t.tokTypes.questionDot);if(M&&(A=!0),M&&this.tok.type!==t.tokTypes.parenL&&this.tok.type!==t.tokTypes.bracketL&&this.tok.type!==t.tokTypes.backQuote||this.eat(t.tokTypes.dot)){var c=this.startNodeAt(h);c.object=p,this.curLineStart!==w&&this.curIndent<=x&&this.tokenStartsLine()?c.property=this.dummyIdent():c.property=this.parsePropertyAccessor()||this.dummyIdent(),c.computed=!1,S&&(c.optional=M),p=this.finishNode(c,\\"MemberExpression\\")}else if(this.tok.type===t.tokTypes.bracketL){this.pushCx(),this.next();var R=this.startNodeAt(h);R.object=p,R.property=this.parseExpression(),R.computed=!0,S&&(R.optional=M),this.popCx(),this.expect(t.tokTypes.bracketR),p=this.finishNode(R,\\"MemberExpression\\")}else if(!T&&this.tok.type===t.tokTypes.parenL){var W=this.parseExprList(t.tokTypes.parenR);if(U&&this.eat(t.tokTypes.arrow))return this.parseArrowExpression(this.startNodeAt(h),W,!0);var X=this.startNodeAt(h);X.callee=p,X.arguments=W,S&&(X.optional=M),p=this.finishNode(X,\\"CallExpression\\")}else if(this.tok.type===t.tokTypes.backQuote){var ie=this.startNodeAt(h);ie.tag=p,ie.quasi=this.parseTemplate(),p=this.finishNode(ie,\\"TaggedTemplateExpression\\")}else break}if(A){var pe=this.startNodeAt(h);pe.expression=p,p=this.finishNode(pe,\\"ChainExpression\\")}return p},g.parseExprAtom=function(){var p;switch(this.tok.type){case t.tokTypes._this:case t.tokTypes._super:var h=this.tok.type===t.tokTypes._this?\\"ThisExpression\\":\\"Super\\";return p=this.startNode(),this.next(),this.finishNode(p,h);case t.tokTypes.name:var T=this.storeCurrentPos(),x=this.parseIdent(),w=!1;if(x.name===\\"async\\"&&!this.canInsertSemicolon()){if(this.eat(t.tokTypes._function))return this.toks.overrideContext(t.tokContexts.f_expr),this.parseFunction(this.startNodeAt(T),!1,!0);this.tok.type===t.tokTypes.name&&(x=this.parseIdent(),w=!0)}return this.eat(t.tokTypes.arrow)?this.parseArrowExpression(this.startNodeAt(T),[x],w):x;case t.tokTypes.regexp:p=this.startNode();var S=this.tok.value;return p.regex={pattern:S.pattern,flags:S.flags},p.value=S.value,p.raw=this.input.slice(this.tok.start,this.tok.end),this.next(),this.finishNode(p,\\"Literal\\");case t.tokTypes.num:case t.tokTypes.string:return p=this.startNode(),p.value=this.tok.value,p.raw=this.input.slice(this.tok.start,this.tok.end),this.tok.type===t.tokTypes.num&&p.raw.charCodeAt(p.raw.length-1)===110&&(p.bigint=p.value!=null?p.value.toString():p.raw.slice(0,-1).replace(/_/g,\\"\\")),this.next(),this.finishNode(p,\\"Literal\\");case t.tokTypes._null:case t.tokTypes._true:case t.tokTypes._false:return p=this.startNode(),p.value=this.tok.type===t.tokTypes._null?null:this.tok.type===t.tokTypes._true,p.raw=this.tok.type.keyword,this.next(),this.finishNode(p,\\"Literal\\");case t.tokTypes.parenL:var A=this.storeCurrentPos();this.next();var U=this.parseExpression();if(this.expect(t.tokTypes.parenR),this.eat(t.tokTypes.arrow)){var M=U.expressions||[U];return M.length&&i(M[M.length-1])&&M.pop(),this.parseArrowExpression(this.startNodeAt(A),M)}if(this.options.preserveParens){var c=this.startNodeAt(A);c.expression=U,U=this.finishNode(c,\\"ParenthesizedExpression\\")}return U;case t.tokTypes.bracketL:return p=this.startNode(),p.elements=this.parseExprList(t.tokTypes.bracketR,!0),this.finishNode(p,\\"ArrayExpression\\");case t.tokTypes.braceL:return this.toks.overrideContext(t.tokContexts.b_expr),this.parseObj();case t.tokTypes._class:return this.parseClass(!1);case t.tokTypes._function:return p=this.startNode(),this.next(),this.parseFunction(p,!1);case t.tokTypes._new:return this.parseNew();case t.tokTypes.backQuote:return this.parseTemplate();case t.tokTypes._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.dummyIdent();default:return this.dummyIdent()}},g.parseExprImport=function(){var p=this.startNode(),h=this.parseIdent(!0);switch(this.tok.type){case t.tokTypes.parenL:return this.parseDynamicImport(p);case t.tokTypes.dot:return p.meta=h,this.parseImportMeta(p);default:return p.name=\\"import\\",this.finishNode(p,\\"Identifier\\")}},g.parseDynamicImport=function(p){var h=this.parseExprList(t.tokTypes.parenR);return p.source=h[0]||this.dummyString(),p.options=h[1]||null,this.finishNode(p,\\"ImportExpression\\")},g.parseImportMeta=function(p){return this.next(),p.property=this.parseIdent(!0),this.finishNode(p,\\"MetaProperty\\")},g.parseNew=function(){var p=this.startNode(),h=this.curIndent,T=this.curLineStart,x=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(t.tokTypes.dot))return p.meta=x,p.property=this.parseIdent(!0),this.finishNode(p,\\"MetaProperty\\");var w=this.storeCurrentPos();return p.callee=this.parseSubscripts(this.parseExprAtom(),w,!0,h,T),this.tok.type===t.tokTypes.parenL?p.arguments=this.parseExprList(t.tokTypes.parenR):p.arguments=[],this.finishNode(p,\\"NewExpression\\")},g.parseTemplateElement=function(){var p=this.startNode();return this.tok.type===t.tokTypes.invalidTemplate?p.value={raw:this.tok.value,cooked:null}:p.value={raw:this.input.slice(this.tok.start,this.tok.end).replace(/\\\\r\\\\n?/g,`\\n`),cooked:this.tok.value},this.next(),p.tail=this.tok.type===t.tokTypes.backQuote,this.finishNode(p,\\"TemplateElement\\")},g.parseTemplate=function(){var p=this.startNode();this.next(),p.expressions=[];var h=this.parseTemplateElement();for(p.quasis=[h];!h.tail;)this.next(),p.expressions.push(this.parseExpression()),this.expect(t.tokTypes.braceR)?h=this.parseTemplateElement():(h=this.startNode(),h.value={cooked:\\"\\",raw:\\"\\"},h.tail=!0,this.finishNode(h,\\"TemplateElement\\")),p.quasis.push(h);return this.expect(t.tokTypes.backQuote),this.finishNode(p,\\"TemplateLiteral\\")},g.parseObj=function(){var p=this.startNode();p.properties=[],this.pushCx();var h=this.curIndent+1,T=this.curLineStart;for(this.eat(t.tokTypes.braceL),this.curIndent+1=9&&this.eat(t.tokTypes.ellipsis)){x.argument=this.parseMaybeAssign(),p.properties.push(this.finishNode(x,\\"SpreadElement\\")),this.eat(t.tokTypes.comma);continue}if(this.options.ecmaVersion>=6&&(A=this.storeCurrentPos(),x.method=!1,x.shorthand=!1,w=this.eat(t.tokTypes.star)),this.parsePropertyName(x),this.toks.isAsyncProp(x)?(S=!0,w=this.options.ecmaVersion>=9&&this.eat(t.tokTypes.star),this.parsePropertyName(x)):S=!1,i(x.key)){i(this.parseMaybeAssign())&&this.next(),this.eat(t.tokTypes.comma);continue}if(this.eat(t.tokTypes.colon))x.kind=\\"init\\",x.value=this.parseMaybeAssign();else if(this.options.ecmaVersion>=6&&(this.tok.type===t.tokTypes.parenL||this.tok.type===t.tokTypes.braceL))x.kind=\\"init\\",x.method=!0,x.value=this.parseMethod(w,S);else if(this.options.ecmaVersion>=5&&x.key.type===\\"Identifier\\"&&!x.computed&&(x.key.name===\\"get\\"||x.key.name===\\"set\\")&&this.tok.type!==t.tokTypes.comma&&this.tok.type!==t.tokTypes.braceR&&this.tok.type!==t.tokTypes.eq)x.kind=x.key.name,this.parsePropertyName(x),x.value=this.parseMethod(!1);else{if(x.kind=\\"init\\",this.options.ecmaVersion>=6)if(this.eat(t.tokTypes.eq)){var U=this.startNodeAt(A);U.operator=\\"=\\",U.left=x.key,U.right=this.parseMaybeAssign(),x.value=this.finishNode(U,\\"AssignmentExpression\\")}else x.value=x.key;else x.value=this.dummyIdent();x.shorthand=!0}p.properties.push(this.finishNode(x,\\"Property\\")),this.eat(t.tokTypes.comma)}return this.popCx(),this.eat(t.tokTypes.braceR)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),this.finishNode(p,\\"ObjectExpression\\")},g.parsePropertyName=function(p){if(this.options.ecmaVersion>=6)if(this.eat(t.tokTypes.bracketL)){p.computed=!0,p.key=this.parseExpression(),this.expect(t.tokTypes.bracketR);return}else p.computed=!1;var h=this.tok.type===t.tokTypes.num||this.tok.type===t.tokTypes.string?this.parseExprAtom():this.parseIdent();p.key=h||this.dummyIdent()},g.parsePropertyAccessor=function(){if(this.tok.type===t.tokTypes.name||this.tok.type.keyword)return this.parseIdent();if(this.tok.type===t.tokTypes.privateId)return this.parsePrivateIdent()},g.parseIdent=function(){var p=this.tok.type===t.tokTypes.name?this.tok.value:this.tok.type.keyword;if(!p)return this.dummyIdent();this.tok.type.keyword&&(this.toks.type=t.tokTypes.name);var h=this.startNode();return this.next(),h.name=p,this.finishNode(h,\\"Identifier\\")},g.parsePrivateIdent=function(){var p=this.startNode();return p.name=this.tok.value,this.next(),this.finishNode(p,\\"PrivateIdentifier\\")},g.initFunction=function(p){p.id=null,p.params=[],this.options.ecmaVersion>=6&&(p.generator=!1,p.expression=!1),this.options.ecmaVersion>=8&&(p.async=!1)},g.toAssignable=function(p,h){if(!(!p||p.type===\\"Identifier\\"||p.type===\\"MemberExpression\\"&&!h))if(p.type===\\"ParenthesizedExpression\\")this.toAssignable(p.expression,h);else{if(this.options.ecmaVersion<6)return this.dummyIdent();if(p.type===\\"ObjectExpression\\"){p.type=\\"ObjectPattern\\";for(var T=0,x=p.properties;T=6&&(T.generator=!!p),this.options.ecmaVersion>=8&&(T.async=!!h),this.inAsync=T.async,this.inGenerator=T.generator,this.inFunction=!0,T.params=this.parseFunctionParams(),T.body=this.parseBlock(),this.toks.adaptDirectivePrologue(T.body.body),this.inAsync=x,this.inGenerator=w,this.inFunction=S,this.finishNode(T,\\"FunctionExpression\\")},g.parseArrowExpression=function(p,h,T){var x=this.inAsync,w=this.inGenerator,S=this.inFunction;return this.initFunction(p),this.options.ecmaVersion>=8&&(p.async=!!T),this.inAsync=p.async,this.inGenerator=!1,this.inFunction=!0,p.params=this.toAssignableList(h,!0),p.expression=this.tok.type!==t.tokTypes.braceL,p.expression?p.body=this.parseMaybeAssign():(p.body=this.parseBlock(),this.toks.adaptDirectivePrologue(p.body.body)),this.inAsync=x,this.inGenerator=w,this.inFunction=S,this.finishNode(p,\\"ArrowFunctionExpression\\")},g.parseExprList=function(p,h){this.pushCx();var T=this.curIndent,x=this.curLineStart,w=[];for(this.next();!this.closes(p,T+1,x);){if(this.eat(t.tokTypes.comma)){w.push(h?null:this.dummyIdent());continue}var S=this.parseMaybeAssign();if(i(S)){if(this.closes(p,T,x))break;this.next()}else w.push(S);this.eat(t.tokTypes.comma)}return this.popCx(),this.eat(p)||(this.last.end=this.tok.start,this.options.locations&&(this.last.loc.end=this.tok.loc.start)),w},g.parseAwait=function(){var p=this.startNode();return this.next(),p.argument=this.parseMaybeUnary(),this.finishNode(p,\\"AwaitExpression\\")},t.defaultOptions.tabSize=4;function L(p,h){return a.parse(p,h)}e.LooseParser=a,e.isDummy=i,e.parse=L})});var Vo=Li(),Ug=Jc(),dr=e1(),Hg=uf(),Tf=df(),Os=null;function kf(){return new Proxy({},{get:function(e,t){if(t in e)return e[t];var s=String(t).split(\\"#\\"),i=s[0],r=s[1]||\\"default\\",a={id:i,chunks:[i],name:r,async:!0};return e[t]=a,a}})}var Nc={};function mf(e,t,s){var i=dr.registerServerReference(e,t,s),r=t+\\"#\\"+s;return Nc[r]=e,i}function Wg(e){if(e.indexOf(\\"use client\\")===-1&&e.indexOf(\\"use server\\")===-1)return null;try{var t=Tf.parse(e,{ecmaVersion:\\"2024\\",sourceType:\\"source\\"}).body}catch{return null}for(var s=0;s0&&T.body&&T.body.type===\\"BlockStatement\\")for(var S=T.body.body,A=0;A 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return
Hi
;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n" as string;
diff --git a/src/components/MDX/Sandpack/templateRSC.ts b/src/components/MDX/Sandpack/templateRSC.ts
index efc4c940cfc..0917546926d 100644
--- a/src/components/MDX/Sandpack/templateRSC.ts
+++ b/src/components/MDX/Sandpack/templateRSC.ts
@@ -6,6 +6,14 @@
*/
import type {SandpackFiles} from '@codesandbox/sandpack-react/unstyled';
+import {
+ REACT_REFRESH_INIT_SOURCE,
+ REACT_REFRESH_RUNTIME_SOURCE,
+ RSC_CLIENT_SOURCE,
+ RSDW_CLIENT_SOURCE,
+ WEBPACK_SHIM_SOURCE,
+ WORKER_BUNDLE_MODULE_SOURCE,
+} from './sandpack-rsc/generatedSources';
function hideFiles(files: SandpackFiles): SandpackFiles {
return Object.fromEntries(
@@ -16,34 +24,6 @@ function hideFiles(files: SandpackFiles): SandpackFiles {
);
}
-// --- Load RSC infrastructure files as raw strings via raw-loader ---
-const RSC_SOURCE_FILES = {
- 'webpack-shim':
- require('!raw-loader?esModule=false!./sandpack-rsc/sandbox-code/src/webpack-shim.js') as string,
- 'rsc-client':
- require('!raw-loader?esModule=false!./sandpack-rsc/sandbox-code/src/rsc-client.js') as string,
- 'react-refresh-init':
- require('!raw-loader?esModule=false!./sandpack-rsc/sandbox-code/src/__react_refresh_init__.js') as string,
- 'worker-bundle': `export default ${JSON.stringify(
- require('!raw-loader?esModule=false!./sandpack-rsc/sandbox-code/src/worker-bundle.dist.js') as string
- )};`,
- 'rsdw-client':
- require('!raw-loader?esModule=false!../../../../node_modules/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js') as string,
-};
-
-// Load react-refresh runtime and strip the process.env.NODE_ENV guard
-// so it works in Sandpack's bundler which may not replace process.env.
-const reactRefreshRaw =
- require('!raw-loader?esModule=false!../../../../node_modules/next/dist/compiled/react-refresh/cjs/react-refresh-runtime.development.js') as string;
-
-// Wrap as a CJS module that Sandpack can require.
-// Strip the `if (process.env.NODE_ENV !== "production")` guard so the
-// runtime always executes inside the sandbox.
-const reactRefreshModule = reactRefreshRaw.replace(
- /if \(process\.env\.NODE_ENV !== "production"\) \{/,
- '{'
-);
-
// Entry point that bootstraps the RSC client pipeline.
// __react_refresh_init__ must be imported BEFORE rsc-client so the
// DevTools hook stub exists before React's renderer loads.
@@ -72,19 +52,19 @@ export const templateRSC: SandpackFiles = {
...hideFiles({
'/public/index.html': indexHTML,
'/src/index.js': indexEntry,
- '/src/__react_refresh_init__.js': RSC_SOURCE_FILES['react-refresh-init'],
- '/src/rsc-client.js': RSC_SOURCE_FILES['rsc-client'],
- '/src/rsc-server.js': RSC_SOURCE_FILES['worker-bundle'],
- '/src/__webpack_shim__.js': RSC_SOURCE_FILES['webpack-shim'],
+ '/src/__react_refresh_init__.js': REACT_REFRESH_INIT_SOURCE,
+ '/src/rsc-client.js': RSC_CLIENT_SOURCE,
+ '/src/rsc-server.js': WORKER_BUNDLE_MODULE_SOURCE,
+ '/src/__webpack_shim__.js': WEBPACK_SHIM_SOURCE,
// RSDW client as a Sandpack local dependency (bypasses Babel bundler)
'/node_modules/react-server-dom-webpack/package.json':
'{"name":"react-server-dom-webpack","main":"index.js"}',
'/node_modules/react-server-dom-webpack/client.browser.js':
- RSC_SOURCE_FILES['rsdw-client'],
+ RSDW_CLIENT_SOURCE,
// react-refresh runtime as a Sandpack local dependency
'/node_modules/react-refresh/package.json':
'{"name":"react-refresh","main":"runtime.js"}',
- '/node_modules/react-refresh/runtime.js': reactRefreshModule,
+ '/node_modules/react-refresh/runtime.js': REACT_REFRESH_RUNTIME_SOURCE,
'/package.json': JSON.stringify(
{
name: 'react.dev',
diff --git a/src/components/MDX/TerminalBlock.tsx b/src/components/MDX/TerminalBlock.tsx
index 0fd0160d665..e23086257c0 100644
--- a/src/components/MDX/TerminalBlock.tsx
+++ b/src/components/MDX/TerminalBlock.tsx
@@ -1,3 +1,5 @@
+'use client';
+
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -9,7 +11,7 @@
* Copyright (c) Facebook, Inc. and its affiliates.
*/
-import {isValidElement, useState, useEffect} from 'react';
+import {Children, isValidElement, useState, useEffect} from 'react';
import * as React from 'react';
import {IconTerminal} from '../Icon/IconTerminal';
import {IconCopy} from 'components/Icon/IconCopy';
@@ -21,6 +23,26 @@ interface TerminalBlockProps {
children: React.ReactNode;
}
+function getTerminalText(node: React.ReactNode): string {
+ let text = '';
+
+ Children.forEach(node, (child) => {
+ if (typeof child === 'string' || typeof child === 'number') {
+ text += child;
+ return;
+ }
+
+ if (!isValidElement(child)) {
+ return;
+ }
+
+ const props = child.props as {children?: React.ReactNode} | null;
+ text += getTerminalText(props?.children ?? null);
+ });
+
+ return text;
+}
+
function LevelText({type}: {type: LogLevel}) {
switch (type) {
case 'warning':
@@ -33,17 +55,8 @@ function LevelText({type}: {type: LogLevel}) {
}
function TerminalBlock({level = 'info', children}: TerminalBlockProps) {
- let message: string | undefined;
- if (typeof children === 'string') {
- message = children;
- } else if (
- isValidElement(children) &&
- typeof (children as React.ReactElement<{children: string}>).props
- .children === 'string'
- ) {
- message = (children as React.ReactElement<{children: string}>).props
- .children;
- } else {
+ const message = getTerminalText(children).trim();
+ if (message.length === 0) {
throw Error('Expected TerminalBlock children to be a plain string.');
}
@@ -70,7 +83,7 @@ function TerminalBlock({level = 'info', children}: TerminalBlockProps) {