diff --git a/.gitattributes b/.gitattributes index 0b8eb376bf0e6641eea12d66698f1840321ca921..53c917795b92e821db9d2fcb983475bc9304f5d2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -83,3 +83,5 @@ e-commerce/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node filter=lfs e-commerce/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text e-commerce/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text e-commerce/node_modules/@typescript/typescript-linux-x64/lib/tsc filter=lfs diff=lfs merge=lfs -text +e-commerce/node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text +e-commerce/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js new file mode 100644 index 0000000000000000000000000000000000000000..b51b92d7db8f83b3cd9d7c727c9f55f60e473174 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js @@ -0,0 +1,690 @@ +import { entityKind, is } from "../../entity.js"; +import { TypedQueryBuilder } from "../../query-builders/query-builder.js"; +import { QueryPromise } from "../../query-promise.js"; +import { SelectionProxyHandler } from "../../selection-proxy.js"; +import { SQL, View } from "../../sql/sql.js"; +import { Subquery } from "../../subquery.js"; +import { Table } from "../../table.js"; +import { + applyMixins, + getTableColumns, + getTableLikeName, + haveSameKeys, + orderSelectedFields +} from "../../utils.js"; +import { ViewBaseConfig } from "../../view-common.js"; +import { extractUsedTable } from "../utils.js"; +import { SQLiteViewBase } from "../view-base.js"; +class SQLiteSelectBuilder { + static [entityKind] = "SQLiteSelectBuilder"; + fields; + session; + dialect; + withList; + distinct; + constructor(config) { + this.fields = config.fields; + this.session = config.session; + this.dialect = config.dialect; + this.withList = config.withList; + this.distinct = config.distinct; + } + from(source) { + const isPartialSelect = !!this.fields; + let fields; + if (this.fields) { + fields = this.fields; + } else if (is(source, Subquery)) { + fields = Object.fromEntries( + Object.keys(source._.selectedFields).map((key) => [key, source[key]]) + ); + } else if (is(source, SQLiteViewBase)) { + fields = source[ViewBaseConfig].selectedFields; + } else if (is(source, SQL)) { + fields = {}; + } else { + fields = getTableColumns(source); + } + return new SQLiteSelectBase({ + table: source, + fields, + isPartialSelect, + session: this.session, + dialect: this.dialect, + withList: this.withList, + distinct: this.distinct + }); + } +} +class SQLiteSelectQueryBuilderBase extends TypedQueryBuilder { + static [entityKind] = "SQLiteSelectQueryBuilder"; + _; + /** @internal */ + config; + joinsNotNullableMap; + tableName; + isPartialSelect; + session; + dialect; + cacheConfig = void 0; + usedTables = /* @__PURE__ */ new Set(); + constructor({ table, fields, isPartialSelect, session, dialect, withList, distinct }) { + super(); + this.config = { + withList, + table, + fields: { ...fields }, + distinct, + setOperators: [] + }; + this.isPartialSelect = isPartialSelect; + this.session = session; + this.dialect = dialect; + this._ = { + selectedFields: fields, + config: this.config + }; + this.tableName = getTableLikeName(table); + this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {}; + for (const item of extractUsedTable(table)) this.usedTables.add(item); + } + /** @internal */ + getUsedTables() { + return [...this.usedTables]; + } + createJoin(joinType) { + return (table, on) => { + const baseTableName = this.tableName; + const tableName = getTableLikeName(table); + for (const item of extractUsedTable(table)) this.usedTables.add(item); + if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) { + throw new Error(`Alias "${tableName}" is already used in this query`); + } + if (!this.isPartialSelect) { + if (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === "string") { + this.config.fields = { + [baseTableName]: this.config.fields + }; + } + if (typeof tableName === "string" && !is(table, SQL)) { + const selection = is(table, Subquery) ? table._.selectedFields : is(table, View) ? table[ViewBaseConfig].selectedFields : table[Table.Symbol.Columns]; + this.config.fields[tableName] = selection; + } + } + if (typeof on === "function") { + on = on( + new Proxy( + this.config.fields, + new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ) + ); + } + if (!this.config.joins) { + this.config.joins = []; + } + this.config.joins.push({ on, table, joinType, alias: tableName }); + if (typeof tableName === "string") { + switch (joinType) { + case "left": { + this.joinsNotNullableMap[tableName] = false; + break; + } + case "right": { + this.joinsNotNullableMap = Object.fromEntries( + Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]) + ); + this.joinsNotNullableMap[tableName] = true; + break; + } + case "cross": + case "inner": { + this.joinsNotNullableMap[tableName] = true; + break; + } + case "full": { + this.joinsNotNullableMap = Object.fromEntries( + Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false]) + ); + this.joinsNotNullableMap[tableName] = false; + break; + } + } + } + return this; + }; + } + /** + * Executes a `left join` operation by adding another table to the current query. + * + * Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null. + * + * See docs: {@link https://orm.drizzle.team/docs/joins#left-join} + * + * @param table the table to join. + * @param on the `on` clause. + * + * @example + * + * ```ts + * // Select all users and their pets + * const usersWithPets: { user: User; pets: Pet | null; }[] = await db.select() + * .from(users) + * .leftJoin(pets, eq(users.id, pets.ownerId)) + * + * // Select userId and petId + * const usersIdsAndPetIds: { userId: number; petId: number | null; }[] = await db.select({ + * userId: users.id, + * petId: pets.id, + * }) + * .from(users) + * .leftJoin(pets, eq(users.id, pets.ownerId)) + * ``` + */ + leftJoin = this.createJoin("left"); + /** + * Executes a `right join` operation by adding another table to the current query. + * + * Calling this method associates each row of the joined table with the corresponding row from the main table, if a match is found. If no matching row exists, it sets all columns of the main table to null. + * + * See docs: {@link https://orm.drizzle.team/docs/joins#right-join} + * + * @param table the table to join. + * @param on the `on` clause. + * + * @example + * + * ```ts + * // Select all users and their pets + * const usersWithPets: { user: User | null; pets: Pet; }[] = await db.select() + * .from(users) + * .rightJoin(pets, eq(users.id, pets.ownerId)) + * + * // Select userId and petId + * const usersIdsAndPetIds: { userId: number | null; petId: number; }[] = await db.select({ + * userId: users.id, + * petId: pets.id, + * }) + * .from(users) + * .rightJoin(pets, eq(users.id, pets.ownerId)) + * ``` + */ + rightJoin = this.createJoin("right"); + /** + * Executes an `inner join` operation, creating a new table by combining rows from two tables that have matching values. + * + * Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs. + * + * See docs: {@link https://orm.drizzle.team/docs/joins#inner-join} + * + * @param table the table to join. + * @param on the `on` clause. + * + * @example + * + * ```ts + * // Select all users and their pets + * const usersWithPets: { user: User; pets: Pet; }[] = await db.select() + * .from(users) + * .innerJoin(pets, eq(users.id, pets.ownerId)) + * + * // Select userId and petId + * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({ + * userId: users.id, + * petId: pets.id, + * }) + * .from(users) + * .innerJoin(pets, eq(users.id, pets.ownerId)) + * ``` + */ + innerJoin = this.createJoin("inner"); + /** + * Executes a `full join` operation by combining rows from two tables into a new table. + * + * Calling this method retrieves all rows from both main and joined tables, merging rows with matching values and filling in `null` for non-matching columns. + * + * See docs: {@link https://orm.drizzle.team/docs/joins#full-join} + * + * @param table the table to join. + * @param on the `on` clause. + * + * @example + * + * ```ts + * // Select all users and their pets + * const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select() + * .from(users) + * .fullJoin(pets, eq(users.id, pets.ownerId)) + * + * // Select userId and petId + * const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({ + * userId: users.id, + * petId: pets.id, + * }) + * .from(users) + * .fullJoin(pets, eq(users.id, pets.ownerId)) + * ``` + */ + fullJoin = this.createJoin("full"); + /** + * Executes a `cross join` operation by combining rows from two tables into a new table. + * + * Calling this method retrieves all rows from both main and joined tables, merging all rows from each table. + * + * See docs: {@link https://orm.drizzle.team/docs/joins#cross-join} + * + * @param table the table to join. + * + * @example + * + * ```ts + * // Select all users, each user with every pet + * const usersWithPets: { user: User; pets: Pet; }[] = await db.select() + * .from(users) + * .crossJoin(pets) + * + * // Select userId and petId + * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({ + * userId: users.id, + * petId: pets.id, + * }) + * .from(users) + * .crossJoin(pets) + * ``` + */ + crossJoin = this.createJoin("cross"); + createSetOperator(type, isAll) { + return (rightSelection) => { + const rightSelect = typeof rightSelection === "function" ? rightSelection(getSQLiteSetOperators()) : rightSelection; + if (!haveSameKeys(this.getSelectedFields(), rightSelect.getSelectedFields())) { + throw new Error( + "Set operator error (union / intersect / except): selected fields are not the same or are in a different order" + ); + } + this.config.setOperators.push({ type, isAll, rightSelect }); + return this; + }; + } + /** + * Adds `union` set operator to the query. + * + * Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them. + * + * See docs: {@link https://orm.drizzle.team/docs/set-operations#union} + * + * @example + * + * ```ts + * // Select all unique names from customers and users tables + * await db.select({ name: users.name }) + * .from(users) + * .union( + * db.select({ name: customers.name }).from(customers) + * ); + * // or + * import { union } from 'drizzle-orm/sqlite-core' + * + * await union( + * db.select({ name: users.name }).from(users), + * db.select({ name: customers.name }).from(customers) + * ); + * ``` + */ + union = this.createSetOperator("union", false); + /** + * Adds `union all` set operator to the query. + * + * Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them. + * + * See docs: {@link https://orm.drizzle.team/docs/set-operations#union-all} + * + * @example + * + * ```ts + * // Select all transaction ids from both online and in-store sales + * await db.select({ transaction: onlineSales.transactionId }) + * .from(onlineSales) + * .unionAll( + * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales) + * ); + * // or + * import { unionAll } from 'drizzle-orm/sqlite-core' + * + * await unionAll( + * db.select({ transaction: onlineSales.transactionId }).from(onlineSales), + * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales) + * ); + * ``` + */ + unionAll = this.createSetOperator("union", true); + /** + * Adds `intersect` set operator to the query. + * + * Calling this method will retain only the rows that are present in both result sets and eliminate duplicates. + * + * See docs: {@link https://orm.drizzle.team/docs/set-operations#intersect} + * + * @example + * + * ```ts + * // Select course names that are offered in both departments A and B + * await db.select({ courseName: depA.courseName }) + * .from(depA) + * .intersect( + * db.select({ courseName: depB.courseName }).from(depB) + * ); + * // or + * import { intersect } from 'drizzle-orm/sqlite-core' + * + * await intersect( + * db.select({ courseName: depA.courseName }).from(depA), + * db.select({ courseName: depB.courseName }).from(depB) + * ); + * ``` + */ + intersect = this.createSetOperator("intersect", false); + /** + * Adds `except` set operator to the query. + * + * Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query. + * + * See docs: {@link https://orm.drizzle.team/docs/set-operations#except} + * + * @example + * + * ```ts + * // Select all courses offered in department A but not in department B + * await db.select({ courseName: depA.courseName }) + * .from(depA) + * .except( + * db.select({ courseName: depB.courseName }).from(depB) + * ); + * // or + * import { except } from 'drizzle-orm/sqlite-core' + * + * await except( + * db.select({ courseName: depA.courseName }).from(depA), + * db.select({ courseName: depB.courseName }).from(depB) + * ); + * ``` + */ + except = this.createSetOperator("except", false); + /** @internal */ + addSetOperators(setOperators) { + this.config.setOperators.push(...setOperators); + return this; + } + /** + * Adds a `where` clause to the query. + * + * Calling this method will select only those rows that fulfill a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/select#filtering} + * + * @param where the `where` clause. + * + * @example + * You can use conditional operators and `sql function` to filter the rows to be selected. + * + * ```ts + * // Select all cars with green color + * await db.select().from(cars).where(eq(cars.color, 'green')); + * // or + * await db.select().from(cars).where(sql`${cars.color} = 'green'`) + * ``` + * + * You can logically combine conditional operators with `and()` and `or()` operators: + * + * ```ts + * // Select all BMW cars with a green color + * await db.select().from(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); + * + * // Select all cars with the green or blue color + * await db.select().from(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); + * ``` + */ + where(where) { + if (typeof where === "function") { + where = where( + new Proxy( + this.config.fields, + new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ) + ); + } + this.config.where = where; + return this; + } + /** + * Adds a `having` clause to the query. + * + * Calling this method will select only those rows that fulfill a specified condition. It is typically used with aggregate functions to filter the aggregated data based on a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/select#aggregations} + * + * @param having the `having` clause. + * + * @example + * + * ```ts + * // Select all brands with more than one car + * await db.select({ + * brand: cars.brand, + * count: sql`cast(count(${cars.id}) as int)`, + * }) + * .from(cars) + * .groupBy(cars.brand) + * .having(({ count }) => gt(count, 1)); + * ``` + */ + having(having) { + if (typeof having === "function") { + having = having( + new Proxy( + this.config.fields, + new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ) + ); + } + this.config.having = having; + return this; + } + groupBy(...columns) { + if (typeof columns[0] === "function") { + const groupBy = columns[0]( + new Proxy( + this.config.fields, + new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) + ) + ); + this.config.groupBy = Array.isArray(groupBy) ? groupBy : [groupBy]; + } else { + this.config.groupBy = columns; + } + return this; + } + orderBy(...columns) { + if (typeof columns[0] === "function") { + const orderBy = columns[0]( + new Proxy( + this.config.fields, + new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) + ) + ); + const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; + if (this.config.setOperators.length > 0) { + this.config.setOperators.at(-1).orderBy = orderByArray; + } else { + this.config.orderBy = orderByArray; + } + } else { + const orderByArray = columns; + if (this.config.setOperators.length > 0) { + this.config.setOperators.at(-1).orderBy = orderByArray; + } else { + this.config.orderBy = orderByArray; + } + } + return this; + } + /** + * Adds a `limit` clause to the query. + * + * Calling this method will set the maximum number of rows that will be returned by this query. + * + * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset} + * + * @param limit the `limit` clause. + * + * @example + * + * ```ts + * // Get the first 10 people from this query. + * await db.select().from(people).limit(10); + * ``` + */ + limit(limit) { + if (this.config.setOperators.length > 0) { + this.config.setOperators.at(-1).limit = limit; + } else { + this.config.limit = limit; + } + return this; + } + /** + * Adds an `offset` clause to the query. + * + * Calling this method will skip a number of rows when returning results from this query. + * + * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset} + * + * @param offset the `offset` clause. + * + * @example + * + * ```ts + * // Get the 10th-20th people from this query. + * await db.select().from(people).offset(10).limit(10); + * ``` + */ + offset(offset) { + if (this.config.setOperators.length > 0) { + this.config.setOperators.at(-1).offset = offset; + } else { + this.config.offset = offset; + } + return this; + } + /** @internal */ + getSQL() { + return this.dialect.buildSelectQuery(this.config); + } + toSQL() { + const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); + return rest; + } + as(alias) { + const usedTables = []; + usedTables.push(...extractUsedTable(this.config.table)); + if (this.config.joins) { + for (const it of this.config.joins) usedTables.push(...extractUsedTable(it.table)); + } + return new Proxy( + new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]), + new SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) + ); + } + /** @internal */ + getSelectedFields() { + return new Proxy( + this.config.fields, + new SelectionProxyHandler({ alias: this.tableName, sqlAliasedBehavior: "alias", sqlBehavior: "error" }) + ); + } + $dynamic() { + return this; + } +} +class SQLiteSelectBase extends SQLiteSelectQueryBuilderBase { + static [entityKind] = "SQLiteSelect"; + /** @internal */ + _prepare(isOneTimeQuery = true) { + if (!this.session) { + throw new Error("Cannot execute a query on a query builder. Please use a database instance instead."); + } + const fieldsList = orderSelectedFields(this.config.fields); + const query = this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( + this.dialect.sqlToQuery(this.getSQL()), + fieldsList, + "all", + true, + void 0, + { + type: "select", + tables: [...this.usedTables] + }, + this.cacheConfig + ); + query.joinsNotNullableMap = this.joinsNotNullableMap; + return query; + } + $withCache(config) { + this.cacheConfig = config === void 0 ? { config: {}, enable: true, autoInvalidate: true } : config === false ? { enable: false } : { enable: true, autoInvalidate: true, ...config }; + return this; + } + prepare() { + return this._prepare(false); + } + run = (placeholderValues) => { + return this._prepare().run(placeholderValues); + }; + all = (placeholderValues) => { + return this._prepare().all(placeholderValues); + }; + get = (placeholderValues) => { + return this._prepare().get(placeholderValues); + }; + values = (placeholderValues) => { + return this._prepare().values(placeholderValues); + }; + async execute() { + return this.all(); + } +} +applyMixins(SQLiteSelectBase, [QueryPromise]); +function createSetOperator(type, isAll) { + return (leftSelect, rightSelect, ...restSelects) => { + const setOperators = [rightSelect, ...restSelects].map((select) => ({ + type, + isAll, + rightSelect: select + })); + for (const setOperator of setOperators) { + if (!haveSameKeys(leftSelect.getSelectedFields(), setOperator.rightSelect.getSelectedFields())) { + throw new Error( + "Set operator error (union / intersect / except): selected fields are not the same or are in a different order" + ); + } + } + return leftSelect.addSetOperators(setOperators); + }; +} +const getSQLiteSetOperators = () => ({ + union, + unionAll, + intersect, + except +}); +const union = createSetOperator("union", false); +const unionAll = createSetOperator("union", true); +const intersect = createSetOperator("intersect", false); +const except = createSetOperator("except", false); +export { + SQLiteSelectBase, + SQLiteSelectBuilder, + SQLiteSelectQueryBuilderBase, + except, + intersect, + union, + unionAll +}; +//# sourceMappingURL=select.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7eadcd2c0528b395997a4c50d1b2cccf221530f2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/sqlite-core/query-builders/select.ts"],"sourcesContent":["import type { CacheConfig, WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type {\n\tBuildSubquerySelection,\n\tGetSelectTableName,\n\tGetSelectTableSelection,\n\tJoinNullability,\n\tJoinType,\n\tSelectMode,\n\tSelectResult,\n\tSetOperator,\n} from '~/query-builders/select.types.ts';\nimport { QueryPromise } from '~/query-promise.ts';\nimport type { RunnableQuery } from '~/runnable-query.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { SQL, View } from '~/sql/sql.ts';\nimport type { ColumnsSelection, Placeholder, Query, SQLWrapper } from '~/sql/sql.ts';\nimport type { SQLiteColumn } from '~/sqlite-core/columns/index.ts';\nimport type { SQLiteDialect } from '~/sqlite-core/dialect.ts';\nimport type { SQLiteSession } from '~/sqlite-core/session.ts';\nimport type { SubqueryWithSelection } from '~/sqlite-core/subquery.ts';\nimport type { SQLiteTable } from '~/sqlite-core/table.ts';\nimport { Subquery } from '~/subquery.ts';\nimport { Table } from '~/table.ts';\nimport {\n\tapplyMixins,\n\tgetTableColumns,\n\tgetTableLikeName,\n\thaveSameKeys,\n\torderSelectedFields,\n\ttype ValueOrArray,\n} from '~/utils.ts';\nimport { ViewBaseConfig } from '~/view-common.ts';\nimport { extractUsedTable } from '../utils.ts';\nimport { SQLiteViewBase } from '../view-base.ts';\nimport type {\n\tAnySQLiteSelect,\n\tCreateSQLiteSelectFromBuilderMode,\n\tGetSQLiteSetOperators,\n\tSelectedFields,\n\tSetOperatorRightSelect,\n\tSQLiteCreateSetOperatorFn,\n\tSQLiteSelectConfig,\n\tSQLiteSelectCrossJoinFn,\n\tSQLiteSelectDynamic,\n\tSQLiteSelectExecute,\n\tSQLiteSelectHKT,\n\tSQLiteSelectHKTBase,\n\tSQLiteSelectJoinFn,\n\tSQLiteSelectPrepare,\n\tSQLiteSelectWithout,\n\tSQLiteSetOperatorExcludedMethods,\n\tSQLiteSetOperatorWithResult,\n} from './select.types.ts';\n\nexport class SQLiteSelectBuilder<\n\tTSelection extends SelectedFields | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTBuilderMode extends 'db' | 'qb' = 'db',\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteSelectBuilder';\n\n\tprivate fields: TSelection;\n\tprivate session: SQLiteSession | undefined;\n\tprivate dialect: SQLiteDialect;\n\tprivate withList: Subquery[] | undefined;\n\tprivate distinct: boolean | undefined;\n\n\tconstructor(\n\t\tconfig: {\n\t\t\tfields: TSelection;\n\t\t\tsession: SQLiteSession | undefined;\n\t\t\tdialect: SQLiteDialect;\n\t\t\twithList?: Subquery[];\n\t\t\tdistinct?: boolean;\n\t\t},\n\t) {\n\t\tthis.fields = config.fields;\n\t\tthis.session = config.session;\n\t\tthis.dialect = config.dialect;\n\t\tthis.withList = config.withList;\n\t\tthis.distinct = config.distinct;\n\t}\n\n\tfrom(\n\t\tsource: TFrom,\n\t): CreateSQLiteSelectFromBuilderMode<\n\t\tTBuilderMode,\n\t\tGetSelectTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection extends undefined ? GetSelectTableSelection : TSelection,\n\t\tTSelection extends undefined ? 'single' : 'partial'\n\t> {\n\t\tconst isPartialSelect = !!this.fields;\n\n\t\tlet fields: SelectedFields;\n\t\tif (this.fields) {\n\t\t\tfields = this.fields;\n\t\t} else if (is(source, Subquery)) {\n\t\t\t// This is required to use the proxy handler to get the correct field values from the subquery\n\t\t\tfields = Object.fromEntries(\n\t\t\t\tObject.keys(source._.selectedFields).map((\n\t\t\t\t\tkey,\n\t\t\t\t) => [key, source[key as unknown as keyof typeof source] as unknown as SelectedFields[string]]),\n\t\t\t);\n\t\t} else if (is(source, SQLiteViewBase)) {\n\t\t\tfields = source[ViewBaseConfig].selectedFields as SelectedFields;\n\t\t} else if (is(source, SQL)) {\n\t\t\tfields = {};\n\t\t} else {\n\t\t\tfields = getTableColumns(source);\n\t\t}\n\n\t\treturn new SQLiteSelectBase({\n\t\t\ttable: source,\n\t\t\tfields,\n\t\t\tisPartialSelect,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\twithList: this.withList,\n\t\t\tdistinct: this.distinct,\n\t\t}) as any;\n\t}\n}\n\nexport abstract class SQLiteSelectQueryBuilderBase<\n\tTHKT extends SQLiteSelectHKTBase,\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTSelectMode extends SelectMode,\n\tTNullabilityMap extends Record = TTableName extends string ? Record\n\t\t: {},\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n\tTResult extends any[] = SelectResult[],\n\tTSelectedFields extends ColumnsSelection = BuildSubquerySelection,\n> extends TypedQueryBuilder {\n\tstatic override readonly [entityKind]: string = 'SQLiteSelectQueryBuilder';\n\n\toverride readonly _: {\n\t\treadonly dialect: 'sqlite';\n\t\treadonly hkt: THKT;\n\t\treadonly tableName: TTableName;\n\t\treadonly resultType: TResultType;\n\t\treadonly runResult: TRunResult;\n\t\treadonly selection: TSelection;\n\t\treadonly selectMode: TSelectMode;\n\t\treadonly nullabilityMap: TNullabilityMap;\n\t\treadonly dynamic: TDynamic;\n\t\treadonly excludedMethods: TExcludedMethods;\n\t\treadonly result: TResult;\n\t\treadonly selectedFields: TSelectedFields;\n\t\treadonly config: SQLiteSelectConfig;\n\t};\n\n\t/** @internal */\n\tconfig: SQLiteSelectConfig;\n\tprotected joinsNotNullableMap: Record;\n\tprivate tableName: string | undefined;\n\tprivate isPartialSelect: boolean;\n\tprotected session: SQLiteSession | undefined;\n\tprotected dialect: SQLiteDialect;\n\tprotected cacheConfig?: WithCacheConfig = undefined;\n\tprotected usedTables: Set = new Set();\n\n\tconstructor(\n\t\t{ table, fields, isPartialSelect, session, dialect, withList, distinct }: {\n\t\t\ttable: SQLiteSelectConfig['table'];\n\t\t\tfields: SQLiteSelectConfig['fields'];\n\t\t\tisPartialSelect: boolean;\n\t\t\tsession: SQLiteSession | undefined;\n\t\t\tdialect: SQLiteDialect;\n\t\t\twithList: Subquery[] | undefined;\n\t\t\tdistinct: boolean | undefined;\n\t\t},\n\t) {\n\t\tsuper();\n\t\tthis.config = {\n\t\t\twithList,\n\t\t\ttable,\n\t\t\tfields: { ...fields },\n\t\t\tdistinct,\n\t\t\tsetOperators: [],\n\t\t};\n\t\tthis.isPartialSelect = isPartialSelect;\n\t\tthis.session = session;\n\t\tthis.dialect = dialect;\n\t\tthis._ = {\n\t\t\tselectedFields: fields as TSelectedFields,\n\t\t\tconfig: this.config,\n\t\t} as this['_'];\n\t\tthis.tableName = getTableLikeName(table);\n\t\tthis.joinsNotNullableMap = typeof this.tableName === 'string' ? { [this.tableName]: true } : {};\n\t\tfor (const item of extractUsedTable(table)) this.usedTables.add(item);\n\t}\n\n\t/** @internal */\n\tgetUsedTables() {\n\t\treturn [...this.usedTables];\n\t}\n\n\tprivate createJoin(\n\t\tjoinType: TJoinType,\n\t): 'cross' extends TJoinType ? SQLiteSelectCrossJoinFn\n\t\t: SQLiteSelectJoinFn\n\t{\n\t\treturn (\n\t\t\ttable: SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\t\t\ton?: ((aliases: TSelection) => SQL | undefined) | SQL | undefined,\n\t\t) => {\n\t\t\tconst baseTableName = this.tableName;\n\t\t\tconst tableName = getTableLikeName(table);\n\n\t\t\t// store all tables used in a query\n\t\t\tfor (const item of extractUsedTable(table)) this.usedTables.add(item);\n\n\t\t\tif (typeof tableName === 'string' && this.config.joins?.some((join) => join.alias === tableName)) {\n\t\t\t\tthrow new Error(`Alias \"${tableName}\" is already used in this query`);\n\t\t\t}\n\n\t\t\tif (!this.isPartialSelect) {\n\t\t\t\t// If this is the first join and this is not a partial select and we're not selecting from raw SQL, \"move\" the fields from the main table to the nested object\n\t\t\t\tif (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === 'string') {\n\t\t\t\t\tthis.config.fields = {\n\t\t\t\t\t\t[baseTableName]: this.config.fields,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (typeof tableName === 'string' && !is(table, SQL)) {\n\t\t\t\t\tconst selection = is(table, Subquery)\n\t\t\t\t\t\t? table._.selectedFields\n\t\t\t\t\t\t: is(table, View)\n\t\t\t\t\t\t? table[ViewBaseConfig].selectedFields\n\t\t\t\t\t\t: table[Table.Symbol.Columns];\n\t\t\t\t\tthis.config.fields[tableName] = selection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof on === 'function') {\n\t\t\t\ton = on(\n\t\t\t\t\tnew Proxy(\n\t\t\t\t\t\tthis.config.fields,\n\t\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t\t) as TSelection,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!this.config.joins) {\n\t\t\t\tthis.config.joins = [];\n\t\t\t}\n\t\t\tthis.config.joins.push({ on, table, joinType, alias: tableName });\n\n\t\t\tif (typeof tableName === 'string') {\n\t\t\t\tswitch (joinType) {\n\t\t\t\t\tcase 'left': {\n\t\t\t\t\t\tthis.joinsNotNullableMap[tableName] = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'right': {\n\t\t\t\t\t\tthis.joinsNotNullableMap = Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries(this.joinsNotNullableMap).map(([key]) => [key, false]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.joinsNotNullableMap[tableName] = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'cross':\n\t\t\t\t\tcase 'inner': {\n\t\t\t\t\t\tthis.joinsNotNullableMap[tableName] = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'full': {\n\t\t\t\t\t\tthis.joinsNotNullableMap = Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries(this.joinsNotNullableMap).map(([key]) => [key, false]),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.joinsNotNullableMap[tableName] = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this as any;\n\t\t};\n\t}\n\n\t/**\n\t * Executes a `left join` operation by adding another table to the current query.\n\t *\n\t * Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/joins#left-join}\n\t *\n\t * @param table the table to join.\n\t * @param on the `on` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all users and their pets\n\t * const usersWithPets: { user: User; pets: Pet | null; }[] = await db.select()\n\t * .from(users)\n\t * .leftJoin(pets, eq(users.id, pets.ownerId))\n\t *\n\t * // Select userId and petId\n\t * const usersIdsAndPetIds: { userId: number; petId: number | null; }[] = await db.select({\n\t * userId: users.id,\n\t * petId: pets.id,\n\t * })\n\t * .from(users)\n\t * .leftJoin(pets, eq(users.id, pets.ownerId))\n\t * ```\n\t */\n\tleftJoin = this.createJoin('left');\n\n\t/**\n\t * Executes a `right join` operation by adding another table to the current query.\n\t *\n\t * Calling this method associates each row of the joined table with the corresponding row from the main table, if a match is found. If no matching row exists, it sets all columns of the main table to null.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/joins#right-join}\n\t *\n\t * @param table the table to join.\n\t * @param on the `on` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all users and their pets\n\t * const usersWithPets: { user: User | null; pets: Pet; }[] = await db.select()\n\t * .from(users)\n\t * .rightJoin(pets, eq(users.id, pets.ownerId))\n\t *\n\t * // Select userId and petId\n\t * const usersIdsAndPetIds: { userId: number | null; petId: number; }[] = await db.select({\n\t * userId: users.id,\n\t * petId: pets.id,\n\t * })\n\t * .from(users)\n\t * .rightJoin(pets, eq(users.id, pets.ownerId))\n\t * ```\n\t */\n\trightJoin = this.createJoin('right');\n\n\t/**\n\t * Executes an `inner join` operation, creating a new table by combining rows from two tables that have matching values.\n\t *\n\t * Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/joins#inner-join}\n\t *\n\t * @param table the table to join.\n\t * @param on the `on` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all users and their pets\n\t * const usersWithPets: { user: User; pets: Pet; }[] = await db.select()\n\t * .from(users)\n\t * .innerJoin(pets, eq(users.id, pets.ownerId))\n\t *\n\t * // Select userId and petId\n\t * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({\n\t * userId: users.id,\n\t * petId: pets.id,\n\t * })\n\t * .from(users)\n\t * .innerJoin(pets, eq(users.id, pets.ownerId))\n\t * ```\n\t */\n\tinnerJoin = this.createJoin('inner');\n\n\t/**\n\t * Executes a `full join` operation by combining rows from two tables into a new table.\n\t *\n\t * Calling this method retrieves all rows from both main and joined tables, merging rows with matching values and filling in `null` for non-matching columns.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/joins#full-join}\n\t *\n\t * @param table the table to join.\n\t * @param on the `on` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all users and their pets\n\t * const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select()\n\t * .from(users)\n\t * .fullJoin(pets, eq(users.id, pets.ownerId))\n\t *\n\t * // Select userId and petId\n\t * const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({\n\t * userId: users.id,\n\t * petId: pets.id,\n\t * })\n\t * .from(users)\n\t * .fullJoin(pets, eq(users.id, pets.ownerId))\n\t * ```\n\t */\n\tfullJoin = this.createJoin('full');\n\n\t/**\n\t * Executes a `cross join` operation by combining rows from two tables into a new table.\n\t *\n\t * Calling this method retrieves all rows from both main and joined tables, merging all rows from each table.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/joins#cross-join}\n\t *\n\t * @param table the table to join.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all users, each user with every pet\n\t * const usersWithPets: { user: User; pets: Pet; }[] = await db.select()\n\t * .from(users)\n\t * .crossJoin(pets)\n\t *\n\t * // Select userId and petId\n\t * const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({\n\t * userId: users.id,\n\t * petId: pets.id,\n\t * })\n\t * .from(users)\n\t * .crossJoin(pets)\n\t * ```\n\t */\n\tcrossJoin = this.createJoin('cross');\n\n\tprivate createSetOperator(\n\t\ttype: SetOperator,\n\t\tisAll: boolean,\n\t): >(\n\t\trightSelection:\n\t\t\t| ((setOperators: GetSQLiteSetOperators) => SetOperatorRightSelect)\n\t\t\t| SetOperatorRightSelect,\n\t) => SQLiteSelectWithout<\n\t\tthis,\n\t\tTDynamic,\n\t\tSQLiteSetOperatorExcludedMethods,\n\t\ttrue\n\t> {\n\t\treturn (rightSelection) => {\n\t\t\tconst rightSelect = (typeof rightSelection === 'function'\n\t\t\t\t? rightSelection(getSQLiteSetOperators())\n\t\t\t\t: rightSelection) as TypedQueryBuilder<\n\t\t\t\t\tany,\n\t\t\t\t\tTResult\n\t\t\t\t>;\n\n\t\t\tif (!haveSameKeys(this.getSelectedFields(), rightSelect.getSelectedFields())) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Set operator error (union / intersect / except): selected fields are not the same or are in a different order',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.config.setOperators.push({ type, isAll, rightSelect });\n\t\t\treturn this as any;\n\t\t};\n\t}\n\n\t/**\n\t * Adds `union` set operator to the query.\n\t *\n\t * Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/set-operations#union}\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all unique names from customers and users tables\n\t * await db.select({ name: users.name })\n\t * .from(users)\n\t * .union(\n\t * db.select({ name: customers.name }).from(customers)\n\t * );\n\t * // or\n\t * import { union } from 'drizzle-orm/sqlite-core'\n\t *\n\t * await union(\n\t * db.select({ name: users.name }).from(users),\n\t * db.select({ name: customers.name }).from(customers)\n\t * );\n\t * ```\n\t */\n\tunion = this.createSetOperator('union', false);\n\n\t/**\n\t * Adds `union all` set operator to the query.\n\t *\n\t * Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/set-operations#union-all}\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all transaction ids from both online and in-store sales\n\t * await db.select({ transaction: onlineSales.transactionId })\n\t * .from(onlineSales)\n\t * .unionAll(\n\t * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)\n\t * );\n\t * // or\n\t * import { unionAll } from 'drizzle-orm/sqlite-core'\n\t *\n\t * await unionAll(\n\t * db.select({ transaction: onlineSales.transactionId }).from(onlineSales),\n\t * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)\n\t * );\n\t * ```\n\t */\n\tunionAll = this.createSetOperator('union', true);\n\n\t/**\n\t * Adds `intersect` set operator to the query.\n\t *\n\t * Calling this method will retain only the rows that are present in both result sets and eliminate duplicates.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/set-operations#intersect}\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select course names that are offered in both departments A and B\n\t * await db.select({ courseName: depA.courseName })\n\t * .from(depA)\n\t * .intersect(\n\t * db.select({ courseName: depB.courseName }).from(depB)\n\t * );\n\t * // or\n\t * import { intersect } from 'drizzle-orm/sqlite-core'\n\t *\n\t * await intersect(\n\t * db.select({ courseName: depA.courseName }).from(depA),\n\t * db.select({ courseName: depB.courseName }).from(depB)\n\t * );\n\t * ```\n\t */\n\tintersect = this.createSetOperator('intersect', false);\n\n\t/**\n\t * Adds `except` set operator to the query.\n\t *\n\t * Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/set-operations#except}\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all courses offered in department A but not in department B\n\t * await db.select({ courseName: depA.courseName })\n\t * .from(depA)\n\t * .except(\n\t * db.select({ courseName: depB.courseName }).from(depB)\n\t * );\n\t * // or\n\t * import { except } from 'drizzle-orm/sqlite-core'\n\t *\n\t * await except(\n\t * db.select({ courseName: depA.courseName }).from(depA),\n\t * db.select({ courseName: depB.courseName }).from(depB)\n\t * );\n\t * ```\n\t */\n\texcept = this.createSetOperator('except', false);\n\n\t/** @internal */\n\taddSetOperators(setOperators: SQLiteSelectConfig['setOperators']): SQLiteSelectWithout<\n\t\tthis,\n\t\tTDynamic,\n\t\tSQLiteSetOperatorExcludedMethods,\n\t\ttrue\n\t> {\n\t\tthis.config.setOperators.push(...setOperators);\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `where` clause to the query.\n\t *\n\t * Calling this method will select only those rows that fulfill a specified condition.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#filtering}\n\t *\n\t * @param where the `where` clause.\n\t *\n\t * @example\n\t * You can use conditional operators and `sql function` to filter the rows to be selected.\n\t *\n\t * ```ts\n\t * // Select all cars with green color\n\t * await db.select().from(cars).where(eq(cars.color, 'green'));\n\t * // or\n\t * await db.select().from(cars).where(sql`${cars.color} = 'green'`)\n\t * ```\n\t *\n\t * You can logically combine conditional operators with `and()` and `or()` operators:\n\t *\n\t * ```ts\n\t * // Select all BMW cars with a green color\n\t * await db.select().from(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));\n\t *\n\t * // Select all cars with the green or blue color\n\t * await db.select().from(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));\n\t * ```\n\t */\n\twhere(\n\t\twhere: ((aliases: TSelection) => SQL | undefined) | SQL | undefined,\n\t): SQLiteSelectWithout {\n\t\tif (typeof where === 'function') {\n\t\t\twhere = where(\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.fields,\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t) as TSelection,\n\t\t\t);\n\t\t}\n\t\tthis.config.where = where;\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `having` clause to the query.\n\t *\n\t * Calling this method will select only those rows that fulfill a specified condition. It is typically used with aggregate functions to filter the aggregated data based on a specified condition.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#aggregations}\n\t *\n\t * @param having the `having` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all brands with more than one car\n\t * await db.select({\n\t * \tbrand: cars.brand,\n\t * \tcount: sql`cast(count(${cars.id}) as int)`,\n\t * })\n\t * .from(cars)\n\t * .groupBy(cars.brand)\n\t * .having(({ count }) => gt(count, 1));\n\t * ```\n\t */\n\thaving(\n\t\thaving: ((aliases: this['_']['selection']) => SQL | undefined) | SQL | undefined,\n\t): SQLiteSelectWithout {\n\t\tif (typeof having === 'function') {\n\t\t\thaving = having(\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.fields,\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t) as TSelection,\n\t\t\t);\n\t\t}\n\t\tthis.config.having = having;\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `group by` clause to the query.\n\t *\n\t * Calling this method will group rows that have the same values into summary rows, often used for aggregation purposes.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#aggregations}\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Group and count people by their last names\n\t * await db.select({\n\t * lastName: people.lastName,\n\t * count: sql`cast(count(*) as int)`\n\t * })\n\t * .from(people)\n\t * .groupBy(people.lastName);\n\t * ```\n\t */\n\tgroupBy(\n\t\tbuilder: (aliases: this['_']['selection']) => ValueOrArray,\n\t): SQLiteSelectWithout;\n\tgroupBy(...columns: (SQLiteColumn | SQL)[]): SQLiteSelectWithout;\n\tgroupBy(\n\t\t...columns:\n\t\t\t| [(aliases: this['_']['selection']) => ValueOrArray]\n\t\t\t| (SQLiteColumn | SQL | SQL.Aliased)[]\n\t): SQLiteSelectWithout {\n\t\tif (typeof columns[0] === 'function') {\n\t\t\tconst groupBy = columns[0](\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.fields,\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'alias', sqlBehavior: 'sql' }),\n\t\t\t\t) as TSelection,\n\t\t\t);\n\t\t\tthis.config.groupBy = Array.isArray(groupBy) ? groupBy : [groupBy];\n\t\t} else {\n\t\t\tthis.config.groupBy = columns as (SQLiteColumn | SQL | SQL.Aliased)[];\n\t\t}\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds an `order by` clause to the query.\n\t *\n\t * Calling this method will sort the result-set in ascending or descending order. By default, the sort order is ascending.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#order-by}\n\t *\n\t * @example\n\t *\n\t * ```\n\t * // Select cars ordered by year\n\t * await db.select().from(cars).orderBy(cars.year);\n\t * ```\n\t *\n\t * You can specify whether results are in ascending or descending order with the `asc()` and `desc()` operators.\n\t *\n\t * ```ts\n\t * // Select cars ordered by year in descending order\n\t * await db.select().from(cars).orderBy(desc(cars.year));\n\t *\n\t * // Select cars ordered by year and price\n\t * await db.select().from(cars).orderBy(asc(cars.year), desc(cars.price));\n\t * ```\n\t */\n\torderBy(\n\t\tbuilder: (aliases: this['_']['selection']) => ValueOrArray,\n\t): SQLiteSelectWithout;\n\torderBy(...columns: (SQLiteColumn | SQL)[]): SQLiteSelectWithout;\n\torderBy(\n\t\t...columns:\n\t\t\t| [(aliases: this['_']['selection']) => ValueOrArray]\n\t\t\t| (SQLiteColumn | SQL | SQL.Aliased)[]\n\t): SQLiteSelectWithout {\n\t\tif (typeof columns[0] === 'function') {\n\t\t\tconst orderBy = columns[0](\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.fields,\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'alias', sqlBehavior: 'sql' }),\n\t\t\t\t) as TSelection,\n\t\t\t);\n\n\t\t\tconst orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];\n\n\t\t\tif (this.config.setOperators.length > 0) {\n\t\t\t\tthis.config.setOperators.at(-1)!.orderBy = orderByArray;\n\t\t\t} else {\n\t\t\t\tthis.config.orderBy = orderByArray;\n\t\t\t}\n\t\t} else {\n\t\t\tconst orderByArray = columns as (SQLiteColumn | SQL | SQL.Aliased)[];\n\n\t\t\tif (this.config.setOperators.length > 0) {\n\t\t\t\tthis.config.setOperators.at(-1)!.orderBy = orderByArray;\n\t\t\t} else {\n\t\t\t\tthis.config.orderBy = orderByArray;\n\t\t\t}\n\t\t}\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `limit` clause to the query.\n\t *\n\t * Calling this method will set the maximum number of rows that will be returned by this query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset}\n\t *\n\t * @param limit the `limit` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Get the first 10 people from this query.\n\t * await db.select().from(people).limit(10);\n\t * ```\n\t */\n\tlimit(limit: number | Placeholder): SQLiteSelectWithout {\n\t\tif (this.config.setOperators.length > 0) {\n\t\t\tthis.config.setOperators.at(-1)!.limit = limit;\n\t\t} else {\n\t\t\tthis.config.limit = limit;\n\t\t}\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds an `offset` clause to the query.\n\t *\n\t * Calling this method will skip a number of rows when returning results from this query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#limit--offset}\n\t *\n\t * @param offset the `offset` clause.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Get the 10th-20th people from this query.\n\t * await db.select().from(people).offset(10).limit(10);\n\t * ```\n\t */\n\toffset(offset: number | Placeholder): SQLiteSelectWithout {\n\t\tif (this.config.setOperators.length > 0) {\n\t\t\tthis.config.setOperators.at(-1)!.offset = offset;\n\t\t} else {\n\t\t\tthis.config.offset = offset;\n\t\t}\n\t\treturn this as any;\n\t}\n\n\t/** @internal */\n\tgetSQL(): SQL {\n\t\treturn this.dialect.buildSelectQuery(this.config);\n\t}\n\n\ttoSQL(): Query {\n\t\tconst { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());\n\t\treturn rest;\n\t}\n\n\tas(\n\t\talias: TAlias,\n\t): SubqueryWithSelection {\n\t\tconst usedTables: string[] = [];\n\t\tusedTables.push(...extractUsedTable(this.config.table));\n\t\tif (this.config.joins) { for (const it of this.config.joins) usedTables.push(...extractUsedTable(it.table)); }\n\n\t\treturn new Proxy(\n\t\t\tnew Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),\n\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t) as SubqueryWithSelection;\n\t}\n\n\t/** @internal */\n\toverride getSelectedFields(): this['_']['selectedFields'] {\n\t\treturn new Proxy(\n\t\t\tthis.config.fields,\n\t\t\tnew SelectionProxyHandler({ alias: this.tableName, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t) as this['_']['selectedFields'];\n\t}\n\n\t$dynamic(): SQLiteSelectDynamic {\n\t\treturn this;\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SQLiteSelectBase<\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTSelectMode extends SelectMode = 'single',\n\tTNullabilityMap extends Record = TTableName extends string ? Record\n\t\t: {},\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n\tTResult extends any[] = SelectResult[],\n\tTSelectedFields extends ColumnsSelection = BuildSubquerySelection,\n> extends\n\tSQLiteSelectQueryBuilderBase<\n\t\tSQLiteSelectHKT,\n\t\tTTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection,\n\t\tTSelectMode,\n\t\tTNullabilityMap,\n\t\tTDynamic,\n\t\tTExcludedMethods,\n\t\tTResult,\n\t\tTSelectedFields\n\t>,\n\tQueryPromise\n{}\n\nexport class SQLiteSelectBase<\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection,\n\tTSelectMode extends SelectMode = 'single',\n\tTNullabilityMap extends Record = TTableName extends string ? Record\n\t\t: {},\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n\tTResult = SelectResult[],\n\tTSelectedFields extends ColumnsSelection = BuildSubquerySelection,\n> extends SQLiteSelectQueryBuilderBase<\n\tSQLiteSelectHKT,\n\tTTableName,\n\tTResultType,\n\tTRunResult,\n\tTSelection,\n\tTSelectMode,\n\tTNullabilityMap,\n\tTDynamic,\n\tTExcludedMethods,\n\tTResult,\n\tTSelectedFields\n> implements RunnableQuery, SQLWrapper {\n\tstatic override readonly [entityKind]: string = 'SQLiteSelect';\n\n\t/** @internal */\n\t_prepare(isOneTimeQuery = true): SQLiteSelectPrepare {\n\t\tif (!this.session) {\n\t\t\tthrow new Error('Cannot execute a query on a query builder. Please use a database instance instead.');\n\t\t}\n\t\tconst fieldsList = orderSelectedFields(this.config.fields);\n\t\tconst query = this.session[isOneTimeQuery ? 'prepareOneTimeQuery' : 'prepareQuery'](\n\t\t\tthis.dialect.sqlToQuery(this.getSQL()),\n\t\t\tfieldsList,\n\t\t\t'all',\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttype: 'select',\n\t\t\t\ttables: [...this.usedTables],\n\t\t\t},\n\t\t\tthis.cacheConfig,\n\t\t);\n\t\tquery.joinsNotNullableMap = this.joinsNotNullableMap;\n\t\treturn query as ReturnType;\n\t}\n\n\t$withCache(config?: { config?: CacheConfig; tag?: string; autoInvalidate?: boolean } | false) {\n\t\tthis.cacheConfig = config === undefined\n\t\t\t? { config: {}, enable: true, autoInvalidate: true }\n\t\t\t: config === false\n\t\t\t? { enable: false }\n\t\t\t: { enable: true, autoInvalidate: true, ...config };\n\t\treturn this;\n\t}\n\n\tprepare(): SQLiteSelectPrepare {\n\t\treturn this._prepare(false);\n\t}\n\n\trun: ReturnType['run'] = (placeholderValues) => {\n\t\treturn this._prepare().run(placeholderValues);\n\t};\n\n\tall: ReturnType['all'] = (placeholderValues) => {\n\t\treturn this._prepare().all(placeholderValues);\n\t};\n\n\tget: ReturnType['get'] = (placeholderValues) => {\n\t\treturn this._prepare().get(placeholderValues);\n\t};\n\n\tvalues: ReturnType['values'] = (placeholderValues) => {\n\t\treturn this._prepare().values(placeholderValues);\n\t};\n\n\tasync execute(): Promise> {\n\t\treturn this.all() as SQLiteSelectExecute;\n\t}\n}\n\napplyMixins(SQLiteSelectBase, [QueryPromise]);\n\nfunction createSetOperator(type: SetOperator, isAll: boolean): SQLiteCreateSetOperatorFn {\n\treturn (leftSelect, rightSelect, ...restSelects) => {\n\t\tconst setOperators = [rightSelect, ...restSelects].map((select) => ({\n\t\t\ttype,\n\t\t\tisAll,\n\t\t\trightSelect: select as AnySQLiteSelect,\n\t\t}));\n\n\t\tfor (const setOperator of setOperators) {\n\t\t\tif (!haveSameKeys((leftSelect as any).getSelectedFields(), setOperator.rightSelect.getSelectedFields())) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Set operator error (union / intersect / except): selected fields are not the same or are in a different order',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn (leftSelect as AnySQLiteSelect).addSetOperators(setOperators) as any;\n\t};\n}\n\nconst getSQLiteSetOperators = () => ({\n\tunion,\n\tunionAll,\n\tintersect,\n\texcept,\n});\n\n/**\n * Adds `union` set operator to the query.\n *\n * Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them.\n *\n * See docs: {@link https://orm.drizzle.team/docs/set-operations#union}\n *\n * @example\n *\n * ```ts\n * // Select all unique names from customers and users tables\n * import { union } from 'drizzle-orm/sqlite-core'\n *\n * await union(\n * db.select({ name: users.name }).from(users),\n * db.select({ name: customers.name }).from(customers)\n * );\n * // or\n * await db.select({ name: users.name })\n * .from(users)\n * .union(\n * db.select({ name: customers.name }).from(customers)\n * );\n * ```\n */\nexport const union = createSetOperator('union', false);\n\n/**\n * Adds `union all` set operator to the query.\n *\n * Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them.\n *\n * See docs: {@link https://orm.drizzle.team/docs/set-operations#union-all}\n *\n * @example\n *\n * ```ts\n * // Select all transaction ids from both online and in-store sales\n * import { unionAll } from 'drizzle-orm/sqlite-core'\n *\n * await unionAll(\n * db.select({ transaction: onlineSales.transactionId }).from(onlineSales),\n * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)\n * );\n * // or\n * await db.select({ transaction: onlineSales.transactionId })\n * .from(onlineSales)\n * .unionAll(\n * db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)\n * );\n * ```\n */\nexport const unionAll = createSetOperator('union', true);\n\n/**\n * Adds `intersect` set operator to the query.\n *\n * Calling this method will retain only the rows that are present in both result sets and eliminate duplicates.\n *\n * See docs: {@link https://orm.drizzle.team/docs/set-operations#intersect}\n *\n * @example\n *\n * ```ts\n * // Select course names that are offered in both departments A and B\n * import { intersect } from 'drizzle-orm/sqlite-core'\n *\n * await intersect(\n * db.select({ courseName: depA.courseName }).from(depA),\n * db.select({ courseName: depB.courseName }).from(depB)\n * );\n * // or\n * await db.select({ courseName: depA.courseName })\n * .from(depA)\n * .intersect(\n * db.select({ courseName: depB.courseName }).from(depB)\n * );\n * ```\n */\nexport const intersect = createSetOperator('intersect', false);\n\n/**\n * Adds `except` set operator to the query.\n *\n * Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query.\n *\n * See docs: {@link https://orm.drizzle.team/docs/set-operations#except}\n *\n * @example\n *\n * ```ts\n * // Select all courses offered in department A but not in department B\n * import { except } from 'drizzle-orm/sqlite-core'\n *\n * await except(\n * db.select({ courseName: depA.courseName }).from(depA),\n * db.select({ courseName: depB.courseName }).from(depB)\n * );\n * // or\n * await db.select({ courseName: depA.courseName })\n * .from(depA)\n * .except(\n * db.select({ courseName: depB.courseName }).from(depB)\n * );\n * ```\n */\nexport const except = createSetOperator('except', false);\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs new file mode 100644 index 0000000000000000000000000000000000000000..d200bf0d2402e6529464bb3ddeb6563974d9730c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs @@ -0,0 +1,17 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var select_types_exports = {}; +module.exports = __toCommonJS(select_types_exports); +//# sourceMappingURL=select.types.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..684133a57931692a15882f0b0cd01610e729e5bc --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/sqlite-core/query-builders/select.types.ts"],"sourcesContent":["import type { ColumnsSelection, Placeholder, SQL, View } from '~/sql/sql.ts';\nimport type { SQLiteColumn } from '~/sqlite-core/columns/index.ts';\nimport type { SQLiteTable, SQLiteTableWithColumns } from '~/sqlite-core/table.ts';\nimport type { Assume, ValidateShape } from '~/utils.ts';\n\nimport type {\n\tSelectedFields as SelectFieldsBase,\n\tSelectedFieldsFlat as SelectFieldsFlatBase,\n\tSelectedFieldsOrdered as SelectFieldsOrderedBase,\n} from '~/operations.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type {\n\tAppendToNullabilityMap,\n\tAppendToResult,\n\tBuildSubquerySelection,\n\tGetSelectTableName,\n\tJoinNullability,\n\tJoinType,\n\tMapColumnsToTableAlias,\n\tSelectMode,\n\tSelectResult,\n\tSetOperator,\n} from '~/query-builders/select.types.ts';\nimport type { Subquery } from '~/subquery.ts';\nimport type { Table, UpdateTableConfig } from '~/table.ts';\nimport type { SQLitePreparedQuery } from '../session.ts';\nimport type { SQLiteViewBase } from '../view-base.ts';\nimport type { SQLiteViewWithSelection } from '../view.ts';\nimport type { SQLiteSelectBase, SQLiteSelectQueryBuilderBase } from './select.ts';\n\nexport interface SQLiteSelectJoinConfig {\n\ton: SQL | undefined;\n\ttable: SQLiteTable | Subquery | SQLiteViewBase | SQL;\n\talias: string | undefined;\n\tjoinType: JoinType;\n}\n\nexport type BuildAliasTable = TTable extends Table\n\t? SQLiteTableWithColumns<\n\t\tUpdateTableConfig;\n\t\t}>\n\t>\n\t: TTable extends View ? SQLiteViewWithSelection<\n\t\t\tTAlias,\n\t\t\tTTable['_']['existing'],\n\t\t\tMapColumnsToTableAlias\n\t\t>\n\t: never;\n\nexport interface SQLiteSelectConfig {\n\twithList?: Subquery[];\n\tfields: Record;\n\tfieldsFlat?: SelectedFieldsOrdered;\n\twhere?: SQL;\n\thaving?: SQL;\n\ttable: SQLiteTable | Subquery | SQLiteViewBase | SQL;\n\tlimit?: number | Placeholder;\n\toffset?: number | Placeholder;\n\tjoins?: SQLiteSelectJoinConfig[];\n\torderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];\n\tgroupBy?: (SQLiteColumn | SQL | SQL.Aliased)[];\n\tdistinct?: boolean;\n\tsetOperators: {\n\t\trightSelect: TypedQueryBuilder;\n\t\ttype: SetOperator;\n\t\tisAll: boolean;\n\t\torderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];\n\t\tlimit?: number | Placeholder;\n\t\toffset?: number | Placeholder;\n\t}[];\n}\n\nexport type SQLiteSelectJoin<\n\tT extends AnySQLiteSelectQueryBuilder,\n\tTDynamic extends boolean,\n\tTJoinType extends JoinType,\n\tTJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\tTJoinedName extends GetSelectTableName = GetSelectTableName,\n> = T extends any ? SQLiteSelectWithout<\n\t\tSQLiteSelectKind<\n\t\t\tT['_']['hkt'],\n\t\t\tT['_']['tableName'],\n\t\t\tT['_']['resultType'],\n\t\t\tT['_']['runResult'],\n\t\t\tAppendToResult<\n\t\t\t\tT['_']['tableName'],\n\t\t\t\tT['_']['selection'],\n\t\t\t\tTJoinedName,\n\t\t\t\tTJoinedTable extends SQLiteTable ? TJoinedTable['_']['columns']\n\t\t\t\t\t: TJoinedTable extends Subquery | View ? Assume\n\t\t\t\t\t: never,\n\t\t\t\tT['_']['selectMode']\n\t\t\t>,\n\t\t\tT['_']['selectMode'] extends 'partial' ? T['_']['selectMode'] : 'multiple',\n\t\t\tAppendToNullabilityMap,\n\t\t\tT['_']['dynamic'],\n\t\t\tT['_']['excludedMethods']\n\t\t>,\n\t\tTDynamic,\n\t\tT['_']['excludedMethods']\n\t>\n\t: never;\n\nexport type SQLiteSelectJoinFn<\n\tT extends AnySQLiteSelectQueryBuilder,\n\tTDynamic extends boolean,\n\tTJoinType extends JoinType,\n> = <\n\tTJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\tTJoinedName extends GetSelectTableName = GetSelectTableName,\n>(\n\ttable: TJoinedTable,\n\ton: ((aliases: T['_']['selection']) => SQL | undefined) | SQL | undefined,\n) => SQLiteSelectJoin;\n\nexport type SQLiteSelectCrossJoinFn<\n\tT extends AnySQLiteSelectQueryBuilder,\n\tTDynamic extends boolean,\n> = <\n\tTJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\tTJoinedName extends GetSelectTableName = GetSelectTableName,\n>(table: TJoinedTable) => SQLiteSelectJoin;\n\nexport type SelectedFieldsFlat = SelectFieldsFlatBase;\n\nexport type SelectedFields = SelectFieldsBase;\n\nexport type SelectedFieldsOrdered = SelectFieldsOrderedBase;\n\nexport interface SQLiteSelectHKTBase {\n\ttableName: string | undefined;\n\tresultType: 'sync' | 'async';\n\trunResult: unknown;\n\tselection: unknown;\n\tselectMode: SelectMode;\n\tnullabilityMap: unknown;\n\tdynamic: boolean;\n\texcludedMethods: string;\n\tresult: unknown;\n\tselectedFields: unknown;\n\t_type: unknown;\n}\n\nexport type SQLiteSelectKind<\n\tT extends SQLiteSelectHKTBase,\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTSelectMode extends SelectMode,\n\tTNullabilityMap extends Record,\n\tTDynamic extends boolean,\n\tTExcludedMethods extends string,\n\tTResult = SelectResult[],\n\tTSelectedFields = BuildSubquerySelection,\n> = (T & {\n\ttableName: TTableName;\n\tresultType: TResultType;\n\trunResult: TRunResult;\n\tselection: TSelection;\n\tselectMode: TSelectMode;\n\tnullabilityMap: TNullabilityMap;\n\tdynamic: TDynamic;\n\texcludedMethods: TExcludedMethods;\n\tresult: TResult;\n\tselectedFields: TSelectedFields;\n})['_type'];\n\nexport interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase {\n\t_type: SQLiteSelectQueryBuilderBase<\n\t\tSQLiteSelectQueryBuilderHKT,\n\t\tthis['tableName'],\n\t\tthis['resultType'],\n\t\tthis['runResult'],\n\t\tAssume,\n\t\tthis['selectMode'],\n\t\tAssume>,\n\t\tthis['dynamic'],\n\t\tthis['excludedMethods'],\n\t\tAssume,\n\t\tAssume\n\t>;\n}\n\nexport interface SQLiteSelectHKT extends SQLiteSelectHKTBase {\n\t_type: SQLiteSelectBase<\n\t\tthis['tableName'],\n\t\tthis['resultType'],\n\t\tthis['runResult'],\n\t\tAssume,\n\t\tthis['selectMode'],\n\t\tAssume>,\n\t\tthis['dynamic'],\n\t\tthis['excludedMethods'],\n\t\tAssume,\n\t\tAssume\n\t>;\n}\n\nexport type SQLiteSetOperatorExcludedMethods =\n\t| 'config'\n\t| 'leftJoin'\n\t| 'rightJoin'\n\t| 'innerJoin'\n\t| 'fullJoin'\n\t| 'where'\n\t| 'having'\n\t| 'groupBy';\n\nexport type CreateSQLiteSelectFromBuilderMode<\n\tTBuilderMode extends 'db' | 'qb',\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTSelectMode extends SelectMode,\n> = TBuilderMode extends 'db' ? SQLiteSelectBase<\n\t\tTTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection,\n\t\tTSelectMode\n\t>\n\t: SQLiteSelectQueryBuilderBase<\n\t\tSQLiteSelectQueryBuilderHKT,\n\t\tTTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection,\n\t\tTSelectMode\n\t>;\n\nexport type SQLiteSelectWithout<\n\tT extends AnySQLiteSelectQueryBuilder,\n\tTDynamic extends boolean,\n\tK extends keyof T & string,\n\tTResetExcluded extends boolean = false,\n> = TDynamic extends true ? T : Omit<\n\tSQLiteSelectKind<\n\t\tT['_']['hkt'],\n\t\tT['_']['tableName'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['selection'],\n\t\tT['_']['selectMode'],\n\t\tT['_']['nullabilityMap'],\n\t\tTDynamic,\n\t\tTResetExcluded extends true ? K : T['_']['excludedMethods'] | K,\n\t\tT['_']['result'],\n\t\tT['_']['selectedFields']\n\t>,\n\tTResetExcluded extends true ? K : T['_']['excludedMethods'] | K\n>;\n\nexport type SQLiteSelectExecute = T['_']['result'];\n\nexport type SQLiteSelectPrepare = SQLitePreparedQuery<\n\t{\n\t\ttype: T['_']['resultType'];\n\t\trun: T['_']['runResult'];\n\t\tall: T['_']['result'];\n\t\tget: T['_']['result'][number] | undefined;\n\t\tvalues: any[][];\n\t\texecute: SQLiteSelectExecute;\n\t}\n>;\n\nexport type SQLiteSelectDynamic = SQLiteSelectKind<\n\tT['_']['hkt'],\n\tT['_']['tableName'],\n\tT['_']['resultType'],\n\tT['_']['runResult'],\n\tT['_']['selection'],\n\tT['_']['selectMode'],\n\tT['_']['nullabilityMap'],\n\ttrue,\n\tnever,\n\tT['_']['result'],\n\tT['_']['selectedFields']\n>;\n\nexport type SQLiteSelectQueryBuilder<\n\tTHKT extends SQLiteSelectHKTBase = SQLiteSelectQueryBuilderHKT,\n\tTTableName extends string | undefined = string | undefined,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n\tTSelectMode extends SelectMode = SelectMode,\n\tTNullabilityMap extends Record = Record,\n\tTResult extends any[] = unknown[],\n\tTSelectedFields extends ColumnsSelection = ColumnsSelection,\n> = SQLiteSelectQueryBuilderBase<\n\tTHKT,\n\tTTableName,\n\tTResultType,\n\tTRunResult,\n\tTSelection,\n\tTSelectMode,\n\tTNullabilityMap,\n\ttrue,\n\tnever,\n\tTResult,\n\tTSelectedFields\n>;\n\nexport type AnySQLiteSelectQueryBuilder = SQLiteSelectQueryBuilderBase<\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany\n>;\n\nexport type AnySQLiteSetOperatorInterface = SQLiteSetOperatorInterface;\n\nexport interface SQLiteSetOperatorInterface<\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTSelectMode extends SelectMode = 'single',\n\tTNullabilityMap extends Record = TTableName extends string ? Record\n\t\t: {},\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n\tTResult extends any[] = SelectResult[],\n\tTSelectedFields extends ColumnsSelection = BuildSubquerySelection,\n> {\n\t_: {\n\t\treadonly hkt: SQLiteSelectHKTBase;\n\t\treadonly tableName: TTableName;\n\t\treadonly resultType: TResultType;\n\t\treadonly runResult: TRunResult;\n\t\treadonly selection: TSelection;\n\t\treadonly selectMode: TSelectMode;\n\t\treadonly nullabilityMap: TNullabilityMap;\n\t\treadonly dynamic: TDynamic;\n\t\treadonly excludedMethods: TExcludedMethods;\n\t\treadonly result: TResult;\n\t\treadonly selectedFields: TSelectedFields;\n\t};\n}\n\nexport type SQLiteSetOperatorWithResult = SQLiteSetOperatorInterface<\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tany,\n\tTResult,\n\tany\n>;\n\nexport type SQLiteSelect<\n\tTTableName extends string | undefined = string | undefined,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTSelection extends ColumnsSelection = Record,\n\tTSelectMode extends SelectMode = SelectMode,\n\tTNullabilityMap extends Record = Record,\n> = SQLiteSelectBase;\n\nexport type AnySQLiteSelect = SQLiteSelectBase;\n\nexport type SQLiteSetOperator<\n\tTTableName extends string | undefined = string | undefined,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTSelection extends ColumnsSelection = Record,\n\tTSelectMode extends SelectMode = SelectMode,\n\tTNullabilityMap extends Record = Record,\n> = SQLiteSelectBase<\n\tTTableName,\n\tTResultType,\n\tTRunResult,\n\tTSelection,\n\tTSelectMode,\n\tTNullabilityMap,\n\ttrue,\n\tSQLiteSetOperatorExcludedMethods\n>;\n\nexport type SetOperatorRightSelect<\n\tTValue extends SQLiteSetOperatorWithResult,\n\tTResult extends any[],\n> = TValue extends SQLiteSetOperatorInterface\n\t? ValidateShape<\n\t\tTValueResult[number],\n\t\tTResult[number],\n\t\tTypedQueryBuilder\n\t>\n\t: TValue;\n\nexport type SetOperatorRestSelect<\n\tTValue extends readonly SQLiteSetOperatorWithResult[],\n\tTResult extends any[],\n> = TValue extends [infer First, ...infer Rest]\n\t? First extends SQLiteSetOperatorInterface\n\t\t? Rest extends AnySQLiteSetOperatorInterface[] ? [\n\t\t\t\tValidateShape>,\n\t\t\t\t...SetOperatorRestSelect,\n\t\t\t]\n\t\t: ValidateShape[]>\n\t: never\n\t: TValue;\n\nexport type SQLiteCreateSetOperatorFn = <\n\tTTableName extends string | undefined,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTSelection extends ColumnsSelection,\n\tTValue extends SQLiteSetOperatorWithResult,\n\tTRest extends SQLiteSetOperatorWithResult[],\n\tTSelectMode extends SelectMode = 'single',\n\tTNullabilityMap extends Record = TTableName extends string ? Record\n\t\t: {},\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n\tTResult extends any[] = SelectResult[],\n\tTSelectedFields extends ColumnsSelection = BuildSubquerySelection,\n>(\n\tleftSelect: SQLiteSetOperatorInterface<\n\t\tTTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection,\n\t\tTSelectMode,\n\t\tTNullabilityMap,\n\t\tTDynamic,\n\t\tTExcludedMethods,\n\t\tTResult,\n\t\tTSelectedFields\n\t>,\n\trightSelect: SetOperatorRightSelect,\n\t...restSelects: SetOperatorRestSelect\n) => SQLiteSelectWithout<\n\tSQLiteSelectBase<\n\t\tTTableName,\n\t\tTResultType,\n\t\tTRunResult,\n\t\tTSelection,\n\t\tTSelectMode,\n\t\tTNullabilityMap,\n\t\tTDynamic,\n\t\tTExcludedMethods,\n\t\tTResult,\n\t\tTSelectedFields\n\t>,\n\tfalse,\n\tSQLiteSetOperatorExcludedMethods,\n\ttrue\n>;\n\nexport type GetSQLiteSetOperators = {\n\tunion: SQLiteCreateSetOperatorFn;\n\tintersect: SQLiteCreateSetOperatorFn;\n\texcept: SQLiteCreateSetOperatorFn;\n\tunionAll: SQLiteCreateSetOperatorFn;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..faf89ea0361f426a2563915426a235ded55b23d9 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.cts @@ -0,0 +1,129 @@ +import type { ColumnsSelection, Placeholder, SQL, View } from "../../sql/sql.cjs"; +import type { SQLiteColumn } from "../columns/index.cjs"; +import type { SQLiteTable, SQLiteTableWithColumns } from "../table.cjs"; +import type { Assume, ValidateShape } from "../../utils.cjs"; +import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from "../../operations.cjs"; +import type { TypedQueryBuilder } from "../../query-builders/query-builder.cjs"; +import type { AppendToNullabilityMap, AppendToResult, BuildSubquerySelection, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode, SelectResult, SetOperator } from "../../query-builders/select.types.cjs"; +import type { Subquery } from "../../subquery.cjs"; +import type { Table, UpdateTableConfig } from "../../table.cjs"; +import type { SQLitePreparedQuery } from "../session.cjs"; +import type { SQLiteViewBase } from "../view-base.cjs"; +import type { SQLiteViewWithSelection } from "../view.cjs"; +import type { SQLiteSelectBase, SQLiteSelectQueryBuilderBase } from "./select.cjs"; +export interface SQLiteSelectJoinConfig { + on: SQL | undefined; + table: SQLiteTable | Subquery | SQLiteViewBase | SQL; + alias: string | undefined; + joinType: JoinType; +} +export type BuildAliasTable = TTable extends Table ? SQLiteTableWithColumns; +}>> : TTable extends View ? SQLiteViewWithSelection> : never; +export interface SQLiteSelectConfig { + withList?: Subquery[]; + fields: Record; + fieldsFlat?: SelectedFieldsOrdered; + where?: SQL; + having?: SQL; + table: SQLiteTable | Subquery | SQLiteViewBase | SQL; + limit?: number | Placeholder; + offset?: number | Placeholder; + joins?: SQLiteSelectJoinConfig[]; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + groupBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + distinct?: boolean; + setOperators: { + rightSelect: TypedQueryBuilder; + type: SetOperator; + isAll: boolean; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + limit?: number | Placeholder; + offset?: number | Placeholder; + }[]; +} +export type SQLiteSelectJoin = GetSelectTableName> = T extends any ? SQLiteSelectWithout : never, T['_']['selectMode']>, T['_']['selectMode'] extends 'partial' ? T['_']['selectMode'] : 'multiple', AppendToNullabilityMap, T['_']['dynamic'], T['_']['excludedMethods']>, TDynamic, T['_']['excludedMethods']> : never; +export type SQLiteSelectJoinFn = = GetSelectTableName>(table: TJoinedTable, on: ((aliases: T['_']['selection']) => SQL | undefined) | SQL | undefined) => SQLiteSelectJoin; +export type SQLiteSelectCrossJoinFn = = GetSelectTableName>(table: TJoinedTable) => SQLiteSelectJoin; +export type SelectedFieldsFlat = SelectFieldsFlatBase; +export type SelectedFields = SelectFieldsBase; +export type SelectedFieldsOrdered = SelectFieldsOrderedBase; +export interface SQLiteSelectHKTBase { + tableName: string | undefined; + resultType: 'sync' | 'async'; + runResult: unknown; + selection: unknown; + selectMode: SelectMode; + nullabilityMap: unknown; + dynamic: boolean; + excludedMethods: string; + result: unknown; + selectedFields: unknown; + _type: unknown; +} +export type SQLiteSelectKind, TDynamic extends boolean, TExcludedMethods extends string, TResult = SelectResult[], TSelectedFields = BuildSubquerySelection> = (T & { + tableName: TTableName; + resultType: TResultType; + runResult: TRunResult; + selection: TSelection; + selectMode: TSelectMode; + nullabilityMap: TNullabilityMap; + dynamic: TDynamic; + excludedMethods: TExcludedMethods; + result: TResult; + selectedFields: TSelectedFields; +})['_type']; +export interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase { + _type: SQLiteSelectQueryBuilderBase, this['selectMode'], Assume>, this['dynamic'], this['excludedMethods'], Assume, Assume>; +} +export interface SQLiteSelectHKT extends SQLiteSelectHKTBase { + _type: SQLiteSelectBase, this['selectMode'], Assume>, this['dynamic'], this['excludedMethods'], Assume, Assume>; +} +export type SQLiteSetOperatorExcludedMethods = 'config' | 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin' | 'where' | 'having' | 'groupBy'; +export type CreateSQLiteSelectFromBuilderMode = TBuilderMode extends 'db' ? SQLiteSelectBase : SQLiteSelectQueryBuilderBase; +export type SQLiteSelectWithout = TDynamic extends true ? T : Omit, TResetExcluded extends true ? K : T['_']['excludedMethods'] | K>; +export type SQLiteSelectExecute = T['_']['result']; +export type SQLiteSelectPrepare = SQLitePreparedQuery<{ + type: T['_']['resultType']; + run: T['_']['runResult']; + all: T['_']['result']; + get: T['_']['result'][number] | undefined; + values: any[][]; + execute: SQLiteSelectExecute; +}>; +export type SQLiteSelectDynamic = SQLiteSelectKind; +export type SQLiteSelectQueryBuilder = Record, TResult extends any[] = unknown[], TSelectedFields extends ColumnsSelection = ColumnsSelection> = SQLiteSelectQueryBuilderBase; +export type AnySQLiteSelectQueryBuilder = SQLiteSelectQueryBuilderBase; +export type AnySQLiteSetOperatorInterface = SQLiteSetOperatorInterface; +export interface SQLiteSetOperatorInterface = TTableName extends string ? Record : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection> { + _: { + readonly hkt: SQLiteSelectHKTBase; + readonly tableName: TTableName; + readonly resultType: TResultType; + readonly runResult: TRunResult; + readonly selection: TSelection; + readonly selectMode: TSelectMode; + readonly nullabilityMap: TNullabilityMap; + readonly dynamic: TDynamic; + readonly excludedMethods: TExcludedMethods; + readonly result: TResult; + readonly selectedFields: TSelectedFields; + }; +} +export type SQLiteSetOperatorWithResult = SQLiteSetOperatorInterface; +export type SQLiteSelect, TSelectMode extends SelectMode = SelectMode, TNullabilityMap extends Record = Record> = SQLiteSelectBase; +export type AnySQLiteSelect = SQLiteSelectBase; +export type SQLiteSetOperator, TSelectMode extends SelectMode = SelectMode, TNullabilityMap extends Record = Record> = SQLiteSelectBase; +export type SetOperatorRightSelect, TResult extends any[]> = TValue extends SQLiteSetOperatorInterface ? ValidateShape> : TValue; +export type SetOperatorRestSelect[], TResult extends any[]> = TValue extends [infer First, ...infer Rest] ? First extends SQLiteSetOperatorInterface ? Rest extends AnySQLiteSetOperatorInterface[] ? [ + ValidateShape>, + ...SetOperatorRestSelect +] : ValidateShape[]> : never : TValue; +export type SQLiteCreateSetOperatorFn = , TRest extends SQLiteSetOperatorWithResult[], TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record = TTableName extends string ? Record : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection>(leftSelect: SQLiteSetOperatorInterface, rightSelect: SetOperatorRightSelect, ...restSelects: SetOperatorRestSelect) => SQLiteSelectWithout, false, SQLiteSetOperatorExcludedMethods, true>; +export type GetSQLiteSetOperators = { + union: SQLiteCreateSetOperatorFn; + intersect: SQLiteCreateSetOperatorFn; + except: SQLiteCreateSetOperatorFn; + unionAll: SQLiteCreateSetOperatorFn; +}; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0030b7d51d76bad1c122ddc3b1496d684519d9c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.ts @@ -0,0 +1,129 @@ +import type { ColumnsSelection, Placeholder, SQL, View } from "../../sql/sql.js"; +import type { SQLiteColumn } from "../columns/index.js"; +import type { SQLiteTable, SQLiteTableWithColumns } from "../table.js"; +import type { Assume, ValidateShape } from "../../utils.js"; +import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase } from "../../operations.js"; +import type { TypedQueryBuilder } from "../../query-builders/query-builder.js"; +import type { AppendToNullabilityMap, AppendToResult, BuildSubquerySelection, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode, SelectResult, SetOperator } from "../../query-builders/select.types.js"; +import type { Subquery } from "../../subquery.js"; +import type { Table, UpdateTableConfig } from "../../table.js"; +import type { SQLitePreparedQuery } from "../session.js"; +import type { SQLiteViewBase } from "../view-base.js"; +import type { SQLiteViewWithSelection } from "../view.js"; +import type { SQLiteSelectBase, SQLiteSelectQueryBuilderBase } from "./select.js"; +export interface SQLiteSelectJoinConfig { + on: SQL | undefined; + table: SQLiteTable | Subquery | SQLiteViewBase | SQL; + alias: string | undefined; + joinType: JoinType; +} +export type BuildAliasTable = TTable extends Table ? SQLiteTableWithColumns; +}>> : TTable extends View ? SQLiteViewWithSelection> : never; +export interface SQLiteSelectConfig { + withList?: Subquery[]; + fields: Record; + fieldsFlat?: SelectedFieldsOrdered; + where?: SQL; + having?: SQL; + table: SQLiteTable | Subquery | SQLiteViewBase | SQL; + limit?: number | Placeholder; + offset?: number | Placeholder; + joins?: SQLiteSelectJoinConfig[]; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + groupBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + distinct?: boolean; + setOperators: { + rightSelect: TypedQueryBuilder; + type: SetOperator; + isAll: boolean; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + limit?: number | Placeholder; + offset?: number | Placeholder; + }[]; +} +export type SQLiteSelectJoin = GetSelectTableName> = T extends any ? SQLiteSelectWithout : never, T['_']['selectMode']>, T['_']['selectMode'] extends 'partial' ? T['_']['selectMode'] : 'multiple', AppendToNullabilityMap, T['_']['dynamic'], T['_']['excludedMethods']>, TDynamic, T['_']['excludedMethods']> : never; +export type SQLiteSelectJoinFn = = GetSelectTableName>(table: TJoinedTable, on: ((aliases: T['_']['selection']) => SQL | undefined) | SQL | undefined) => SQLiteSelectJoin; +export type SQLiteSelectCrossJoinFn = = GetSelectTableName>(table: TJoinedTable) => SQLiteSelectJoin; +export type SelectedFieldsFlat = SelectFieldsFlatBase; +export type SelectedFields = SelectFieldsBase; +export type SelectedFieldsOrdered = SelectFieldsOrderedBase; +export interface SQLiteSelectHKTBase { + tableName: string | undefined; + resultType: 'sync' | 'async'; + runResult: unknown; + selection: unknown; + selectMode: SelectMode; + nullabilityMap: unknown; + dynamic: boolean; + excludedMethods: string; + result: unknown; + selectedFields: unknown; + _type: unknown; +} +export type SQLiteSelectKind, TDynamic extends boolean, TExcludedMethods extends string, TResult = SelectResult[], TSelectedFields = BuildSubquerySelection> = (T & { + tableName: TTableName; + resultType: TResultType; + runResult: TRunResult; + selection: TSelection; + selectMode: TSelectMode; + nullabilityMap: TNullabilityMap; + dynamic: TDynamic; + excludedMethods: TExcludedMethods; + result: TResult; + selectedFields: TSelectedFields; +})['_type']; +export interface SQLiteSelectQueryBuilderHKT extends SQLiteSelectHKTBase { + _type: SQLiteSelectQueryBuilderBase, this['selectMode'], Assume>, this['dynamic'], this['excludedMethods'], Assume, Assume>; +} +export interface SQLiteSelectHKT extends SQLiteSelectHKTBase { + _type: SQLiteSelectBase, this['selectMode'], Assume>, this['dynamic'], this['excludedMethods'], Assume, Assume>; +} +export type SQLiteSetOperatorExcludedMethods = 'config' | 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin' | 'where' | 'having' | 'groupBy'; +export type CreateSQLiteSelectFromBuilderMode = TBuilderMode extends 'db' ? SQLiteSelectBase : SQLiteSelectQueryBuilderBase; +export type SQLiteSelectWithout = TDynamic extends true ? T : Omit, TResetExcluded extends true ? K : T['_']['excludedMethods'] | K>; +export type SQLiteSelectExecute = T['_']['result']; +export type SQLiteSelectPrepare = SQLitePreparedQuery<{ + type: T['_']['resultType']; + run: T['_']['runResult']; + all: T['_']['result']; + get: T['_']['result'][number] | undefined; + values: any[][]; + execute: SQLiteSelectExecute; +}>; +export type SQLiteSelectDynamic = SQLiteSelectKind; +export type SQLiteSelectQueryBuilder = Record, TResult extends any[] = unknown[], TSelectedFields extends ColumnsSelection = ColumnsSelection> = SQLiteSelectQueryBuilderBase; +export type AnySQLiteSelectQueryBuilder = SQLiteSelectQueryBuilderBase; +export type AnySQLiteSetOperatorInterface = SQLiteSetOperatorInterface; +export interface SQLiteSetOperatorInterface = TTableName extends string ? Record : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection> { + _: { + readonly hkt: SQLiteSelectHKTBase; + readonly tableName: TTableName; + readonly resultType: TResultType; + readonly runResult: TRunResult; + readonly selection: TSelection; + readonly selectMode: TSelectMode; + readonly nullabilityMap: TNullabilityMap; + readonly dynamic: TDynamic; + readonly excludedMethods: TExcludedMethods; + readonly result: TResult; + readonly selectedFields: TSelectedFields; + }; +} +export type SQLiteSetOperatorWithResult = SQLiteSetOperatorInterface; +export type SQLiteSelect, TSelectMode extends SelectMode = SelectMode, TNullabilityMap extends Record = Record> = SQLiteSelectBase; +export type AnySQLiteSelect = SQLiteSelectBase; +export type SQLiteSetOperator, TSelectMode extends SelectMode = SelectMode, TNullabilityMap extends Record = Record> = SQLiteSelectBase; +export type SetOperatorRightSelect, TResult extends any[]> = TValue extends SQLiteSetOperatorInterface ? ValidateShape> : TValue; +export type SetOperatorRestSelect[], TResult extends any[]> = TValue extends [infer First, ...infer Rest] ? First extends SQLiteSetOperatorInterface ? Rest extends AnySQLiteSetOperatorInterface[] ? [ + ValidateShape>, + ...SetOperatorRestSelect +] : ValidateShape[]> : never : TValue; +export type SQLiteCreateSetOperatorFn = , TRest extends SQLiteSetOperatorWithResult[], TSelectMode extends SelectMode = 'single', TNullabilityMap extends Record = TTableName extends string ? Record : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection>(leftSelect: SQLiteSetOperatorInterface, rightSelect: SetOperatorRightSelect, ...restSelects: SetOperatorRestSelect) => SQLiteSelectWithout, false, SQLiteSetOperatorExcludedMethods, true>; +export type GetSQLiteSetOperators = { + union: SQLiteCreateSetOperatorFn; + intersect: SQLiteCreateSetOperatorFn; + except: SQLiteCreateSetOperatorFn; + unionAll: SQLiteCreateSetOperatorFn; +}; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js new file mode 100644 index 0000000000000000000000000000000000000000..cafc2bfb2fdad2bf2dfc5b0e44b44e15801f1e4e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js @@ -0,0 +1 @@ +//# sourceMappingURL=select.types.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js.map new file mode 100644 index 0000000000000000000000000000000000000000..84c51b288c478ac0d18748007ccfb8cddc797f3a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/select.types.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs new file mode 100644 index 0000000000000000000000000000000000000000..a8d0e7582da2dd68d17e4d424e300fed0be427ad --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs @@ -0,0 +1,204 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var update_exports = {}; +__export(update_exports, { + SQLiteUpdateBase: () => SQLiteUpdateBase, + SQLiteUpdateBuilder: () => SQLiteUpdateBuilder +}); +module.exports = __toCommonJS(update_exports); +var import_entity = require("../../entity.cjs"); +var import_query_promise = require("../../query-promise.cjs"); +var import_selection_proxy = require("../../selection-proxy.cjs"); +var import_table = require("../table.cjs"); +var import_subquery = require("../../subquery.cjs"); +var import_table2 = require("../../table.cjs"); +var import_utils = require("../../utils.cjs"); +var import_view_common = require("../../view-common.cjs"); +var import_utils2 = require("../utils.cjs"); +var import_view_base = require("../view-base.cjs"); +class SQLiteUpdateBuilder { + constructor(table, session, dialect, withList) { + this.table = table; + this.session = session; + this.dialect = dialect; + this.withList = withList; + } + static [import_entity.entityKind] = "SQLiteUpdateBuilder"; + set(values) { + return new SQLiteUpdateBase( + this.table, + (0, import_utils.mapUpdateSet)(this.table, values), + this.session, + this.dialect, + this.withList + ); + } +} +class SQLiteUpdateBase extends import_query_promise.QueryPromise { + constructor(table, set, session, dialect, withList) { + super(); + this.session = session; + this.dialect = dialect; + this.config = { set, table, withList, joins: [] }; + } + static [import_entity.entityKind] = "SQLiteUpdate"; + /** @internal */ + config; + from(source) { + this.config.from = source; + return this; + } + createJoin(joinType) { + return (table, on) => { + const tableName = (0, import_utils.getTableLikeName)(table); + if (typeof tableName === "string" && this.config.joins.some((join) => join.alias === tableName)) { + throw new Error(`Alias "${tableName}" is already used in this query`); + } + if (typeof on === "function") { + const from = this.config.from ? (0, import_entity.is)(table, import_table.SQLiteTable) ? table[import_table2.Table.Symbol.Columns] : (0, import_entity.is)(table, import_subquery.Subquery) ? table._.selectedFields : (0, import_entity.is)(table, import_view_base.SQLiteViewBase) ? table[import_view_common.ViewBaseConfig].selectedFields : void 0 : void 0; + on = on( + new Proxy( + this.config.table[import_table2.Table.Symbol.Columns], + new import_selection_proxy.SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ), + from && new Proxy( + from, + new import_selection_proxy.SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ) + ); + } + this.config.joins.push({ on, table, joinType, alias: tableName }); + return this; + }; + } + leftJoin = this.createJoin("left"); + rightJoin = this.createJoin("right"); + innerJoin = this.createJoin("inner"); + fullJoin = this.createJoin("full"); + /** + * Adds a 'where' clause to the query. + * + * Calling this method will update only those rows that fulfill a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/update} + * + * @param where the 'where' clause. + * + * @example + * You can use conditional operators and `sql function` to filter the rows to be updated. + * + * ```ts + * // Update all cars with green color + * db.update(cars).set({ color: 'red' }) + * .where(eq(cars.color, 'green')); + * // or + * db.update(cars).set({ color: 'red' }) + * .where(sql`${cars.color} = 'green'`) + * ``` + * + * You can logically combine conditional operators with `and()` and `or()` operators: + * + * ```ts + * // Update all BMW cars with a green color + * db.update(cars).set({ color: 'red' }) + * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); + * + * // Update all cars with the green or blue color + * db.update(cars).set({ color: 'red' }) + * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); + * ``` + */ + where(where) { + this.config.where = where; + return this; + } + orderBy(...columns) { + if (typeof columns[0] === "function") { + const orderBy = columns[0]( + new Proxy( + this.config.table[import_table2.Table.Symbol.Columns], + new import_selection_proxy.SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) + ) + ); + const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; + this.config.orderBy = orderByArray; + } else { + const orderByArray = columns; + this.config.orderBy = orderByArray; + } + return this; + } + limit(limit) { + this.config.limit = limit; + return this; + } + returning(fields = this.config.table[import_table.SQLiteTable.Symbol.Columns]) { + this.config.returning = (0, import_utils.orderSelectedFields)(fields); + return this; + } + /** @internal */ + getSQL() { + return this.dialect.buildUpdateQuery(this.config); + } + toSQL() { + const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); + return rest; + } + /** @internal */ + _prepare(isOneTimeQuery = true) { + return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( + this.dialect.sqlToQuery(this.getSQL()), + this.config.returning, + this.config.returning ? "all" : "run", + true, + void 0, + { + type: "insert", + tables: (0, import_utils2.extractUsedTable)(this.config.table) + } + ); + } + prepare() { + return this._prepare(false); + } + run = (placeholderValues) => { + return this._prepare().run(placeholderValues); + }; + all = (placeholderValues) => { + return this._prepare().all(placeholderValues); + }; + get = (placeholderValues) => { + return this._prepare().get(placeholderValues); + }; + values = (placeholderValues) => { + return this._prepare().values(placeholderValues); + }; + async execute() { + return this.config.returning ? this.all() : this.run(); + } + $dynamic() { + return this; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SQLiteUpdateBase, + SQLiteUpdateBuilder +}); +//# sourceMappingURL=update.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..62b6b61ab84cb38f6ebd8a4264f26f20c19ce69f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/sqlite-core/query-builders/update.ts"],"sourcesContent":["import type { GetColumnData } from '~/column.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport type { JoinType, SelectResultFields } from '~/query-builders/select.types.ts';\nimport { QueryPromise } from '~/query-promise.ts';\nimport type { RunnableQuery } from '~/runnable-query.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport type { Placeholder, Query, SQL, SQLWrapper } from '~/sql/sql.ts';\nimport type { SQLiteDialect } from '~/sqlite-core/dialect.ts';\nimport type { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts';\nimport { SQLiteTable } from '~/sqlite-core/table.ts';\nimport { Subquery } from '~/subquery.ts';\nimport { Table } from '~/table.ts';\nimport {\n\ttype DrizzleTypeError,\n\tgetTableLikeName,\n\tmapUpdateSet,\n\torderSelectedFields,\n\ttype UpdateSet,\n\ttype ValueOrArray,\n} from '~/utils.ts';\nimport { ViewBaseConfig } from '~/view-common.ts';\nimport type { SQLiteColumn } from '../columns/common.ts';\nimport { extractUsedTable } from '../utils.ts';\nimport { SQLiteViewBase } from '../view-base.ts';\nimport type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from './select.types.ts';\n\nexport interface SQLiteUpdateConfig {\n\twhere?: SQL | undefined;\n\tlimit?: number | Placeholder;\n\torderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];\n\tset: UpdateSet;\n\ttable: SQLiteTable;\n\tfrom?: SQLiteTable | Subquery | SQLiteViewBase | SQL;\n\tjoins: SQLiteSelectJoinConfig[];\n\treturning?: SelectedFieldsOrdered;\n\twithList?: Subquery[];\n}\n\nexport type SQLiteUpdateSetSource =\n\t& {\n\t\t[Key in keyof TTable['$inferInsert']]?:\n\t\t\t| GetColumnData\n\t\t\t| SQL\n\t\t\t| SQLiteColumn\n\t\t\t| undefined;\n\t}\n\t& {};\n\nexport class SQLiteUpdateBuilder<\n\tTTable extends SQLiteTable,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteUpdateBuilder';\n\n\tdeclare readonly _: {\n\t\treadonly table: TTable;\n\t};\n\n\tconstructor(\n\t\tprotected table: TTable,\n\t\tprotected session: SQLiteSession,\n\t\tprotected dialect: SQLiteDialect,\n\t\tprivate withList?: Subquery[],\n\t) {}\n\n\tset(\n\t\tvalues: SQLiteUpdateSetSource,\n\t): SQLiteUpdateWithout<\n\t\tSQLiteUpdateBase,\n\t\tfalse,\n\t\t'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'\n\t> {\n\t\treturn new SQLiteUpdateBase(\n\t\t\tthis.table,\n\t\t\tmapUpdateSet(this.table, values),\n\t\t\tthis.session,\n\t\t\tthis.dialect,\n\t\t\tthis.withList,\n\t\t) as any;\n\t}\n}\n\nexport type SQLiteUpdateWithout<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tK extends keyof T & string,\n> = TDynamic extends true ? T : Omit<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tT['_']['returning'],\n\t\tTDynamic,\n\t\tT['_']['excludedMethods'] | K\n\t>,\n\tT['_']['excludedMethods'] | K\n>;\n\nexport type SQLiteUpdateWithJoins<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n> = TDynamic extends true ? T : Omit<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tTFrom,\n\t\tT['_']['returning'],\n\t\tTDynamic,\n\t\tExclude\n\t>,\n\tExclude\n>;\n\nexport type SQLiteUpdateReturningAll = SQLiteUpdateWithout<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tT['_']['table']['$inferSelect'],\n\t\tTDynamic,\n\t\tT['_']['excludedMethods']\n\t>,\n\tTDynamic,\n\t'returning'\n>;\n\nexport type SQLiteUpdateReturning<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tTSelectedFields extends SelectedFields,\n> = SQLiteUpdateWithout<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tSelectResultFields,\n\t\tTDynamic,\n\t\tT['_']['excludedMethods']\n\t>,\n\tTDynamic,\n\t'returning'\n>;\n\nexport type SQLiteUpdateExecute = T['_']['returning'] extends undefined ? T['_']['runResult']\n\t: T['_']['returning'][];\n\nexport type SQLiteUpdatePrepare = SQLitePreparedQuery<\n\t{\n\t\ttype: T['_']['resultType'];\n\t\trun: T['_']['runResult'];\n\t\tall: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'>\n\t\t\t: T['_']['returning'][];\n\t\tget: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'>\n\t\t\t: T['_']['returning'];\n\t\tvalues: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'>\n\t\t\t: any[][];\n\t\texecute: SQLiteUpdateExecute;\n\t}\n>;\n\nexport type SQLiteUpdateJoinFn<\n\tT extends AnySQLiteUpdate,\n> = <\n\tTJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n>(\n\ttable: TJoinedTable,\n\ton:\n\t\t| (\n\t\t\t(\n\t\t\t\tupdateTable: T['_']['table']['_']['columns'],\n\t\t\t\tfrom: T['_']['from'] extends SQLiteTable ? T['_']['from']['_']['columns']\n\t\t\t\t\t: T['_']['from'] extends Subquery | SQLiteViewBase ? T['_']['from']['_']['selectedFields']\n\t\t\t\t\t: never,\n\t\t\t) => SQL | undefined\n\t\t)\n\t\t| SQL\n\t\t| undefined,\n) => T;\n\nexport type SQLiteUpdateDynamic = SQLiteUpdate<\n\tT['_']['table'],\n\tT['_']['resultType'],\n\tT['_']['runResult'],\n\tT['_']['returning']\n>;\n\nexport type SQLiteUpdate<\n\tTTable extends SQLiteTable = SQLiteTable,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = any,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning extends Record | undefined = Record | undefined,\n> = SQLiteUpdateBase;\n\nexport type AnySQLiteUpdate = SQLiteUpdateBase;\n\nexport interface SQLiteUpdateBase<\n\tTTable extends SQLiteTable = SQLiteTable,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning = undefined,\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n> extends SQLWrapper, QueryPromise {\n\treadonly _: {\n\t\treadonly dialect: 'sqlite';\n\t\treadonly table: TTable;\n\t\treadonly resultType: TResultType;\n\t\treadonly runResult: TRunResult;\n\t\treadonly from: TFrom;\n\t\treadonly returning: TReturning;\n\t\treadonly dynamic: TDynamic;\n\t\treadonly excludedMethods: TExcludedMethods;\n\t\treadonly result: TReturning extends undefined ? TRunResult : TReturning[];\n\t};\n}\n\nexport class SQLiteUpdateBase<\n\tTTable extends SQLiteTable = SQLiteTable,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning = undefined,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTDynamic extends boolean = false,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTExcludedMethods extends string = never,\n> extends QueryPromise\n\timplements RunnableQuery, SQLWrapper\n{\n\tstatic override readonly [entityKind]: string = 'SQLiteUpdate';\n\n\t/** @internal */\n\tconfig: SQLiteUpdateConfig;\n\n\tconstructor(\n\t\ttable: TTable,\n\t\tset: UpdateSet,\n\t\tprivate session: SQLiteSession,\n\t\tprivate dialect: SQLiteDialect,\n\t\twithList?: Subquery[],\n\t) {\n\t\tsuper();\n\t\tthis.config = { set, table, withList, joins: [] };\n\t}\n\n\tfrom(\n\t\tsource: TFrom,\n\t): SQLiteUpdateWithJoins {\n\t\tthis.config.from = source;\n\t\treturn this as any;\n\t}\n\n\tprivate createJoin(\n\t\tjoinType: TJoinType,\n\t): SQLiteUpdateJoinFn {\n\t\treturn ((\n\t\t\ttable: SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\t\t\ton: ((updateTable: TTable, from: TFrom) => SQL | undefined) | SQL | undefined,\n\t\t) => {\n\t\t\tconst tableName = getTableLikeName(table);\n\n\t\t\tif (typeof tableName === 'string' && this.config.joins.some((join) => join.alias === tableName)) {\n\t\t\t\tthrow new Error(`Alias \"${tableName}\" is already used in this query`);\n\t\t\t}\n\n\t\t\tif (typeof on === 'function') {\n\t\t\t\tconst from = this.config.from\n\t\t\t\t\t? is(table, SQLiteTable)\n\t\t\t\t\t\t? table[Table.Symbol.Columns]\n\t\t\t\t\t\t: is(table, Subquery)\n\t\t\t\t\t\t? table._.selectedFields\n\t\t\t\t\t\t: is(table, SQLiteViewBase)\n\t\t\t\t\t\t? table[ViewBaseConfig].selectedFields\n\t\t\t\t\t\t: undefined\n\t\t\t\t\t: undefined;\n\t\t\t\ton = on(\n\t\t\t\t\tnew Proxy(\n\t\t\t\t\t\tthis.config.table[Table.Symbol.Columns],\n\t\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t\t) as any,\n\t\t\t\t\tfrom && new Proxy(\n\t\t\t\t\t\tfrom,\n\t\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t\t) as any,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.config.joins.push({ on, table, joinType, alias: tableName });\n\n\t\t\treturn this as any;\n\t\t}) as any;\n\t}\n\n\tleftJoin = this.createJoin('left');\n\n\trightJoin = this.createJoin('right');\n\n\tinnerJoin = this.createJoin('inner');\n\n\tfullJoin = this.createJoin('full');\n\n\t/**\n\t * Adds a 'where' clause to the query.\n\t *\n\t * Calling this method will update only those rows that fulfill a specified condition.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param where the 'where' clause.\n\t *\n\t * @example\n\t * You can use conditional operators and `sql function` to filter the rows to be updated.\n\t *\n\t * ```ts\n\t * // Update all cars with green color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'));\n\t * // or\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(sql`${cars.color} = 'green'`)\n\t * ```\n\t *\n\t * You can logically combine conditional operators with `and()` and `or()` operators:\n\t *\n\t * ```ts\n\t * // Update all BMW cars with a green color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));\n\t *\n\t * // Update all cars with the green or blue color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));\n\t * ```\n\t */\n\twhere(where: SQL | undefined): SQLiteUpdateWithout {\n\t\tthis.config.where = where;\n\t\treturn this as any;\n\t}\n\n\torderBy(\n\t\tbuilder: (updateTable: TTable) => ValueOrArray,\n\t): SQLiteUpdateWithout;\n\torderBy(...columns: (SQLiteColumn | SQL | SQL.Aliased)[]): SQLiteUpdateWithout;\n\torderBy(\n\t\t...columns:\n\t\t\t| [(updateTable: TTable) => ValueOrArray]\n\t\t\t| (SQLiteColumn | SQL | SQL.Aliased)[]\n\t): SQLiteUpdateWithout {\n\t\tif (typeof columns[0] === 'function') {\n\t\t\tconst orderBy = columns[0](\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.table[Table.Symbol.Columns],\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'alias', sqlBehavior: 'sql' }),\n\t\t\t\t) as any,\n\t\t\t);\n\n\t\t\tconst orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];\n\t\t\tthis.config.orderBy = orderByArray;\n\t\t} else {\n\t\t\tconst orderByArray = columns as (SQLiteColumn | SQL | SQL.Aliased)[];\n\t\t\tthis.config.orderBy = orderByArray;\n\t\t}\n\t\treturn this as any;\n\t}\n\n\tlimit(limit: number | Placeholder): SQLiteUpdateWithout {\n\t\tthis.config.limit = limit;\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `returning` clause to the query.\n\t *\n\t * Calling this method will return the specified fields of the updated rows. If no fields are specified, all fields will be returned.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update#update-with-returning}\n\t *\n\t * @example\n\t * ```ts\n\t * // Update all cars with the green color and return all fields\n\t * const updatedCars: Car[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'))\n\t * .returning();\n\t *\n\t * // Update all cars with the green color and return only their id and brand fields\n\t * const updatedCarsIdsAndBrands: { id: number, brand: string }[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'))\n\t * .returning({ id: cars.id, brand: cars.brand });\n\t * ```\n\t */\n\treturning(): SQLiteUpdateReturningAll;\n\treturning(\n\t\tfields: TSelectedFields,\n\t): SQLiteUpdateReturning;\n\treturning(\n\t\tfields: SelectedFields = this.config.table[SQLiteTable.Symbol.Columns],\n\t): SQLiteUpdateWithout {\n\t\tthis.config.returning = orderSelectedFields(fields);\n\t\treturn this as any;\n\t}\n\n\t/** @internal */\n\tgetSQL(): SQL {\n\t\treturn this.dialect.buildUpdateQuery(this.config);\n\t}\n\n\ttoSQL(): Query {\n\t\tconst { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());\n\t\treturn rest;\n\t}\n\n\t/** @internal */\n\t_prepare(isOneTimeQuery = true): SQLiteUpdatePrepare {\n\t\treturn this.session[isOneTimeQuery ? 'prepareOneTimeQuery' : 'prepareQuery'](\n\t\t\tthis.dialect.sqlToQuery(this.getSQL()),\n\t\t\tthis.config.returning,\n\t\t\tthis.config.returning ? 'all' : 'run',\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttype: 'insert',\n\t\t\t\ttables: extractUsedTable(this.config.table),\n\t\t\t},\n\t\t) as SQLiteUpdatePrepare;\n\t}\n\n\tprepare(): SQLiteUpdatePrepare {\n\t\treturn this._prepare(false);\n\t}\n\n\trun: ReturnType['run'] = (placeholderValues) => {\n\t\treturn this._prepare().run(placeholderValues);\n\t};\n\n\tall: ReturnType['all'] = (placeholderValues) => {\n\t\treturn this._prepare().all(placeholderValues);\n\t};\n\n\tget: ReturnType['get'] = (placeholderValues) => {\n\t\treturn this._prepare().get(placeholderValues);\n\t};\n\n\tvalues: ReturnType['values'] = (placeholderValues) => {\n\t\treturn this._prepare().values(placeholderValues);\n\t};\n\n\toverride async execute(): Promise> {\n\t\treturn (this.config.returning ? this.all() : this.run()) as SQLiteUpdateExecute;\n\t}\n\n\t$dynamic(): SQLiteUpdateDynamic {\n\t\treturn this as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAE/B,2BAA6B;AAE7B,6BAAsC;AAItC,mBAA4B;AAC5B,sBAAyB;AACzB,IAAAA,gBAAsB;AACtB,mBAOO;AACP,yBAA+B;AAE/B,IAAAC,gBAAiC;AACjC,uBAA+B;AAyBxB,MAAM,oBAIX;AAAA,EAOD,YACW,OACA,SACA,SACF,UACP;AAJS;AACA;AACA;AACF;AAAA,EACN;AAAA,EAXH,QAAiB,wBAAU,IAAY;AAAA,EAavC,IACC,QAKC;AACD,WAAO,IAAI;AAAA,MACV,KAAK;AAAA,UACL,2BAAa,KAAK,OAAO,MAAM;AAAA,MAC/B,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA,EACD;AACD;AA+IO,MAAM,yBAWH,kCAEV;AAAA,EAMC,YACC,OACA,KACQ,SACA,SACR,UACC;AACD,UAAM;AAJE;AACA;AAIR,SAAK,SAAS,EAAE,KAAK,OAAO,UAAU,OAAO,CAAC,EAAE;AAAA,EACjD;AAAA,EAdA,QAA0B,wBAAU,IAAY;AAAA;AAAA,EAGhD;AAAA,EAaA,KACC,QAC+C;AAC/C,SAAK,OAAO,OAAO;AACnB,WAAO;AAAA,EACR;AAAA,EAEQ,WACP,UAC2B;AAC3B,WAAQ,CACP,OACA,OACI;AACJ,YAAM,gBAAY,+BAAiB,KAAK;AAExC,UAAI,OAAO,cAAc,YAAY,KAAK,OAAO,MAAM,KAAK,CAAC,SAAS,KAAK,UAAU,SAAS,GAAG;AAChG,cAAM,IAAI,MAAM,UAAU,SAAS,iCAAiC;AAAA,MACrE;AAEA,UAAI,OAAO,OAAO,YAAY;AAC7B,cAAM,OAAO,KAAK,OAAO,WACtB,kBAAG,OAAO,wBAAW,IACpB,MAAM,oBAAM,OAAO,OAAO,QAC1B,kBAAG,OAAO,wBAAQ,IAClB,MAAM,EAAE,qBACR,kBAAG,OAAO,+BAAc,IACxB,MAAM,iCAAc,EAAE,iBACtB,SACD;AACH,aAAK;AAAA,UACJ,IAAI;AAAA,YACH,KAAK,OAAO,MAAM,oBAAM,OAAO,OAAO;AAAA,YACtC,IAAI,6CAAsB,EAAE,oBAAoB,OAAO,aAAa,MAAM,CAAC;AAAA,UAC5E;AAAA,UACA,QAAQ,IAAI;AAAA,YACX;AAAA,YACA,IAAI,6CAAsB,EAAE,oBAAoB,OAAO,aAAa,MAAM,CAAC;AAAA,UAC5E;AAAA,QACD;AAAA,MACD;AAEA,WAAK,OAAO,MAAM,KAAK,EAAE,IAAI,OAAO,UAAU,OAAO,UAAU,CAAC;AAEhE,aAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,WAAW,KAAK,WAAW,MAAM;AAAA,EAEjC,YAAY,KAAK,WAAW,OAAO;AAAA,EAEnC,YAAY,KAAK,WAAW,OAAO;AAAA,EAEnC,WAAW,KAAK,WAAW,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCjC,MAAM,OAAsE;AAC3E,SAAK,OAAO,QAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EAMA,WACI,SAG8C;AACjD,QAAI,OAAO,QAAQ,CAAC,MAAM,YAAY;AACrC,YAAM,UAAU,QAAQ,CAAC;AAAA,QACxB,IAAI;AAAA,UACH,KAAK,OAAO,MAAM,oBAAM,OAAO,OAAO;AAAA,UACtC,IAAI,6CAAsB,EAAE,oBAAoB,SAAS,aAAa,MAAM,CAAC;AAAA,QAC9E;AAAA,MACD;AAEA,YAAM,eAAe,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAChE,WAAK,OAAO,UAAU;AAAA,IACvB,OAAO;AACN,YAAM,eAAe;AACrB,WAAK,OAAO,UAAU;AAAA,IACvB;AACA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,OAA2E;AAChF,SAAK,OAAO,QAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EA4BA,UACC,SAAyB,KAAK,OAAO,MAAM,yBAAY,OAAO,OAAO,GACP;AAC9D,SAAK,OAAO,gBAAY,kCAAkC,MAAM;AAChE,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,SAAc;AACb,WAAO,KAAK,QAAQ,iBAAiB,KAAK,MAAM;AAAA,EACjD;AAAA,EAEA,QAAe;AACd,UAAM,EAAE,SAAS,UAAU,GAAG,KAAK,IAAI,KAAK,QAAQ,WAAW,KAAK,OAAO,CAAC;AAC5E,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,SAAS,iBAAiB,MAAiC;AAC1D,WAAO,KAAK,QAAQ,iBAAiB,wBAAwB,cAAc;AAAA,MAC1E,KAAK,QAAQ,WAAW,KAAK,OAAO,CAAC;AAAA,MACrC,KAAK,OAAO;AAAA,MACZ,KAAK,OAAO,YAAY,QAAQ;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,YAAQ,gCAAiB,KAAK,OAAO,KAAK;AAAA,MAC3C;AAAA,IACD;AAAA,EACD;AAAA,EAEA,UAAqC;AACpC,WAAO,KAAK,SAAS,KAAK;AAAA,EAC3B;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,SAAgD,CAAC,sBAAsB;AACtE,WAAO,KAAK,SAAS,EAAE,OAAO,iBAAiB;AAAA,EAChD;AAAA,EAEA,MAAe,UAA8C;AAC5D,WAAQ,KAAK,OAAO,YAAY,KAAK,IAAI,IAAI,KAAK,IAAI;AAAA,EACvD;AAAA,EAEA,WAAsC;AACrC,WAAO;AAAA,EACR;AACD;","names":["import_table","import_utils"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..3988411b1cf6e539950593a6cc3eb540c6af739a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.cts @@ -0,0 +1,151 @@ +import type { GetColumnData } from "../../column.cjs"; +import { entityKind } from "../../entity.cjs"; +import type { SelectResultFields } from "../../query-builders/select.types.cjs"; +import { QueryPromise } from "../../query-promise.cjs"; +import type { RunnableQuery } from "../../runnable-query.cjs"; +import type { Placeholder, Query, SQL, SQLWrapper } from "../../sql/sql.cjs"; +import type { SQLiteDialect } from "../dialect.cjs"; +import type { SQLitePreparedQuery, SQLiteSession } from "../session.cjs"; +import { SQLiteTable } from "../table.cjs"; +import { Subquery } from "../../subquery.cjs"; +import { type DrizzleTypeError, type UpdateSet, type ValueOrArray } from "../../utils.cjs"; +import type { SQLiteColumn } from "../columns/common.cjs"; +import { SQLiteViewBase } from "../view-base.cjs"; +import type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from "./select.types.cjs"; +export interface SQLiteUpdateConfig { + where?: SQL | undefined; + limit?: number | Placeholder; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + set: UpdateSet; + table: SQLiteTable; + from?: SQLiteTable | Subquery | SQLiteViewBase | SQL; + joins: SQLiteSelectJoinConfig[]; + returning?: SelectedFieldsOrdered; + withList?: Subquery[]; +} +export type SQLiteUpdateSetSource = { + [Key in keyof TTable['$inferInsert']]?: GetColumnData | SQL | SQLiteColumn | undefined; +} & {}; +export declare class SQLiteUpdateBuilder { + protected table: TTable; + protected session: SQLiteSession; + protected dialect: SQLiteDialect; + private withList?; + static readonly [entityKind]: string; + readonly _: { + readonly table: TTable; + }; + constructor(table: TTable, session: SQLiteSession, dialect: SQLiteDialect, withList?: Subquery[] | undefined); + set(values: SQLiteUpdateSetSource): SQLiteUpdateWithout, false, 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'>; +} +export type SQLiteUpdateWithout = TDynamic extends true ? T : Omit, T['_']['excludedMethods'] | K>; +export type SQLiteUpdateWithJoins = TDynamic extends true ? T : Omit>, Exclude>; +export type SQLiteUpdateReturningAll = SQLiteUpdateWithout, TDynamic, 'returning'>; +export type SQLiteUpdateReturning = SQLiteUpdateWithout, TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>; +export type SQLiteUpdateExecute = T['_']['returning'] extends undefined ? T['_']['runResult'] : T['_']['returning'][]; +export type SQLiteUpdatePrepare = SQLitePreparedQuery<{ + type: T['_']['resultType']; + run: T['_']['runResult']; + all: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : T['_']['returning'][]; + get: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : T['_']['returning']; + values: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][]; + execute: SQLiteUpdateExecute; +}>; +export type SQLiteUpdateJoinFn = (table: TJoinedTable, on: ((updateTable: T['_']['table']['_']['columns'], from: T['_']['from'] extends SQLiteTable ? T['_']['from']['_']['columns'] : T['_']['from'] extends Subquery | SQLiteViewBase ? T['_']['from']['_']['selectedFields'] : never) => SQL | undefined) | SQL | undefined) => T; +export type SQLiteUpdateDynamic = SQLiteUpdate; +export type SQLiteUpdate | undefined = Record | undefined> = SQLiteUpdateBase; +export type AnySQLiteUpdate = SQLiteUpdateBase; +export interface SQLiteUpdateBase extends SQLWrapper, QueryPromise { + readonly _: { + readonly dialect: 'sqlite'; + readonly table: TTable; + readonly resultType: TResultType; + readonly runResult: TRunResult; + readonly from: TFrom; + readonly returning: TReturning; + readonly dynamic: TDynamic; + readonly excludedMethods: TExcludedMethods; + readonly result: TReturning extends undefined ? TRunResult : TReturning[]; + }; +} +export declare class SQLiteUpdateBase extends QueryPromise implements RunnableQuery, SQLWrapper { + private session; + private dialect; + static readonly [entityKind]: string; + constructor(table: TTable, set: UpdateSet, session: SQLiteSession, dialect: SQLiteDialect, withList?: Subquery[]); + from(source: TFrom): SQLiteUpdateWithJoins; + private createJoin; + leftJoin: SQLiteUpdateJoinFn; + rightJoin: SQLiteUpdateJoinFn; + innerJoin: SQLiteUpdateJoinFn; + fullJoin: SQLiteUpdateJoinFn; + /** + * Adds a 'where' clause to the query. + * + * Calling this method will update only those rows that fulfill a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/update} + * + * @param where the 'where' clause. + * + * @example + * You can use conditional operators and `sql function` to filter the rows to be updated. + * + * ```ts + * // Update all cars with green color + * db.update(cars).set({ color: 'red' }) + * .where(eq(cars.color, 'green')); + * // or + * db.update(cars).set({ color: 'red' }) + * .where(sql`${cars.color} = 'green'`) + * ``` + * + * You can logically combine conditional operators with `and()` and `or()` operators: + * + * ```ts + * // Update all BMW cars with a green color + * db.update(cars).set({ color: 'red' }) + * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); + * + * // Update all cars with the green or blue color + * db.update(cars).set({ color: 'red' }) + * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); + * ``` + */ + where(where: SQL | undefined): SQLiteUpdateWithout; + orderBy(builder: (updateTable: TTable) => ValueOrArray): SQLiteUpdateWithout; + orderBy(...columns: (SQLiteColumn | SQL | SQL.Aliased)[]): SQLiteUpdateWithout; + limit(limit: number | Placeholder): SQLiteUpdateWithout; + /** + * Adds a `returning` clause to the query. + * + * Calling this method will return the specified fields of the updated rows. If no fields are specified, all fields will be returned. + * + * See docs: {@link https://orm.drizzle.team/docs/update#update-with-returning} + * + * @example + * ```ts + * // Update all cars with the green color and return all fields + * const updatedCars: Car[] = await db.update(cars) + * .set({ color: 'red' }) + * .where(eq(cars.color, 'green')) + * .returning(); + * + * // Update all cars with the green color and return only their id and brand fields + * const updatedCarsIdsAndBrands: { id: number, brand: string }[] = await db.update(cars) + * .set({ color: 'red' }) + * .where(eq(cars.color, 'green')) + * .returning({ id: cars.id, brand: cars.brand }); + * ``` + */ + returning(): SQLiteUpdateReturningAll; + returning(fields: TSelectedFields): SQLiteUpdateReturning; + toSQL(): Query; + prepare(): SQLiteUpdatePrepare; + run: ReturnType['run']; + all: ReturnType['all']; + get: ReturnType['get']; + values: ReturnType['values']; + execute(): Promise>; + $dynamic(): SQLiteUpdateDynamic; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b3fceb909cbeaf89d895f6581e13fe3c77d5fbd --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.d.ts @@ -0,0 +1,151 @@ +import type { GetColumnData } from "../../column.js"; +import { entityKind } from "../../entity.js"; +import type { SelectResultFields } from "../../query-builders/select.types.js"; +import { QueryPromise } from "../../query-promise.js"; +import type { RunnableQuery } from "../../runnable-query.js"; +import type { Placeholder, Query, SQL, SQLWrapper } from "../../sql/sql.js"; +import type { SQLiteDialect } from "../dialect.js"; +import type { SQLitePreparedQuery, SQLiteSession } from "../session.js"; +import { SQLiteTable } from "../table.js"; +import { Subquery } from "../../subquery.js"; +import { type DrizzleTypeError, type UpdateSet, type ValueOrArray } from "../../utils.js"; +import type { SQLiteColumn } from "../columns/common.js"; +import { SQLiteViewBase } from "../view-base.js"; +import type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from "./select.types.js"; +export interface SQLiteUpdateConfig { + where?: SQL | undefined; + limit?: number | Placeholder; + orderBy?: (SQLiteColumn | SQL | SQL.Aliased)[]; + set: UpdateSet; + table: SQLiteTable; + from?: SQLiteTable | Subquery | SQLiteViewBase | SQL; + joins: SQLiteSelectJoinConfig[]; + returning?: SelectedFieldsOrdered; + withList?: Subquery[]; +} +export type SQLiteUpdateSetSource = { + [Key in keyof TTable['$inferInsert']]?: GetColumnData | SQL | SQLiteColumn | undefined; +} & {}; +export declare class SQLiteUpdateBuilder { + protected table: TTable; + protected session: SQLiteSession; + protected dialect: SQLiteDialect; + private withList?; + static readonly [entityKind]: string; + readonly _: { + readonly table: TTable; + }; + constructor(table: TTable, session: SQLiteSession, dialect: SQLiteDialect, withList?: Subquery[] | undefined); + set(values: SQLiteUpdateSetSource): SQLiteUpdateWithout, false, 'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'>; +} +export type SQLiteUpdateWithout = TDynamic extends true ? T : Omit, T['_']['excludedMethods'] | K>; +export type SQLiteUpdateWithJoins = TDynamic extends true ? T : Omit>, Exclude>; +export type SQLiteUpdateReturningAll = SQLiteUpdateWithout, TDynamic, 'returning'>; +export type SQLiteUpdateReturning = SQLiteUpdateWithout, TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>; +export type SQLiteUpdateExecute = T['_']['returning'] extends undefined ? T['_']['runResult'] : T['_']['returning'][]; +export type SQLiteUpdatePrepare = SQLitePreparedQuery<{ + type: T['_']['resultType']; + run: T['_']['runResult']; + all: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'> : T['_']['returning'][]; + get: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'> : T['_']['returning']; + values: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'> : any[][]; + execute: SQLiteUpdateExecute; +}>; +export type SQLiteUpdateJoinFn = (table: TJoinedTable, on: ((updateTable: T['_']['table']['_']['columns'], from: T['_']['from'] extends SQLiteTable ? T['_']['from']['_']['columns'] : T['_']['from'] extends Subquery | SQLiteViewBase ? T['_']['from']['_']['selectedFields'] : never) => SQL | undefined) | SQL | undefined) => T; +export type SQLiteUpdateDynamic = SQLiteUpdate; +export type SQLiteUpdate | undefined = Record | undefined> = SQLiteUpdateBase; +export type AnySQLiteUpdate = SQLiteUpdateBase; +export interface SQLiteUpdateBase extends SQLWrapper, QueryPromise { + readonly _: { + readonly dialect: 'sqlite'; + readonly table: TTable; + readonly resultType: TResultType; + readonly runResult: TRunResult; + readonly from: TFrom; + readonly returning: TReturning; + readonly dynamic: TDynamic; + readonly excludedMethods: TExcludedMethods; + readonly result: TReturning extends undefined ? TRunResult : TReturning[]; + }; +} +export declare class SQLiteUpdateBase extends QueryPromise implements RunnableQuery, SQLWrapper { + private session; + private dialect; + static readonly [entityKind]: string; + constructor(table: TTable, set: UpdateSet, session: SQLiteSession, dialect: SQLiteDialect, withList?: Subquery[]); + from(source: TFrom): SQLiteUpdateWithJoins; + private createJoin; + leftJoin: SQLiteUpdateJoinFn; + rightJoin: SQLiteUpdateJoinFn; + innerJoin: SQLiteUpdateJoinFn; + fullJoin: SQLiteUpdateJoinFn; + /** + * Adds a 'where' clause to the query. + * + * Calling this method will update only those rows that fulfill a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/update} + * + * @param where the 'where' clause. + * + * @example + * You can use conditional operators and `sql function` to filter the rows to be updated. + * + * ```ts + * // Update all cars with green color + * db.update(cars).set({ color: 'red' }) + * .where(eq(cars.color, 'green')); + * // or + * db.update(cars).set({ color: 'red' }) + * .where(sql`${cars.color} = 'green'`) + * ``` + * + * You can logically combine conditional operators with `and()` and `or()` operators: + * + * ```ts + * // Update all BMW cars with a green color + * db.update(cars).set({ color: 'red' }) + * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); + * + * // Update all cars with the green or blue color + * db.update(cars).set({ color: 'red' }) + * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); + * ``` + */ + where(where: SQL | undefined): SQLiteUpdateWithout; + orderBy(builder: (updateTable: TTable) => ValueOrArray): SQLiteUpdateWithout; + orderBy(...columns: (SQLiteColumn | SQL | SQL.Aliased)[]): SQLiteUpdateWithout; + limit(limit: number | Placeholder): SQLiteUpdateWithout; + /** + * Adds a `returning` clause to the query. + * + * Calling this method will return the specified fields of the updated rows. If no fields are specified, all fields will be returned. + * + * See docs: {@link https://orm.drizzle.team/docs/update#update-with-returning} + * + * @example + * ```ts + * // Update all cars with the green color and return all fields + * const updatedCars: Car[] = await db.update(cars) + * .set({ color: 'red' }) + * .where(eq(cars.color, 'green')) + * .returning(); + * + * // Update all cars with the green color and return only their id and brand fields + * const updatedCarsIdsAndBrands: { id: number, brand: string }[] = await db.update(cars) + * .set({ color: 'red' }) + * .where(eq(cars.color, 'green')) + * .returning({ id: cars.id, brand: cars.brand }); + * ``` + */ + returning(): SQLiteUpdateReturningAll; + returning(fields: TSelectedFields): SQLiteUpdateReturning; + toSQL(): Query; + prepare(): SQLiteUpdatePrepare; + run: ReturnType['run']; + all: ReturnType['all']; + get: ReturnType['get']; + values: ReturnType['values']; + execute(): Promise>; + $dynamic(): SQLiteUpdateDynamic; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js new file mode 100644 index 0000000000000000000000000000000000000000..f9d33513ec6247c7951c45ef4c7ad6a1bdd7b71b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js @@ -0,0 +1,183 @@ +import { entityKind, is } from "../../entity.js"; +import { QueryPromise } from "../../query-promise.js"; +import { SelectionProxyHandler } from "../../selection-proxy.js"; +import { SQLiteTable } from "../table.js"; +import { Subquery } from "../../subquery.js"; +import { Table } from "../../table.js"; +import { + getTableLikeName, + mapUpdateSet, + orderSelectedFields +} from "../../utils.js"; +import { ViewBaseConfig } from "../../view-common.js"; +import { extractUsedTable } from "../utils.js"; +import { SQLiteViewBase } from "../view-base.js"; +class SQLiteUpdateBuilder { + constructor(table, session, dialect, withList) { + this.table = table; + this.session = session; + this.dialect = dialect; + this.withList = withList; + } + static [entityKind] = "SQLiteUpdateBuilder"; + set(values) { + return new SQLiteUpdateBase( + this.table, + mapUpdateSet(this.table, values), + this.session, + this.dialect, + this.withList + ); + } +} +class SQLiteUpdateBase extends QueryPromise { + constructor(table, set, session, dialect, withList) { + super(); + this.session = session; + this.dialect = dialect; + this.config = { set, table, withList, joins: [] }; + } + static [entityKind] = "SQLiteUpdate"; + /** @internal */ + config; + from(source) { + this.config.from = source; + return this; + } + createJoin(joinType) { + return (table, on) => { + const tableName = getTableLikeName(table); + if (typeof tableName === "string" && this.config.joins.some((join) => join.alias === tableName)) { + throw new Error(`Alias "${tableName}" is already used in this query`); + } + if (typeof on === "function") { + const from = this.config.from ? is(table, SQLiteTable) ? table[Table.Symbol.Columns] : is(table, Subquery) ? table._.selectedFields : is(table, SQLiteViewBase) ? table[ViewBaseConfig].selectedFields : void 0 : void 0; + on = on( + new Proxy( + this.config.table[Table.Symbol.Columns], + new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ), + from && new Proxy( + from, + new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" }) + ) + ); + } + this.config.joins.push({ on, table, joinType, alias: tableName }); + return this; + }; + } + leftJoin = this.createJoin("left"); + rightJoin = this.createJoin("right"); + innerJoin = this.createJoin("inner"); + fullJoin = this.createJoin("full"); + /** + * Adds a 'where' clause to the query. + * + * Calling this method will update only those rows that fulfill a specified condition. + * + * See docs: {@link https://orm.drizzle.team/docs/update} + * + * @param where the 'where' clause. + * + * @example + * You can use conditional operators and `sql function` to filter the rows to be updated. + * + * ```ts + * // Update all cars with green color + * db.update(cars).set({ color: 'red' }) + * .where(eq(cars.color, 'green')); + * // or + * db.update(cars).set({ color: 'red' }) + * .where(sql`${cars.color} = 'green'`) + * ``` + * + * You can logically combine conditional operators with `and()` and `or()` operators: + * + * ```ts + * // Update all BMW cars with a green color + * db.update(cars).set({ color: 'red' }) + * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW'))); + * + * // Update all cars with the green or blue color + * db.update(cars).set({ color: 'red' }) + * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue'))); + * ``` + */ + where(where) { + this.config.where = where; + return this; + } + orderBy(...columns) { + if (typeof columns[0] === "function") { + const orderBy = columns[0]( + new Proxy( + this.config.table[Table.Symbol.Columns], + new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" }) + ) + ); + const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy]; + this.config.orderBy = orderByArray; + } else { + const orderByArray = columns; + this.config.orderBy = orderByArray; + } + return this; + } + limit(limit) { + this.config.limit = limit; + return this; + } + returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) { + this.config.returning = orderSelectedFields(fields); + return this; + } + /** @internal */ + getSQL() { + return this.dialect.buildUpdateQuery(this.config); + } + toSQL() { + const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL()); + return rest; + } + /** @internal */ + _prepare(isOneTimeQuery = true) { + return this.session[isOneTimeQuery ? "prepareOneTimeQuery" : "prepareQuery"]( + this.dialect.sqlToQuery(this.getSQL()), + this.config.returning, + this.config.returning ? "all" : "run", + true, + void 0, + { + type: "insert", + tables: extractUsedTable(this.config.table) + } + ); + } + prepare() { + return this._prepare(false); + } + run = (placeholderValues) => { + return this._prepare().run(placeholderValues); + }; + all = (placeholderValues) => { + return this._prepare().all(placeholderValues); + }; + get = (placeholderValues) => { + return this._prepare().get(placeholderValues); + }; + values = (placeholderValues) => { + return this._prepare().values(placeholderValues); + }; + async execute() { + return this.config.returning ? this.all() : this.run(); + } + $dynamic() { + return this; + } +} +export { + SQLiteUpdateBase, + SQLiteUpdateBuilder +}; +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3cd57ce6d189b02fa2463a5be51204513e99c27e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/query-builders/update.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/sqlite-core/query-builders/update.ts"],"sourcesContent":["import type { GetColumnData } from '~/column.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport type { JoinType, SelectResultFields } from '~/query-builders/select.types.ts';\nimport { QueryPromise } from '~/query-promise.ts';\nimport type { RunnableQuery } from '~/runnable-query.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport type { Placeholder, Query, SQL, SQLWrapper } from '~/sql/sql.ts';\nimport type { SQLiteDialect } from '~/sqlite-core/dialect.ts';\nimport type { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts';\nimport { SQLiteTable } from '~/sqlite-core/table.ts';\nimport { Subquery } from '~/subquery.ts';\nimport { Table } from '~/table.ts';\nimport {\n\ttype DrizzleTypeError,\n\tgetTableLikeName,\n\tmapUpdateSet,\n\torderSelectedFields,\n\ttype UpdateSet,\n\ttype ValueOrArray,\n} from '~/utils.ts';\nimport { ViewBaseConfig } from '~/view-common.ts';\nimport type { SQLiteColumn } from '../columns/common.ts';\nimport { extractUsedTable } from '../utils.ts';\nimport { SQLiteViewBase } from '../view-base.ts';\nimport type { SelectedFields, SelectedFieldsOrdered, SQLiteSelectJoinConfig } from './select.types.ts';\n\nexport interface SQLiteUpdateConfig {\n\twhere?: SQL | undefined;\n\tlimit?: number | Placeholder;\n\torderBy?: (SQLiteColumn | SQL | SQL.Aliased)[];\n\tset: UpdateSet;\n\ttable: SQLiteTable;\n\tfrom?: SQLiteTable | Subquery | SQLiteViewBase | SQL;\n\tjoins: SQLiteSelectJoinConfig[];\n\treturning?: SelectedFieldsOrdered;\n\twithList?: Subquery[];\n}\n\nexport type SQLiteUpdateSetSource =\n\t& {\n\t\t[Key in keyof TTable['$inferInsert']]?:\n\t\t\t| GetColumnData\n\t\t\t| SQL\n\t\t\t| SQLiteColumn\n\t\t\t| undefined;\n\t}\n\t& {};\n\nexport class SQLiteUpdateBuilder<\n\tTTable extends SQLiteTable,\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteUpdateBuilder';\n\n\tdeclare readonly _: {\n\t\treadonly table: TTable;\n\t};\n\n\tconstructor(\n\t\tprotected table: TTable,\n\t\tprotected session: SQLiteSession,\n\t\tprotected dialect: SQLiteDialect,\n\t\tprivate withList?: Subquery[],\n\t) {}\n\n\tset(\n\t\tvalues: SQLiteUpdateSetSource,\n\t): SQLiteUpdateWithout<\n\t\tSQLiteUpdateBase,\n\t\tfalse,\n\t\t'leftJoin' | 'rightJoin' | 'innerJoin' | 'fullJoin'\n\t> {\n\t\treturn new SQLiteUpdateBase(\n\t\t\tthis.table,\n\t\t\tmapUpdateSet(this.table, values),\n\t\t\tthis.session,\n\t\t\tthis.dialect,\n\t\t\tthis.withList,\n\t\t) as any;\n\t}\n}\n\nexport type SQLiteUpdateWithout<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tK extends keyof T & string,\n> = TDynamic extends true ? T : Omit<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tT['_']['returning'],\n\t\tTDynamic,\n\t\tT['_']['excludedMethods'] | K\n\t>,\n\tT['_']['excludedMethods'] | K\n>;\n\nexport type SQLiteUpdateWithJoins<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n> = TDynamic extends true ? T : Omit<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tTFrom,\n\t\tT['_']['returning'],\n\t\tTDynamic,\n\t\tExclude\n\t>,\n\tExclude\n>;\n\nexport type SQLiteUpdateReturningAll = SQLiteUpdateWithout<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tT['_']['table']['$inferSelect'],\n\t\tTDynamic,\n\t\tT['_']['excludedMethods']\n\t>,\n\tTDynamic,\n\t'returning'\n>;\n\nexport type SQLiteUpdateReturning<\n\tT extends AnySQLiteUpdate,\n\tTDynamic extends boolean,\n\tTSelectedFields extends SelectedFields,\n> = SQLiteUpdateWithout<\n\tSQLiteUpdateBase<\n\t\tT['_']['table'],\n\t\tT['_']['resultType'],\n\t\tT['_']['runResult'],\n\t\tT['_']['from'],\n\t\tSelectResultFields,\n\t\tTDynamic,\n\t\tT['_']['excludedMethods']\n\t>,\n\tTDynamic,\n\t'returning'\n>;\n\nexport type SQLiteUpdateExecute = T['_']['returning'] extends undefined ? T['_']['runResult']\n\t: T['_']['returning'][];\n\nexport type SQLiteUpdatePrepare = SQLitePreparedQuery<\n\t{\n\t\ttype: T['_']['resultType'];\n\t\trun: T['_']['runResult'];\n\t\tall: T['_']['returning'] extends undefined ? DrizzleTypeError<'.all() cannot be used without .returning()'>\n\t\t\t: T['_']['returning'][];\n\t\tget: T['_']['returning'] extends undefined ? DrizzleTypeError<'.get() cannot be used without .returning()'>\n\t\t\t: T['_']['returning'];\n\t\tvalues: T['_']['returning'] extends undefined ? DrizzleTypeError<'.values() cannot be used without .returning()'>\n\t\t\t: any[][];\n\t\texecute: SQLiteUpdateExecute;\n\t}\n>;\n\nexport type SQLiteUpdateJoinFn<\n\tT extends AnySQLiteUpdate,\n> = <\n\tTJoinedTable extends SQLiteTable | Subquery | SQLiteViewBase | SQL,\n>(\n\ttable: TJoinedTable,\n\ton:\n\t\t| (\n\t\t\t(\n\t\t\t\tupdateTable: T['_']['table']['_']['columns'],\n\t\t\t\tfrom: T['_']['from'] extends SQLiteTable ? T['_']['from']['_']['columns']\n\t\t\t\t\t: T['_']['from'] extends Subquery | SQLiteViewBase ? T['_']['from']['_']['selectedFields']\n\t\t\t\t\t: never,\n\t\t\t) => SQL | undefined\n\t\t)\n\t\t| SQL\n\t\t| undefined,\n) => T;\n\nexport type SQLiteUpdateDynamic = SQLiteUpdate<\n\tT['_']['table'],\n\tT['_']['resultType'],\n\tT['_']['runResult'],\n\tT['_']['returning']\n>;\n\nexport type SQLiteUpdate<\n\tTTable extends SQLiteTable = SQLiteTable,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = any,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning extends Record | undefined = Record | undefined,\n> = SQLiteUpdateBase;\n\nexport type AnySQLiteUpdate = SQLiteUpdateBase;\n\nexport interface SQLiteUpdateBase<\n\tTTable extends SQLiteTable = SQLiteTable,\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning = undefined,\n\tTDynamic extends boolean = false,\n\tTExcludedMethods extends string = never,\n> extends SQLWrapper, QueryPromise {\n\treadonly _: {\n\t\treadonly dialect: 'sqlite';\n\t\treadonly table: TTable;\n\t\treadonly resultType: TResultType;\n\t\treadonly runResult: TRunResult;\n\t\treadonly from: TFrom;\n\t\treadonly returning: TReturning;\n\t\treadonly dynamic: TDynamic;\n\t\treadonly excludedMethods: TExcludedMethods;\n\t\treadonly result: TReturning extends undefined ? TRunResult : TReturning[];\n\t};\n}\n\nexport class SQLiteUpdateBase<\n\tTTable extends SQLiteTable = SQLiteTable,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTResultType extends 'sync' | 'async' = 'sync' | 'async',\n\tTRunResult = unknown,\n\tTFrom extends SQLiteTable | Subquery | SQLiteViewBase | SQL | undefined = undefined,\n\tTReturning = undefined,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTDynamic extends boolean = false,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTExcludedMethods extends string = never,\n> extends QueryPromise\n\timplements RunnableQuery, SQLWrapper\n{\n\tstatic override readonly [entityKind]: string = 'SQLiteUpdate';\n\n\t/** @internal */\n\tconfig: SQLiteUpdateConfig;\n\n\tconstructor(\n\t\ttable: TTable,\n\t\tset: UpdateSet,\n\t\tprivate session: SQLiteSession,\n\t\tprivate dialect: SQLiteDialect,\n\t\twithList?: Subquery[],\n\t) {\n\t\tsuper();\n\t\tthis.config = { set, table, withList, joins: [] };\n\t}\n\n\tfrom(\n\t\tsource: TFrom,\n\t): SQLiteUpdateWithJoins {\n\t\tthis.config.from = source;\n\t\treturn this as any;\n\t}\n\n\tprivate createJoin(\n\t\tjoinType: TJoinType,\n\t): SQLiteUpdateJoinFn {\n\t\treturn ((\n\t\t\ttable: SQLiteTable | Subquery | SQLiteViewBase | SQL,\n\t\t\ton: ((updateTable: TTable, from: TFrom) => SQL | undefined) | SQL | undefined,\n\t\t) => {\n\t\t\tconst tableName = getTableLikeName(table);\n\n\t\t\tif (typeof tableName === 'string' && this.config.joins.some((join) => join.alias === tableName)) {\n\t\t\t\tthrow new Error(`Alias \"${tableName}\" is already used in this query`);\n\t\t\t}\n\n\t\t\tif (typeof on === 'function') {\n\t\t\t\tconst from = this.config.from\n\t\t\t\t\t? is(table, SQLiteTable)\n\t\t\t\t\t\t? table[Table.Symbol.Columns]\n\t\t\t\t\t\t: is(table, Subquery)\n\t\t\t\t\t\t? table._.selectedFields\n\t\t\t\t\t\t: is(table, SQLiteViewBase)\n\t\t\t\t\t\t? table[ViewBaseConfig].selectedFields\n\t\t\t\t\t\t: undefined\n\t\t\t\t\t: undefined;\n\t\t\t\ton = on(\n\t\t\t\t\tnew Proxy(\n\t\t\t\t\t\tthis.config.table[Table.Symbol.Columns],\n\t\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t\t) as any,\n\t\t\t\t\tfrom && new Proxy(\n\t\t\t\t\t\tfrom,\n\t\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'sql', sqlBehavior: 'sql' }),\n\t\t\t\t\t) as any,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.config.joins.push({ on, table, joinType, alias: tableName });\n\n\t\t\treturn this as any;\n\t\t}) as any;\n\t}\n\n\tleftJoin = this.createJoin('left');\n\n\trightJoin = this.createJoin('right');\n\n\tinnerJoin = this.createJoin('inner');\n\n\tfullJoin = this.createJoin('full');\n\n\t/**\n\t * Adds a 'where' clause to the query.\n\t *\n\t * Calling this method will update only those rows that fulfill a specified condition.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param where the 'where' clause.\n\t *\n\t * @example\n\t * You can use conditional operators and `sql function` to filter the rows to be updated.\n\t *\n\t * ```ts\n\t * // Update all cars with green color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'));\n\t * // or\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(sql`${cars.color} = 'green'`)\n\t * ```\n\t *\n\t * You can logically combine conditional operators with `and()` and `or()` operators:\n\t *\n\t * ```ts\n\t * // Update all BMW cars with a green color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));\n\t *\n\t * // Update all cars with the green or blue color\n\t * db.update(cars).set({ color: 'red' })\n\t * .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));\n\t * ```\n\t */\n\twhere(where: SQL | undefined): SQLiteUpdateWithout {\n\t\tthis.config.where = where;\n\t\treturn this as any;\n\t}\n\n\torderBy(\n\t\tbuilder: (updateTable: TTable) => ValueOrArray,\n\t): SQLiteUpdateWithout;\n\torderBy(...columns: (SQLiteColumn | SQL | SQL.Aliased)[]): SQLiteUpdateWithout;\n\torderBy(\n\t\t...columns:\n\t\t\t| [(updateTable: TTable) => ValueOrArray]\n\t\t\t| (SQLiteColumn | SQL | SQL.Aliased)[]\n\t): SQLiteUpdateWithout {\n\t\tif (typeof columns[0] === 'function') {\n\t\t\tconst orderBy = columns[0](\n\t\t\t\tnew Proxy(\n\t\t\t\t\tthis.config.table[Table.Symbol.Columns],\n\t\t\t\t\tnew SelectionProxyHandler({ sqlAliasedBehavior: 'alias', sqlBehavior: 'sql' }),\n\t\t\t\t) as any,\n\t\t\t);\n\n\t\t\tconst orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];\n\t\t\tthis.config.orderBy = orderByArray;\n\t\t} else {\n\t\t\tconst orderByArray = columns as (SQLiteColumn | SQL | SQL.Aliased)[];\n\t\t\tthis.config.orderBy = orderByArray;\n\t\t}\n\t\treturn this as any;\n\t}\n\n\tlimit(limit: number | Placeholder): SQLiteUpdateWithout {\n\t\tthis.config.limit = limit;\n\t\treturn this as any;\n\t}\n\n\t/**\n\t * Adds a `returning` clause to the query.\n\t *\n\t * Calling this method will return the specified fields of the updated rows. If no fields are specified, all fields will be returned.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update#update-with-returning}\n\t *\n\t * @example\n\t * ```ts\n\t * // Update all cars with the green color and return all fields\n\t * const updatedCars: Car[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'))\n\t * .returning();\n\t *\n\t * // Update all cars with the green color and return only their id and brand fields\n\t * const updatedCarsIdsAndBrands: { id: number, brand: string }[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.color, 'green'))\n\t * .returning({ id: cars.id, brand: cars.brand });\n\t * ```\n\t */\n\treturning(): SQLiteUpdateReturningAll;\n\treturning(\n\t\tfields: TSelectedFields,\n\t): SQLiteUpdateReturning;\n\treturning(\n\t\tfields: SelectedFields = this.config.table[SQLiteTable.Symbol.Columns],\n\t): SQLiteUpdateWithout {\n\t\tthis.config.returning = orderSelectedFields(fields);\n\t\treturn this as any;\n\t}\n\n\t/** @internal */\n\tgetSQL(): SQL {\n\t\treturn this.dialect.buildUpdateQuery(this.config);\n\t}\n\n\ttoSQL(): Query {\n\t\tconst { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());\n\t\treturn rest;\n\t}\n\n\t/** @internal */\n\t_prepare(isOneTimeQuery = true): SQLiteUpdatePrepare {\n\t\treturn this.session[isOneTimeQuery ? 'prepareOneTimeQuery' : 'prepareQuery'](\n\t\t\tthis.dialect.sqlToQuery(this.getSQL()),\n\t\t\tthis.config.returning,\n\t\t\tthis.config.returning ? 'all' : 'run',\n\t\t\ttrue,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttype: 'insert',\n\t\t\t\ttables: extractUsedTable(this.config.table),\n\t\t\t},\n\t\t) as SQLiteUpdatePrepare;\n\t}\n\n\tprepare(): SQLiteUpdatePrepare {\n\t\treturn this._prepare(false);\n\t}\n\n\trun: ReturnType['run'] = (placeholderValues) => {\n\t\treturn this._prepare().run(placeholderValues);\n\t};\n\n\tall: ReturnType['all'] = (placeholderValues) => {\n\t\treturn this._prepare().all(placeholderValues);\n\t};\n\n\tget: ReturnType['get'] = (placeholderValues) => {\n\t\treturn this._prepare().get(placeholderValues);\n\t};\n\n\tvalues: ReturnType['values'] = (placeholderValues) => {\n\t\treturn this._prepare().values(placeholderValues);\n\t};\n\n\toverride async execute(): Promise> {\n\t\treturn (this.config.returning ? this.all() : this.run()) as SQLiteUpdateExecute;\n\t}\n\n\t$dynamic(): SQLiteUpdateDynamic {\n\t\treturn this as any;\n\t}\n}\n"],"mappings":"AACA,SAAS,YAAY,UAAU;AAE/B,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AAItC,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AACP,SAAS,sBAAsB;AAE/B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAyBxB,MAAM,oBAIX;AAAA,EAOD,YACW,OACA,SACA,SACF,UACP;AAJS;AACA;AACA;AACF;AAAA,EACN;AAAA,EAXH,QAAiB,UAAU,IAAY;AAAA,EAavC,IACC,QAKC;AACD,WAAO,IAAI;AAAA,MACV,KAAK;AAAA,MACL,aAAa,KAAK,OAAO,MAAM;AAAA,MAC/B,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,IACN;AAAA,EACD;AACD;AA+IO,MAAM,yBAWH,aAEV;AAAA,EAMC,YACC,OACA,KACQ,SACA,SACR,UACC;AACD,UAAM;AAJE;AACA;AAIR,SAAK,SAAS,EAAE,KAAK,OAAO,UAAU,OAAO,CAAC,EAAE;AAAA,EACjD;AAAA,EAdA,QAA0B,UAAU,IAAY;AAAA;AAAA,EAGhD;AAAA,EAaA,KACC,QAC+C;AAC/C,SAAK,OAAO,OAAO;AACnB,WAAO;AAAA,EACR;AAAA,EAEQ,WACP,UAC2B;AAC3B,WAAQ,CACP,OACA,OACI;AACJ,YAAM,YAAY,iBAAiB,KAAK;AAExC,UAAI,OAAO,cAAc,YAAY,KAAK,OAAO,MAAM,KAAK,CAAC,SAAS,KAAK,UAAU,SAAS,GAAG;AAChG,cAAM,IAAI,MAAM,UAAU,SAAS,iCAAiC;AAAA,MACrE;AAEA,UAAI,OAAO,OAAO,YAAY;AAC7B,cAAM,OAAO,KAAK,OAAO,OACtB,GAAG,OAAO,WAAW,IACpB,MAAM,MAAM,OAAO,OAAO,IAC1B,GAAG,OAAO,QAAQ,IAClB,MAAM,EAAE,iBACR,GAAG,OAAO,cAAc,IACxB,MAAM,cAAc,EAAE,iBACtB,SACD;AACH,aAAK;AAAA,UACJ,IAAI;AAAA,YACH,KAAK,OAAO,MAAM,MAAM,OAAO,OAAO;AAAA,YACtC,IAAI,sBAAsB,EAAE,oBAAoB,OAAO,aAAa,MAAM,CAAC;AAAA,UAC5E;AAAA,UACA,QAAQ,IAAI;AAAA,YACX;AAAA,YACA,IAAI,sBAAsB,EAAE,oBAAoB,OAAO,aAAa,MAAM,CAAC;AAAA,UAC5E;AAAA,QACD;AAAA,MACD;AAEA,WAAK,OAAO,MAAM,KAAK,EAAE,IAAI,OAAO,UAAU,OAAO,UAAU,CAAC;AAEhE,aAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,WAAW,KAAK,WAAW,MAAM;AAAA,EAEjC,YAAY,KAAK,WAAW,OAAO;AAAA,EAEnC,YAAY,KAAK,WAAW,OAAO;AAAA,EAEnC,WAAW,KAAK,WAAW,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmCjC,MAAM,OAAsE;AAC3E,SAAK,OAAO,QAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EAMA,WACI,SAG8C;AACjD,QAAI,OAAO,QAAQ,CAAC,MAAM,YAAY;AACrC,YAAM,UAAU,QAAQ,CAAC;AAAA,QACxB,IAAI;AAAA,UACH,KAAK,OAAO,MAAM,MAAM,OAAO,OAAO;AAAA,UACtC,IAAI,sBAAsB,EAAE,oBAAoB,SAAS,aAAa,MAAM,CAAC;AAAA,QAC9E;AAAA,MACD;AAEA,YAAM,eAAe,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAChE,WAAK,OAAO,UAAU;AAAA,IACvB,OAAO;AACN,YAAM,eAAe;AACrB,WAAK,OAAO,UAAU;AAAA,IACvB;AACA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,OAA2E;AAChF,SAAK,OAAO,QAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EA4BA,UACC,SAAyB,KAAK,OAAO,MAAM,YAAY,OAAO,OAAO,GACP;AAC9D,SAAK,OAAO,YAAY,oBAAkC,MAAM;AAChE,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,SAAc;AACb,WAAO,KAAK,QAAQ,iBAAiB,KAAK,MAAM;AAAA,EACjD;AAAA,EAEA,QAAe;AACd,UAAM,EAAE,SAAS,UAAU,GAAG,KAAK,IAAI,KAAK,QAAQ,WAAW,KAAK,OAAO,CAAC;AAC5E,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,SAAS,iBAAiB,MAAiC;AAC1D,WAAO,KAAK,QAAQ,iBAAiB,wBAAwB,cAAc;AAAA,MAC1E,KAAK,QAAQ,WAAW,KAAK,OAAO,CAAC;AAAA,MACrC,KAAK,OAAO;AAAA,MACZ,KAAK,OAAO,YAAY,QAAQ;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,QAAQ,iBAAiB,KAAK,OAAO,KAAK;AAAA,MAC3C;AAAA,IACD;AAAA,EACD;AAAA,EAEA,UAAqC;AACpC,WAAO,KAAK,SAAS,KAAK;AAAA,EAC3B;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,MAA0C,CAAC,sBAAsB;AAChE,WAAO,KAAK,SAAS,EAAE,IAAI,iBAAiB;AAAA,EAC7C;AAAA,EAEA,SAAgD,CAAC,sBAAsB;AACtE,WAAO,KAAK,SAAS,EAAE,OAAO,iBAAiB;AAAA,EAChD;AAAA,EAEA,MAAe,UAA8C;AAC5D,WAAQ,KAAK,OAAO,YAAY,KAAK,IAAI,IAAI,KAAK,IAAI;AAAA,EACvD;AAAA,EAEA,WAAsC;AACrC,WAAO;AAAA,EACR;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs new file mode 100644 index 0000000000000000000000000000000000000000..bc1ff40989a1d11a4730d21ceae1ea2a0edc2e5d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs @@ -0,0 +1,233 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var session_exports = {}; +__export(session_exports, { + ExecuteResultSync: () => ExecuteResultSync, + SQLitePreparedQuery: () => SQLitePreparedQuery, + SQLiteSession: () => SQLiteSession, + SQLiteTransaction: () => SQLiteTransaction +}); +module.exports = __toCommonJS(session_exports); +var import_cache = require("../cache/core/cache.cjs"); +var import_entity = require("../entity.cjs"); +var import_errors = require("../errors.cjs"); +var import_query_promise = require("../query-promise.cjs"); +var import_db = require("./db.cjs"); +class ExecuteResultSync extends import_query_promise.QueryPromise { + constructor(resultCb) { + super(); + this.resultCb = resultCb; + } + static [import_entity.entityKind] = "ExecuteResultSync"; + async execute() { + return this.resultCb(); + } + sync() { + return this.resultCb(); + } +} +class SQLitePreparedQuery { + constructor(mode, executeMethod, query, cache, queryMetadata, cacheConfig) { + this.mode = mode; + this.executeMethod = executeMethod; + this.query = query; + this.cache = cache; + this.queryMetadata = queryMetadata; + this.cacheConfig = cacheConfig; + if (cache && cache.strategy() === "all" && cacheConfig === void 0) { + this.cacheConfig = { enable: true, autoInvalidate: true }; + } + if (!this.cacheConfig?.enable) { + this.cacheConfig = void 0; + } + } + static [import_entity.entityKind] = "PreparedQuery"; + /** @internal */ + joinsNotNullableMap; + /** @internal */ + async queryWithCache(queryString, params, query) { + if (this.cache === void 0 || (0, import_entity.is)(this.cache, import_cache.NoopCache) || this.queryMetadata === void 0) { + try { + return await query(); + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + } + if (this.cacheConfig && !this.cacheConfig.enable) { + try { + return await query(); + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + } + if ((this.queryMetadata.type === "insert" || this.queryMetadata.type === "update" || this.queryMetadata.type === "delete") && this.queryMetadata.tables.length > 0) { + try { + const [res] = await Promise.all([ + query(), + this.cache.onMutate({ tables: this.queryMetadata.tables }) + ]); + return res; + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + } + if (!this.cacheConfig) { + try { + return await query(); + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + } + if (this.queryMetadata.type === "select") { + const fromCache = await this.cache.get( + this.cacheConfig.tag ?? (await (0, import_cache.hashQuery)(queryString, params)), + this.queryMetadata.tables, + this.cacheConfig.tag !== void 0, + this.cacheConfig.autoInvalidate + ); + if (fromCache === void 0) { + let result; + try { + result = await query(); + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + await this.cache.put( + this.cacheConfig.tag ?? (await (0, import_cache.hashQuery)(queryString, params)), + result, + // make sure we send tables that were used in a query only if user wants to invalidate it on each write + this.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [], + this.cacheConfig.tag !== void 0, + this.cacheConfig.config + ); + return result; + } + return fromCache; + } + try { + return await query(); + } catch (e) { + throw new import_errors.DrizzleQueryError(queryString, params, e); + } + } + getQuery() { + return this.query; + } + mapRunResult(result, _isFromBatch) { + return result; + } + mapAllResult(_result, _isFromBatch) { + throw new Error("Not implemented"); + } + mapGetResult(_result, _isFromBatch) { + throw new Error("Not implemented"); + } + execute(placeholderValues) { + if (this.mode === "async") { + return this[this.executeMethod](placeholderValues); + } + return new ExecuteResultSync(() => this[this.executeMethod](placeholderValues)); + } + mapResult(response, isFromBatch) { + switch (this.executeMethod) { + case "run": { + return this.mapRunResult(response, isFromBatch); + } + case "all": { + return this.mapAllResult(response, isFromBatch); + } + case "get": { + return this.mapGetResult(response, isFromBatch); + } + } + } +} +class SQLiteSession { + constructor(dialect) { + this.dialect = dialect; + } + static [import_entity.entityKind] = "SQLiteSession"; + prepareOneTimeQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return this.prepareQuery( + query, + fields, + executeMethod, + isResponseInArrayMode, + customResultMapper, + queryMetadata, + cacheConfig + ); + } + run(query) { + const staticQuery = this.dialect.sqlToQuery(query); + try { + return this.prepareOneTimeQuery(staticQuery, void 0, "run", false).run(); + } catch (err) { + throw new import_errors.DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` }); + } + } + /** @internal */ + extractRawRunValueFromBatchResult(result) { + return result; + } + all(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).all(); + } + /** @internal */ + extractRawAllValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } + get(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).get(); + } + /** @internal */ + extractRawGetValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } + values(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).values(); + } + async count(sql) { + const result = await this.values(sql); + return result[0][0]; + } + /** @internal */ + extractRawValuesValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } +} +class SQLiteTransaction extends import_db.BaseSQLiteDatabase { + constructor(resultType, dialect, session, schema, nestedIndex = 0) { + super(resultType, dialect, session, schema); + this.schema = schema; + this.nestedIndex = nestedIndex; + } + static [import_entity.entityKind] = "SQLiteTransaction"; + rollback() { + throw new import_errors.TransactionRollbackError(); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ExecuteResultSync, + SQLitePreparedQuery, + SQLiteSession, + SQLiteTransaction +}); +//# sourceMappingURL=session.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..2577ecdfb53ed2ff8e4285618b04567ef3c761d0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/session.ts"],"sourcesContent":["import { type Cache, hashQuery, NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { DrizzleError, DrizzleQueryError, TransactionRollbackError } from '~/errors.ts';\nimport { QueryPromise } from '~/query-promise.ts';\nimport type { TablesRelationalConfig } from '~/relations.ts';\nimport type { PreparedQuery } from '~/session.ts';\nimport type { Query, SQL } from '~/sql/sql.ts';\nimport type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect.ts';\nimport { BaseSQLiteDatabase } from './db.ts';\nimport type { SQLiteRaw } from './query-builders/raw.ts';\nimport type { SelectedFieldsOrdered } from './query-builders/select.types.ts';\n\nexport interface PreparedQueryConfig {\n\ttype: 'sync' | 'async';\n\trun: unknown;\n\tall: unknown;\n\tget: unknown;\n\tvalues: unknown;\n\texecute: unknown;\n}\n\nexport class ExecuteResultSync extends QueryPromise {\n\tstatic override readonly [entityKind]: string = 'ExecuteResultSync';\n\n\tconstructor(private resultCb: () => T) {\n\t\tsuper();\n\t}\n\n\toverride async execute(): Promise {\n\t\treturn this.resultCb();\n\t}\n\n\tsync(): T {\n\t\treturn this.resultCb();\n\t}\n}\n\nexport type ExecuteResult = TType extends 'async' ? Promise\n\t: ExecuteResultSync;\n\nexport abstract class SQLitePreparedQuery implements PreparedQuery {\n\tstatic readonly [entityKind]: string = 'PreparedQuery';\n\n\t/** @internal */\n\tjoinsNotNullableMap?: Record;\n\n\tconstructor(\n\t\tprivate mode: 'sync' | 'async',\n\t\tprivate executeMethod: SQLiteExecuteMethod,\n\t\tprotected query: Query,\n\t\tprivate cache?: Cache,\n\t\t// per query related metadata\n\t\tprivate queryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\t// config that was passed through $withCache\n\t\tprivate cacheConfig?: WithCacheConfig,\n\t) {\n\t\t// it means that no $withCache options were passed and it should be just enabled\n\t\tif (cache && cache.strategy() === 'all' && cacheConfig === undefined) {\n\t\t\tthis.cacheConfig = { enable: true, autoInvalidate: true };\n\t\t}\n\t\tif (!this.cacheConfig?.enable) {\n\t\t\tthis.cacheConfig = undefined;\n\t\t}\n\t}\n\n\t/** @internal */\n\tprotected async queryWithCache(\n\t\tqueryString: string,\n\t\tparams: any[],\n\t\tquery: () => Promise,\n\t): Promise {\n\t\tif (this.cache === undefined || is(this.cache, NoopCache) || this.queryMetadata === undefined) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// don't do any mutations, if globally is false\n\t\tif (this.cacheConfig && !this.cacheConfig.enable) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// For mutate queries, we should query the database, wait for a response, and then perform invalidation\n\t\tif (\n\t\t\t(\n\t\t\t\tthis.queryMetadata.type === 'insert' || this.queryMetadata.type === 'update'\n\t\t\t\t|| this.queryMetadata.type === 'delete'\n\t\t\t) && this.queryMetadata.tables.length > 0\n\t\t) {\n\t\t\ttry {\n\t\t\t\tconst [res] = await Promise.all([\n\t\t\t\t\tquery(),\n\t\t\t\t\tthis.cache.onMutate({ tables: this.queryMetadata.tables }),\n\t\t\t\t]);\n\t\t\t\treturn res;\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// don't do any reads if globally disabled\n\t\tif (!this.cacheConfig) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\tif (this.queryMetadata.type === 'select') {\n\t\t\tconst fromCache = await this.cache.get(\n\t\t\t\tthis.cacheConfig.tag ?? await hashQuery(queryString, params),\n\t\t\t\tthis.queryMetadata.tables,\n\t\t\t\tthis.cacheConfig.tag !== undefined,\n\t\t\t\tthis.cacheConfig.autoInvalidate,\n\t\t\t);\n\t\t\tif (fromCache === undefined) {\n\t\t\t\tlet result;\n\t\t\t\ttry {\n\t\t\t\t\tresult = await query();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t\t}\n\n\t\t\t\t// put actual key\n\t\t\t\tawait this.cache.put(\n\t\t\t\t\tthis.cacheConfig.tag ?? await hashQuery(queryString, params),\n\t\t\t\t\tresult,\n\t\t\t\t\t// make sure we send tables that were used in a query only if user wants to invalidate it on each write\n\t\t\t\t\tthis.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [],\n\t\t\t\t\tthis.cacheConfig.tag !== undefined,\n\t\t\t\t\tthis.cacheConfig.config,\n\t\t\t\t);\n\t\t\t\t// put flag if we should invalidate or not\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn fromCache as unknown as T;\n\t\t}\n\t\ttry {\n\t\t\treturn await query();\n\t\t} catch (e) {\n\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t}\n\t}\n\n\tgetQuery(): Query {\n\t\treturn this.query;\n\t}\n\n\tabstract run(placeholderValues?: Record): Result;\n\n\tmapRunResult(result: unknown, _isFromBatch?: boolean): unknown {\n\t\treturn result;\n\t}\n\n\tabstract all(placeholderValues?: Record): Result;\n\n\tmapAllResult(_result: unknown, _isFromBatch?: boolean): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tabstract get(placeholderValues?: Record): Result;\n\n\tmapGetResult(_result: unknown, _isFromBatch?: boolean): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tabstract values(placeholderValues?: Record): Result;\n\n\texecute(placeholderValues?: Record): ExecuteResult {\n\t\tif (this.mode === 'async') {\n\t\t\treturn this[this.executeMethod](placeholderValues) as ExecuteResult;\n\t\t}\n\t\treturn new ExecuteResultSync(() => this[this.executeMethod](placeholderValues));\n\t}\n\n\tmapResult(response: unknown, isFromBatch?: boolean) {\n\t\tswitch (this.executeMethod) {\n\t\t\tcase 'run': {\n\t\t\t\treturn this.mapRunResult(response, isFromBatch);\n\t\t\t}\n\t\t\tcase 'all': {\n\t\t\t\treturn this.mapAllResult(response, isFromBatch);\n\t\t\t}\n\t\t\tcase 'get': {\n\t\t\t\treturn this.mapGetResult(response, isFromBatch);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @internal */\n\tabstract isResponseInArrayMode(): boolean;\n}\n\nexport interface SQLiteTransactionConfig {\n\tbehavior?: 'deferred' | 'immediate' | 'exclusive';\n}\n\nexport type SQLiteExecuteMethod = 'run' | 'all' | 'get';\n\nexport abstract class SQLiteSession<\n\tTResultKind extends 'sync' | 'async',\n\tTRunResult,\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteSession';\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }[TResultKind],\n\t) {}\n\n\tabstract prepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): SQLitePreparedQuery;\n\n\tprepareOneTimeQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): SQLitePreparedQuery {\n\t\treturn this.prepareQuery(\n\t\t\tquery,\n\t\t\tfields,\n\t\t\texecuteMethod,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t);\n\t}\n\n\tabstract transaction(\n\t\ttransaction: (tx: SQLiteTransaction) => Result,\n\t\tconfig?: SQLiteTransactionConfig,\n\t): Result;\n\n\trun(query: SQL): Result {\n\t\tconst staticQuery = this.dialect.sqlToQuery(query);\n\t\ttry {\n\t\t\treturn this.prepareOneTimeQuery(staticQuery, undefined, 'run', false).run() as Result;\n\t\t} catch (err) {\n\t\t\tthrow new DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` });\n\t\t}\n\t}\n\n\t/** @internal */\n\textractRawRunValueFromBatchResult(result: unknown) {\n\t\treturn result;\n\t}\n\n\tall(query: SQL): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).all() as Result<\n\t\t\tTResultKind,\n\t\t\tT[]\n\t\t>;\n\t}\n\n\t/** @internal */\n\textractRawAllValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tget(query: SQL): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).get() as Result<\n\t\t\tTResultKind,\n\t\t\tT\n\t\t>;\n\t}\n\n\t/** @internal */\n\textractRawGetValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tvalues(\n\t\tquery: SQL,\n\t): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).values() as Result<\n\t\t\tTResultKind,\n\t\t\tT[]\n\t\t>;\n\t}\n\n\tasync count(sql: SQL) {\n\t\tconst result = await this.values(sql) as [[number]];\n\n\t\treturn result[0][0];\n\t}\n\n\t/** @internal */\n\textractRawValuesValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n}\n\nexport type Result = { sync: TResult; async: Promise }[TKind];\n\nexport type DBResult = { sync: TResult; async: SQLiteRaw }[TKind];\n\nexport abstract class SQLiteTransaction<\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends BaseSQLiteDatabase {\n\tstatic override readonly [entityKind]: string = 'SQLiteTransaction';\n\n\tconstructor(\n\t\tresultType: TResultType,\n\t\tdialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }[TResultType],\n\t\tsession: SQLiteSession,\n\t\tprotected schema: {\n\t\t\tfullSchema: Record;\n\t\t\tschema: TSchema;\n\t\t\ttableNamesMap: Record;\n\t\t} | undefined,\n\t\tprotected readonly nestedIndex = 0,\n\t) {\n\t\tsuper(resultType, dialect, session, schema);\n\t}\n\n\trollback(): never {\n\t\tthrow new TransactionRollbackError();\n\t}\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..bde266748853f430034766ee4f0a1ffd1b46f974 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.cts @@ -0,0 +1,107 @@ +import { type Cache } from "../cache/core/cache.cjs"; +import type { WithCacheConfig } from "../cache/core/types.cjs"; +import { entityKind } from "../entity.cjs"; +import { QueryPromise } from "../query-promise.cjs"; +import type { TablesRelationalConfig } from "../relations.cjs"; +import type { PreparedQuery } from "../session.cjs"; +import type { Query, SQL } from "../sql/sql.cjs"; +import type { SQLiteAsyncDialect, SQLiteSyncDialect } from "./dialect.cjs"; +import { BaseSQLiteDatabase } from "./db.cjs"; +import type { SQLiteRaw } from "./query-builders/raw.cjs"; +import type { SelectedFieldsOrdered } from "./query-builders/select.types.cjs"; +export interface PreparedQueryConfig { + type: 'sync' | 'async'; + run: unknown; + all: unknown; + get: unknown; + values: unknown; + execute: unknown; +} +export declare class ExecuteResultSync extends QueryPromise { + private resultCb; + static readonly [entityKind]: string; + constructor(resultCb: () => T); + execute(): Promise; + sync(): T; +} +export type ExecuteResult = TType extends 'async' ? Promise : ExecuteResultSync; +export declare abstract class SQLitePreparedQuery implements PreparedQuery { + private mode; + private executeMethod; + protected query: Query; + private cache?; + private queryMetadata?; + private cacheConfig?; + static readonly [entityKind]: string; + constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod, query: Query, cache?: Cache | undefined, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig?: WithCacheConfig | undefined); + getQuery(): Query; + abstract run(placeholderValues?: Record): Result; + mapRunResult(result: unknown, _isFromBatch?: boolean): unknown; + abstract all(placeholderValues?: Record): Result; + mapAllResult(_result: unknown, _isFromBatch?: boolean): unknown; + abstract get(placeholderValues?: Record): Result; + mapGetResult(_result: unknown, _isFromBatch?: boolean): unknown; + abstract values(placeholderValues?: Record): Result; + execute(placeholderValues?: Record): ExecuteResult; + mapResult(response: unknown, isFromBatch?: boolean): unknown; +} +export interface SQLiteTransactionConfig { + behavior?: 'deferred' | 'immediate' | 'exclusive'; +} +export type SQLiteExecuteMethod = 'run' | 'all' | 'get'; +export declare abstract class SQLiteSession, TSchema extends TablesRelationalConfig> { + static readonly [entityKind]: string; + constructor( + /** @internal */ + dialect: { + sync: SQLiteSyncDialect; + async: SQLiteAsyncDialect; + }[TResultKind]); + abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): SQLitePreparedQuery; + prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): SQLitePreparedQuery; + abstract transaction(transaction: (tx: SQLiteTransaction) => Result, config?: SQLiteTransactionConfig): Result; + run(query: SQL): Result; + all(query: SQL): Result; + get(query: SQL): Result; + values(query: SQL): Result; + count(sql: SQL): Promise; +} +export type Result = { + sync: TResult; + async: Promise; +}[TKind]; +export type DBResult = { + sync: TResult; + async: SQLiteRaw; +}[TKind]; +export declare abstract class SQLiteTransaction, TSchema extends TablesRelationalConfig> extends BaseSQLiteDatabase { + protected schema: { + fullSchema: Record; + schema: TSchema; + tableNamesMap: Record; + } | undefined; + protected readonly nestedIndex: number; + static readonly [entityKind]: string; + constructor(resultType: TResultType, dialect: { + sync: SQLiteSyncDialect; + async: SQLiteAsyncDialect; + }[TResultType], session: SQLiteSession, schema: { + fullSchema: Record; + schema: TSchema; + tableNamesMap: Record; + } | undefined, nestedIndex?: number); + rollback(): never; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85418159b64f93104ef465af007272069e09c12e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.d.ts @@ -0,0 +1,107 @@ +import { type Cache } from "../cache/core/cache.js"; +import type { WithCacheConfig } from "../cache/core/types.js"; +import { entityKind } from "../entity.js"; +import { QueryPromise } from "../query-promise.js"; +import type { TablesRelationalConfig } from "../relations.js"; +import type { PreparedQuery } from "../session.js"; +import type { Query, SQL } from "../sql/sql.js"; +import type { SQLiteAsyncDialect, SQLiteSyncDialect } from "./dialect.js"; +import { BaseSQLiteDatabase } from "./db.js"; +import type { SQLiteRaw } from "./query-builders/raw.js"; +import type { SelectedFieldsOrdered } from "./query-builders/select.types.js"; +export interface PreparedQueryConfig { + type: 'sync' | 'async'; + run: unknown; + all: unknown; + get: unknown; + values: unknown; + execute: unknown; +} +export declare class ExecuteResultSync extends QueryPromise { + private resultCb; + static readonly [entityKind]: string; + constructor(resultCb: () => T); + execute(): Promise; + sync(): T; +} +export type ExecuteResult = TType extends 'async' ? Promise : ExecuteResultSync; +export declare abstract class SQLitePreparedQuery implements PreparedQuery { + private mode; + private executeMethod; + protected query: Query; + private cache?; + private queryMetadata?; + private cacheConfig?; + static readonly [entityKind]: string; + constructor(mode: 'sync' | 'async', executeMethod: SQLiteExecuteMethod, query: Query, cache?: Cache | undefined, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig?: WithCacheConfig | undefined); + getQuery(): Query; + abstract run(placeholderValues?: Record): Result; + mapRunResult(result: unknown, _isFromBatch?: boolean): unknown; + abstract all(placeholderValues?: Record): Result; + mapAllResult(_result: unknown, _isFromBatch?: boolean): unknown; + abstract get(placeholderValues?: Record): Result; + mapGetResult(_result: unknown, _isFromBatch?: boolean): unknown; + abstract values(placeholderValues?: Record): Result; + execute(placeholderValues?: Record): ExecuteResult; + mapResult(response: unknown, isFromBatch?: boolean): unknown; +} +export interface SQLiteTransactionConfig { + behavior?: 'deferred' | 'immediate' | 'exclusive'; +} +export type SQLiteExecuteMethod = 'run' | 'all' | 'get'; +export declare abstract class SQLiteSession, TSchema extends TablesRelationalConfig> { + static readonly [entityKind]: string; + constructor( + /** @internal */ + dialect: { + sync: SQLiteSyncDialect; + async: SQLiteAsyncDialect; + }[TResultKind]); + abstract prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): SQLitePreparedQuery; + prepareOneTimeQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): SQLitePreparedQuery; + abstract transaction(transaction: (tx: SQLiteTransaction) => Result, config?: SQLiteTransactionConfig): Result; + run(query: SQL): Result; + all(query: SQL): Result; + get(query: SQL): Result; + values(query: SQL): Result; + count(sql: SQL): Promise; +} +export type Result = { + sync: TResult; + async: Promise; +}[TKind]; +export type DBResult = { + sync: TResult; + async: SQLiteRaw; +}[TKind]; +export declare abstract class SQLiteTransaction, TSchema extends TablesRelationalConfig> extends BaseSQLiteDatabase { + protected schema: { + fullSchema: Record; + schema: TSchema; + tableNamesMap: Record; + } | undefined; + protected readonly nestedIndex: number; + static readonly [entityKind]: string; + constructor(resultType: TResultType, dialect: { + sync: SQLiteSyncDialect; + async: SQLiteAsyncDialect; + }[TResultType], session: SQLiteSession, schema: { + fullSchema: Record; + schema: TSchema; + tableNamesMap: Record; + } | undefined, nestedIndex?: number); + rollback(): never; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js new file mode 100644 index 0000000000000000000000000000000000000000..30efa3d01d4511325bbee98c32608135e5a05b7d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js @@ -0,0 +1,206 @@ +import { hashQuery, NoopCache } from "../cache/core/cache.js"; +import { entityKind, is } from "../entity.js"; +import { DrizzleError, DrizzleQueryError, TransactionRollbackError } from "../errors.js"; +import { QueryPromise } from "../query-promise.js"; +import { BaseSQLiteDatabase } from "./db.js"; +class ExecuteResultSync extends QueryPromise { + constructor(resultCb) { + super(); + this.resultCb = resultCb; + } + static [entityKind] = "ExecuteResultSync"; + async execute() { + return this.resultCb(); + } + sync() { + return this.resultCb(); + } +} +class SQLitePreparedQuery { + constructor(mode, executeMethod, query, cache, queryMetadata, cacheConfig) { + this.mode = mode; + this.executeMethod = executeMethod; + this.query = query; + this.cache = cache; + this.queryMetadata = queryMetadata; + this.cacheConfig = cacheConfig; + if (cache && cache.strategy() === "all" && cacheConfig === void 0) { + this.cacheConfig = { enable: true, autoInvalidate: true }; + } + if (!this.cacheConfig?.enable) { + this.cacheConfig = void 0; + } + } + static [entityKind] = "PreparedQuery"; + /** @internal */ + joinsNotNullableMap; + /** @internal */ + async queryWithCache(queryString, params, query) { + if (this.cache === void 0 || is(this.cache, NoopCache) || this.queryMetadata === void 0) { + try { + return await query(); + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + } + if (this.cacheConfig && !this.cacheConfig.enable) { + try { + return await query(); + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + } + if ((this.queryMetadata.type === "insert" || this.queryMetadata.type === "update" || this.queryMetadata.type === "delete") && this.queryMetadata.tables.length > 0) { + try { + const [res] = await Promise.all([ + query(), + this.cache.onMutate({ tables: this.queryMetadata.tables }) + ]); + return res; + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + } + if (!this.cacheConfig) { + try { + return await query(); + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + } + if (this.queryMetadata.type === "select") { + const fromCache = await this.cache.get( + this.cacheConfig.tag ?? (await hashQuery(queryString, params)), + this.queryMetadata.tables, + this.cacheConfig.tag !== void 0, + this.cacheConfig.autoInvalidate + ); + if (fromCache === void 0) { + let result; + try { + result = await query(); + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + await this.cache.put( + this.cacheConfig.tag ?? (await hashQuery(queryString, params)), + result, + // make sure we send tables that were used in a query only if user wants to invalidate it on each write + this.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [], + this.cacheConfig.tag !== void 0, + this.cacheConfig.config + ); + return result; + } + return fromCache; + } + try { + return await query(); + } catch (e) { + throw new DrizzleQueryError(queryString, params, e); + } + } + getQuery() { + return this.query; + } + mapRunResult(result, _isFromBatch) { + return result; + } + mapAllResult(_result, _isFromBatch) { + throw new Error("Not implemented"); + } + mapGetResult(_result, _isFromBatch) { + throw new Error("Not implemented"); + } + execute(placeholderValues) { + if (this.mode === "async") { + return this[this.executeMethod](placeholderValues); + } + return new ExecuteResultSync(() => this[this.executeMethod](placeholderValues)); + } + mapResult(response, isFromBatch) { + switch (this.executeMethod) { + case "run": { + return this.mapRunResult(response, isFromBatch); + } + case "all": { + return this.mapAllResult(response, isFromBatch); + } + case "get": { + return this.mapGetResult(response, isFromBatch); + } + } + } +} +class SQLiteSession { + constructor(dialect) { + this.dialect = dialect; + } + static [entityKind] = "SQLiteSession"; + prepareOneTimeQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return this.prepareQuery( + query, + fields, + executeMethod, + isResponseInArrayMode, + customResultMapper, + queryMetadata, + cacheConfig + ); + } + run(query) { + const staticQuery = this.dialect.sqlToQuery(query); + try { + return this.prepareOneTimeQuery(staticQuery, void 0, "run", false).run(); + } catch (err) { + throw new DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` }); + } + } + /** @internal */ + extractRawRunValueFromBatchResult(result) { + return result; + } + all(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).all(); + } + /** @internal */ + extractRawAllValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } + get(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).get(); + } + /** @internal */ + extractRawGetValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } + values(query) { + return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run", false).values(); + } + async count(sql) { + const result = await this.values(sql); + return result[0][0]; + } + /** @internal */ + extractRawValuesValueFromBatchResult(_result) { + throw new Error("Not implemented"); + } +} +class SQLiteTransaction extends BaseSQLiteDatabase { + constructor(resultType, dialect, session, schema, nestedIndex = 0) { + super(resultType, dialect, session, schema); + this.schema = schema; + this.nestedIndex = nestedIndex; + } + static [entityKind] = "SQLiteTransaction"; + rollback() { + throw new TransactionRollbackError(); + } +} +export { + ExecuteResultSync, + SQLitePreparedQuery, + SQLiteSession, + SQLiteTransaction +}; +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js.map new file mode 100644 index 0000000000000000000000000000000000000000..46e591a7c67d0ad44d7550306def2f189d7ee2f4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/session.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/session.ts"],"sourcesContent":["import { type Cache, hashQuery, NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { DrizzleError, DrizzleQueryError, TransactionRollbackError } from '~/errors.ts';\nimport { QueryPromise } from '~/query-promise.ts';\nimport type { TablesRelationalConfig } from '~/relations.ts';\nimport type { PreparedQuery } from '~/session.ts';\nimport type { Query, SQL } from '~/sql/sql.ts';\nimport type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect.ts';\nimport { BaseSQLiteDatabase } from './db.ts';\nimport type { SQLiteRaw } from './query-builders/raw.ts';\nimport type { SelectedFieldsOrdered } from './query-builders/select.types.ts';\n\nexport interface PreparedQueryConfig {\n\ttype: 'sync' | 'async';\n\trun: unknown;\n\tall: unknown;\n\tget: unknown;\n\tvalues: unknown;\n\texecute: unknown;\n}\n\nexport class ExecuteResultSync extends QueryPromise {\n\tstatic override readonly [entityKind]: string = 'ExecuteResultSync';\n\n\tconstructor(private resultCb: () => T) {\n\t\tsuper();\n\t}\n\n\toverride async execute(): Promise {\n\t\treturn this.resultCb();\n\t}\n\n\tsync(): T {\n\t\treturn this.resultCb();\n\t}\n}\n\nexport type ExecuteResult = TType extends 'async' ? Promise\n\t: ExecuteResultSync;\n\nexport abstract class SQLitePreparedQuery implements PreparedQuery {\n\tstatic readonly [entityKind]: string = 'PreparedQuery';\n\n\t/** @internal */\n\tjoinsNotNullableMap?: Record;\n\n\tconstructor(\n\t\tprivate mode: 'sync' | 'async',\n\t\tprivate executeMethod: SQLiteExecuteMethod,\n\t\tprotected query: Query,\n\t\tprivate cache?: Cache,\n\t\t// per query related metadata\n\t\tprivate queryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\t// config that was passed through $withCache\n\t\tprivate cacheConfig?: WithCacheConfig,\n\t) {\n\t\t// it means that no $withCache options were passed and it should be just enabled\n\t\tif (cache && cache.strategy() === 'all' && cacheConfig === undefined) {\n\t\t\tthis.cacheConfig = { enable: true, autoInvalidate: true };\n\t\t}\n\t\tif (!this.cacheConfig?.enable) {\n\t\t\tthis.cacheConfig = undefined;\n\t\t}\n\t}\n\n\t/** @internal */\n\tprotected async queryWithCache(\n\t\tqueryString: string,\n\t\tparams: any[],\n\t\tquery: () => Promise,\n\t): Promise {\n\t\tif (this.cache === undefined || is(this.cache, NoopCache) || this.queryMetadata === undefined) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// don't do any mutations, if globally is false\n\t\tif (this.cacheConfig && !this.cacheConfig.enable) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// For mutate queries, we should query the database, wait for a response, and then perform invalidation\n\t\tif (\n\t\t\t(\n\t\t\t\tthis.queryMetadata.type === 'insert' || this.queryMetadata.type === 'update'\n\t\t\t\t|| this.queryMetadata.type === 'delete'\n\t\t\t) && this.queryMetadata.tables.length > 0\n\t\t) {\n\t\t\ttry {\n\t\t\t\tconst [res] = await Promise.all([\n\t\t\t\t\tquery(),\n\t\t\t\t\tthis.cache.onMutate({ tables: this.queryMetadata.tables }),\n\t\t\t\t]);\n\t\t\t\treturn res;\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// don't do any reads if globally disabled\n\t\tif (!this.cacheConfig) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\tif (this.queryMetadata.type === 'select') {\n\t\t\tconst fromCache = await this.cache.get(\n\t\t\t\tthis.cacheConfig.tag ?? await hashQuery(queryString, params),\n\t\t\t\tthis.queryMetadata.tables,\n\t\t\t\tthis.cacheConfig.tag !== undefined,\n\t\t\t\tthis.cacheConfig.autoInvalidate,\n\t\t\t);\n\t\t\tif (fromCache === undefined) {\n\t\t\t\tlet result;\n\t\t\t\ttry {\n\t\t\t\t\tresult = await query();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t\t}\n\n\t\t\t\t// put actual key\n\t\t\t\tawait this.cache.put(\n\t\t\t\t\tthis.cacheConfig.tag ?? await hashQuery(queryString, params),\n\t\t\t\t\tresult,\n\t\t\t\t\t// make sure we send tables that were used in a query only if user wants to invalidate it on each write\n\t\t\t\t\tthis.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [],\n\t\t\t\t\tthis.cacheConfig.tag !== undefined,\n\t\t\t\t\tthis.cacheConfig.config,\n\t\t\t\t);\n\t\t\t\t// put flag if we should invalidate or not\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn fromCache as unknown as T;\n\t\t}\n\t\ttry {\n\t\t\treturn await query();\n\t\t} catch (e) {\n\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t}\n\t}\n\n\tgetQuery(): Query {\n\t\treturn this.query;\n\t}\n\n\tabstract run(placeholderValues?: Record): Result;\n\n\tmapRunResult(result: unknown, _isFromBatch?: boolean): unknown {\n\t\treturn result;\n\t}\n\n\tabstract all(placeholderValues?: Record): Result;\n\n\tmapAllResult(_result: unknown, _isFromBatch?: boolean): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tabstract get(placeholderValues?: Record): Result;\n\n\tmapGetResult(_result: unknown, _isFromBatch?: boolean): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tabstract values(placeholderValues?: Record): Result;\n\n\texecute(placeholderValues?: Record): ExecuteResult {\n\t\tif (this.mode === 'async') {\n\t\t\treturn this[this.executeMethod](placeholderValues) as ExecuteResult;\n\t\t}\n\t\treturn new ExecuteResultSync(() => this[this.executeMethod](placeholderValues));\n\t}\n\n\tmapResult(response: unknown, isFromBatch?: boolean) {\n\t\tswitch (this.executeMethod) {\n\t\t\tcase 'run': {\n\t\t\t\treturn this.mapRunResult(response, isFromBatch);\n\t\t\t}\n\t\t\tcase 'all': {\n\t\t\t\treturn this.mapAllResult(response, isFromBatch);\n\t\t\t}\n\t\t\tcase 'get': {\n\t\t\t\treturn this.mapGetResult(response, isFromBatch);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @internal */\n\tabstract isResponseInArrayMode(): boolean;\n}\n\nexport interface SQLiteTransactionConfig {\n\tbehavior?: 'deferred' | 'immediate' | 'exclusive';\n}\n\nexport type SQLiteExecuteMethod = 'run' | 'all' | 'get';\n\nexport abstract class SQLiteSession<\n\tTResultKind extends 'sync' | 'async',\n\tTRunResult,\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteSession';\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }[TResultKind],\n\t) {}\n\n\tabstract prepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): SQLitePreparedQuery;\n\n\tprepareOneTimeQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): SQLitePreparedQuery {\n\t\treturn this.prepareQuery(\n\t\t\tquery,\n\t\t\tfields,\n\t\t\texecuteMethod,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t);\n\t}\n\n\tabstract transaction(\n\t\ttransaction: (tx: SQLiteTransaction) => Result,\n\t\tconfig?: SQLiteTransactionConfig,\n\t): Result;\n\n\trun(query: SQL): Result {\n\t\tconst staticQuery = this.dialect.sqlToQuery(query);\n\t\ttry {\n\t\t\treturn this.prepareOneTimeQuery(staticQuery, undefined, 'run', false).run() as Result;\n\t\t} catch (err) {\n\t\t\tthrow new DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` });\n\t\t}\n\t}\n\n\t/** @internal */\n\textractRawRunValueFromBatchResult(result: unknown) {\n\t\treturn result;\n\t}\n\n\tall(query: SQL): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).all() as Result<\n\t\t\tTResultKind,\n\t\t\tT[]\n\t\t>;\n\t}\n\n\t/** @internal */\n\textractRawAllValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tget(query: SQL): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).get() as Result<\n\t\t\tTResultKind,\n\t\t\tT\n\t\t>;\n\t}\n\n\t/** @internal */\n\textractRawGetValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n\n\tvalues(\n\t\tquery: SQL,\n\t): Result {\n\t\treturn this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), undefined, 'run', false).values() as Result<\n\t\t\tTResultKind,\n\t\t\tT[]\n\t\t>;\n\t}\n\n\tasync count(sql: SQL) {\n\t\tconst result = await this.values(sql) as [[number]];\n\n\t\treturn result[0][0];\n\t}\n\n\t/** @internal */\n\textractRawValuesValueFromBatchResult(_result: unknown): unknown {\n\t\tthrow new Error('Not implemented');\n\t}\n}\n\nexport type Result = { sync: TResult; async: Promise }[TKind];\n\nexport type DBResult = { sync: TResult; async: SQLiteRaw }[TKind];\n\nexport abstract class SQLiteTransaction<\n\tTResultType extends 'sync' | 'async',\n\tTRunResult,\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends BaseSQLiteDatabase {\n\tstatic override readonly [entityKind]: string = 'SQLiteTransaction';\n\n\tconstructor(\n\t\tresultType: TResultType,\n\t\tdialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }[TResultType],\n\t\tsession: SQLiteSession,\n\t\tprotected schema: {\n\t\t\tfullSchema: Record;\n\t\t\tschema: TSchema;\n\t\t\ttableNamesMap: Record;\n\t\t} | undefined,\n\t\tprotected readonly nestedIndex = 0,\n\t) {\n\t\tsuper(resultType, dialect, session, schema);\n\t}\n\n\trollback(): never {\n\t\tthrow new TransactionRollbackError();\n\t}\n}\n"],"mappings":"AAAA,SAAqB,WAAW,iBAAiB;AAEjD,SAAS,YAAY,UAAU;AAC/B,SAAS,cAAc,mBAAmB,gCAAgC;AAC1E,SAAS,oBAAoB;AAK7B,SAAS,0BAA0B;AAa5B,MAAM,0BAA6B,aAAgB;AAAA,EAGzD,YAAoB,UAAmB;AACtC,UAAM;AADa;AAAA,EAEpB;AAAA,EAJA,QAA0B,UAAU,IAAY;AAAA,EAMhD,MAAe,UAAsB;AACpC,WAAO,KAAK,SAAS;AAAA,EACtB;AAAA,EAEA,OAAU;AACT,WAAO,KAAK,SAAS;AAAA,EACtB;AACD;AAKO,MAAe,oBAA4E;AAAA,EAMjG,YACS,MACA,eACE,OACF,OAEA,eAKA,aACP;AAXO;AACA;AACE;AACF;AAEA;AAKA;AAGR,QAAI,SAAS,MAAM,SAAS,MAAM,SAAS,gBAAgB,QAAW;AACrE,WAAK,cAAc,EAAE,QAAQ,MAAM,gBAAgB,KAAK;AAAA,IACzD;AACA,QAAI,CAAC,KAAK,aAAa,QAAQ;AAC9B,WAAK,cAAc;AAAA,IACpB;AAAA,EACD;AAAA,EAzBA,QAAiB,UAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAyBA,MAAgB,eACf,aACA,QACA,OACa;AACb,QAAI,KAAK,UAAU,UAAa,GAAG,KAAK,OAAO,SAAS,KAAK,KAAK,kBAAkB,QAAW;AAC9F,UAAI;AACH,eAAO,MAAM,MAAM;AAAA,MACpB,SAAS,GAAG;AACX,cAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,MAC5D;AAAA,IACD;AAGA,QAAI,KAAK,eAAe,CAAC,KAAK,YAAY,QAAQ;AACjD,UAAI;AACH,eAAO,MAAM,MAAM;AAAA,MACpB,SAAS,GAAG;AACX,cAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,MAC5D;AAAA,IACD;AAGA,SAEE,KAAK,cAAc,SAAS,YAAY,KAAK,cAAc,SAAS,YACjE,KAAK,cAAc,SAAS,aAC3B,KAAK,cAAc,OAAO,SAAS,GACvC;AACD,UAAI;AACH,cAAM,CAAC,GAAG,IAAI,MAAM,QAAQ,IAAI;AAAA,UAC/B,MAAM;AAAA,UACN,KAAK,MAAM,SAAS,EAAE,QAAQ,KAAK,cAAc,OAAO,CAAC;AAAA,QAC1D,CAAC;AACD,eAAO;AAAA,MACR,SAAS,GAAG;AACX,cAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,MAC5D;AAAA,IACD;AAGA,QAAI,CAAC,KAAK,aAAa;AACtB,UAAI;AACH,eAAO,MAAM,MAAM;AAAA,MACpB,SAAS,GAAG;AACX,cAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,MAC5D;AAAA,IACD;AAEA,QAAI,KAAK,cAAc,SAAS,UAAU;AACzC,YAAM,YAAY,MAAM,KAAK,MAAM;AAAA,QAClC,KAAK,YAAY,OAAO,MAAM,UAAU,aAAa,MAAM;AAAA,QAC3D,KAAK,cAAc;AAAA,QACnB,KAAK,YAAY,QAAQ;AAAA,QACzB,KAAK,YAAY;AAAA,MAClB;AACA,UAAI,cAAc,QAAW;AAC5B,YAAI;AACJ,YAAI;AACH,mBAAS,MAAM,MAAM;AAAA,QACtB,SAAS,GAAG;AACX,gBAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,QAC5D;AAGA,cAAM,KAAK,MAAM;AAAA,UAChB,KAAK,YAAY,OAAO,MAAM,UAAU,aAAa,MAAM;AAAA,UAC3D;AAAA;AAAA,UAEA,KAAK,YAAY,iBAAiB,KAAK,cAAc,SAAS,CAAC;AAAA,UAC/D,KAAK,YAAY,QAAQ;AAAA,UACzB,KAAK,YAAY;AAAA,QAClB;AAEA,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,IACR;AACA,QAAI;AACH,aAAO,MAAM,MAAM;AAAA,IACpB,SAAS,GAAG;AACX,YAAM,IAAI,kBAAkB,aAAa,QAAQ,CAAU;AAAA,IAC5D;AAAA,EACD;AAAA,EAEA,WAAkB;AACjB,WAAO,KAAK;AAAA,EACb;AAAA,EAIA,aAAa,QAAiB,cAAiC;AAC9D,WAAO;AAAA,EACR;AAAA,EAIA,aAAa,SAAkB,cAAiC;AAC/D,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AAAA,EAIA,aAAa,SAAkB,cAAiC;AAC/D,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AAAA,EAIA,QAAQ,mBAAqF;AAC5F,QAAI,KAAK,SAAS,SAAS;AAC1B,aAAO,KAAK,KAAK,aAAa,EAAE,iBAAiB;AAAA,IAClD;AACA,WAAO,IAAI,kBAAkB,MAAM,KAAK,KAAK,aAAa,EAAE,iBAAiB,CAAC;AAAA,EAC/E;AAAA,EAEA,UAAU,UAAmB,aAAuB;AACnD,YAAQ,KAAK,eAAe;AAAA,MAC3B,KAAK,OAAO;AACX,eAAO,KAAK,aAAa,UAAU,WAAW;AAAA,MAC/C;AAAA,MACA,KAAK,OAAO;AACX,eAAO,KAAK,aAAa,UAAU,WAAW;AAAA,MAC/C;AAAA,MACA,KAAK,OAAO;AACX,eAAO,KAAK,aAAa,UAAU,WAAW;AAAA,MAC/C;AAAA,IACD;AAAA,EACD;AAID;AAQO,MAAe,cAKpB;AAAA,EAGD,YAEU,SACR;AADQ;AAAA,EACP;AAAA,EALH,QAAiB,UAAU,IAAY;AAAA,EAoBvC,oBACC,OACA,QACA,eACA,uBACA,oBACA,eAIA,aACmE;AACnE,WAAO,KAAK;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA,EAOA,IAAI,OAA6C;AAChD,UAAM,cAAc,KAAK,QAAQ,WAAW,KAAK;AACjD,QAAI;AACH,aAAO,KAAK,oBAAoB,aAAa,QAAW,OAAO,KAAK,EAAE,IAAI;AAAA,IAC3E,SAAS,KAAK;AACb,YAAM,IAAI,aAAa,EAAE,OAAO,KAAK,SAAS,4BAA4B,YAAY,GAAG,IAAI,CAAC;AAAA,IAC/F;AAAA,EACD;AAAA;AAAA,EAGA,kCAAkC,QAAiB;AAClD,WAAO;AAAA,EACR;AAAA,EAEA,IAAiB,OAAsC;AACtD,WAAO,KAAK,oBAAoB,KAAK,QAAQ,WAAW,KAAK,GAAG,QAAW,OAAO,KAAK,EAAE,IAAI;AAAA,EAI9F;AAAA;AAAA,EAGA,kCAAkC,SAA2B;AAC5D,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AAAA,EAEA,IAAiB,OAAoC;AACpD,WAAO,KAAK,oBAAoB,KAAK,QAAQ,WAAW,KAAK,GAAG,QAAW,OAAO,KAAK,EAAE,IAAI;AAAA,EAI9F;AAAA;AAAA,EAGA,kCAAkC,SAA2B;AAC5D,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AAAA,EAEA,OACC,OAC2B;AAC3B,WAAO,KAAK,oBAAoB,KAAK,QAAQ,WAAW,KAAK,GAAG,QAAW,OAAO,KAAK,EAAE,OAAO;AAAA,EAIjG;AAAA,EAEA,MAAM,MAAM,KAAU;AACrB,UAAM,SAAS,MAAM,KAAK,OAAO,GAAG;AAEpC,WAAO,OAAO,CAAC,EAAE,CAAC;AAAA,EACnB;AAAA;AAAA,EAGA,qCAAqC,SAA2B;AAC/D,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AACD;AAMO,MAAe,0BAKZ,mBAAkE;AAAA,EAG3E,YACC,YACA,SACA,SACU,QAKS,cAAc,GAChC;AACD,UAAM,YAAY,SAAS,SAAS,MAAM;AAPhC;AAKS;AAAA,EAGpB;AAAA,EAdA,QAA0B,UAAU,IAAY;AAAA,EAgBhD,WAAkB;AACjB,UAAM,IAAI,yBAAyB;AAAA,EACpC;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs new file mode 100644 index 0000000000000000000000000000000000000000..c52a318a9393aa0cd2b9721994ebc1abd97ab167 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs @@ -0,0 +1,17 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var subquery_exports = {}; +module.exports = __toCommonJS(subquery_exports); +//# sourceMappingURL=subquery.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..8fa6c1d50a88392a80526ec3725bc0a2c576761a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/subquery.ts"],"sourcesContent":["import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AddAliasToSelection } from '~/query-builders/select.types.ts';\nimport type { ColumnsSelection, SQL } from '~/sql/sql.ts';\nimport type { Subquery, WithSubquery, WithSubqueryWithoutSelection } from '~/subquery.ts';\nimport type { QueryBuilder } from './query-builders/query-builder.ts';\n\nexport type SubqueryWithSelection =\n\t& Subquery>\n\t& AddAliasToSelection;\n\nexport type WithSubqueryWithSelection =\n\t& WithSubquery>\n\t& AddAliasToSelection;\n\nexport interface WithBuilder {\n\t(alias: TAlias): {\n\t\tas: {\n\t\t\t(\n\t\t\t\tqb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder),\n\t\t\t): WithSubqueryWithSelection;\n\t\t\t(\n\t\t\t\tqb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder),\n\t\t\t): WithSubqueryWithoutSelection;\n\t\t};\n\t};\n\t(alias: TAlias, selection: TSelection): {\n\t\tas: (qb: SQL | ((qb: QueryBuilder) => SQL)) => WithSubqueryWithSelection;\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..205d4844dcea139063bca50cdc6467488755c009 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.cts @@ -0,0 +1,18 @@ +import type { TypedQueryBuilder } from "../query-builders/query-builder.cjs"; +import type { AddAliasToSelection } from "../query-builders/select.types.cjs"; +import type { ColumnsSelection, SQL } from "../sql/sql.cjs"; +import type { Subquery, WithSubquery, WithSubqueryWithoutSelection } from "../subquery.cjs"; +import type { QueryBuilder } from "./query-builders/query-builder.cjs"; +export type SubqueryWithSelection = Subquery> & AddAliasToSelection; +export type WithSubqueryWithSelection = WithSubquery> & AddAliasToSelection; +export interface WithBuilder { + (alias: TAlias): { + as: { + (qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): WithSubqueryWithSelection; + (qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): WithSubqueryWithoutSelection; + }; + }; + (alias: TAlias, selection: TSelection): { + as: (qb: SQL | ((qb: QueryBuilder) => SQL)) => WithSubqueryWithSelection; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c82087ce391700d1b8cb3b172a94b9a9a1d49159 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.d.ts @@ -0,0 +1,18 @@ +import type { TypedQueryBuilder } from "../query-builders/query-builder.js"; +import type { AddAliasToSelection } from "../query-builders/select.types.js"; +import type { ColumnsSelection, SQL } from "../sql/sql.js"; +import type { Subquery, WithSubquery, WithSubqueryWithoutSelection } from "../subquery.js"; +import type { QueryBuilder } from "./query-builders/query-builder.js"; +export type SubqueryWithSelection = Subquery> & AddAliasToSelection; +export type WithSubqueryWithSelection = WithSubquery> & AddAliasToSelection; +export interface WithBuilder { + (alias: TAlias): { + as: { + (qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): WithSubqueryWithSelection; + (qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): WithSubqueryWithoutSelection; + }; + }; + (alias: TAlias, selection: TSelection): { + as: (qb: SQL | ((qb: QueryBuilder) => SQL)) => WithSubqueryWithSelection; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js new file mode 100644 index 0000000000000000000000000000000000000000..b8a08148eb03514aab41f7f3ca199a5ab57dc387 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js @@ -0,0 +1 @@ +//# sourceMappingURL=subquery.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js.map new file mode 100644 index 0000000000000000000000000000000000000000..84c51b288c478ac0d18748007ccfb8cddc797f3a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/subquery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs new file mode 100644 index 0000000000000000000000000000000000000000..e45468624a451535d353108b1fa1b868ca276216 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs @@ -0,0 +1,79 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var table_exports = {}; +__export(table_exports, { + InlineForeignKeys: () => InlineForeignKeys, + SQLiteTable: () => SQLiteTable, + sqliteTable: () => sqliteTable, + sqliteTableCreator: () => sqliteTableCreator +}); +module.exports = __toCommonJS(table_exports); +var import_entity = require("../entity.cjs"); +var import_table = require("../table.cjs"); +var import_all = require("./columns/all.cjs"); +const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys"); +class SQLiteTable extends import_table.Table { + static [import_entity.entityKind] = "SQLiteTable"; + /** @internal */ + static Symbol = Object.assign({}, import_table.Table.Symbol, { + InlineForeignKeys + }); + /** @internal */ + [import_table.Table.Symbol.Columns]; + /** @internal */ + [InlineForeignKeys] = []; + /** @internal */ + [import_table.Table.Symbol.ExtraConfigBuilder] = void 0; +} +function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) { + const rawTable = new SQLiteTable(name, schema, baseName); + const parsedColumns = typeof columns === "function" ? columns((0, import_all.getSQLiteColumnBuilders)()) : columns; + const builtColumns = Object.fromEntries( + Object.entries(parsedColumns).map(([name2, colBuilderBase]) => { + const colBuilder = colBuilderBase; + colBuilder.setName(name2); + const column = colBuilder.build(rawTable); + rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable)); + return [name2, column]; + }) + ); + const table = Object.assign(rawTable, builtColumns); + table[import_table.Table.Symbol.Columns] = builtColumns; + table[import_table.Table.Symbol.ExtraConfigColumns] = builtColumns; + if (extraConfig) { + table[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig; + } + return table; +} +const sqliteTable = (name, columns, extraConfig) => { + return sqliteTableBase(name, columns, extraConfig); +}; +function sqliteTableCreator(customizeTableName) { + return (name, columns, extraConfig) => { + return sqliteTableBase(customizeTableName(name), columns, extraConfig, void 0, name); + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + InlineForeignKeys, + SQLiteTable, + sqliteTable, + sqliteTableCreator +}); +//# sourceMappingURL=table.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..db51b20034ef82e8a7b37a8cce0cff194298b886 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/table.ts"],"sourcesContent":["import type { BuildColumns, BuildExtraConfigColumns } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table.ts';\nimport type { CheckBuilder } from './checks.ts';\nimport { getSQLiteColumnBuilders, type SQLiteColumnBuilders } from './columns/all.ts';\nimport type { SQLiteColumn, SQLiteColumnBuilder, SQLiteColumnBuilderBase } from './columns/common.ts';\nimport type { ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts';\nimport type { IndexBuilder } from './indexes.ts';\nimport type { PrimaryKeyBuilder } from './primary-keys.ts';\nimport type { UniqueConstraintBuilder } from './unique-constraint.ts';\n\nexport type SQLiteTableExtraConfigValue =\n\t| IndexBuilder\n\t| CheckBuilder\n\t| ForeignKeyBuilder\n\t| PrimaryKeyBuilder\n\t| UniqueConstraintBuilder;\n\nexport type SQLiteTableExtraConfig = Record<\n\tstring,\n\tSQLiteTableExtraConfigValue\n>;\n\nexport type TableConfig = TableConfigBase>;\n\n/** @internal */\nexport const InlineForeignKeys = Symbol.for('drizzle:SQLiteInlineForeignKeys');\n\nexport class SQLiteTable extends Table {\n\tstatic override readonly [entityKind]: string = 'SQLiteTable';\n\n\t/** @internal */\n\tstatic override readonly Symbol = Object.assign({}, Table.Symbol, {\n\t\tInlineForeignKeys: InlineForeignKeys as typeof InlineForeignKeys,\n\t});\n\n\t/** @internal */\n\toverride [Table.Symbol.Columns]!: NonNullable;\n\n\t/** @internal */\n\t[InlineForeignKeys]: ForeignKey[] = [];\n\n\t/** @internal */\n\toverride [Table.Symbol.ExtraConfigBuilder]:\n\t\t| ((self: Record) => SQLiteTableExtraConfig)\n\t\t| undefined = undefined;\n}\n\nexport type AnySQLiteTable = {}> = SQLiteTable<\n\tUpdateTableConfig\n>;\n\nexport type SQLiteTableWithColumns =\n\t& SQLiteTable\n\t& {\n\t\t[Key in keyof T['columns']]: T['columns'][Key];\n\t};\n\nexport interface SQLiteTableFn {\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: TColumnsMap,\n\t\textraConfig?: (\n\t\t\tself: BuildColumns,\n\t\t) => SQLiteTableExtraConfigValue[],\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[],\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\t/**\n\t * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object\n\t *\n\t * @example\n\t * Deprecated version:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => ({\n\t * \tidx: index('custom_name').on(t.id)\n\t * }));\n\t * ```\n\t *\n\t * New API:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => [\n\t * \tindex('custom_name').on(t.id)\n\t * ]);\n\t * ```\n\t */\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig,\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\n\t/**\n\t * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object\n\t *\n\t * @example\n\t * Deprecated version:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => ({\n\t * \tidx: index('custom_name').on(t.id)\n\t * }));\n\t * ```\n\t *\n\t * New API:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => [\n\t * \tindex('custom_name').on(t.id)\n\t * ]);\n\t * ```\n\t */\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig,\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n}\n\nfunction sqliteTableBase<\n\tTTableName extends string,\n\tTColumnsMap extends Record,\n\tTSchema extends string | undefined,\n>(\n\tname: TTableName,\n\tcolumns: TColumnsMap | ((columnTypes: SQLiteColumnBuilders) => TColumnsMap),\n\textraConfig:\n\t\t| ((\n\t\t\tself: BuildColumns,\n\t\t) => SQLiteTableExtraConfig | SQLiteTableExtraConfigValue[])\n\t\t| undefined,\n\tschema?: TSchema,\n\tbaseName = name,\n): SQLiteTableWithColumns<{\n\tname: TTableName;\n\tschema: TSchema;\n\tcolumns: BuildColumns;\n\tdialect: 'sqlite';\n}> {\n\tconst rawTable = new SQLiteTable<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>(name, schema, baseName);\n\n\tconst parsedColumns: TColumnsMap = typeof columns === 'function' ? columns(getSQLiteColumnBuilders()) : columns;\n\n\tconst builtColumns = Object.fromEntries(\n\t\tObject.entries(parsedColumns).map(([name, colBuilderBase]) => {\n\t\t\tconst colBuilder = colBuilderBase as SQLiteColumnBuilder;\n\t\t\tcolBuilder.setName(name);\n\t\t\tconst column = colBuilder.build(rawTable);\n\t\t\trawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));\n\t\t\treturn [name, column];\n\t\t}),\n\t) as unknown as BuildColumns;\n\n\tconst table = Object.assign(rawTable, builtColumns);\n\n\ttable[Table.Symbol.Columns] = builtColumns;\n\ttable[Table.Symbol.ExtraConfigColumns] = builtColumns as unknown as BuildExtraConfigColumns<\n\t\tTTableName,\n\t\tTColumnsMap,\n\t\t'sqlite'\n\t>;\n\n\tif (extraConfig) {\n\t\ttable[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig as (\n\t\t\tself: Record,\n\t\t) => SQLiteTableExtraConfig;\n\t}\n\n\treturn table;\n}\n\nexport const sqliteTable: SQLiteTableFn = (name, columns, extraConfig) => {\n\treturn sqliteTableBase(name, columns, extraConfig);\n};\n\nexport function sqliteTableCreator(customizeTableName: (name: string) => string): SQLiteTableFn {\n\treturn (name, columns, extraConfig) => {\n\t\treturn sqliteTableBase(customizeTableName(name) as typeof name, columns, extraConfig, undefined, name);\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,mBAAmF;AAEnF,iBAAmE;AAsB5D,MAAM,oBAAoB,OAAO,IAAI,iCAAiC;AAEtE,MAAM,oBAAyD,mBAAS;AAAA,EAC9E,QAA0B,wBAAU,IAAY;AAAA;AAAA,EAGhD,OAAyB,SAAS,OAAO,OAAO,CAAC,GAAG,mBAAM,QAAQ;AAAA,IACjE;AAAA,EACD,CAAC;AAAA;AAAA,EAGD,CAAU,mBAAM,OAAO,OAAO;AAAA;AAAA,EAG9B,CAAC,iBAAiB,IAAkB,CAAC;AAAA;AAAA,EAGrC,CAAU,mBAAM,OAAO,kBAAkB,IAE1B;AAChB;AAmHA,SAAS,gBAKR,MACA,SACA,aAKA,QACA,WAAW,MAMT;AACF,QAAM,WAAW,IAAI,YAKlB,MAAM,QAAQ,QAAQ;AAEzB,QAAM,gBAA6B,OAAO,YAAY,aAAa,YAAQ,oCAAwB,CAAC,IAAI;AAExG,QAAM,eAAe,OAAO;AAAA,IAC3B,OAAO,QAAQ,aAAa,EAAE,IAAI,CAAC,CAACA,OAAM,cAAc,MAAM;AAC7D,YAAM,aAAa;AACnB,iBAAW,QAAQA,KAAI;AACvB,YAAM,SAAS,WAAW,MAAM,QAAQ;AACxC,eAAS,iBAAiB,EAAE,KAAK,GAAG,WAAW,iBAAiB,QAAQ,QAAQ,CAAC;AACjF,aAAO,CAACA,OAAM,MAAM;AAAA,IACrB,CAAC;AAAA,EACF;AAEA,QAAM,QAAQ,OAAO,OAAO,UAAU,YAAY;AAElD,QAAM,mBAAM,OAAO,OAAO,IAAI;AAC9B,QAAM,mBAAM,OAAO,kBAAkB,IAAI;AAMzC,MAAI,aAAa;AAChB,UAAM,YAAY,OAAO,kBAAkB,IAAI;AAAA,EAGhD;AAEA,SAAO;AACR;AAEO,MAAM,cAA6B,CAAC,MAAM,SAAS,gBAAgB;AACzE,SAAO,gBAAgB,MAAM,SAAS,WAAW;AAClD;AAEO,SAAS,mBAAmB,oBAA6D;AAC/F,SAAO,CAAC,MAAM,SAAS,gBAAgB;AACtC,WAAO,gBAAgB,mBAAmB,IAAI,GAAkB,SAAS,aAAa,QAAW,IAAI;AAAA,EACtG;AACD;","names":["name"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..3a707aa33273af4da79acb66be3fd686b089a63b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.cts @@ -0,0 +1,92 @@ +import type { BuildColumns } from "../column-builder.cjs"; +import { entityKind } from "../entity.cjs"; +import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from "../table.cjs"; +import type { CheckBuilder } from "./checks.cjs"; +import { type SQLiteColumnBuilders } from "./columns/all.cjs"; +import type { SQLiteColumn, SQLiteColumnBuilderBase } from "./columns/common.cjs"; +import type { ForeignKeyBuilder } from "./foreign-keys.cjs"; +import type { IndexBuilder } from "./indexes.cjs"; +import type { PrimaryKeyBuilder } from "./primary-keys.cjs"; +import type { UniqueConstraintBuilder } from "./unique-constraint.cjs"; +export type SQLiteTableExtraConfigValue = IndexBuilder | CheckBuilder | ForeignKeyBuilder | PrimaryKeyBuilder | UniqueConstraintBuilder; +export type SQLiteTableExtraConfig = Record; +export type TableConfig = TableConfigBase>; +export declare class SQLiteTable extends Table { + static readonly [entityKind]: string; +} +export type AnySQLiteTable = {}> = SQLiteTable>; +export type SQLiteTableWithColumns = SQLiteTable & { + [Key in keyof T['columns']]: T['columns'][Key]; +}; +export interface SQLiteTableFn { + >(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[]): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + >(name: TTableName, columns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[]): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + /** + * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object + * + * @example + * Deprecated version: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => ({ + * idx: index('custom_name').on(t.id) + * })); + * ``` + * + * New API: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => [ + * index('custom_name').on(t.id) + * ]); + * ``` + */ + >(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + /** + * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object + * + * @example + * Deprecated version: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => ({ + * idx: index('custom_name').on(t.id) + * })); + * ``` + * + * New API: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => [ + * index('custom_name').on(t.id) + * ]); + * ``` + */ + >(name: TTableName, columns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; +} +export declare const sqliteTable: SQLiteTableFn; +export declare function sqliteTableCreator(customizeTableName: (name: string) => string): SQLiteTableFn; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..611cf8ee47fb1bef059eacb3eec7afdb51bd56f9 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.d.ts @@ -0,0 +1,92 @@ +import type { BuildColumns } from "../column-builder.js"; +import { entityKind } from "../entity.js"; +import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from "../table.js"; +import type { CheckBuilder } from "./checks.js"; +import { type SQLiteColumnBuilders } from "./columns/all.js"; +import type { SQLiteColumn, SQLiteColumnBuilderBase } from "./columns/common.js"; +import type { ForeignKeyBuilder } from "./foreign-keys.js"; +import type { IndexBuilder } from "./indexes.js"; +import type { PrimaryKeyBuilder } from "./primary-keys.js"; +import type { UniqueConstraintBuilder } from "./unique-constraint.js"; +export type SQLiteTableExtraConfigValue = IndexBuilder | CheckBuilder | ForeignKeyBuilder | PrimaryKeyBuilder | UniqueConstraintBuilder; +export type SQLiteTableExtraConfig = Record; +export type TableConfig = TableConfigBase>; +export declare class SQLiteTable extends Table { + static readonly [entityKind]: string; +} +export type AnySQLiteTable = {}> = SQLiteTable>; +export type SQLiteTableWithColumns = SQLiteTable & { + [Key in keyof T['columns']]: T['columns'][Key]; +}; +export interface SQLiteTableFn { + >(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[]): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + >(name: TTableName, columns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[]): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + /** + * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object + * + * @example + * Deprecated version: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => ({ + * idx: index('custom_name').on(t.id) + * })); + * ``` + * + * New API: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => [ + * index('custom_name').on(t.id) + * ]); + * ``` + */ + >(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; + /** + * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object + * + * @example + * Deprecated version: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => ({ + * idx: index('custom_name').on(t.id) + * })); + * ``` + * + * New API: + * ```ts + * export const users = sqliteTable("users", { + * id: int(), + * }, (t) => [ + * index('custom_name').on(t.id) + * ]); + * ``` + */ + >(name: TTableName, columns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap, extraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig): SQLiteTableWithColumns<{ + name: TTableName; + schema: TSchema; + columns: BuildColumns; + dialect: 'sqlite'; + }>; +} +export declare const sqliteTable: SQLiteTableFn; +export declare function sqliteTableCreator(customizeTableName: (name: string) => string): SQLiteTableFn; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js new file mode 100644 index 0000000000000000000000000000000000000000..2214339b9083e7d673828fb7faac8073f20d5537 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js @@ -0,0 +1,52 @@ +import { entityKind } from "../entity.js"; +import { Table } from "../table.js"; +import { getSQLiteColumnBuilders } from "./columns/all.js"; +const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys"); +class SQLiteTable extends Table { + static [entityKind] = "SQLiteTable"; + /** @internal */ + static Symbol = Object.assign({}, Table.Symbol, { + InlineForeignKeys + }); + /** @internal */ + [Table.Symbol.Columns]; + /** @internal */ + [InlineForeignKeys] = []; + /** @internal */ + [Table.Symbol.ExtraConfigBuilder] = void 0; +} +function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) { + const rawTable = new SQLiteTable(name, schema, baseName); + const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns; + const builtColumns = Object.fromEntries( + Object.entries(parsedColumns).map(([name2, colBuilderBase]) => { + const colBuilder = colBuilderBase; + colBuilder.setName(name2); + const column = colBuilder.build(rawTable); + rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable)); + return [name2, column]; + }) + ); + const table = Object.assign(rawTable, builtColumns); + table[Table.Symbol.Columns] = builtColumns; + table[Table.Symbol.ExtraConfigColumns] = builtColumns; + if (extraConfig) { + table[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig; + } + return table; +} +const sqliteTable = (name, columns, extraConfig) => { + return sqliteTableBase(name, columns, extraConfig); +}; +function sqliteTableCreator(customizeTableName) { + return (name, columns, extraConfig) => { + return sqliteTableBase(customizeTableName(name), columns, extraConfig, void 0, name); + }; +} +export { + InlineForeignKeys, + SQLiteTable, + sqliteTable, + sqliteTableCreator +}; +//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js.map new file mode 100644 index 0000000000000000000000000000000000000000..98c5d142d8eeb5f4f528e2650b9cd4eb56f79b8d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/table.ts"],"sourcesContent":["import type { BuildColumns, BuildExtraConfigColumns } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table.ts';\nimport type { CheckBuilder } from './checks.ts';\nimport { getSQLiteColumnBuilders, type SQLiteColumnBuilders } from './columns/all.ts';\nimport type { SQLiteColumn, SQLiteColumnBuilder, SQLiteColumnBuilderBase } from './columns/common.ts';\nimport type { ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts';\nimport type { IndexBuilder } from './indexes.ts';\nimport type { PrimaryKeyBuilder } from './primary-keys.ts';\nimport type { UniqueConstraintBuilder } from './unique-constraint.ts';\n\nexport type SQLiteTableExtraConfigValue =\n\t| IndexBuilder\n\t| CheckBuilder\n\t| ForeignKeyBuilder\n\t| PrimaryKeyBuilder\n\t| UniqueConstraintBuilder;\n\nexport type SQLiteTableExtraConfig = Record<\n\tstring,\n\tSQLiteTableExtraConfigValue\n>;\n\nexport type TableConfig = TableConfigBase>;\n\n/** @internal */\nexport const InlineForeignKeys = Symbol.for('drizzle:SQLiteInlineForeignKeys');\n\nexport class SQLiteTable extends Table {\n\tstatic override readonly [entityKind]: string = 'SQLiteTable';\n\n\t/** @internal */\n\tstatic override readonly Symbol = Object.assign({}, Table.Symbol, {\n\t\tInlineForeignKeys: InlineForeignKeys as typeof InlineForeignKeys,\n\t});\n\n\t/** @internal */\n\toverride [Table.Symbol.Columns]!: NonNullable;\n\n\t/** @internal */\n\t[InlineForeignKeys]: ForeignKey[] = [];\n\n\t/** @internal */\n\toverride [Table.Symbol.ExtraConfigBuilder]:\n\t\t| ((self: Record) => SQLiteTableExtraConfig)\n\t\t| undefined = undefined;\n}\n\nexport type AnySQLiteTable = {}> = SQLiteTable<\n\tUpdateTableConfig\n>;\n\nexport type SQLiteTableWithColumns =\n\t& SQLiteTable\n\t& {\n\t\t[Key in keyof T['columns']]: T['columns'][Key];\n\t};\n\nexport interface SQLiteTableFn {\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: TColumnsMap,\n\t\textraConfig?: (\n\t\t\tself: BuildColumns,\n\t\t) => SQLiteTableExtraConfigValue[],\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfigValue[],\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\t/**\n\t * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object\n\t *\n\t * @example\n\t * Deprecated version:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => ({\n\t * \tidx: index('custom_name').on(t.id)\n\t * }));\n\t * ```\n\t *\n\t * New API:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => [\n\t * \tindex('custom_name').on(t.id)\n\t * ]);\n\t * ```\n\t */\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig,\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n\n\t/**\n\t * @deprecated The third parameter of sqliteTable is changing and will only accept an array instead of an object\n\t *\n\t * @example\n\t * Deprecated version:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => ({\n\t * \tidx: index('custom_name').on(t.id)\n\t * }));\n\t * ```\n\t *\n\t * New API:\n\t * ```ts\n\t * export const users = sqliteTable(\"users\", {\n\t * \tid: int(),\n\t * }, (t) => [\n\t * \tindex('custom_name').on(t.id)\n\t * ]);\n\t * ```\n\t */\n\t<\n\t\tTTableName extends string,\n\t\tTColumnsMap extends Record,\n\t>(\n\t\tname: TTableName,\n\t\tcolumns: (columnTypes: SQLiteColumnBuilders) => TColumnsMap,\n\t\textraConfig?: (self: BuildColumns) => SQLiteTableExtraConfig,\n\t): SQLiteTableWithColumns<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>;\n}\n\nfunction sqliteTableBase<\n\tTTableName extends string,\n\tTColumnsMap extends Record,\n\tTSchema extends string | undefined,\n>(\n\tname: TTableName,\n\tcolumns: TColumnsMap | ((columnTypes: SQLiteColumnBuilders) => TColumnsMap),\n\textraConfig:\n\t\t| ((\n\t\t\tself: BuildColumns,\n\t\t) => SQLiteTableExtraConfig | SQLiteTableExtraConfigValue[])\n\t\t| undefined,\n\tschema?: TSchema,\n\tbaseName = name,\n): SQLiteTableWithColumns<{\n\tname: TTableName;\n\tschema: TSchema;\n\tcolumns: BuildColumns;\n\tdialect: 'sqlite';\n}> {\n\tconst rawTable = new SQLiteTable<{\n\t\tname: TTableName;\n\t\tschema: TSchema;\n\t\tcolumns: BuildColumns;\n\t\tdialect: 'sqlite';\n\t}>(name, schema, baseName);\n\n\tconst parsedColumns: TColumnsMap = typeof columns === 'function' ? columns(getSQLiteColumnBuilders()) : columns;\n\n\tconst builtColumns = Object.fromEntries(\n\t\tObject.entries(parsedColumns).map(([name, colBuilderBase]) => {\n\t\t\tconst colBuilder = colBuilderBase as SQLiteColumnBuilder;\n\t\t\tcolBuilder.setName(name);\n\t\t\tconst column = colBuilder.build(rawTable);\n\t\t\trawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));\n\t\t\treturn [name, column];\n\t\t}),\n\t) as unknown as BuildColumns;\n\n\tconst table = Object.assign(rawTable, builtColumns);\n\n\ttable[Table.Symbol.Columns] = builtColumns;\n\ttable[Table.Symbol.ExtraConfigColumns] = builtColumns as unknown as BuildExtraConfigColumns<\n\t\tTTableName,\n\t\tTColumnsMap,\n\t\t'sqlite'\n\t>;\n\n\tif (extraConfig) {\n\t\ttable[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig as (\n\t\t\tself: Record,\n\t\t) => SQLiteTableExtraConfig;\n\t}\n\n\treturn table;\n}\n\nexport const sqliteTable: SQLiteTableFn = (name, columns, extraConfig) => {\n\treturn sqliteTableBase(name, columns, extraConfig);\n};\n\nexport function sqliteTableCreator(customizeTableName: (name: string) => string): SQLiteTableFn {\n\treturn (name, columns, extraConfig) => {\n\t\treturn sqliteTableBase(customizeTableName(name) as typeof name, columns, extraConfig, undefined, name);\n\t};\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAC3B,SAAS,aAA0E;AAEnF,SAAS,+BAA0D;AAsB5D,MAAM,oBAAoB,OAAO,IAAI,iCAAiC;AAEtE,MAAM,oBAAyD,MAAS;AAAA,EAC9E,QAA0B,UAAU,IAAY;AAAA;AAAA,EAGhD,OAAyB,SAAS,OAAO,OAAO,CAAC,GAAG,MAAM,QAAQ;AAAA,IACjE;AAAA,EACD,CAAC;AAAA;AAAA,EAGD,CAAU,MAAM,OAAO,OAAO;AAAA;AAAA,EAG9B,CAAC,iBAAiB,IAAkB,CAAC;AAAA;AAAA,EAGrC,CAAU,MAAM,OAAO,kBAAkB,IAE1B;AAChB;AAmHA,SAAS,gBAKR,MACA,SACA,aAKA,QACA,WAAW,MAMT;AACF,QAAM,WAAW,IAAI,YAKlB,MAAM,QAAQ,QAAQ;AAEzB,QAAM,gBAA6B,OAAO,YAAY,aAAa,QAAQ,wBAAwB,CAAC,IAAI;AAExG,QAAM,eAAe,OAAO;AAAA,IAC3B,OAAO,QAAQ,aAAa,EAAE,IAAI,CAAC,CAACA,OAAM,cAAc,MAAM;AAC7D,YAAM,aAAa;AACnB,iBAAW,QAAQA,KAAI;AACvB,YAAM,SAAS,WAAW,MAAM,QAAQ;AACxC,eAAS,iBAAiB,EAAE,KAAK,GAAG,WAAW,iBAAiB,QAAQ,QAAQ,CAAC;AACjF,aAAO,CAACA,OAAM,MAAM;AAAA,IACrB,CAAC;AAAA,EACF;AAEA,QAAM,QAAQ,OAAO,OAAO,UAAU,YAAY;AAElD,QAAM,MAAM,OAAO,OAAO,IAAI;AAC9B,QAAM,MAAM,OAAO,kBAAkB,IAAI;AAMzC,MAAI,aAAa;AAChB,UAAM,YAAY,OAAO,kBAAkB,IAAI;AAAA,EAGhD;AAEA,SAAO;AACR;AAEO,MAAM,cAA6B,CAAC,MAAM,SAAS,gBAAgB;AACzE,SAAO,gBAAgB,MAAM,SAAS,WAAW;AAClD;AAEO,SAAS,mBAAmB,oBAA6D;AAC/F,SAAO,CAAC,MAAM,SAAS,gBAAgB;AACtC,WAAO,gBAAgB,mBAAmB,IAAI,GAAkB,SAAS,aAAa,QAAW,IAAI;AAAA,EACtG;AACD;","names":["name"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs new file mode 100644 index 0000000000000000000000000000000000000000..fd62a695a15523b3daee8bb86c6c27ce0218d4ec --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs @@ -0,0 +1,81 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var unique_constraint_exports = {}; +__export(unique_constraint_exports, { + UniqueConstraint: () => UniqueConstraint, + UniqueConstraintBuilder: () => UniqueConstraintBuilder, + UniqueOnConstraintBuilder: () => UniqueOnConstraintBuilder, + unique: () => unique, + uniqueKeyName: () => uniqueKeyName +}); +module.exports = __toCommonJS(unique_constraint_exports); +var import_entity = require("../entity.cjs"); +var import_table_utils = require("../table.utils.cjs"); +function uniqueKeyName(table, columns) { + return `${table[import_table_utils.TableName]}_${columns.join("_")}_unique`; +} +function unique(name) { + return new UniqueOnConstraintBuilder(name); +} +class UniqueConstraintBuilder { + constructor(columns, name) { + this.name = name; + this.columns = columns; + } + static [import_entity.entityKind] = "SQLiteUniqueConstraintBuilder"; + /** @internal */ + columns; + /** @internal */ + build(table) { + return new UniqueConstraint(table, this.columns, this.name); + } +} +class UniqueOnConstraintBuilder { + static [import_entity.entityKind] = "SQLiteUniqueOnConstraintBuilder"; + /** @internal */ + name; + constructor(name) { + this.name = name; + } + on(...columns) { + return new UniqueConstraintBuilder(columns, this.name); + } +} +class UniqueConstraint { + constructor(table, columns, name) { + this.table = table; + this.columns = columns; + this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name)); + } + static [import_entity.entityKind] = "SQLiteUniqueConstraint"; + columns; + name; + getName() { + return this.name; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + UniqueConstraint, + UniqueConstraintBuilder, + UniqueOnConstraintBuilder, + unique, + uniqueKeyName +}); +//# sourceMappingURL=unique-constraint.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..2bba989f146954a9d4078644cb64be901c2955eb --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/unique-constraint.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { TableName } from '~/table.utils.ts';\nimport type { SQLiteColumn } from './columns/common.ts';\nimport type { SQLiteTable } from './table.ts';\n\nexport function uniqueKeyName(table: SQLiteTable, columns: string[]) {\n\treturn `${table[TableName]}_${columns.join('_')}_unique`;\n}\n\nexport function unique(name?: string): UniqueOnConstraintBuilder {\n\treturn new UniqueOnConstraintBuilder(name);\n}\n\nexport class UniqueConstraintBuilder {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueConstraintBuilder';\n\n\t/** @internal */\n\tcolumns: SQLiteColumn[];\n\n\tconstructor(\n\t\tcolumns: SQLiteColumn[],\n\t\tprivate name?: string,\n\t) {\n\t\tthis.columns = columns;\n\t}\n\n\t/** @internal */\n\tbuild(table: SQLiteTable): UniqueConstraint {\n\t\treturn new UniqueConstraint(table, this.columns, this.name);\n\t}\n}\n\nexport class UniqueOnConstraintBuilder {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueOnConstraintBuilder';\n\n\t/** @internal */\n\tname?: string;\n\n\tconstructor(\n\t\tname?: string,\n\t) {\n\t\tthis.name = name;\n\t}\n\n\ton(...columns: [SQLiteColumn, ...SQLiteColumn[]]) {\n\t\treturn new UniqueConstraintBuilder(columns, this.name);\n\t}\n}\n\nexport class UniqueConstraint {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueConstraint';\n\n\treadonly columns: SQLiteColumn[];\n\treadonly name?: string;\n\n\tconstructor(readonly table: SQLiteTable, columns: SQLiteColumn[], name?: string) {\n\t\tthis.columns = columns;\n\t\tthis.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name));\n\t}\n\n\tgetName() {\n\t\treturn this.name;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,yBAA0B;AAInB,SAAS,cAAc,OAAoB,SAAmB;AACpE,SAAO,GAAG,MAAM,4BAAS,CAAC,IAAI,QAAQ,KAAK,GAAG,CAAC;AAChD;AAEO,SAAS,OAAO,MAA0C;AAChE,SAAO,IAAI,0BAA0B,IAAI;AAC1C;AAEO,MAAM,wBAAwB;AAAA,EAMpC,YACC,SACQ,MACP;AADO;AAER,SAAK,UAAU;AAAA,EAChB;AAAA,EAVA,QAAiB,wBAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAUA,MAAM,OAAsC;AAC3C,WAAO,IAAI,iBAAiB,OAAO,KAAK,SAAS,KAAK,IAAI;AAAA,EAC3D;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,QAAiB,wBAAU,IAAY;AAAA;AAAA,EAGvC;AAAA,EAEA,YACC,MACC;AACD,SAAK,OAAO;AAAA,EACb;AAAA,EAEA,MAAM,SAA4C;AACjD,WAAO,IAAI,wBAAwB,SAAS,KAAK,IAAI;AAAA,EACtD;AACD;AAEO,MAAM,iBAAiB;AAAA,EAM7B,YAAqB,OAAoB,SAAyB,MAAe;AAA5D;AACpB,SAAK,UAAU;AACf,SAAK,OAAO,QAAQ,cAAc,KAAK,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC;AAAA,EACxF;AAAA,EARA,QAAiB,wBAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EAOT,UAAU;AACT,WAAO,KAAK;AAAA,EACb;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..ee1eb3b0202f1b92b1f07792b3ca449ddbfde46f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.cts @@ -0,0 +1,23 @@ +import { entityKind } from "../entity.cjs"; +import type { SQLiteColumn } from "./columns/common.cjs"; +import type { SQLiteTable } from "./table.cjs"; +export declare function uniqueKeyName(table: SQLiteTable, columns: string[]): string; +export declare function unique(name?: string): UniqueOnConstraintBuilder; +export declare class UniqueConstraintBuilder { + private name?; + static readonly [entityKind]: string; + constructor(columns: SQLiteColumn[], name?: string | undefined); +} +export declare class UniqueOnConstraintBuilder { + static readonly [entityKind]: string; + constructor(name?: string); + on(...columns: [SQLiteColumn, ...SQLiteColumn[]]): UniqueConstraintBuilder; +} +export declare class UniqueConstraint { + readonly table: SQLiteTable; + static readonly [entityKind]: string; + readonly columns: SQLiteColumn[]; + readonly name?: string; + constructor(table: SQLiteTable, columns: SQLiteColumn[], name?: string); + getName(): string | undefined; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f11f5a0d7fcaf114c6784060a54e36e77603ebc3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.d.ts @@ -0,0 +1,23 @@ +import { entityKind } from "../entity.js"; +import type { SQLiteColumn } from "./columns/common.js"; +import type { SQLiteTable } from "./table.js"; +export declare function uniqueKeyName(table: SQLiteTable, columns: string[]): string; +export declare function unique(name?: string): UniqueOnConstraintBuilder; +export declare class UniqueConstraintBuilder { + private name?; + static readonly [entityKind]: string; + constructor(columns: SQLiteColumn[], name?: string | undefined); +} +export declare class UniqueOnConstraintBuilder { + static readonly [entityKind]: string; + constructor(name?: string); + on(...columns: [SQLiteColumn, ...SQLiteColumn[]]): UniqueConstraintBuilder; +} +export declare class UniqueConstraint { + readonly table: SQLiteTable; + static readonly [entityKind]: string; + readonly columns: SQLiteColumn[]; + readonly name?: string; + constructor(table: SQLiteTable, columns: SQLiteColumn[], name?: string); + getName(): string | undefined; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js new file mode 100644 index 0000000000000000000000000000000000000000..d7df2b0c82132fc7cbe45ec17965038d4c21d85d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js @@ -0,0 +1,53 @@ +import { entityKind } from "../entity.js"; +import { TableName } from "../table.utils.js"; +function uniqueKeyName(table, columns) { + return `${table[TableName]}_${columns.join("_")}_unique`; +} +function unique(name) { + return new UniqueOnConstraintBuilder(name); +} +class UniqueConstraintBuilder { + constructor(columns, name) { + this.name = name; + this.columns = columns; + } + static [entityKind] = "SQLiteUniqueConstraintBuilder"; + /** @internal */ + columns; + /** @internal */ + build(table) { + return new UniqueConstraint(table, this.columns, this.name); + } +} +class UniqueOnConstraintBuilder { + static [entityKind] = "SQLiteUniqueOnConstraintBuilder"; + /** @internal */ + name; + constructor(name) { + this.name = name; + } + on(...columns) { + return new UniqueConstraintBuilder(columns, this.name); + } +} +class UniqueConstraint { + constructor(table, columns, name) { + this.table = table; + this.columns = columns; + this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name)); + } + static [entityKind] = "SQLiteUniqueConstraint"; + columns; + name; + getName() { + return this.name; + } +} +export { + UniqueConstraint, + UniqueConstraintBuilder, + UniqueOnConstraintBuilder, + unique, + uniqueKeyName +}; +//# sourceMappingURL=unique-constraint.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js.map new file mode 100644 index 0000000000000000000000000000000000000000..a2fe6fe12a7ae4b5a9982c0a50f81028a776a2ca --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/unique-constraint.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/unique-constraint.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { TableName } from '~/table.utils.ts';\nimport type { SQLiteColumn } from './columns/common.ts';\nimport type { SQLiteTable } from './table.ts';\n\nexport function uniqueKeyName(table: SQLiteTable, columns: string[]) {\n\treturn `${table[TableName]}_${columns.join('_')}_unique`;\n}\n\nexport function unique(name?: string): UniqueOnConstraintBuilder {\n\treturn new UniqueOnConstraintBuilder(name);\n}\n\nexport class UniqueConstraintBuilder {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueConstraintBuilder';\n\n\t/** @internal */\n\tcolumns: SQLiteColumn[];\n\n\tconstructor(\n\t\tcolumns: SQLiteColumn[],\n\t\tprivate name?: string,\n\t) {\n\t\tthis.columns = columns;\n\t}\n\n\t/** @internal */\n\tbuild(table: SQLiteTable): UniqueConstraint {\n\t\treturn new UniqueConstraint(table, this.columns, this.name);\n\t}\n}\n\nexport class UniqueOnConstraintBuilder {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueOnConstraintBuilder';\n\n\t/** @internal */\n\tname?: string;\n\n\tconstructor(\n\t\tname?: string,\n\t) {\n\t\tthis.name = name;\n\t}\n\n\ton(...columns: [SQLiteColumn, ...SQLiteColumn[]]) {\n\t\treturn new UniqueConstraintBuilder(columns, this.name);\n\t}\n}\n\nexport class UniqueConstraint {\n\tstatic readonly [entityKind]: string = 'SQLiteUniqueConstraint';\n\n\treadonly columns: SQLiteColumn[];\n\treadonly name?: string;\n\n\tconstructor(readonly table: SQLiteTable, columns: SQLiteColumn[], name?: string) {\n\t\tthis.columns = columns;\n\t\tthis.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name));\n\t}\n\n\tgetName() {\n\t\treturn this.name;\n\t}\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAInB,SAAS,cAAc,OAAoB,SAAmB;AACpE,SAAO,GAAG,MAAM,SAAS,CAAC,IAAI,QAAQ,KAAK,GAAG,CAAC;AAChD;AAEO,SAAS,OAAO,MAA0C;AAChE,SAAO,IAAI,0BAA0B,IAAI;AAC1C;AAEO,MAAM,wBAAwB;AAAA,EAMpC,YACC,SACQ,MACP;AADO;AAER,SAAK,UAAU;AAAA,EAChB;AAAA,EAVA,QAAiB,UAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAUA,MAAM,OAAsC;AAC3C,WAAO,IAAI,iBAAiB,OAAO,KAAK,SAAS,KAAK,IAAI;AAAA,EAC3D;AACD;AAEO,MAAM,0BAA0B;AAAA,EACtC,QAAiB,UAAU,IAAY;AAAA;AAAA,EAGvC;AAAA,EAEA,YACC,MACC;AACD,SAAK,OAAO;AAAA,EACb;AAAA,EAEA,MAAM,SAA4C;AACjD,WAAO,IAAI,wBAAwB,SAAS,KAAK,IAAI;AAAA,EACtD;AACD;AAEO,MAAM,iBAAiB;AAAA,EAM7B,YAAqB,OAAoB,SAAyB,MAAe;AAA5D;AACpB,SAAK,UAAU;AACf,SAAK,OAAO,QAAQ,cAAc,KAAK,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC;AAAA,EACxF;AAAA,EARA,QAAiB,UAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EAOT,UAAU;AACT,WAAO,KAAK;AAAA,EACb;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs new file mode 100644 index 0000000000000000000000000000000000000000..5e4c4dc042d79954731d3e4435e154aad071d9de --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs @@ -0,0 +1,97 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + extractUsedTable: () => extractUsedTable, + getTableConfig: () => getTableConfig, + getViewConfig: () => getViewConfig +}); +module.exports = __toCommonJS(utils_exports); +var import_entity = require("../entity.cjs"); +var import_sql = require("../sql/sql.cjs"); +var import_subquery = require("../subquery.cjs"); +var import_table = require("../table.cjs"); +var import_view_common = require("../view-common.cjs"); +var import_checks = require("./checks.cjs"); +var import_foreign_keys = require("./foreign-keys.cjs"); +var import_indexes = require("./indexes.cjs"); +var import_primary_keys = require("./primary-keys.cjs"); +var import_table2 = require("./table.cjs"); +var import_unique_constraint = require("./unique-constraint.cjs"); +function getTableConfig(table) { + const columns = Object.values(table[import_table2.SQLiteTable.Symbol.Columns]); + const indexes = []; + const checks = []; + const primaryKeys = []; + const uniqueConstraints = []; + const foreignKeys = Object.values(table[import_table2.SQLiteTable.Symbol.InlineForeignKeys]); + const name = table[import_table.Table.Symbol.Name]; + const extraConfigBuilder = table[import_table2.SQLiteTable.Symbol.ExtraConfigBuilder]; + if (extraConfigBuilder !== void 0) { + const extraConfig = extraConfigBuilder(table[import_table2.SQLiteTable.Symbol.Columns]); + const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig); + for (const builder of Object.values(extraValues)) { + if ((0, import_entity.is)(builder, import_indexes.IndexBuilder)) { + indexes.push(builder.build(table)); + } else if ((0, import_entity.is)(builder, import_checks.CheckBuilder)) { + checks.push(builder.build(table)); + } else if ((0, import_entity.is)(builder, import_unique_constraint.UniqueConstraintBuilder)) { + uniqueConstraints.push(builder.build(table)); + } else if ((0, import_entity.is)(builder, import_primary_keys.PrimaryKeyBuilder)) { + primaryKeys.push(builder.build(table)); + } else if ((0, import_entity.is)(builder, import_foreign_keys.ForeignKeyBuilder)) { + foreignKeys.push(builder.build(table)); + } + } + } + return { + columns, + indexes, + foreignKeys, + checks, + primaryKeys, + uniqueConstraints, + name + }; +} +function extractUsedTable(table) { + if ((0, import_entity.is)(table, import_table2.SQLiteTable)) { + return [`${table[import_table.Table.Symbol.BaseName]}`]; + } + if ((0, import_entity.is)(table, import_subquery.Subquery)) { + return table._.usedTables ?? []; + } + if ((0, import_entity.is)(table, import_sql.SQL)) { + return table.usedTables ?? []; + } + return []; +} +function getViewConfig(view) { + return { + ...view[import_view_common.ViewBaseConfig] + // ...view[SQLiteViewConfig], + }; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + extractUsedTable, + getTableConfig, + getViewConfig +}); +//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..07a012067a82d4fa6c63893fc59b5f180799f9b8 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/utils.ts"],"sourcesContent":["import { is } from '~/entity.ts';\nimport { SQL } from '~/sql/sql.ts';\nimport { Subquery } from '~/subquery.ts';\nimport { Table } from '~/table.ts';\nimport { ViewBaseConfig } from '~/view-common.ts';\nimport type { Check } from './checks.ts';\nimport { CheckBuilder } from './checks.ts';\nimport type { ForeignKey } from './foreign-keys.ts';\nimport { ForeignKeyBuilder } from './foreign-keys.ts';\nimport type { Index } from './indexes.ts';\nimport { IndexBuilder } from './indexes.ts';\nimport type { PrimaryKey } from './primary-keys.ts';\nimport { PrimaryKeyBuilder } from './primary-keys.ts';\nimport { SQLiteTable } from './table.ts';\nimport { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint.ts';\nimport type { SQLiteViewBase } from './view-base.ts';\nimport type { SQLiteView } from './view.ts';\n\nexport function getTableConfig(table: TTable) {\n\tconst columns = Object.values(table[SQLiteTable.Symbol.Columns]);\n\tconst indexes: Index[] = [];\n\tconst checks: Check[] = [];\n\tconst primaryKeys: PrimaryKey[] = [];\n\tconst uniqueConstraints: UniqueConstraint[] = [];\n\tconst foreignKeys: ForeignKey[] = Object.values(table[SQLiteTable.Symbol.InlineForeignKeys]);\n\tconst name = table[Table.Symbol.Name];\n\n\tconst extraConfigBuilder = table[SQLiteTable.Symbol.ExtraConfigBuilder];\n\n\tif (extraConfigBuilder !== undefined) {\n\t\tconst extraConfig = extraConfigBuilder(table[SQLiteTable.Symbol.Columns]);\n\t\tconst extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) as any[] : Object.values(extraConfig);\n\t\tfor (const builder of Object.values(extraValues)) {\n\t\t\tif (is(builder, IndexBuilder)) {\n\t\t\t\tindexes.push(builder.build(table));\n\t\t\t} else if (is(builder, CheckBuilder)) {\n\t\t\t\tchecks.push(builder.build(table));\n\t\t\t} else if (is(builder, UniqueConstraintBuilder)) {\n\t\t\t\tuniqueConstraints.push(builder.build(table));\n\t\t\t} else if (is(builder, PrimaryKeyBuilder)) {\n\t\t\t\tprimaryKeys.push(builder.build(table));\n\t\t\t} else if (is(builder, ForeignKeyBuilder)) {\n\t\t\t\tforeignKeys.push(builder.build(table));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tcolumns,\n\t\tindexes,\n\t\tforeignKeys,\n\t\tchecks,\n\t\tprimaryKeys,\n\t\tuniqueConstraints,\n\t\tname,\n\t};\n}\n\nexport function extractUsedTable(table: SQLiteTable | Subquery | SQLiteViewBase | SQL): string[] {\n\tif (is(table, SQLiteTable)) {\n\t\treturn [`${table[Table.Symbol.BaseName]}`];\n\t}\n\tif (is(table, Subquery)) {\n\t\treturn table._.usedTables ?? [];\n\t}\n\tif (is(table, SQL)) {\n\t\treturn table.usedTables ?? [];\n\t}\n\treturn [];\n}\n\nexport type OnConflict = 'rollback' | 'abort' | 'fail' | 'ignore' | 'replace';\n\nexport function getViewConfig<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n>(view: SQLiteView) {\n\treturn {\n\t\t...view[ViewBaseConfig],\n\t\t// ...view[SQLiteViewConfig],\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,iBAAoB;AACpB,sBAAyB;AACzB,mBAAsB;AACtB,yBAA+B;AAE/B,oBAA6B;AAE7B,0BAAkC;AAElC,qBAA6B;AAE7B,0BAAkC;AAClC,IAAAA,gBAA4B;AAC5B,+BAA+D;AAIxD,SAAS,eAA2C,OAAe;AACzE,QAAM,UAAU,OAAO,OAAO,MAAM,0BAAY,OAAO,OAAO,CAAC;AAC/D,QAAM,UAAmB,CAAC;AAC1B,QAAM,SAAkB,CAAC;AACzB,QAAM,cAA4B,CAAC;AACnC,QAAM,oBAAwC,CAAC;AAC/C,QAAM,cAA4B,OAAO,OAAO,MAAM,0BAAY,OAAO,iBAAiB,CAAC;AAC3F,QAAM,OAAO,MAAM,mBAAM,OAAO,IAAI;AAEpC,QAAM,qBAAqB,MAAM,0BAAY,OAAO,kBAAkB;AAEtE,MAAI,uBAAuB,QAAW;AACrC,UAAM,cAAc,mBAAmB,MAAM,0BAAY,OAAO,OAAO,CAAC;AACxE,UAAM,cAAc,MAAM,QAAQ,WAAW,IAAI,YAAY,KAAK,CAAC,IAAa,OAAO,OAAO,WAAW;AACzG,eAAW,WAAW,OAAO,OAAO,WAAW,GAAG;AACjD,cAAI,kBAAG,SAAS,2BAAY,GAAG;AAC9B,gBAAQ,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MAClC,eAAW,kBAAG,SAAS,0BAAY,GAAG;AACrC,eAAO,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACjC,eAAW,kBAAG,SAAS,gDAAuB,GAAG;AAChD,0BAAkB,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MAC5C,eAAW,kBAAG,SAAS,qCAAiB,GAAG;AAC1C,oBAAY,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACtC,eAAW,kBAAG,SAAS,qCAAiB,GAAG;AAC1C,oBAAY,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACtC;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,iBAAiB,OAAgE;AAChG,UAAI,kBAAG,OAAO,yBAAW,GAAG;AAC3B,WAAO,CAAC,GAAG,MAAM,mBAAM,OAAO,QAAQ,CAAC,EAAE;AAAA,EAC1C;AACA,UAAI,kBAAG,OAAO,wBAAQ,GAAG;AACxB,WAAO,MAAM,EAAE,cAAc,CAAC;AAAA,EAC/B;AACA,UAAI,kBAAG,OAAO,cAAG,GAAG;AACnB,WAAO,MAAM,cAAc,CAAC;AAAA,EAC7B;AACA,SAAO,CAAC;AACT;AAIO,SAAS,cAGd,MAAoC;AACrC,SAAO;AAAA,IACN,GAAG,KAAK,iCAAc;AAAA;AAAA,EAEvB;AACD;","names":["import_table"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..0c061517b297595bd5838dcf5fdcebb74101c46b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.cts @@ -0,0 +1,30 @@ +import { SQL } from "../sql/sql.cjs"; +import { Subquery } from "../subquery.cjs"; +import type { Check } from "./checks.cjs"; +import type { ForeignKey } from "./foreign-keys.cjs"; +import type { Index } from "./indexes.cjs"; +import type { PrimaryKey } from "./primary-keys.cjs"; +import { SQLiteTable } from "./table.cjs"; +import { type UniqueConstraint } from "./unique-constraint.cjs"; +import type { SQLiteViewBase } from "./view-base.cjs"; +import type { SQLiteView } from "./view.cjs"; +export declare function getTableConfig(table: TTable): { + columns: import("./index.ts").SQLiteColumn[]; + indexes: Index[]; + foreignKeys: ForeignKey[]; + checks: Check[]; + primaryKeys: PrimaryKey[]; + uniqueConstraints: UniqueConstraint[]; + name: string; +}; +export declare function extractUsedTable(table: SQLiteTable | Subquery | SQLiteViewBase | SQL): string[]; +export type OnConflict = 'rollback' | 'abort' | 'fail' | 'ignore' | 'replace'; +export declare function getViewConfig(view: SQLiteView): { + name: TName; + originalName: TName; + schema: string | undefined; + selectedFields: import("../sql/sql.ts").ColumnsSelection; + isExisting: TExisting; + query: TExisting extends true ? undefined : SQL; + isAlias: boolean; +}; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4a335a34fd33500bd5089a6cfc19892785fe09c3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.d.ts @@ -0,0 +1,30 @@ +import { SQL } from "../sql/sql.js"; +import { Subquery } from "../subquery.js"; +import type { Check } from "./checks.js"; +import type { ForeignKey } from "./foreign-keys.js"; +import type { Index } from "./indexes.js"; +import type { PrimaryKey } from "./primary-keys.js"; +import { SQLiteTable } from "./table.js"; +import { type UniqueConstraint } from "./unique-constraint.js"; +import type { SQLiteViewBase } from "./view-base.js"; +import type { SQLiteView } from "./view.js"; +export declare function getTableConfig(table: TTable): { + columns: import("./index.js").SQLiteColumn[]; + indexes: Index[]; + foreignKeys: ForeignKey[]; + checks: Check[]; + primaryKeys: PrimaryKey[]; + uniqueConstraints: UniqueConstraint[]; + name: string; +}; +export declare function extractUsedTable(table: SQLiteTable | Subquery | SQLiteViewBase | SQL): string[]; +export type OnConflict = 'rollback' | 'abort' | 'fail' | 'ignore' | 'replace'; +export declare function getViewConfig(view: SQLiteView): { + name: TName; + originalName: TName; + schema: string | undefined; + selectedFields: import("../sql/sql.js").ColumnsSelection; + isExisting: TExisting; + query: TExisting extends true ? undefined : SQL; + isAlias: boolean; +}; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..eff31ca92c5c887d4732bad635f69cd147852725 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js @@ -0,0 +1,71 @@ +import { is } from "../entity.js"; +import { SQL } from "../sql/sql.js"; +import { Subquery } from "../subquery.js"; +import { Table } from "../table.js"; +import { ViewBaseConfig } from "../view-common.js"; +import { CheckBuilder } from "./checks.js"; +import { ForeignKeyBuilder } from "./foreign-keys.js"; +import { IndexBuilder } from "./indexes.js"; +import { PrimaryKeyBuilder } from "./primary-keys.js"; +import { SQLiteTable } from "./table.js"; +import { UniqueConstraintBuilder } from "./unique-constraint.js"; +function getTableConfig(table) { + const columns = Object.values(table[SQLiteTable.Symbol.Columns]); + const indexes = []; + const checks = []; + const primaryKeys = []; + const uniqueConstraints = []; + const foreignKeys = Object.values(table[SQLiteTable.Symbol.InlineForeignKeys]); + const name = table[Table.Symbol.Name]; + const extraConfigBuilder = table[SQLiteTable.Symbol.ExtraConfigBuilder]; + if (extraConfigBuilder !== void 0) { + const extraConfig = extraConfigBuilder(table[SQLiteTable.Symbol.Columns]); + const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig); + for (const builder of Object.values(extraValues)) { + if (is(builder, IndexBuilder)) { + indexes.push(builder.build(table)); + } else if (is(builder, CheckBuilder)) { + checks.push(builder.build(table)); + } else if (is(builder, UniqueConstraintBuilder)) { + uniqueConstraints.push(builder.build(table)); + } else if (is(builder, PrimaryKeyBuilder)) { + primaryKeys.push(builder.build(table)); + } else if (is(builder, ForeignKeyBuilder)) { + foreignKeys.push(builder.build(table)); + } + } + } + return { + columns, + indexes, + foreignKeys, + checks, + primaryKeys, + uniqueConstraints, + name + }; +} +function extractUsedTable(table) { + if (is(table, SQLiteTable)) { + return [`${table[Table.Symbol.BaseName]}`]; + } + if (is(table, Subquery)) { + return table._.usedTables ?? []; + } + if (is(table, SQL)) { + return table.usedTables ?? []; + } + return []; +} +function getViewConfig(view) { + return { + ...view[ViewBaseConfig] + // ...view[SQLiteViewConfig], + }; +} +export { + extractUsedTable, + getTableConfig, + getViewConfig +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..02044b369d94edf42cf098eeeb6c99b0594cfffd --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/utils.ts"],"sourcesContent":["import { is } from '~/entity.ts';\nimport { SQL } from '~/sql/sql.ts';\nimport { Subquery } from '~/subquery.ts';\nimport { Table } from '~/table.ts';\nimport { ViewBaseConfig } from '~/view-common.ts';\nimport type { Check } from './checks.ts';\nimport { CheckBuilder } from './checks.ts';\nimport type { ForeignKey } from './foreign-keys.ts';\nimport { ForeignKeyBuilder } from './foreign-keys.ts';\nimport type { Index } from './indexes.ts';\nimport { IndexBuilder } from './indexes.ts';\nimport type { PrimaryKey } from './primary-keys.ts';\nimport { PrimaryKeyBuilder } from './primary-keys.ts';\nimport { SQLiteTable } from './table.ts';\nimport { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint.ts';\nimport type { SQLiteViewBase } from './view-base.ts';\nimport type { SQLiteView } from './view.ts';\n\nexport function getTableConfig(table: TTable) {\n\tconst columns = Object.values(table[SQLiteTable.Symbol.Columns]);\n\tconst indexes: Index[] = [];\n\tconst checks: Check[] = [];\n\tconst primaryKeys: PrimaryKey[] = [];\n\tconst uniqueConstraints: UniqueConstraint[] = [];\n\tconst foreignKeys: ForeignKey[] = Object.values(table[SQLiteTable.Symbol.InlineForeignKeys]);\n\tconst name = table[Table.Symbol.Name];\n\n\tconst extraConfigBuilder = table[SQLiteTable.Symbol.ExtraConfigBuilder];\n\n\tif (extraConfigBuilder !== undefined) {\n\t\tconst extraConfig = extraConfigBuilder(table[SQLiteTable.Symbol.Columns]);\n\t\tconst extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) as any[] : Object.values(extraConfig);\n\t\tfor (const builder of Object.values(extraValues)) {\n\t\t\tif (is(builder, IndexBuilder)) {\n\t\t\t\tindexes.push(builder.build(table));\n\t\t\t} else if (is(builder, CheckBuilder)) {\n\t\t\t\tchecks.push(builder.build(table));\n\t\t\t} else if (is(builder, UniqueConstraintBuilder)) {\n\t\t\t\tuniqueConstraints.push(builder.build(table));\n\t\t\t} else if (is(builder, PrimaryKeyBuilder)) {\n\t\t\t\tprimaryKeys.push(builder.build(table));\n\t\t\t} else if (is(builder, ForeignKeyBuilder)) {\n\t\t\t\tforeignKeys.push(builder.build(table));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tcolumns,\n\t\tindexes,\n\t\tforeignKeys,\n\t\tchecks,\n\t\tprimaryKeys,\n\t\tuniqueConstraints,\n\t\tname,\n\t};\n}\n\nexport function extractUsedTable(table: SQLiteTable | Subquery | SQLiteViewBase | SQL): string[] {\n\tif (is(table, SQLiteTable)) {\n\t\treturn [`${table[Table.Symbol.BaseName]}`];\n\t}\n\tif (is(table, Subquery)) {\n\t\treturn table._.usedTables ?? [];\n\t}\n\tif (is(table, SQL)) {\n\t\treturn table.usedTables ?? [];\n\t}\n\treturn [];\n}\n\nexport type OnConflict = 'rollback' | 'abort' | 'fail' | 'ignore' | 'replace';\n\nexport function getViewConfig<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n>(view: SQLiteView) {\n\treturn {\n\t\t...view[ViewBaseConfig],\n\t\t// ...view[SQLiteViewConfig],\n\t};\n}\n"],"mappings":"AAAA,SAAS,UAAU;AACnB,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAC5B,SAAgC,+BAA+B;AAIxD,SAAS,eAA2C,OAAe;AACzE,QAAM,UAAU,OAAO,OAAO,MAAM,YAAY,OAAO,OAAO,CAAC;AAC/D,QAAM,UAAmB,CAAC;AAC1B,QAAM,SAAkB,CAAC;AACzB,QAAM,cAA4B,CAAC;AACnC,QAAM,oBAAwC,CAAC;AAC/C,QAAM,cAA4B,OAAO,OAAO,MAAM,YAAY,OAAO,iBAAiB,CAAC;AAC3F,QAAM,OAAO,MAAM,MAAM,OAAO,IAAI;AAEpC,QAAM,qBAAqB,MAAM,YAAY,OAAO,kBAAkB;AAEtE,MAAI,uBAAuB,QAAW;AACrC,UAAM,cAAc,mBAAmB,MAAM,YAAY,OAAO,OAAO,CAAC;AACxE,UAAM,cAAc,MAAM,QAAQ,WAAW,IAAI,YAAY,KAAK,CAAC,IAAa,OAAO,OAAO,WAAW;AACzG,eAAW,WAAW,OAAO,OAAO,WAAW,GAAG;AACjD,UAAI,GAAG,SAAS,YAAY,GAAG;AAC9B,gBAAQ,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MAClC,WAAW,GAAG,SAAS,YAAY,GAAG;AACrC,eAAO,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACjC,WAAW,GAAG,SAAS,uBAAuB,GAAG;AAChD,0BAAkB,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MAC5C,WAAW,GAAG,SAAS,iBAAiB,GAAG;AAC1C,oBAAY,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACtC,WAAW,GAAG,SAAS,iBAAiB,GAAG;AAC1C,oBAAY,KAAK,QAAQ,MAAM,KAAK,CAAC;AAAA,MACtC;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,iBAAiB,OAAgE;AAChG,MAAI,GAAG,OAAO,WAAW,GAAG;AAC3B,WAAO,CAAC,GAAG,MAAM,MAAM,OAAO,QAAQ,CAAC,EAAE;AAAA,EAC1C;AACA,MAAI,GAAG,OAAO,QAAQ,GAAG;AACxB,WAAO,MAAM,EAAE,cAAc,CAAC;AAAA,EAC/B;AACA,MAAI,GAAG,OAAO,GAAG,GAAG;AACnB,WAAO,MAAM,cAAc,CAAC;AAAA,EAC7B;AACA,SAAO,CAAC;AACT;AAIO,SAAS,cAGd,MAAoC;AACrC,SAAO;AAAA,IACN,GAAG,KAAK,cAAc;AAAA;AAAA,EAEvB;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs new file mode 100644 index 0000000000000000000000000000000000000000..857c6dda394dc20ea2cd704c8d82111cfcc7de23 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var view_base_exports = {}; +__export(view_base_exports, { + SQLiteViewBase: () => SQLiteViewBase +}); +module.exports = __toCommonJS(view_base_exports); +var import_entity = require("../entity.cjs"); +var import_sql = require("../sql/sql.cjs"); +class SQLiteViewBase extends import_sql.View { + static [import_entity.entityKind] = "SQLiteViewBase"; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SQLiteViewBase +}); +//# sourceMappingURL=view-base.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..b71962af2707c406d81ade2ba701fc51435899ce --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view-base.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { ColumnsSelection } from '~/sql/sql.ts';\nimport { View } from '~/sql/sql.ts';\n\nexport abstract class SQLiteViewBase<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n> extends View {\n\tstatic override readonly [entityKind]: string = 'SQLiteViewBase';\n\n\tdeclare _: View['_'] & {\n\t\tviewBrand: 'SQLiteView';\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAE3B,iBAAqB;AAEd,MAAe,uBAIZ,gBAAmC;AAAA,EAC5C,QAA0B,wBAAU,IAAY;AAKjD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..6773e1f906862fab6c6e7a0e75cb7f22fe0ef075 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.cts @@ -0,0 +1,9 @@ +import { entityKind } from "../entity.cjs"; +import type { ColumnsSelection } from "../sql/sql.cjs"; +import { View } from "../sql/sql.cjs"; +export declare abstract class SQLiteViewBase extends View { + static readonly [entityKind]: string; + _: View['_'] & { + viewBrand: 'SQLiteView'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d6f0fabb2a91df3ef41b0f4594bda1e6e7643e0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.d.ts @@ -0,0 +1,9 @@ +import { entityKind } from "../entity.js"; +import type { ColumnsSelection } from "../sql/sql.js"; +import { View } from "../sql/sql.js"; +export declare abstract class SQLiteViewBase extends View { + static readonly [entityKind]: string; + _: View['_'] & { + viewBrand: 'SQLiteView'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js new file mode 100644 index 0000000000000000000000000000000000000000..a4d58693a16f03ac76adecbb3fb8ec265df586da --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js @@ -0,0 +1,9 @@ +import { entityKind } from "../entity.js"; +import { View } from "../sql/sql.js"; +class SQLiteViewBase extends View { + static [entityKind] = "SQLiteViewBase"; +} +export { + SQLiteViewBase +}; +//# sourceMappingURL=view-base.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f937cf72dbc9ea9a01f9cd7429f47c11b2e54433 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-base.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view-base.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { ColumnsSelection } from '~/sql/sql.ts';\nimport { View } from '~/sql/sql.ts';\n\nexport abstract class SQLiteViewBase<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n> extends View {\n\tstatic override readonly [entityKind]: string = 'SQLiteViewBase';\n\n\tdeclare _: View['_'] & {\n\t\tviewBrand: 'SQLiteView';\n\t};\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AAEd,MAAe,uBAIZ,KAAmC;AAAA,EAC5C,QAA0B,UAAU,IAAY;AAKjD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs new file mode 100644 index 0000000000000000000000000000000000000000..54904ed7c8d3864a66a5fb81c6894b51124932c1 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs @@ -0,0 +1,29 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var view_common_exports = {}; +__export(view_common_exports, { + SQLiteViewConfig: () => SQLiteViewConfig +}); +module.exports = __toCommonJS(view_common_exports); +const SQLiteViewConfig = Symbol.for("drizzle:SQLiteViewConfig"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SQLiteViewConfig +}); +//# sourceMappingURL=view-common.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..57de3ef5b65bb64d655f713f91f824a22ddd72b0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view-common.ts"],"sourcesContent":["export const SQLiteViewConfig = Symbol.for('drizzle:SQLiteViewConfig');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB,OAAO,IAAI,0BAA0B;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..e20b3d6f4ec18619e0fcdf985f435dec7cf4c4bf --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.cts @@ -0,0 +1 @@ +export declare const SQLiteViewConfig: unique symbol; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e20b3d6f4ec18619e0fcdf985f435dec7cf4c4bf --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.d.ts @@ -0,0 +1 @@ +export declare const SQLiteViewConfig: unique symbol; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js new file mode 100644 index 0000000000000000000000000000000000000000..c63c597f3f61f52d01d7f014ed827ce39c4e533a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js @@ -0,0 +1,5 @@ +const SQLiteViewConfig = Symbol.for("drizzle:SQLiteViewConfig"); +export { + SQLiteViewConfig +}; +//# sourceMappingURL=view-common.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f9b86da6407f1003c2b7bf7ba3299024047e5175 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view-common.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view-common.ts"],"sourcesContent":["export const SQLiteViewConfig = Symbol.for('drizzle:SQLiteViewConfig');\n"],"mappings":"AAAO,MAAM,mBAAmB,OAAO,IAAI,0BAA0B;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs new file mode 100644 index 0000000000000000000000000000000000000000..fa06ca228456158db84dc23c451675f0e63438ee --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs @@ -0,0 +1,135 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var view_exports = {}; +__export(view_exports, { + ManualViewBuilder: () => ManualViewBuilder, + SQLiteView: () => SQLiteView, + ViewBuilder: () => ViewBuilder, + ViewBuilderCore: () => ViewBuilderCore, + sqliteView: () => sqliteView, + view: () => view +}); +module.exports = __toCommonJS(view_exports); +var import_entity = require("../entity.cjs"); +var import_selection_proxy = require("../selection-proxy.cjs"); +var import_utils = require("../utils.cjs"); +var import_query_builder = require("./query-builders/query-builder.cjs"); +var import_table = require("./table.cjs"); +var import_view_base = require("./view-base.cjs"); +class ViewBuilderCore { + constructor(name) { + this.name = name; + } + static [import_entity.entityKind] = "SQLiteViewBuilderCore"; + config = {}; +} +class ViewBuilder extends ViewBuilderCore { + static [import_entity.entityKind] = "SQLiteViewBuilder"; + as(qb) { + if (typeof qb === "function") { + qb = qb(new import_query_builder.QueryBuilder()); + } + const selectionProxy = new import_selection_proxy.SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }); + const aliasedSelectedFields = qb.getSelectedFields(); + return new Proxy( + new SQLiteView({ + // sqliteConfig: this.config, + config: { + name: this.name, + schema: void 0, + selectedFields: aliasedSelectedFields, + query: qb.getSQL().inlineParams() + } + }), + selectionProxy + ); + } +} +class ManualViewBuilder extends ViewBuilderCore { + static [import_entity.entityKind] = "SQLiteManualViewBuilder"; + columns; + constructor(name, columns) { + super(name); + this.columns = (0, import_utils.getTableColumns)((0, import_table.sqliteTable)(name, columns)); + } + existing() { + return new Proxy( + new SQLiteView({ + config: { + name: this.name, + schema: void 0, + selectedFields: this.columns, + query: void 0 + } + }), + new import_selection_proxy.SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }) + ); + } + as(query) { + return new Proxy( + new SQLiteView({ + config: { + name: this.name, + schema: void 0, + selectedFields: this.columns, + query: query.inlineParams() + } + }), + new import_selection_proxy.SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }) + ); + } +} +class SQLiteView extends import_view_base.SQLiteViewBase { + static [import_entity.entityKind] = "SQLiteView"; + constructor({ config }) { + super(config); + } +} +function sqliteView(name, selection) { + if (selection) { + return new ManualViewBuilder(name, selection); + } + return new ViewBuilder(name); +} +const view = sqliteView; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ManualViewBuilder, + SQLiteView, + ViewBuilder, + ViewBuilderCore, + sqliteView, + view +}); +//# sourceMappingURL=view.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..f5fc326ec315441ae203ae09d0cffeb80c7a0557 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view.ts"],"sourcesContent":["import type { BuildColumns } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AddAliasToSelection } from '~/query-builders/select.types.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport type { ColumnsSelection, SQL } from '~/sql/sql.ts';\nimport { getTableColumns } from '~/utils.ts';\nimport type { SQLiteColumn, SQLiteColumnBuilderBase } from './columns/common.ts';\nimport { QueryBuilder } from './query-builders/query-builder.ts';\nimport { sqliteTable } from './table.ts';\nimport { SQLiteViewBase } from './view-base.ts';\n\nexport interface ViewBuilderConfig {\n\talgorithm?: 'undefined' | 'merge' | 'temptable';\n\tdefiner?: string;\n\tsqlSecurity?: 'definer' | 'invoker';\n\twithCheckOption?: 'cascaded' | 'local';\n}\n\nexport class ViewBuilderCore<\n\tTConfig extends { name: string; columns?: unknown },\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteViewBuilderCore';\n\n\tdeclare readonly _: {\n\t\treadonly name: TConfig['name'];\n\t\treadonly columns: TConfig['columns'];\n\t};\n\n\tconstructor(\n\t\tprotected name: TConfig['name'],\n\t) {}\n\n\tprotected config: ViewBuilderConfig = {};\n}\n\nexport class ViewBuilder extends ViewBuilderCore<{ name: TName }> {\n\tstatic override readonly [entityKind]: string = 'SQLiteViewBuilder';\n\n\tas(\n\t\tqb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder),\n\t): SQLiteViewWithSelection> {\n\t\tif (typeof qb === 'function') {\n\t\t\tqb = qb(new QueryBuilder());\n\t\t}\n\t\tconst selectionProxy = new SelectionProxyHandler({\n\t\t\talias: this.name,\n\t\t\tsqlBehavior: 'error',\n\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\treplaceOriginalName: true,\n\t\t});\n\t\t// const aliasedSelectedFields = new Proxy(qb.getSelectedFields(), selectionProxy);\n\t\tconst aliasedSelectedFields = qb.getSelectedFields();\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\t// sqliteConfig: this.config,\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: aliasedSelectedFields,\n\t\t\t\t\tquery: qb.getSQL().inlineParams(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tselectionProxy as any,\n\t\t) as SQLiteViewWithSelection>;\n\t}\n}\n\nexport class ManualViewBuilder<\n\tTName extends string = string,\n\tTColumns extends Record = Record,\n> extends ViewBuilderCore<\n\t{ name: TName; columns: TColumns }\n> {\n\tstatic override readonly [entityKind]: string = 'SQLiteManualViewBuilder';\n\n\tprivate columns: Record;\n\n\tconstructor(\n\t\tname: TName,\n\t\tcolumns: TColumns,\n\t) {\n\t\tsuper(name);\n\t\tthis.columns = getTableColumns(sqliteTable(name, columns)) as BuildColumns;\n\t}\n\n\texisting(): SQLiteViewWithSelection> {\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: this.columns,\n\t\t\t\t\tquery: undefined,\n\t\t\t\t},\n\t\t\t}),\n\t\t\tnew SelectionProxyHandler({\n\t\t\t\talias: this.name,\n\t\t\t\tsqlBehavior: 'error',\n\t\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\t\treplaceOriginalName: true,\n\t\t\t}),\n\t\t) as SQLiteViewWithSelection>;\n\t}\n\n\tas(query: SQL): SQLiteViewWithSelection> {\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: this.columns,\n\t\t\t\t\tquery: query.inlineParams(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tnew SelectionProxyHandler({\n\t\t\t\talias: this.name,\n\t\t\t\tsqlBehavior: 'error',\n\t\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\t\treplaceOriginalName: true,\n\t\t\t}),\n\t\t) as SQLiteViewWithSelection>;\n\t}\n}\n\nexport class SQLiteView<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n> extends SQLiteViewBase {\n\tstatic override readonly [entityKind]: string = 'SQLiteView';\n\n\tconstructor({ config }: {\n\t\tconfig: {\n\t\t\tname: TName;\n\t\t\tschema: string | undefined;\n\t\t\tselectedFields: ColumnsSelection;\n\t\t\tquery: SQL | undefined;\n\t\t};\n\t}) {\n\t\tsuper(config);\n\t}\n}\n\nexport type SQLiteViewWithSelection<\n\tTName extends string,\n\tTExisting extends boolean,\n\tTSelection extends ColumnsSelection,\n> = SQLiteView & TSelection;\n\nexport function sqliteView(name: TName): ViewBuilder;\nexport function sqliteView>(\n\tname: TName,\n\tcolumns: TColumns,\n): ManualViewBuilder;\nexport function sqliteView(\n\tname: string,\n\tselection?: Record,\n): ViewBuilder | ManualViewBuilder {\n\tif (selection) {\n\t\treturn new ManualViewBuilder(name, selection);\n\t}\n\treturn new ViewBuilder(name);\n}\n\nexport const view = sqliteView;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAG3B,6BAAsC;AAEtC,mBAAgC;AAEhC,2BAA6B;AAC7B,mBAA4B;AAC5B,uBAA+B;AASxB,MAAM,gBAEX;AAAA,EAQD,YACW,MACT;AADS;AAAA,EACR;AAAA,EATH,QAAiB,wBAAU,IAAY;AAAA,EAW7B,SAA4B,CAAC;AACxC;AAEO,MAAM,oBAAmD,gBAAiC;AAAA,EAChG,QAA0B,wBAAU,IAAY;AAAA,EAEhD,GACC,IAC0F;AAC1F,QAAI,OAAO,OAAO,YAAY;AAC7B,WAAK,GAAG,IAAI,kCAAa,CAAC;AAAA,IAC3B;AACA,UAAM,iBAAiB,IAAI,6CAAkC;AAAA,MAC5D,OAAO,KAAK;AAAA,MACZ,aAAa;AAAA,MACb,oBAAoB;AAAA,MACpB,qBAAqB;AAAA,IACtB,CAAC;AAED,UAAM,wBAAwB,GAAG,kBAAkB;AACnD,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA;AAAA,QAEd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB;AAAA,UAChB,OAAO,GAAG,OAAO,EAAE,aAAa;AAAA,QACjC;AAAA,MACD,CAAC;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,0BAGH,gBAER;AAAA,EACD,QAA0B,wBAAU,IAAY;AAAA,EAExC;AAAA,EAER,YACC,MACA,SACC;AACD,UAAM,IAAI;AACV,SAAK,cAAU,kCAAgB,0BAAY,MAAM,OAAO,CAAC;AAAA,EAC1D;AAAA,EAEA,WAA0F;AACzF,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA,QACd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB,KAAK;AAAA,UACrB,OAAO;AAAA,QACR;AAAA,MACD,CAAC;AAAA,MACD,IAAI,6CAAsB;AAAA,QACzB,OAAO,KAAK;AAAA,QACZ,aAAa;AAAA,QACb,oBAAoB;AAAA,QACpB,qBAAqB;AAAA,MACtB,CAAC;AAAA,IACF;AAAA,EACD;AAAA,EAEA,GAAG,OAA4F;AAC9F,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA,QACd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB,KAAK;AAAA,UACrB,OAAO,MAAM,aAAa;AAAA,QAC3B;AAAA,MACD,CAAC;AAAA,MACD,IAAI,6CAAsB;AAAA,QACzB,OAAO,KAAK;AAAA,QACZ,aAAa;AAAA,QACb,oBAAoB;AAAA,QACpB,qBAAqB;AAAA,MACtB,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAEO,MAAM,mBAIH,gCAA6C;AAAA,EACtD,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,EAAE,OAAO,GAOlB;AACF,UAAM,MAAM;AAAA,EACb;AACD;AAaO,SAAS,WACf,MACA,WACkC;AAClC,MAAI,WAAW;AACd,WAAO,IAAI,kBAAkB,MAAM,SAAS;AAAA,EAC7C;AACA,SAAO,IAAI,YAAY,IAAI;AAC5B;AAEO,MAAM,OAAO;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..e8841d860659b480f3e73819b4fe49931769f327 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.cts @@ -0,0 +1,58 @@ +import type { BuildColumns } from "../column-builder.cjs"; +import { entityKind } from "../entity.cjs"; +import type { TypedQueryBuilder } from "../query-builders/query-builder.cjs"; +import type { AddAliasToSelection } from "../query-builders/select.types.cjs"; +import type { ColumnsSelection, SQL } from "../sql/sql.cjs"; +import type { SQLiteColumnBuilderBase } from "./columns/common.cjs"; +import { QueryBuilder } from "./query-builders/query-builder.cjs"; +import { SQLiteViewBase } from "./view-base.cjs"; +export interface ViewBuilderConfig { + algorithm?: 'undefined' | 'merge' | 'temptable'; + definer?: string; + sqlSecurity?: 'definer' | 'invoker'; + withCheckOption?: 'cascaded' | 'local'; +} +export declare class ViewBuilderCore { + protected name: TConfig['name']; + static readonly [entityKind]: string; + readonly _: { + readonly name: TConfig['name']; + readonly columns: TConfig['columns']; + }; + constructor(name: TConfig['name']); + protected config: ViewBuilderConfig; +} +export declare class ViewBuilder extends ViewBuilderCore<{ + name: TName; +}> { + static readonly [entityKind]: string; + as(qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): SQLiteViewWithSelection>; +} +export declare class ManualViewBuilder = Record> extends ViewBuilderCore<{ + name: TName; + columns: TColumns; +}> { + static readonly [entityKind]: string; + private columns; + constructor(name: TName, columns: TColumns); + existing(): SQLiteViewWithSelection>; + as(query: SQL): SQLiteViewWithSelection>; +} +export declare class SQLiteView extends SQLiteViewBase { + static readonly [entityKind]: string; + constructor({ config }: { + config: { + name: TName; + schema: string | undefined; + selectedFields: ColumnsSelection; + query: SQL | undefined; + }; + }); +} +export type SQLiteViewWithSelection = SQLiteView & TSelection; +export declare function sqliteView(name: TName): ViewBuilder; +export declare function sqliteView>(name: TName, columns: TColumns): ManualViewBuilder; +export declare const view: typeof sqliteView; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a90254d7055a8e067fa320e6ead450df874385a2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.d.ts @@ -0,0 +1,58 @@ +import type { BuildColumns } from "../column-builder.js"; +import { entityKind } from "../entity.js"; +import type { TypedQueryBuilder } from "../query-builders/query-builder.js"; +import type { AddAliasToSelection } from "../query-builders/select.types.js"; +import type { ColumnsSelection, SQL } from "../sql/sql.js"; +import type { SQLiteColumnBuilderBase } from "./columns/common.js"; +import { QueryBuilder } from "./query-builders/query-builder.js"; +import { SQLiteViewBase } from "./view-base.js"; +export interface ViewBuilderConfig { + algorithm?: 'undefined' | 'merge' | 'temptable'; + definer?: string; + sqlSecurity?: 'definer' | 'invoker'; + withCheckOption?: 'cascaded' | 'local'; +} +export declare class ViewBuilderCore { + protected name: TConfig['name']; + static readonly [entityKind]: string; + readonly _: { + readonly name: TConfig['name']; + readonly columns: TConfig['columns']; + }; + constructor(name: TConfig['name']); + protected config: ViewBuilderConfig; +} +export declare class ViewBuilder extends ViewBuilderCore<{ + name: TName; +}> { + static readonly [entityKind]: string; + as(qb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder)): SQLiteViewWithSelection>; +} +export declare class ManualViewBuilder = Record> extends ViewBuilderCore<{ + name: TName; + columns: TColumns; +}> { + static readonly [entityKind]: string; + private columns; + constructor(name: TName, columns: TColumns); + existing(): SQLiteViewWithSelection>; + as(query: SQL): SQLiteViewWithSelection>; +} +export declare class SQLiteView extends SQLiteViewBase { + static readonly [entityKind]: string; + constructor({ config }: { + config: { + name: TName; + schema: string | undefined; + selectedFields: ColumnsSelection; + query: SQL | undefined; + }; + }); +} +export type SQLiteViewWithSelection = SQLiteView & TSelection; +export declare function sqliteView(name: TName): ViewBuilder; +export declare function sqliteView>(name: TName, columns: TColumns): ManualViewBuilder; +export declare const view: typeof sqliteView; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js new file mode 100644 index 0000000000000000000000000000000000000000..f1fd9c11fad5a6d4937b2ae6b7a15d47301e5e6d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js @@ -0,0 +1,106 @@ +import { entityKind } from "../entity.js"; +import { SelectionProxyHandler } from "../selection-proxy.js"; +import { getTableColumns } from "../utils.js"; +import { QueryBuilder } from "./query-builders/query-builder.js"; +import { sqliteTable } from "./table.js"; +import { SQLiteViewBase } from "./view-base.js"; +class ViewBuilderCore { + constructor(name) { + this.name = name; + } + static [entityKind] = "SQLiteViewBuilderCore"; + config = {}; +} +class ViewBuilder extends ViewBuilderCore { + static [entityKind] = "SQLiteViewBuilder"; + as(qb) { + if (typeof qb === "function") { + qb = qb(new QueryBuilder()); + } + const selectionProxy = new SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }); + const aliasedSelectedFields = qb.getSelectedFields(); + return new Proxy( + new SQLiteView({ + // sqliteConfig: this.config, + config: { + name: this.name, + schema: void 0, + selectedFields: aliasedSelectedFields, + query: qb.getSQL().inlineParams() + } + }), + selectionProxy + ); + } +} +class ManualViewBuilder extends ViewBuilderCore { + static [entityKind] = "SQLiteManualViewBuilder"; + columns; + constructor(name, columns) { + super(name); + this.columns = getTableColumns(sqliteTable(name, columns)); + } + existing() { + return new Proxy( + new SQLiteView({ + config: { + name: this.name, + schema: void 0, + selectedFields: this.columns, + query: void 0 + } + }), + new SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }) + ); + } + as(query) { + return new Proxy( + new SQLiteView({ + config: { + name: this.name, + schema: void 0, + selectedFields: this.columns, + query: query.inlineParams() + } + }), + new SelectionProxyHandler({ + alias: this.name, + sqlBehavior: "error", + sqlAliasedBehavior: "alias", + replaceOriginalName: true + }) + ); + } +} +class SQLiteView extends SQLiteViewBase { + static [entityKind] = "SQLiteView"; + constructor({ config }) { + super(config); + } +} +function sqliteView(name, selection) { + if (selection) { + return new ManualViewBuilder(name, selection); + } + return new ViewBuilder(name); +} +const view = sqliteView; +export { + ManualViewBuilder, + SQLiteView, + ViewBuilder, + ViewBuilderCore, + sqliteView, + view +}; +//# sourceMappingURL=view.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f16bda20842cca89333a2d0922d9c200f31c88b3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-core/view.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-core/view.ts"],"sourcesContent":["import type { BuildColumns } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AddAliasToSelection } from '~/query-builders/select.types.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport type { ColumnsSelection, SQL } from '~/sql/sql.ts';\nimport { getTableColumns } from '~/utils.ts';\nimport type { SQLiteColumn, SQLiteColumnBuilderBase } from './columns/common.ts';\nimport { QueryBuilder } from './query-builders/query-builder.ts';\nimport { sqliteTable } from './table.ts';\nimport { SQLiteViewBase } from './view-base.ts';\n\nexport interface ViewBuilderConfig {\n\talgorithm?: 'undefined' | 'merge' | 'temptable';\n\tdefiner?: string;\n\tsqlSecurity?: 'definer' | 'invoker';\n\twithCheckOption?: 'cascaded' | 'local';\n}\n\nexport class ViewBuilderCore<\n\tTConfig extends { name: string; columns?: unknown },\n> {\n\tstatic readonly [entityKind]: string = 'SQLiteViewBuilderCore';\n\n\tdeclare readonly _: {\n\t\treadonly name: TConfig['name'];\n\t\treadonly columns: TConfig['columns'];\n\t};\n\n\tconstructor(\n\t\tprotected name: TConfig['name'],\n\t) {}\n\n\tprotected config: ViewBuilderConfig = {};\n}\n\nexport class ViewBuilder extends ViewBuilderCore<{ name: TName }> {\n\tstatic override readonly [entityKind]: string = 'SQLiteViewBuilder';\n\n\tas(\n\t\tqb: TypedQueryBuilder | ((qb: QueryBuilder) => TypedQueryBuilder),\n\t): SQLiteViewWithSelection> {\n\t\tif (typeof qb === 'function') {\n\t\t\tqb = qb(new QueryBuilder());\n\t\t}\n\t\tconst selectionProxy = new SelectionProxyHandler({\n\t\t\talias: this.name,\n\t\t\tsqlBehavior: 'error',\n\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\treplaceOriginalName: true,\n\t\t});\n\t\t// const aliasedSelectedFields = new Proxy(qb.getSelectedFields(), selectionProxy);\n\t\tconst aliasedSelectedFields = qb.getSelectedFields();\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\t// sqliteConfig: this.config,\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: aliasedSelectedFields,\n\t\t\t\t\tquery: qb.getSQL().inlineParams(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tselectionProxy as any,\n\t\t) as SQLiteViewWithSelection>;\n\t}\n}\n\nexport class ManualViewBuilder<\n\tTName extends string = string,\n\tTColumns extends Record = Record,\n> extends ViewBuilderCore<\n\t{ name: TName; columns: TColumns }\n> {\n\tstatic override readonly [entityKind]: string = 'SQLiteManualViewBuilder';\n\n\tprivate columns: Record;\n\n\tconstructor(\n\t\tname: TName,\n\t\tcolumns: TColumns,\n\t) {\n\t\tsuper(name);\n\t\tthis.columns = getTableColumns(sqliteTable(name, columns)) as BuildColumns;\n\t}\n\n\texisting(): SQLiteViewWithSelection> {\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: this.columns,\n\t\t\t\t\tquery: undefined,\n\t\t\t\t},\n\t\t\t}),\n\t\t\tnew SelectionProxyHandler({\n\t\t\t\talias: this.name,\n\t\t\t\tsqlBehavior: 'error',\n\t\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\t\treplaceOriginalName: true,\n\t\t\t}),\n\t\t) as SQLiteViewWithSelection>;\n\t}\n\n\tas(query: SQL): SQLiteViewWithSelection> {\n\t\treturn new Proxy(\n\t\t\tnew SQLiteView({\n\t\t\t\tconfig: {\n\t\t\t\t\tname: this.name,\n\t\t\t\t\tschema: undefined,\n\t\t\t\t\tselectedFields: this.columns,\n\t\t\t\t\tquery: query.inlineParams(),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tnew SelectionProxyHandler({\n\t\t\t\talias: this.name,\n\t\t\t\tsqlBehavior: 'error',\n\t\t\t\tsqlAliasedBehavior: 'alias',\n\t\t\t\treplaceOriginalName: true,\n\t\t\t}),\n\t\t) as SQLiteViewWithSelection>;\n\t}\n}\n\nexport class SQLiteView<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n> extends SQLiteViewBase {\n\tstatic override readonly [entityKind]: string = 'SQLiteView';\n\n\tconstructor({ config }: {\n\t\tconfig: {\n\t\t\tname: TName;\n\t\t\tschema: string | undefined;\n\t\t\tselectedFields: ColumnsSelection;\n\t\t\tquery: SQL | undefined;\n\t\t};\n\t}) {\n\t\tsuper(config);\n\t}\n}\n\nexport type SQLiteViewWithSelection<\n\tTName extends string,\n\tTExisting extends boolean,\n\tTSelection extends ColumnsSelection,\n> = SQLiteView & TSelection;\n\nexport function sqliteView(name: TName): ViewBuilder;\nexport function sqliteView>(\n\tname: TName,\n\tcolumns: TColumns,\n): ManualViewBuilder;\nexport function sqliteView(\n\tname: string,\n\tselection?: Record,\n): ViewBuilder | ManualViewBuilder {\n\tif (selection) {\n\t\treturn new ManualViewBuilder(name, selection);\n\t}\n\treturn new ViewBuilder(name);\n}\n\nexport const view = sqliteView;\n"],"mappings":"AACA,SAAS,kBAAkB;AAG3B,SAAS,6BAA6B;AAEtC,SAAS,uBAAuB;AAEhC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AASxB,MAAM,gBAEX;AAAA,EAQD,YACW,MACT;AADS;AAAA,EACR;AAAA,EATH,QAAiB,UAAU,IAAY;AAAA,EAW7B,SAA4B,CAAC;AACxC;AAEO,MAAM,oBAAmD,gBAAiC;AAAA,EAChG,QAA0B,UAAU,IAAY;AAAA,EAEhD,GACC,IAC0F;AAC1F,QAAI,OAAO,OAAO,YAAY;AAC7B,WAAK,GAAG,IAAI,aAAa,CAAC;AAAA,IAC3B;AACA,UAAM,iBAAiB,IAAI,sBAAkC;AAAA,MAC5D,OAAO,KAAK;AAAA,MACZ,aAAa;AAAA,MACb,oBAAoB;AAAA,MACpB,qBAAqB;AAAA,IACtB,CAAC;AAED,UAAM,wBAAwB,GAAG,kBAAkB;AACnD,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA;AAAA,QAEd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB;AAAA,UAChB,OAAO,GAAG,OAAO,EAAE,aAAa;AAAA,QACjC;AAAA,MACD,CAAC;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,MAAM,0BAGH,gBAER;AAAA,EACD,QAA0B,UAAU,IAAY;AAAA,EAExC;AAAA,EAER,YACC,MACA,SACC;AACD,UAAM,IAAI;AACV,SAAK,UAAU,gBAAgB,YAAY,MAAM,OAAO,CAAC;AAAA,EAC1D;AAAA,EAEA,WAA0F;AACzF,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA,QACd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB,KAAK;AAAA,UACrB,OAAO;AAAA,QACR;AAAA,MACD,CAAC;AAAA,MACD,IAAI,sBAAsB;AAAA,QACzB,OAAO,KAAK;AAAA,QACZ,aAAa;AAAA,QACb,oBAAoB;AAAA,QACpB,qBAAqB;AAAA,MACtB,CAAC;AAAA,IACF;AAAA,EACD;AAAA,EAEA,GAAG,OAA4F;AAC9F,WAAO,IAAI;AAAA,MACV,IAAI,WAAW;AAAA,QACd,QAAQ;AAAA,UACP,MAAM,KAAK;AAAA,UACX,QAAQ;AAAA,UACR,gBAAgB,KAAK;AAAA,UACrB,OAAO,MAAM,aAAa;AAAA,QAC3B;AAAA,MACD,CAAC;AAAA,MACD,IAAI,sBAAsB;AAAA,QACzB,OAAO,KAAK;AAAA,QACZ,aAAa;AAAA,QACb,oBAAoB;AAAA,QACpB,qBAAqB;AAAA,MACtB,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAEO,MAAM,mBAIH,eAA6C;AAAA,EACtD,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,EAAE,OAAO,GAOlB;AACF,UAAM,MAAM;AAAA,EACb;AACD;AAaO,SAAS,WACf,MACA,WACkC;AAClC,MAAI,WAAW;AACd,WAAO,IAAI,kBAAkB,MAAM,SAAS;AAAA,EAC7C;AACA,SAAO,IAAI,YAAY,IAAI;AAC5B;AAEO,MAAM,OAAO;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs new file mode 100644 index 0000000000000000000000000000000000000000..5358931a17340367497a467c2b25bda78d088cf0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs @@ -0,0 +1,83 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var driver_exports = {}; +__export(driver_exports, { + SqliteRemoteDatabase: () => SqliteRemoteDatabase, + drizzle: () => drizzle +}); +module.exports = __toCommonJS(driver_exports); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_relations = require("../relations.cjs"); +var import_db = require("../sqlite-core/db.cjs"); +var import_dialect = require("../sqlite-core/dialect.cjs"); +var import_session = require("./session.cjs"); +class SqliteRemoteDatabase extends import_db.BaseSQLiteDatabase { + static [import_entity.entityKind] = "SqliteRemoteDatabase"; + async batch(batch) { + return this.session.batch(batch); + } +} +function drizzle(callback, batchCallback, config) { + const dialect = new import_dialect.SQLiteAsyncDialect({ casing: config?.casing }); + let logger; + let cache; + let _batchCallback; + let _config = {}; + if (batchCallback) { + if (typeof batchCallback === "function") { + _batchCallback = batchCallback; + _config = config ?? {}; + } else { + _batchCallback = void 0; + _config = batchCallback; + } + if (_config.logger === true) { + logger = new import_logger.DefaultLogger(); + } else if (_config.logger !== false) { + logger = _config.logger; + cache = _config.cache; + } + } + let schema; + if (_config.schema) { + const tablesConfig = (0, import_relations.extractTablesRelationalConfig)( + _config.schema, + import_relations.createTableRelationsHelpers + ); + schema = { + fullSchema: _config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const session = new import_session.SQLiteRemoteSession(callback, dialect, schema, _batchCallback, { logger, cache }); + const db = new SqliteRemoteDatabase("async", dialect, session, schema); + db.$cache = cache; + if (db.$cache) { + db.$cache["invalidate"] = cache?.onMutate; + } + return db; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SqliteRemoteDatabase, + drizzle +}); +//# sourceMappingURL=driver.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..51c822e65e51e4d6c9a7759c091a1cbd2d989776 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/driver.ts"],"sourcesContent":["import type { BatchItem, BatchResponse } from '~/batch.ts';\nimport { entityKind } from '~/entity.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { createTableRelationsHelpers, extractTablesRelationalConfig } from '~/relations.ts';\nimport type { ExtractTablesWithRelations, RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { BaseSQLiteDatabase } from '~/sqlite-core/db.ts';\nimport { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport { SQLiteRemoteSession } from './session.ts';\n\nexport interface SqliteRemoteResult {\n\trows?: T[];\n}\n\nexport class SqliteRemoteDatabase<\n\tTSchema extends Record = Record,\n> extends BaseSQLiteDatabase<'async', SqliteRemoteResult, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SqliteRemoteDatabase';\n\n\t/** @internal */\n\tdeclare readonly session: SQLiteRemoteSession>;\n\n\tasync batch, T extends Readonly<[U, ...U[]]>>(\n\t\tbatch: T,\n\t): Promise> {\n\t\treturn this.session.batch(batch) as Promise>;\n\t}\n}\n\nexport type AsyncRemoteCallback = (\n\tsql: string,\n\tparams: any[],\n\tmethod: 'run' | 'all' | 'values' | 'get',\n) => Promise<{ rows: any[] }>;\n\nexport type AsyncBatchRemoteCallback = (batch: {\n\tsql: string;\n\tparams: any[];\n\tmethod: 'run' | 'all' | 'values' | 'get';\n}[]) => Promise<{ rows: any[] }[]>;\n\nexport type RemoteCallback = AsyncRemoteCallback;\n\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase;\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tbatchCallback?: AsyncBatchRemoteCallback,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase;\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tbatchCallback?: AsyncBatchRemoteCallback | DrizzleConfig,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase {\n\tconst dialect = new SQLiteAsyncDialect({ casing: config?.casing });\n\tlet logger;\n\tlet cache;\n\tlet _batchCallback: AsyncBatchRemoteCallback | undefined;\n\tlet _config: DrizzleConfig = {};\n\n\tif (batchCallback) {\n\t\tif (typeof batchCallback === 'function') {\n\t\t\t_batchCallback = batchCallback as AsyncBatchRemoteCallback;\n\t\t\t_config = config ?? {};\n\t\t} else {\n\t\t\t_batchCallback = undefined;\n\t\t\t_config = batchCallback as DrizzleConfig;\n\t\t}\n\n\t\tif (_config.logger === true) {\n\t\t\tlogger = new DefaultLogger();\n\t\t} else if (_config.logger !== false) {\n\t\t\tlogger = _config.logger;\n\t\t\tcache = _config.cache;\n\t\t}\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (_config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\t_config.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: _config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst session = new SQLiteRemoteSession(callback, dialect, schema, _batchCallback, { logger, cache });\n\tconst db = new SqliteRemoteDatabase('async', dialect, session, schema) as SqliteRemoteDatabase;\n\t( db).$cache = cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = cache?.onMutate;\n\t}\n\treturn db;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,oBAA8B;AAC9B,uBAA2E;AAE3E,gBAAmC;AACnC,qBAAmC;AAEnC,qBAAoC;AAM7B,MAAM,6BAEH,6BAAyD;AAAA,EAClE,QAA0B,wBAAU,IAAY;AAAA,EAKhD,MAAM,MACL,OAC4B;AAC5B,WAAO,KAAK,QAAQ,MAAM,KAAK;AAAA,EAChC;AACD;AAyBO,SAAS,QACf,UACA,eACA,QACgC;AAChC,QAAM,UAAU,IAAI,kCAAmB,EAAE,QAAQ,QAAQ,OAAO,CAAC;AACjE,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,UAAkC,CAAC;AAEvC,MAAI,eAAe;AAClB,QAAI,OAAO,kBAAkB,YAAY;AACxC,uBAAiB;AACjB,gBAAU,UAAU,CAAC;AAAA,IACtB,OAAO;AACN,uBAAiB;AACjB,gBAAU;AAAA,IACX;AAEA,QAAI,QAAQ,WAAW,MAAM;AAC5B,eAAS,IAAI,4BAAc;AAAA,IAC5B,WAAW,QAAQ,WAAW,OAAO;AACpC,eAAS,QAAQ;AACjB,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD;AAEA,MAAI;AACJ,MAAI,QAAQ,QAAQ;AACnB,UAAM,mBAAe;AAAA,MACpB,QAAQ;AAAA,MACR;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,QAAQ;AAAA,MACpB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,UAAU,IAAI,mCAAoB,UAAU,SAAS,QAAQ,gBAAgB,EAAE,QAAQ,MAAM,CAAC;AACpG,QAAM,KAAK,IAAI,qBAAqB,SAAS,SAAS,SAAS,MAAM;AACrE,EAAO,GAAI,SAAS;AACpB,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO;AAAA,EAC1C;AACA,SAAO;AACR;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..6937f3af0c0cefbfe4191b6ed41278c872cc4744 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.cts @@ -0,0 +1,24 @@ +import type { BatchItem, BatchResponse } from "../batch.cjs"; +import { entityKind } from "../entity.cjs"; +import { BaseSQLiteDatabase } from "../sqlite-core/db.cjs"; +import type { DrizzleConfig } from "../utils.cjs"; +export interface SqliteRemoteResult { + rows?: T[]; +} +export declare class SqliteRemoteDatabase = Record> extends BaseSQLiteDatabase<'async', SqliteRemoteResult, TSchema> { + static readonly [entityKind]: string; + batch, T extends Readonly<[U, ...U[]]>>(batch: T): Promise>; +} +export type AsyncRemoteCallback = (sql: string, params: any[], method: 'run' | 'all' | 'values' | 'get') => Promise<{ + rows: any[]; +}>; +export type AsyncBatchRemoteCallback = (batch: { + sql: string; + params: any[]; + method: 'run' | 'all' | 'values' | 'get'; +}[]) => Promise<{ + rows: any[]; +}[]>; +export type RemoteCallback = AsyncRemoteCallback; +export declare function drizzle = Record>(callback: RemoteCallback, config?: DrizzleConfig): SqliteRemoteDatabase; +export declare function drizzle = Record>(callback: RemoteCallback, batchCallback?: AsyncBatchRemoteCallback, config?: DrizzleConfig): SqliteRemoteDatabase; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8bbff2626e73ac4e7e8c90d4fbacef894b5f2ed --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.d.ts @@ -0,0 +1,24 @@ +import type { BatchItem, BatchResponse } from "../batch.js"; +import { entityKind } from "../entity.js"; +import { BaseSQLiteDatabase } from "../sqlite-core/db.js"; +import type { DrizzleConfig } from "../utils.js"; +export interface SqliteRemoteResult { + rows?: T[]; +} +export declare class SqliteRemoteDatabase = Record> extends BaseSQLiteDatabase<'async', SqliteRemoteResult, TSchema> { + static readonly [entityKind]: string; + batch, T extends Readonly<[U, ...U[]]>>(batch: T): Promise>; +} +export type AsyncRemoteCallback = (sql: string, params: any[], method: 'run' | 'all' | 'values' | 'get') => Promise<{ + rows: any[]; +}>; +export type AsyncBatchRemoteCallback = (batch: { + sql: string; + params: any[]; + method: 'run' | 'all' | 'values' | 'get'; +}[]) => Promise<{ + rows: any[]; +}[]>; +export type RemoteCallback = AsyncRemoteCallback; +export declare function drizzle = Record>(callback: RemoteCallback, config?: DrizzleConfig): SqliteRemoteDatabase; +export declare function drizzle = Record>(callback: RemoteCallback, batchCallback?: AsyncBatchRemoteCallback, config?: DrizzleConfig): SqliteRemoteDatabase; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js new file mode 100644 index 0000000000000000000000000000000000000000..d9126bb9b5102f1f698027f21a4d659e3d0e05d7 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js @@ -0,0 +1,58 @@ +import { entityKind } from "../entity.js"; +import { DefaultLogger } from "../logger.js"; +import { createTableRelationsHelpers, extractTablesRelationalConfig } from "../relations.js"; +import { BaseSQLiteDatabase } from "../sqlite-core/db.js"; +import { SQLiteAsyncDialect } from "../sqlite-core/dialect.js"; +import { SQLiteRemoteSession } from "./session.js"; +class SqliteRemoteDatabase extends BaseSQLiteDatabase { + static [entityKind] = "SqliteRemoteDatabase"; + async batch(batch) { + return this.session.batch(batch); + } +} +function drizzle(callback, batchCallback, config) { + const dialect = new SQLiteAsyncDialect({ casing: config?.casing }); + let logger; + let cache; + let _batchCallback; + let _config = {}; + if (batchCallback) { + if (typeof batchCallback === "function") { + _batchCallback = batchCallback; + _config = config ?? {}; + } else { + _batchCallback = void 0; + _config = batchCallback; + } + if (_config.logger === true) { + logger = new DefaultLogger(); + } else if (_config.logger !== false) { + logger = _config.logger; + cache = _config.cache; + } + } + let schema; + if (_config.schema) { + const tablesConfig = extractTablesRelationalConfig( + _config.schema, + createTableRelationsHelpers + ); + schema = { + fullSchema: _config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const session = new SQLiteRemoteSession(callback, dialect, schema, _batchCallback, { logger, cache }); + const db = new SqliteRemoteDatabase("async", dialect, session, schema); + db.$cache = cache; + if (db.$cache) { + db.$cache["invalidate"] = cache?.onMutate; + } + return db; +} +export { + SqliteRemoteDatabase, + drizzle +}; +//# sourceMappingURL=driver.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js.map new file mode 100644 index 0000000000000000000000000000000000000000..23381d0278ebc68f242e0eb6f5a5c2661a207b57 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/driver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/driver.ts"],"sourcesContent":["import type { BatchItem, BatchResponse } from '~/batch.ts';\nimport { entityKind } from '~/entity.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { createTableRelationsHelpers, extractTablesRelationalConfig } from '~/relations.ts';\nimport type { ExtractTablesWithRelations, RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { BaseSQLiteDatabase } from '~/sqlite-core/db.ts';\nimport { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport { SQLiteRemoteSession } from './session.ts';\n\nexport interface SqliteRemoteResult {\n\trows?: T[];\n}\n\nexport class SqliteRemoteDatabase<\n\tTSchema extends Record = Record,\n> extends BaseSQLiteDatabase<'async', SqliteRemoteResult, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SqliteRemoteDatabase';\n\n\t/** @internal */\n\tdeclare readonly session: SQLiteRemoteSession>;\n\n\tasync batch, T extends Readonly<[U, ...U[]]>>(\n\t\tbatch: T,\n\t): Promise> {\n\t\treturn this.session.batch(batch) as Promise>;\n\t}\n}\n\nexport type AsyncRemoteCallback = (\n\tsql: string,\n\tparams: any[],\n\tmethod: 'run' | 'all' | 'values' | 'get',\n) => Promise<{ rows: any[] }>;\n\nexport type AsyncBatchRemoteCallback = (batch: {\n\tsql: string;\n\tparams: any[];\n\tmethod: 'run' | 'all' | 'values' | 'get';\n}[]) => Promise<{ rows: any[] }[]>;\n\nexport type RemoteCallback = AsyncRemoteCallback;\n\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase;\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tbatchCallback?: AsyncBatchRemoteCallback,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase;\nexport function drizzle = Record>(\n\tcallback: RemoteCallback,\n\tbatchCallback?: AsyncBatchRemoteCallback | DrizzleConfig,\n\tconfig?: DrizzleConfig,\n): SqliteRemoteDatabase {\n\tconst dialect = new SQLiteAsyncDialect({ casing: config?.casing });\n\tlet logger;\n\tlet cache;\n\tlet _batchCallback: AsyncBatchRemoteCallback | undefined;\n\tlet _config: DrizzleConfig = {};\n\n\tif (batchCallback) {\n\t\tif (typeof batchCallback === 'function') {\n\t\t\t_batchCallback = batchCallback as AsyncBatchRemoteCallback;\n\t\t\t_config = config ?? {};\n\t\t} else {\n\t\t\t_batchCallback = undefined;\n\t\t\t_config = batchCallback as DrizzleConfig;\n\t\t}\n\n\t\tif (_config.logger === true) {\n\t\t\tlogger = new DefaultLogger();\n\t\t} else if (_config.logger !== false) {\n\t\t\tlogger = _config.logger;\n\t\t\tcache = _config.cache;\n\t\t}\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (_config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\t_config.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: _config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst session = new SQLiteRemoteSession(callback, dialect, schema, _batchCallback, { logger, cache });\n\tconst db = new SqliteRemoteDatabase('async', dialect, session, schema) as SqliteRemoteDatabase;\n\t( db).$cache = cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = cache?.onMutate;\n\t}\n\treturn db;\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B,qCAAqC;AAE3E,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAEnC,SAAS,2BAA2B;AAM7B,MAAM,6BAEH,mBAAyD;AAAA,EAClE,QAA0B,UAAU,IAAY;AAAA,EAKhD,MAAM,MACL,OAC4B;AAC5B,WAAO,KAAK,QAAQ,MAAM,KAAK;AAAA,EAChC;AACD;AAyBO,SAAS,QACf,UACA,eACA,QACgC;AAChC,QAAM,UAAU,IAAI,mBAAmB,EAAE,QAAQ,QAAQ,OAAO,CAAC;AACjE,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,UAAkC,CAAC;AAEvC,MAAI,eAAe;AAClB,QAAI,OAAO,kBAAkB,YAAY;AACxC,uBAAiB;AACjB,gBAAU,UAAU,CAAC;AAAA,IACtB,OAAO;AACN,uBAAiB;AACjB,gBAAU;AAAA,IACX;AAEA,QAAI,QAAQ,WAAW,MAAM;AAC5B,eAAS,IAAI,cAAc;AAAA,IAC5B,WAAW,QAAQ,WAAW,OAAO;AACpC,eAAS,QAAQ;AACjB,cAAQ,QAAQ;AAAA,IACjB;AAAA,EACD;AAEA,MAAI;AACJ,MAAI,QAAQ,QAAQ;AACnB,UAAM,eAAe;AAAA,MACpB,QAAQ;AAAA,MACR;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,QAAQ;AAAA,MACpB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,UAAU,IAAI,oBAAoB,UAAU,SAAS,QAAQ,gBAAgB,EAAE,QAAQ,MAAM,CAAC;AACpG,QAAM,KAAK,IAAI,qBAAqB,SAAS,SAAS,SAAS,MAAM;AACrE,EAAO,GAAI,SAAS;AACpB,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO;AAAA,EAC1C;AACA,SAAO;AACR;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..e7a1eb39478cffe3101527cc622d2fe3ab61ea0a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var sqlite_proxy_exports = {}; +module.exports = __toCommonJS(sqlite_proxy_exports); +__reExport(sqlite_proxy_exports, require("./driver.cjs"), module.exports); +__reExport(sqlite_proxy_exports, require("./session.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./driver.cjs"), + ...require("./session.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..78bd5613e1aee61847399806965c11660d77e3a0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iCAAc,wBAAd;AACA,iCAAc,yBADd;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..b7d749dade04d95ea95fff584a889f4704f5d86f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.cts @@ -0,0 +1,2 @@ +export * from "./driver.cjs"; +export * from "./session.cjs"; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b74eaceb03f40303e798cdb14943536693db242b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.d.ts @@ -0,0 +1,2 @@ +export * from "./driver.js"; +export * from "./session.js"; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6a77b476c19f87ef52c4b4bd27bb1eff3c095323 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js @@ -0,0 +1,3 @@ +export * from "./driver.js"; +export * from "./session.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..4bea1613d0efbd8630831b4b3bf2ccf4fb43d10a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0eb5f4021d65693db00cc33d8dfd114cfb3b8053 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs @@ -0,0 +1,56 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var migrator_exports = {}; +__export(migrator_exports, { + migrate: () => migrate +}); +module.exports = __toCommonJS(migrator_exports); +var import_migrator = require("../migrator.cjs"); +var import_sql = require("../sql/sql.cjs"); +async function migrate(db, callback, config) { + const migrations = (0, import_migrator.readMigrationFiles)(config); + const migrationsTable = typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations"; + const migrationTableCreate = import_sql.sql` + CREATE TABLE IF NOT EXISTS ${import_sql.sql.identifier(migrationsTable)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at numeric + ) + `; + await db.run(migrationTableCreate); + const dbMigrations = await db.values( + import_sql.sql`SELECT id, hash, created_at FROM ${import_sql.sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1` + ); + const lastDbMigration = dbMigrations[0] ?? void 0; + const queriesToRun = []; + for (const migration of migrations) { + if (!lastDbMigration || Number(lastDbMigration[2]) < migration.folderMillis) { + queriesToRun.push( + ...migration.sql, + `INSERT INTO \`${migrationsTable}\` ("hash", "created_at") VALUES('${migration.hash}', '${migration.folderMillis}')` + ); + } + } + await callback(queriesToRun); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + migrate +}); +//# sourceMappingURL=migrator.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..865ad2c7727f56bca1ae5df9175e08395a59e04b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SqliteRemoteDatabase } from './driver.ts';\n\nexport type ProxyMigrator = (migrationQueries: string[]) => Promise;\n\nexport async function migrate>(\n\tdb: SqliteRemoteDatabase,\n\tcallback: ProxyMigrator,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\n\tconst migrationsTable = typeof config === 'string'\n\t\t? '__drizzle_migrations'\n\t\t: config.migrationsTable ?? '__drizzle_migrations';\n\n\tconst migrationTableCreate = sql`\n\t\tCREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} (\n\t\t\tid SERIAL PRIMARY KEY,\n\t\t\thash text NOT NULL,\n\t\t\tcreated_at numeric\n\t\t)\n\t`;\n\n\tawait db.run(migrationTableCreate);\n\n\tconst dbMigrations = await db.values<[number, string, string]>(\n\t\tsql`SELECT id, hash, created_at FROM ${sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1`,\n\t);\n\n\tconst lastDbMigration = dbMigrations[0] ?? undefined;\n\n\tconst queriesToRun: string[] = [];\n\tfor (const migration of migrations) {\n\t\tif (\n\t\t\t!lastDbMigration\n\t\t\t|| Number(lastDbMigration[2])! < migration.folderMillis\n\t\t) {\n\t\t\tqueriesToRun.push(\n\t\t\t\t...migration.sql,\n\t\t\t\t`INSERT INTO \\`${migrationsTable}\\` (\"hash\", \"created_at\") VALUES('${migration.hash}', '${migration.folderMillis}')`,\n\t\t\t);\n\t\t}\n\t}\n\n\tawait callback(queriesToRun);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AACnC,iBAAoB;AAKpB,eAAsB,QACrB,IACA,UACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAE5C,QAAM,kBAAkB,OAAO,WAAW,WACvC,yBACA,OAAO,mBAAmB;AAE7B,QAAM,uBAAuB;AAAA,+BACC,eAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7D,QAAM,GAAG,IAAI,oBAAoB;AAEjC,QAAM,eAAe,MAAM,GAAG;AAAA,IAC7B,kDAAuC,eAAI,WAAW,eAAe,CAAC;AAAA,EACvE;AAEA,QAAM,kBAAkB,aAAa,CAAC,KAAK;AAE3C,QAAM,eAAyB,CAAC;AAChC,aAAW,aAAa,YAAY;AACnC,QACC,CAAC,mBACE,OAAO,gBAAgB,CAAC,CAAC,IAAK,UAAU,cAC1C;AACD,mBAAa;AAAA,QACZ,GAAG,UAAU;AAAA,QACb,iBAAiB,eAAe,qCAAqC,UAAU,IAAI,OAAO,UAAU,YAAY;AAAA,MACjH;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAAS,YAAY;AAC5B;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..23774c8ea49f00fbe89d7ad5245ed16f989c08e8 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.cts @@ -0,0 +1,4 @@ +import type { MigrationConfig } from "../migrator.cjs"; +import type { SqliteRemoteDatabase } from "./driver.cjs"; +export type ProxyMigrator = (migrationQueries: string[]) => Promise; +export declare function migrate>(db: SqliteRemoteDatabase, callback: ProxyMigrator, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b4e532c84c55dc702f2093837f02aaa4265ed1c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.d.ts @@ -0,0 +1,4 @@ +import type { MigrationConfig } from "../migrator.js"; +import type { SqliteRemoteDatabase } from "./driver.js"; +export type ProxyMigrator = (migrationQueries: string[]) => Promise; +export declare function migrate>(db: SqliteRemoteDatabase, callback: ProxyMigrator, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js new file mode 100644 index 0000000000000000000000000000000000000000..e28ebfa021bebbf024cf973eb00a05eaeb4a81fe --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js @@ -0,0 +1,32 @@ +import { readMigrationFiles } from "../migrator.js"; +import { sql } from "../sql/sql.js"; +async function migrate(db, callback, config) { + const migrations = readMigrationFiles(config); + const migrationsTable = typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations"; + const migrationTableCreate = sql` + CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at numeric + ) + `; + await db.run(migrationTableCreate); + const dbMigrations = await db.values( + sql`SELECT id, hash, created_at FROM ${sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1` + ); + const lastDbMigration = dbMigrations[0] ?? void 0; + const queriesToRun = []; + for (const migration of migrations) { + if (!lastDbMigration || Number(lastDbMigration[2]) < migration.folderMillis) { + queriesToRun.push( + ...migration.sql, + `INSERT INTO \`${migrationsTable}\` ("hash", "created_at") VALUES('${migration.hash}', '${migration.folderMillis}')` + ); + } + } + await callback(queriesToRun); +} +export { + migrate +}; +//# sourceMappingURL=migrator.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js.map new file mode 100644 index 0000000000000000000000000000000000000000..75408de9176cd7ff01ea307125a15038d5c94cbe --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/migrator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SqliteRemoteDatabase } from './driver.ts';\n\nexport type ProxyMigrator = (migrationQueries: string[]) => Promise;\n\nexport async function migrate>(\n\tdb: SqliteRemoteDatabase,\n\tcallback: ProxyMigrator,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\n\tconst migrationsTable = typeof config === 'string'\n\t\t? '__drizzle_migrations'\n\t\t: config.migrationsTable ?? '__drizzle_migrations';\n\n\tconst migrationTableCreate = sql`\n\t\tCREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} (\n\t\t\tid SERIAL PRIMARY KEY,\n\t\t\thash text NOT NULL,\n\t\t\tcreated_at numeric\n\t\t)\n\t`;\n\n\tawait db.run(migrationTableCreate);\n\n\tconst dbMigrations = await db.values<[number, string, string]>(\n\t\tsql`SELECT id, hash, created_at FROM ${sql.identifier(migrationsTable)} ORDER BY created_at DESC LIMIT 1`,\n\t);\n\n\tconst lastDbMigration = dbMigrations[0] ?? undefined;\n\n\tconst queriesToRun: string[] = [];\n\tfor (const migration of migrations) {\n\t\tif (\n\t\t\t!lastDbMigration\n\t\t\t|| Number(lastDbMigration[2])! < migration.folderMillis\n\t\t) {\n\t\t\tqueriesToRun.push(\n\t\t\t\t...migration.sql,\n\t\t\t\t`INSERT INTO \\`${migrationsTable}\\` (\"hash\", \"created_at\") VALUES('${migration.hash}', '${migration.folderMillis}')`,\n\t\t\t);\n\t\t}\n\t}\n\n\tawait callback(queriesToRun);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AACnC,SAAS,WAAW;AAKpB,eAAsB,QACrB,IACA,UACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAE5C,QAAM,kBAAkB,OAAO,WAAW,WACvC,yBACA,OAAO,mBAAmB;AAE7B,QAAM,uBAAuB;AAAA,+BACC,IAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7D,QAAM,GAAG,IAAI,oBAAoB;AAEjC,QAAM,eAAe,MAAM,GAAG;AAAA,IAC7B,uCAAuC,IAAI,WAAW,eAAe,CAAC;AAAA,EACvE;AAEA,QAAM,kBAAkB,aAAa,CAAC,KAAK;AAE3C,QAAM,eAAyB,CAAC;AAChC,aAAW,aAAa,YAAY;AACnC,QACC,CAAC,mBACE,OAAO,gBAAgB,CAAC,CAAC,IAAK,UAAU,cAC1C;AACD,mBAAa;AAAA,QACZ,GAAG,UAAU;AAAA,QACb,iBAAiB,eAAe,qCAAqC,UAAU,IAAI,OAAO,UAAU,YAAY;AAAA,MACjH;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAAS,YAAY;AAC5B;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs new file mode 100644 index 0000000000000000000000000000000000000000..a77c19f509bc1376c9ab71c03e69bc1a8f83eb81 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs @@ -0,0 +1,207 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var session_exports = {}; +__export(session_exports, { + RemotePreparedQuery: () => RemotePreparedQuery, + SQLiteProxyTransaction: () => SQLiteProxyTransaction, + SQLiteRemoteSession: () => SQLiteRemoteSession +}); +module.exports = __toCommonJS(session_exports); +var import_core = require("../cache/core/index.cjs"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_sql = require("../sql/sql.cjs"); +var import_sqlite_core = require("../sqlite-core/index.cjs"); +var import_session = require("../sqlite-core/session.cjs"); +var import_utils = require("../utils.cjs"); +class SQLiteRemoteSession extends import_session.SQLiteSession { + constructor(client, dialect, schema, batchCLient, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.batchCLient = batchCLient; + this.logger = options.logger ?? new import_logger.NoopLogger(); + this.cache = options.cache ?? new import_core.NoopCache(); + } + static [import_entity.entityKind] = "SQLiteRemoteSession"; + logger; + cache; + prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new RemotePreparedQuery( + this.client, + query, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + executeMethod, + isResponseInArrayMode, + customResultMapper + ); + } + async batch(queries) { + const preparedQueries = []; + const builtQueries = []; + for (const query of queries) { + const preparedQuery = query._prepare(); + const builtQuery = preparedQuery.getQuery(); + preparedQueries.push(preparedQuery); + builtQueries.push({ sql: builtQuery.sql, params: builtQuery.params, method: builtQuery.method }); + } + const batchResults = await this.batchCLient(builtQueries); + return batchResults.map((result, i) => preparedQueries[i].mapResult(result, true)); + } + async transaction(transaction, config) { + const tx = new SQLiteProxyTransaction("async", this.dialect, this, this.schema); + await this.run(import_sql.sql.raw(`begin${config?.behavior ? " " + config.behavior : ""}`)); + try { + const result = await transaction(tx); + await this.run(import_sql.sql`commit`); + return result; + } catch (err) { + await this.run(import_sql.sql`rollback`); + throw err; + } + } + extractRawAllValueFromBatchResult(result) { + return result.rows; + } + extractRawGetValueFromBatchResult(result) { + return result.rows[0]; + } + extractRawValuesValueFromBatchResult(result) { + return result.rows; + } +} +class SQLiteProxyTransaction extends import_sqlite_core.SQLiteTransaction { + static [import_entity.entityKind] = "SQLiteProxyTransaction"; + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex}`; + const tx = new SQLiteProxyTransaction("async", this.dialect, this.session, this.schema, this.nestedIndex + 1); + await this.session.run(import_sql.sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await this.session.run(import_sql.sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await this.session.run(import_sql.sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +class RemotePreparedQuery extends import_session.SQLitePreparedQuery { + constructor(client, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) { + super("async", executeMethod, query, cache, queryMetadata, cacheConfig); + this.client = client; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + this.customResultMapper = customResultMapper; + this.method = executeMethod; + } + static [import_entity.entityKind] = "SQLiteProxyPreparedQuery"; + method; + getQuery() { + return { ...this.query, method: this.method }; + } + async run(placeholderValues) { + const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {}); + this.logger.logQuery(this.query.sql, params); + return await this.queryWithCache(this.query.sql, params, async () => { + return await this.client(this.query.sql, params, "run"); + }); + } + mapAllResult(rows, isFromBatch) { + if (isFromBatch) { + rows = rows.rows; + } + if (!this.fields && !this.customResultMapper) { + return rows; + } + if (this.customResultMapper) { + return this.customResultMapper(rows); + } + return rows.map((row) => { + return (0, import_utils.mapResultRow)( + this.fields, + row, + this.joinsNotNullableMap + ); + }); + } + async all(placeholderValues) { + const { query, logger, client } = this; + const params = (0, import_sql.fillPlaceholders)(query.params, placeholderValues ?? {}); + logger.logQuery(query.sql, params); + const { rows } = await this.queryWithCache(query.sql, params, async () => { + return await client(query.sql, params, "all"); + }); + return this.mapAllResult(rows); + } + async get(placeholderValues) { + const { query, logger, client } = this; + const params = (0, import_sql.fillPlaceholders)(query.params, placeholderValues ?? {}); + logger.logQuery(query.sql, params); + const clientResult = await this.queryWithCache(query.sql, params, async () => { + return await client(query.sql, params, "get"); + }); + return this.mapGetResult(clientResult.rows); + } + mapGetResult(rows, isFromBatch) { + if (isFromBatch) { + rows = rows.rows; + } + const row = rows; + if (!this.fields && !this.customResultMapper) { + return row; + } + if (!row) { + return void 0; + } + if (this.customResultMapper) { + return this.customResultMapper([rows]); + } + return (0, import_utils.mapResultRow)( + this.fields, + row, + this.joinsNotNullableMap + ); + } + async values(placeholderValues) { + const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {}); + this.logger.logQuery(this.query.sql, params); + const clientResult = await this.queryWithCache(this.query.sql, params, async () => { + return await this.client(this.query.sql, params, "values"); + }); + return clientResult.rows; + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + RemotePreparedQuery, + SQLiteProxyTransaction, + SQLiteRemoteSession +}); +//# sourceMappingURL=session.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..fda6c4e737f6348f2ee53375d88a8f44ab3b2760 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/session.ts"],"sourcesContent":["import type { BatchItem } from '~/batch.ts';\nimport { type Cache, NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport type { PreparedQuery } from '~/session.ts';\nimport { fillPlaceholders, type Query, sql } from '~/sql/sql.ts';\nimport type { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts';\nimport { SQLiteTransaction } from '~/sqlite-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSQLiteExecuteMethod,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/session.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts';\nimport { mapResultRow } from '~/utils.ts';\nimport type { AsyncBatchRemoteCallback, AsyncRemoteCallback, RemoteCallback, SqliteRemoteResult } from './driver.ts';\n\nexport interface SQLiteRemoteSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport type PreparedQueryConfig = Omit;\n\nexport class SQLiteRemoteSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends SQLiteSession<'async', SqliteRemoteResult, TFullSchema, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SQLiteRemoteSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: RemoteCallback,\n\t\tdialect: SQLiteAsyncDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate batchCLient?: AsyncBatchRemoteCallback,\n\t\toptions: SQLiteRemoteSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): RemotePreparedQuery {\n\t\treturn new RemotePreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\texecuteMethod,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync batch[] | readonly BatchItem<'sqlite'>[]>(queries: T) {\n\t\tconst preparedQueries: PreparedQuery[] = [];\n\t\tconst builtQueries: { sql: string; params: any[]; method: 'run' | 'all' | 'values' | 'get' }[] = [];\n\n\t\tfor (const query of queries) {\n\t\t\tconst preparedQuery = query._prepare();\n\t\t\tconst builtQuery = (preparedQuery as RemotePreparedQuery).getQuery();\n\t\t\tpreparedQueries.push(preparedQuery);\n\t\t\tbuiltQueries.push({ sql: builtQuery.sql, params: builtQuery.params, method: builtQuery.method });\n\t\t}\n\n\t\tconst batchResults = await (this.batchCLient as AsyncBatchRemoteCallback)(builtQueries);\n\t\treturn batchResults.map((result, i) => preparedQueries[i]!.mapResult(result, true));\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: SQLiteProxyTransaction) => Promise,\n\t\tconfig?: SQLiteTransactionConfig,\n\t): Promise {\n\t\tconst tx = new SQLiteProxyTransaction('async', this.dialect, this, this.schema);\n\t\tawait this.run(sql.raw(`begin${config?.behavior ? ' ' + config.behavior : ''}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait this.run(sql`commit`);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait this.run(sql`rollback`);\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\toverride extractRawAllValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows;\n\t}\n\n\toverride extractRawGetValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows![0];\n\t}\n\n\toverride extractRawValuesValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows;\n\t}\n}\n\nexport class SQLiteProxyTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends SQLiteTransaction<'async', SqliteRemoteResult, TFullSchema, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SQLiteProxyTransaction';\n\n\toverride async transaction(\n\t\ttransaction: (tx: SQLiteProxyTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex}`;\n\t\tconst tx = new SQLiteProxyTransaction('async', this.dialect, this.session, this.schema, this.nestedIndex + 1);\n\t\tawait this.session.run(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait this.session.run(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport class RemotePreparedQuery extends SQLitePreparedQuery<\n\t{ type: 'async'; run: SqliteRemoteResult; all: T['all']; get: T['get']; values: T['values']; execute: T['execute'] }\n> {\n\tstatic override readonly [entityKind]: string = 'SQLiteProxyPreparedQuery';\n\n\tprivate method: SQLiteExecuteMethod;\n\n\tconstructor(\n\t\tprivate client: RemoteCallback,\n\t\tquery: Query,\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\t/** @internal */ public customResultMapper?: (\n\t\t\trows: unknown[][],\n\t\t\tmapColumnValue?: (value: unknown) => unknown,\n\t\t) => unknown,\n\t) {\n\t\tsuper('async', executeMethod, query, cache, queryMetadata, cacheConfig);\n\t\tthis.customResultMapper = customResultMapper;\n\t\tthis.method = executeMethod;\n\t}\n\n\toverride getQuery(): Query & { method: SQLiteExecuteMethod } {\n\t\treturn { ...this.query, method: this.method };\n\t}\n\n\tasync run(placeholderValues?: Record): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn await this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn await (this.client as AsyncRemoteCallback)(this.query.sql, params, 'run');\n\t\t});\n\t}\n\n\toverride mapAllResult(rows: unknown, isFromBatch?: boolean): unknown {\n\t\tif (isFromBatch) {\n\t\t\trows = (rows as SqliteRemoteResult).rows;\n\t\t}\n\n\t\tif (!this.fields && !this.customResultMapper) {\n\t\t\treturn rows;\n\t\t}\n\n\t\tif (this.customResultMapper) {\n\t\t\treturn this.customResultMapper(rows as unknown[][]) as T['all'];\n\t\t}\n\n\t\treturn (rows as unknown[][]).map((row) => {\n\t\t\treturn mapResultRow(\n\t\t\t\tthis.fields!,\n\t\t\t\trow,\n\t\t\t\tthis.joinsNotNullableMap,\n\t\t\t);\n\t\t});\n\t}\n\n\tasync all(placeholderValues?: Record): Promise {\n\t\tconst { query, logger, client } = this;\n\n\t\tconst params = fillPlaceholders(query.params, placeholderValues ?? {});\n\t\tlogger.logQuery(query.sql, params);\n\n\t\tconst { rows } = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await (client as AsyncRemoteCallback)(query.sql, params, 'all');\n\t\t});\n\t\treturn this.mapAllResult(rows);\n\t}\n\n\tasync get(placeholderValues?: Record): Promise {\n\t\tconst { query, logger, client } = this;\n\n\t\tconst params = fillPlaceholders(query.params, placeholderValues ?? {});\n\t\tlogger.logQuery(query.sql, params);\n\n\t\tconst clientResult = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await (client as AsyncRemoteCallback)(query.sql, params, 'get');\n\t\t});\n\n\t\treturn this.mapGetResult(clientResult.rows);\n\t}\n\n\toverride mapGetResult(rows: unknown, isFromBatch?: boolean): unknown {\n\t\tif (isFromBatch) {\n\t\t\trows = (rows as SqliteRemoteResult).rows;\n\t\t}\n\n\t\tconst row = rows as unknown[];\n\n\t\tif (!this.fields && !this.customResultMapper) {\n\t\t\treturn row;\n\t\t}\n\n\t\tif (!row) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.customResultMapper) {\n\t\t\treturn this.customResultMapper([rows] as unknown[][]) as T['get'];\n\t\t}\n\n\t\treturn mapResultRow(\n\t\t\tthis.fields!,\n\t\t\trow,\n\t\t\tthis.joinsNotNullableMap,\n\t\t);\n\t}\n\n\tasync values(placeholderValues?: Record): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\tconst clientResult = await this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn await (this.client as AsyncRemoteCallback)(this.query.sql, params, 'values');\n\t\t});\n\t\treturn clientResult.rows as T[];\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode(): boolean {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.cts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..de531541277e622ba07bfba92b0c5fa1853d39b3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.cts @@ -0,0 +1,69 @@ +import type { BatchItem } from "../batch.cjs"; +import { type Cache } from "../cache/core/index.cjs"; +import type { WithCacheConfig } from "../cache/core/types.cjs"; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs"; +import { type Query } from "../sql/sql.cjs"; +import type { SQLiteAsyncDialect } from "../sqlite-core/dialect.cjs"; +import { SQLiteTransaction } from "../sqlite-core/index.cjs"; +import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.cjs"; +import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig } from "../sqlite-core/session.cjs"; +import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.cjs"; +import type { AsyncBatchRemoteCallback, RemoteCallback, SqliteRemoteResult } from "./driver.cjs"; +export interface SQLiteRemoteSessionOptions { + logger?: Logger; + cache?: Cache; +} +export type PreparedQueryConfig = Omit; +export declare class SQLiteRemoteSession, TSchema extends TablesRelationalConfig> extends SQLiteSession<'async', SqliteRemoteResult, TFullSchema, TSchema> { + private client; + private schema; + private batchCLient?; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: RemoteCallback, dialect: SQLiteAsyncDialect, schema: RelationalSchemaConfig | undefined, batchCLient?: AsyncBatchRemoteCallback | undefined, options?: SQLiteRemoteSessionOptions); + prepareQuery>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): RemotePreparedQuery; + batch[] | readonly BatchItem<'sqlite'>[]>(queries: T): Promise; + transaction(transaction: (tx: SQLiteProxyTransaction) => Promise, config?: SQLiteTransactionConfig): Promise; + extractRawAllValueFromBatchResult(result: unknown): unknown; + extractRawGetValueFromBatchResult(result: unknown): unknown; + extractRawValuesValueFromBatchResult(result: unknown): unknown; +} +export declare class SQLiteProxyTransaction, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'async', SqliteRemoteResult, TFullSchema, TSchema> { + static readonly [entityKind]: string; + transaction(transaction: (tx: SQLiteProxyTransaction) => Promise): Promise; +} +export declare class RemotePreparedQuery extends SQLitePreparedQuery<{ + type: 'async'; + run: SqliteRemoteResult; + all: T['all']; + get: T['get']; + values: T['values']; + execute: T['execute']; +}> { + private client; + private logger; + private fields; + private _isResponseInArrayMode; + static readonly [entityKind]: string; + private method; + constructor(client: RemoteCallback, query: Query, logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, + /** @internal */ customResultMapper?: ((rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown) | undefined); + getQuery(): Query & { + method: SQLiteExecuteMethod; + }; + run(placeholderValues?: Record): Promise; + mapAllResult(rows: unknown, isFromBatch?: boolean): unknown; + all(placeholderValues?: Record): Promise; + get(placeholderValues?: Record): Promise; + mapGetResult(rows: unknown, isFromBatch?: boolean): unknown; + values(placeholderValues?: Record): Promise; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.ts b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9578e82411178ce82fa9d9965be1b9899ee786b2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.d.ts @@ -0,0 +1,69 @@ +import type { BatchItem } from "../batch.js"; +import { type Cache } from "../cache/core/index.js"; +import type { WithCacheConfig } from "../cache/core/types.js"; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js"; +import { type Query } from "../sql/sql.js"; +import type { SQLiteAsyncDialect } from "../sqlite-core/dialect.js"; +import { SQLiteTransaction } from "../sqlite-core/index.js"; +import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.js"; +import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig } from "../sqlite-core/session.js"; +import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.js"; +import type { AsyncBatchRemoteCallback, RemoteCallback, SqliteRemoteResult } from "./driver.js"; +export interface SQLiteRemoteSessionOptions { + logger?: Logger; + cache?: Cache; +} +export type PreparedQueryConfig = Omit; +export declare class SQLiteRemoteSession, TSchema extends TablesRelationalConfig> extends SQLiteSession<'async', SqliteRemoteResult, TFullSchema, TSchema> { + private client; + private schema; + private batchCLient?; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: RemoteCallback, dialect: SQLiteAsyncDialect, schema: RelationalSchemaConfig | undefined, batchCLient?: AsyncBatchRemoteCallback | undefined, options?: SQLiteRemoteSessionOptions); + prepareQuery>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): RemotePreparedQuery; + batch[] | readonly BatchItem<'sqlite'>[]>(queries: T): Promise; + transaction(transaction: (tx: SQLiteProxyTransaction) => Promise, config?: SQLiteTransactionConfig): Promise; + extractRawAllValueFromBatchResult(result: unknown): unknown; + extractRawGetValueFromBatchResult(result: unknown): unknown; + extractRawValuesValueFromBatchResult(result: unknown): unknown; +} +export declare class SQLiteProxyTransaction, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'async', SqliteRemoteResult, TFullSchema, TSchema> { + static readonly [entityKind]: string; + transaction(transaction: (tx: SQLiteProxyTransaction) => Promise): Promise; +} +export declare class RemotePreparedQuery extends SQLitePreparedQuery<{ + type: 'async'; + run: SqliteRemoteResult; + all: T['all']; + get: T['get']; + values: T['values']; + execute: T['execute']; +}> { + private client; + private logger; + private fields; + private _isResponseInArrayMode; + static readonly [entityKind]: string; + private method; + constructor(client: RemoteCallback, query: Query, logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, + /** @internal */ customResultMapper?: ((rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown) | undefined); + getQuery(): Query & { + method: SQLiteExecuteMethod; + }; + run(placeholderValues?: Record): Promise; + mapAllResult(rows: unknown, isFromBatch?: boolean): unknown; + all(placeholderValues?: Record): Promise; + get(placeholderValues?: Record): Promise; + mapGetResult(rows: unknown, isFromBatch?: boolean): unknown; + values(placeholderValues?: Record): Promise; +} diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js new file mode 100644 index 0000000000000000000000000000000000000000..177665ac3e4c49c1d260fe24640c15baec3b345e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js @@ -0,0 +1,181 @@ +import { NoopCache } from "../cache/core/index.js"; +import { entityKind } from "../entity.js"; +import { NoopLogger } from "../logger.js"; +import { fillPlaceholders, sql } from "../sql/sql.js"; +import { SQLiteTransaction } from "../sqlite-core/index.js"; +import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.js"; +import { mapResultRow } from "../utils.js"; +class SQLiteRemoteSession extends SQLiteSession { + constructor(client, dialect, schema, batchCLient, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.batchCLient = batchCLient; + this.logger = options.logger ?? new NoopLogger(); + this.cache = options.cache ?? new NoopCache(); + } + static [entityKind] = "SQLiteRemoteSession"; + logger; + cache; + prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new RemotePreparedQuery( + this.client, + query, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + executeMethod, + isResponseInArrayMode, + customResultMapper + ); + } + async batch(queries) { + const preparedQueries = []; + const builtQueries = []; + for (const query of queries) { + const preparedQuery = query._prepare(); + const builtQuery = preparedQuery.getQuery(); + preparedQueries.push(preparedQuery); + builtQueries.push({ sql: builtQuery.sql, params: builtQuery.params, method: builtQuery.method }); + } + const batchResults = await this.batchCLient(builtQueries); + return batchResults.map((result, i) => preparedQueries[i].mapResult(result, true)); + } + async transaction(transaction, config) { + const tx = new SQLiteProxyTransaction("async", this.dialect, this, this.schema); + await this.run(sql.raw(`begin${config?.behavior ? " " + config.behavior : ""}`)); + try { + const result = await transaction(tx); + await this.run(sql`commit`); + return result; + } catch (err) { + await this.run(sql`rollback`); + throw err; + } + } + extractRawAllValueFromBatchResult(result) { + return result.rows; + } + extractRawGetValueFromBatchResult(result) { + return result.rows[0]; + } + extractRawValuesValueFromBatchResult(result) { + return result.rows; + } +} +class SQLiteProxyTransaction extends SQLiteTransaction { + static [entityKind] = "SQLiteProxyTransaction"; + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex}`; + const tx = new SQLiteProxyTransaction("async", this.dialect, this.session, this.schema, this.nestedIndex + 1); + await this.session.run(sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await this.session.run(sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await this.session.run(sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +class RemotePreparedQuery extends SQLitePreparedQuery { + constructor(client, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) { + super("async", executeMethod, query, cache, queryMetadata, cacheConfig); + this.client = client; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + this.customResultMapper = customResultMapper; + this.method = executeMethod; + } + static [entityKind] = "SQLiteProxyPreparedQuery"; + method; + getQuery() { + return { ...this.query, method: this.method }; + } + async run(placeholderValues) { + const params = fillPlaceholders(this.query.params, placeholderValues ?? {}); + this.logger.logQuery(this.query.sql, params); + return await this.queryWithCache(this.query.sql, params, async () => { + return await this.client(this.query.sql, params, "run"); + }); + } + mapAllResult(rows, isFromBatch) { + if (isFromBatch) { + rows = rows.rows; + } + if (!this.fields && !this.customResultMapper) { + return rows; + } + if (this.customResultMapper) { + return this.customResultMapper(rows); + } + return rows.map((row) => { + return mapResultRow( + this.fields, + row, + this.joinsNotNullableMap + ); + }); + } + async all(placeholderValues) { + const { query, logger, client } = this; + const params = fillPlaceholders(query.params, placeholderValues ?? {}); + logger.logQuery(query.sql, params); + const { rows } = await this.queryWithCache(query.sql, params, async () => { + return await client(query.sql, params, "all"); + }); + return this.mapAllResult(rows); + } + async get(placeholderValues) { + const { query, logger, client } = this; + const params = fillPlaceholders(query.params, placeholderValues ?? {}); + logger.logQuery(query.sql, params); + const clientResult = await this.queryWithCache(query.sql, params, async () => { + return await client(query.sql, params, "get"); + }); + return this.mapGetResult(clientResult.rows); + } + mapGetResult(rows, isFromBatch) { + if (isFromBatch) { + rows = rows.rows; + } + const row = rows; + if (!this.fields && !this.customResultMapper) { + return row; + } + if (!row) { + return void 0; + } + if (this.customResultMapper) { + return this.customResultMapper([rows]); + } + return mapResultRow( + this.fields, + row, + this.joinsNotNullableMap + ); + } + async values(placeholderValues) { + const params = fillPlaceholders(this.query.params, placeholderValues ?? {}); + this.logger.logQuery(this.query.sql, params); + const clientResult = await this.queryWithCache(this.query.sql, params, async () => { + return await this.client(this.query.sql, params, "values"); + }); + return clientResult.rows; + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +export { + RemotePreparedQuery, + SQLiteProxyTransaction, + SQLiteRemoteSession +}; +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js.map b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js.map new file mode 100644 index 0000000000000000000000000000000000000000..dd00987c5cb0bbb8b5a0e6eda83b76630e7e2e40 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/sqlite-proxy/session.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/sqlite-proxy/session.ts"],"sourcesContent":["import type { BatchItem } from '~/batch.ts';\nimport { type Cache, NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport type { PreparedQuery } from '~/session.ts';\nimport { fillPlaceholders, type Query, sql } from '~/sql/sql.ts';\nimport type { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts';\nimport { SQLiteTransaction } from '~/sqlite-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSQLiteExecuteMethod,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/session.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts';\nimport { mapResultRow } from '~/utils.ts';\nimport type { AsyncBatchRemoteCallback, AsyncRemoteCallback, RemoteCallback, SqliteRemoteResult } from './driver.ts';\n\nexport interface SQLiteRemoteSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport type PreparedQueryConfig = Omit;\n\nexport class SQLiteRemoteSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends SQLiteSession<'async', SqliteRemoteResult, TFullSchema, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SQLiteRemoteSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: RemoteCallback,\n\t\tdialect: SQLiteAsyncDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate batchCLient?: AsyncBatchRemoteCallback,\n\t\toptions: SQLiteRemoteSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => unknown,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): RemotePreparedQuery {\n\t\treturn new RemotePreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\texecuteMethod,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync batch[] | readonly BatchItem<'sqlite'>[]>(queries: T) {\n\t\tconst preparedQueries: PreparedQuery[] = [];\n\t\tconst builtQueries: { sql: string; params: any[]; method: 'run' | 'all' | 'values' | 'get' }[] = [];\n\n\t\tfor (const query of queries) {\n\t\t\tconst preparedQuery = query._prepare();\n\t\t\tconst builtQuery = (preparedQuery as RemotePreparedQuery).getQuery();\n\t\t\tpreparedQueries.push(preparedQuery);\n\t\t\tbuiltQueries.push({ sql: builtQuery.sql, params: builtQuery.params, method: builtQuery.method });\n\t\t}\n\n\t\tconst batchResults = await (this.batchCLient as AsyncBatchRemoteCallback)(builtQueries);\n\t\treturn batchResults.map((result, i) => preparedQueries[i]!.mapResult(result, true));\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: SQLiteProxyTransaction) => Promise,\n\t\tconfig?: SQLiteTransactionConfig,\n\t): Promise {\n\t\tconst tx = new SQLiteProxyTransaction('async', this.dialect, this, this.schema);\n\t\tawait this.run(sql.raw(`begin${config?.behavior ? ' ' + config.behavior : ''}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait this.run(sql`commit`);\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait this.run(sql`rollback`);\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\toverride extractRawAllValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows;\n\t}\n\n\toverride extractRawGetValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows![0];\n\t}\n\n\toverride extractRawValuesValueFromBatchResult(result: unknown): unknown {\n\t\treturn (result as SqliteRemoteResult).rows;\n\t}\n}\n\nexport class SQLiteProxyTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends SQLiteTransaction<'async', SqliteRemoteResult, TFullSchema, TSchema> {\n\tstatic override readonly [entityKind]: string = 'SQLiteProxyTransaction';\n\n\toverride async transaction(\n\t\ttransaction: (tx: SQLiteProxyTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex}`;\n\t\tconst tx = new SQLiteProxyTransaction('async', this.dialect, this.session, this.schema, this.nestedIndex + 1);\n\t\tawait this.session.run(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait this.session.run(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport class RemotePreparedQuery extends SQLitePreparedQuery<\n\t{ type: 'async'; run: SqliteRemoteResult; all: T['all']; get: T['get']; values: T['values']; execute: T['execute'] }\n> {\n\tstatic override readonly [entityKind]: string = 'SQLiteProxyPreparedQuery';\n\n\tprivate method: SQLiteExecuteMethod;\n\n\tconstructor(\n\t\tprivate client: RemoteCallback,\n\t\tquery: Query,\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\t/** @internal */ public customResultMapper?: (\n\t\t\trows: unknown[][],\n\t\t\tmapColumnValue?: (value: unknown) => unknown,\n\t\t) => unknown,\n\t) {\n\t\tsuper('async', executeMethod, query, cache, queryMetadata, cacheConfig);\n\t\tthis.customResultMapper = customResultMapper;\n\t\tthis.method = executeMethod;\n\t}\n\n\toverride getQuery(): Query & { method: SQLiteExecuteMethod } {\n\t\treturn { ...this.query, method: this.method };\n\t}\n\n\tasync run(placeholderValues?: Record): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn await this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn await (this.client as AsyncRemoteCallback)(this.query.sql, params, 'run');\n\t\t});\n\t}\n\n\toverride mapAllResult(rows: unknown, isFromBatch?: boolean): unknown {\n\t\tif (isFromBatch) {\n\t\t\trows = (rows as SqliteRemoteResult).rows;\n\t\t}\n\n\t\tif (!this.fields && !this.customResultMapper) {\n\t\t\treturn rows;\n\t\t}\n\n\t\tif (this.customResultMapper) {\n\t\t\treturn this.customResultMapper(rows as unknown[][]) as T['all'];\n\t\t}\n\n\t\treturn (rows as unknown[][]).map((row) => {\n\t\t\treturn mapResultRow(\n\t\t\t\tthis.fields!,\n\t\t\t\trow,\n\t\t\t\tthis.joinsNotNullableMap,\n\t\t\t);\n\t\t});\n\t}\n\n\tasync all(placeholderValues?: Record): Promise {\n\t\tconst { query, logger, client } = this;\n\n\t\tconst params = fillPlaceholders(query.params, placeholderValues ?? {});\n\t\tlogger.logQuery(query.sql, params);\n\n\t\tconst { rows } = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await (client as AsyncRemoteCallback)(query.sql, params, 'all');\n\t\t});\n\t\treturn this.mapAllResult(rows);\n\t}\n\n\tasync get(placeholderValues?: Record): Promise {\n\t\tconst { query, logger, client } = this;\n\n\t\tconst params = fillPlaceholders(query.params, placeholderValues ?? {});\n\t\tlogger.logQuery(query.sql, params);\n\n\t\tconst clientResult = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await (client as AsyncRemoteCallback)(query.sql, params, 'get');\n\t\t});\n\n\t\treturn this.mapGetResult(clientResult.rows);\n\t}\n\n\toverride mapGetResult(rows: unknown, isFromBatch?: boolean): unknown {\n\t\tif (isFromBatch) {\n\t\t\trows = (rows as SqliteRemoteResult).rows;\n\t\t}\n\n\t\tconst row = rows as unknown[];\n\n\t\tif (!this.fields && !this.customResultMapper) {\n\t\t\treturn row;\n\t\t}\n\n\t\tif (!row) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (this.customResultMapper) {\n\t\t\treturn this.customResultMapper([rows] as unknown[][]) as T['get'];\n\t\t}\n\n\t\treturn mapResultRow(\n\t\t\tthis.fields!,\n\t\t\trow,\n\t\t\tthis.joinsNotNullableMap,\n\t\t);\n\t}\n\n\tasync values(placeholderValues?: Record): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\tconst clientResult = await this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn await (this.client as AsyncRemoteCallback)(this.query.sql, params, 'values');\n\t\t});\n\t\treturn clientResult.rows as T[];\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode(): boolean {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/subquery.cjs b/e-commerce/node_modules/drizzle-orm/subquery.cjs new file mode 100644 index 0000000000000000000000000000000000000000..7913c04814262d98500c7d765984df7c76eb2a56 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.cjs @@ -0,0 +1,50 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var subquery_exports = {}; +__export(subquery_exports, { + Subquery: () => Subquery, + WithSubquery: () => WithSubquery +}); +module.exports = __toCommonJS(subquery_exports); +var import_entity = require("./entity.cjs"); +class Subquery { + static [import_entity.entityKind] = "Subquery"; + constructor(sql, fields, alias, isWith = false, usedTables = []) { + this._ = { + brand: "Subquery", + sql, + selectedFields: fields, + alias, + isWith, + usedTables + }; + } + // getSQL(): SQL { + // return new SQL([this]); + // } +} +class WithSubquery extends Subquery { + static [import_entity.entityKind] = "WithSubquery"; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Subquery, + WithSubquery +}); +//# sourceMappingURL=subquery.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/subquery.cjs.map b/e-commerce/node_modules/drizzle-orm/subquery.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..97510a77556d38f9ae04b4891e1d1bd39019ce9e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/subquery.ts"],"sourcesContent":["import { entityKind } from './entity.ts';\nimport type { SQL, SQLWrapper } from './sql/sql.ts';\n\nexport interface Subquery<\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTAlias extends string = string,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTSelectedFields extends Record = Record,\n> extends SQLWrapper {\n\t// SQLWrapper runtime implementation is defined in 'sql/sql.ts'\n}\nexport class Subquery<\n\tTAlias extends string = string,\n\tTSelectedFields extends Record = Record,\n> implements SQLWrapper {\n\tstatic readonly [entityKind]: string = 'Subquery';\n\n\tdeclare _: {\n\t\tbrand: 'Subquery';\n\t\tsql: SQL;\n\t\tselectedFields: TSelectedFields;\n\t\talias: TAlias;\n\t\tisWith: boolean;\n\t\tusedTables?: string[];\n\t};\n\n\tconstructor(sql: SQL, fields: TSelectedFields, alias: string, isWith = false, usedTables: string[] = []) {\n\t\tthis._ = {\n\t\t\tbrand: 'Subquery',\n\t\t\tsql,\n\t\t\tselectedFields: fields as TSelectedFields,\n\t\t\talias: alias as TAlias,\n\t\t\tisWith,\n\t\t\tusedTables,\n\t\t};\n\t}\n\n\t// getSQL(): SQL {\n\t// \treturn new SQL([this]);\n\t// }\n}\n\nexport class WithSubquery<\n\tTAlias extends string = string,\n\tTSelection extends Record = Record,\n> extends Subquery {\n\tstatic override readonly [entityKind]: string = 'WithSubquery';\n}\n\nexport type WithSubqueryWithoutSelection = WithSubquery;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAWpB,MAAM,SAGW;AAAA,EACvB,QAAiB,wBAAU,IAAY;AAAA,EAWvC,YAAY,KAAU,QAAyB,OAAe,SAAS,OAAO,aAAuB,CAAC,GAAG;AACxG,SAAK,IAAI;AAAA,MACR,OAAO;AAAA,MACP;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA;AAAA;AAAA;AAKD;AAEO,MAAM,qBAGH,SAA6B;AAAA,EACtC,QAA0B,wBAAU,IAAY;AACjD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/subquery.d.cts b/e-commerce/node_modules/drizzle-orm/subquery.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..4ea85a0981380b05d775b419508d56d71e51bd7c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.d.cts @@ -0,0 +1,20 @@ +import { entityKind } from "./entity.cjs"; +import type { SQL, SQLWrapper } from "./sql/sql.cjs"; +export interface Subquery = Record> extends SQLWrapper { +} +export declare class Subquery = Record> implements SQLWrapper { + static readonly [entityKind]: string; + _: { + brand: 'Subquery'; + sql: SQL; + selectedFields: TSelectedFields; + alias: TAlias; + isWith: boolean; + usedTables?: string[]; + }; + constructor(sql: SQL, fields: TSelectedFields, alias: string, isWith?: boolean, usedTables?: string[]); +} +export declare class WithSubquery = Record> extends Subquery { + static readonly [entityKind]: string; +} +export type WithSubqueryWithoutSelection = WithSubquery; diff --git a/e-commerce/node_modules/drizzle-orm/subquery.d.ts b/e-commerce/node_modules/drizzle-orm/subquery.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5e7ca8a7655fdf76b0bc1d450b8bdd23063bcd1 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.d.ts @@ -0,0 +1,20 @@ +import { entityKind } from "./entity.js"; +import type { SQL, SQLWrapper } from "./sql/sql.js"; +export interface Subquery = Record> extends SQLWrapper { +} +export declare class Subquery = Record> implements SQLWrapper { + static readonly [entityKind]: string; + _: { + brand: 'Subquery'; + sql: SQL; + selectedFields: TSelectedFields; + alias: TAlias; + isWith: boolean; + usedTables?: string[]; + }; + constructor(sql: SQL, fields: TSelectedFields, alias: string, isWith?: boolean, usedTables?: string[]); +} +export declare class WithSubquery = Record> extends Subquery { + static readonly [entityKind]: string; +} +export type WithSubqueryWithoutSelection = WithSubquery; diff --git a/e-commerce/node_modules/drizzle-orm/subquery.js b/e-commerce/node_modules/drizzle-orm/subquery.js new file mode 100644 index 0000000000000000000000000000000000000000..75d497082f0779629c87a1d677069c659f2e20bf --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.js @@ -0,0 +1,25 @@ +import { entityKind } from "./entity.js"; +class Subquery { + static [entityKind] = "Subquery"; + constructor(sql, fields, alias, isWith = false, usedTables = []) { + this._ = { + brand: "Subquery", + sql, + selectedFields: fields, + alias, + isWith, + usedTables + }; + } + // getSQL(): SQL { + // return new SQL([this]); + // } +} +class WithSubquery extends Subquery { + static [entityKind] = "WithSubquery"; +} +export { + Subquery, + WithSubquery +}; +//# sourceMappingURL=subquery.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/subquery.js.map b/e-commerce/node_modules/drizzle-orm/subquery.js.map new file mode 100644 index 0000000000000000000000000000000000000000..353198c6ce0d25d8fa784b94a5c4d5a29242aef4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/subquery.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/subquery.ts"],"sourcesContent":["import { entityKind } from './entity.ts';\nimport type { SQL, SQLWrapper } from './sql/sql.ts';\n\nexport interface Subquery<\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTAlias extends string = string,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tTSelectedFields extends Record = Record,\n> extends SQLWrapper {\n\t// SQLWrapper runtime implementation is defined in 'sql/sql.ts'\n}\nexport class Subquery<\n\tTAlias extends string = string,\n\tTSelectedFields extends Record = Record,\n> implements SQLWrapper {\n\tstatic readonly [entityKind]: string = 'Subquery';\n\n\tdeclare _: {\n\t\tbrand: 'Subquery';\n\t\tsql: SQL;\n\t\tselectedFields: TSelectedFields;\n\t\talias: TAlias;\n\t\tisWith: boolean;\n\t\tusedTables?: string[];\n\t};\n\n\tconstructor(sql: SQL, fields: TSelectedFields, alias: string, isWith = false, usedTables: string[] = []) {\n\t\tthis._ = {\n\t\t\tbrand: 'Subquery',\n\t\t\tsql,\n\t\t\tselectedFields: fields as TSelectedFields,\n\t\t\talias: alias as TAlias,\n\t\t\tisWith,\n\t\t\tusedTables,\n\t\t};\n\t}\n\n\t// getSQL(): SQL {\n\t// \treturn new SQL([this]);\n\t// }\n}\n\nexport class WithSubquery<\n\tTAlias extends string = string,\n\tTSelection extends Record = Record,\n> extends Subquery {\n\tstatic override readonly [entityKind]: string = 'WithSubquery';\n}\n\nexport type WithSubqueryWithoutSelection = WithSubquery;\n"],"mappings":"AAAA,SAAS,kBAAkB;AAWpB,MAAM,SAGW;AAAA,EACvB,QAAiB,UAAU,IAAY;AAAA,EAWvC,YAAY,KAAU,QAAyB,OAAe,SAAS,OAAO,aAAuB,CAAC,GAAG;AACxG,SAAK,IAAI;AAAA,MACR,OAAO;AAAA,MACP;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA;AAAA;AAAA;AAKD;AAEO,MAAM,qBAGH,SAA6B;AAAA,EACtC,QAA0B,UAAU,IAAY;AACjD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.cjs b/e-commerce/node_modules/drizzle-orm/supabase/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..7d65be4b151f1002d967f2b70b95c18b68106714 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.cjs @@ -0,0 +1,23 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var supabase_exports = {}; +module.exports = __toCommonJS(supabase_exports); +__reExport(supabase_exports, require("./rls.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./rls.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.cjs.map b/e-commerce/node_modules/drizzle-orm/supabase/index.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..babdb5f45f74d3e4236fa91d32fcc7e96d30ce06 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/supabase/index.ts"],"sourcesContent":["export * from './rls.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,qBAAd;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.d.cts b/e-commerce/node_modules/drizzle-orm/supabase/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..5fc685e94b7839e816dfd220e36fedd08a203682 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.d.cts @@ -0,0 +1 @@ +export * from "./rls.cjs"; diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.d.ts b/e-commerce/node_modules/drizzle-orm/supabase/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8d797b72656e6a4ac53f55286b2402bb2906b3c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.d.ts @@ -0,0 +1 @@ +export * from "./rls.js"; diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.js b/e-commerce/node_modules/drizzle-orm/supabase/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c2ca22ca2e9d5e6d0440bd32a2637827d2a4bb91 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.js @@ -0,0 +1,2 @@ +export * from "./rls.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/index.js.map b/e-commerce/node_modules/drizzle-orm/supabase/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..4714aee4bea8b8a74beccc652d595f81f94b3cd4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/supabase/index.ts"],"sourcesContent":["export * from './rls.ts';\n"],"mappings":"AAAA,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs b/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs new file mode 100644 index 0000000000000000000000000000000000000000..f2496a9e756e00f4b67193dd7e754ca7def794fb --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs @@ -0,0 +1,76 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var rls_exports = {}; +__export(rls_exports, { + anonRole: () => anonRole, + authUid: () => authUid, + authUsers: () => authUsers, + authenticatedRole: () => authenticatedRole, + postgresRole: () => postgresRole, + realtimeMessages: () => realtimeMessages, + realtimeTopic: () => realtimeTopic, + serviceRole: () => serviceRole, + supabaseAuthAdminRole: () => supabaseAuthAdminRole +}); +module.exports = __toCommonJS(rls_exports); +var import_pg_core = require("../pg-core/index.cjs"); +var import_roles = require("../pg-core/roles.cjs"); +var import_sql = require("../sql/sql.cjs"); +const anonRole = (0, import_roles.pgRole)("anon").existing(); +const authenticatedRole = (0, import_roles.pgRole)("authenticated").existing(); +const serviceRole = (0, import_roles.pgRole)("service_role").existing(); +const postgresRole = (0, import_roles.pgRole)("postgres_role").existing(); +const supabaseAuthAdminRole = (0, import_roles.pgRole)("supabase_auth_admin").existing(); +const auth = (0, import_pg_core.pgSchema)("auth"); +const authUsers = auth.table("users", { + id: (0, import_pg_core.uuid)().primaryKey().notNull(), + email: (0, import_pg_core.varchar)({ length: 255 }), + phone: (0, import_pg_core.text)().unique(), + emailConfirmedAt: (0, import_pg_core.timestamp)("email_confirmed_at", { withTimezone: true }), + phoneConfirmedAt: (0, import_pg_core.timestamp)("phone_confirmed_at", { withTimezone: true }), + lastSignInAt: (0, import_pg_core.timestamp)("last_sign_in_at", { withTimezone: true }), + createdAt: (0, import_pg_core.timestamp)("created_at", { withTimezone: true }), + updatedAt: (0, import_pg_core.timestamp)("updated_at", { withTimezone: true }) +}); +const realtime = (0, import_pg_core.pgSchema)("realtime"); +const realtimeMessages = realtime.table( + "messages", + { + id: (0, import_pg_core.bigserial)({ mode: "bigint" }).primaryKey(), + topic: (0, import_pg_core.text)().notNull(), + extension: (0, import_pg_core.text)({ + enum: ["presence", "broadcast", "postgres_changes"] + }).notNull() + } +); +const authUid = import_sql.sql`(select auth.uid())`; +const realtimeTopic = import_sql.sql`realtime.topic()`; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + anonRole, + authUid, + authUsers, + authenticatedRole, + postgresRole, + realtimeMessages, + realtimeTopic, + serviceRole, + supabaseAuthAdminRole +}); +//# sourceMappingURL=rls.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs.map b/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..96bd12923e64186e5c502459e9d2827da4ea6ecf --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/supabase/rls.ts"],"sourcesContent":["import { bigserial, pgSchema, text, timestamp, uuid, varchar } from '~/pg-core/index.ts';\nimport { pgRole } from '~/pg-core/roles.ts';\nimport { sql } from '~/sql/sql.ts';\n\nexport const anonRole = pgRole('anon').existing();\nexport const authenticatedRole = pgRole('authenticated').existing();\nexport const serviceRole = pgRole('service_role').existing();\nexport const postgresRole = pgRole('postgres_role').existing();\nexport const supabaseAuthAdminRole = pgRole('supabase_auth_admin').existing();\n\n/* ------------------------------ auth schema; ------------------------------ */\nconst auth = pgSchema('auth');\n\nexport const authUsers = auth.table('users', {\n\tid: uuid().primaryKey().notNull(),\n\temail: varchar({ length: 255 }),\n\tphone: text().unique(),\n\temailConfirmedAt: timestamp('email_confirmed_at', { withTimezone: true }),\n\tphoneConfirmedAt: timestamp('phone_confirmed_at', { withTimezone: true }),\n\tlastSignInAt: timestamp('last_sign_in_at', { withTimezone: true }),\n\tcreatedAt: timestamp('created_at', { withTimezone: true }),\n\tupdatedAt: timestamp('updated_at', { withTimezone: true }),\n});\n\n/* ------------------------------ realtime schema; ------------------------------- */\nconst realtime = pgSchema('realtime');\n\nexport const realtimeMessages = realtime.table(\n\t'messages',\n\t{\n\t\tid: bigserial({ mode: 'bigint' }).primaryKey(),\n\t\ttopic: text().notNull(),\n\t\textension: text({\n\t\t\tenum: ['presence', 'broadcast', 'postgres_changes'],\n\t\t}).notNull(),\n\t},\n);\n\nexport const authUid = sql`(select auth.uid())`;\nexport const realtimeTopic = sql`realtime.topic()`;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoE;AACpE,mBAAuB;AACvB,iBAAoB;AAEb,MAAM,eAAW,qBAAO,MAAM,EAAE,SAAS;AACzC,MAAM,wBAAoB,qBAAO,eAAe,EAAE,SAAS;AAC3D,MAAM,kBAAc,qBAAO,cAAc,EAAE,SAAS;AACpD,MAAM,mBAAe,qBAAO,eAAe,EAAE,SAAS;AACtD,MAAM,4BAAwB,qBAAO,qBAAqB,EAAE,SAAS;AAG5E,MAAM,WAAO,yBAAS,MAAM;AAErB,MAAM,YAAY,KAAK,MAAM,SAAS;AAAA,EAC5C,QAAI,qBAAK,EAAE,WAAW,EAAE,QAAQ;AAAA,EAChC,WAAO,wBAAQ,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC9B,WAAO,qBAAK,EAAE,OAAO;AAAA,EACrB,sBAAkB,0BAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,sBAAkB,0BAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,kBAAc,0BAAU,mBAAmB,EAAE,cAAc,KAAK,CAAC;AAAA,EACjE,eAAW,0BAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAAA,EACzD,eAAW,0BAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAC1D,CAAC;AAGD,MAAM,eAAW,yBAAS,UAAU;AAE7B,MAAM,mBAAmB,SAAS;AAAA,EACxC;AAAA,EACA;AAAA,IACC,QAAI,0BAAU,EAAE,MAAM,SAAS,CAAC,EAAE,WAAW;AAAA,IAC7C,WAAO,qBAAK,EAAE,QAAQ;AAAA,IACtB,eAAW,qBAAK;AAAA,MACf,MAAM,CAAC,YAAY,aAAa,kBAAkB;AAAA,IACnD,CAAC,EAAE,QAAQ;AAAA,EACZ;AACD;AAEO,MAAM,UAAU;AAChB,MAAM,gBAAgB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.d.cts b/e-commerce/node_modules/drizzle-orm/supabase/rls.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..11c247d73d85453f03ee613a583a94780f4db8e6 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.d.cts @@ -0,0 +1,210 @@ +export declare const anonRole: import("../pg-core/roles.ts").PgRole; +export declare const authenticatedRole: import("../pg-core/roles.ts").PgRole; +export declare const serviceRole: import("../pg-core/roles.ts").PgRole; +export declare const postgresRole: import("../pg-core/roles.ts").PgRole; +export declare const supabaseAuthAdminRole: import("../pg-core/roles.ts").PgRole; +export declare const authUsers: import("../pg-core/index.ts").PgTableWithColumns<{ + name: "users"; + schema: "auth"; + columns: { + id: import("../pg-core/index.ts").PgColumn<{ + name: "id"; + tableName: "users"; + dataType: "string"; + columnType: "PgUUID"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + email: import("../pg-core/index.ts").PgColumn<{ + name: "email"; + tableName: "users"; + dataType: "string"; + columnType: "PgVarchar"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, { + length: 255; + }>; + phone: import("../pg-core/index.ts").PgColumn<{ + name: "phone"; + tableName: "users"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + emailConfirmedAt: import("../pg-core/index.ts").PgColumn<{ + name: "email_confirmed_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + phoneConfirmedAt: import("../pg-core/index.ts").PgColumn<{ + name: "phone_confirmed_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + lastSignInAt: import("../pg-core/index.ts").PgColumn<{ + name: "last_sign_in_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + createdAt: import("../pg-core/index.ts").PgColumn<{ + name: "created_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + updatedAt: import("../pg-core/index.ts").PgColumn<{ + name: "updated_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +export declare const realtimeMessages: import("../pg-core/index.ts").PgTableWithColumns<{ + name: "messages"; + schema: "realtime"; + columns: { + id: import("../pg-core/index.ts").PgColumn<{ + name: "id"; + tableName: "messages"; + dataType: "bigint"; + columnType: "PgBigSerial64"; + data: bigint; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + topic: import("../pg-core/index.ts").PgColumn<{ + name: "topic"; + tableName: "messages"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + extension: import("../pg-core/index.ts").PgColumn<{ + name: "extension"; + tableName: "messages"; + dataType: "string"; + columnType: "PgText"; + data: "presence" | "broadcast" | "postgres_changes"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["presence", "broadcast", "postgres_changes"]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +export declare const authUid: import("../sql/sql.ts").SQL; +export declare const realtimeTopic: import("../sql/sql.ts").SQL; diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.d.ts b/e-commerce/node_modules/drizzle-orm/supabase/rls.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..700448c1b46d4d0609b9a864eaa180f497f5aaee --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.d.ts @@ -0,0 +1,210 @@ +export declare const anonRole: import("../pg-core/roles.js").PgRole; +export declare const authenticatedRole: import("../pg-core/roles.js").PgRole; +export declare const serviceRole: import("../pg-core/roles.js").PgRole; +export declare const postgresRole: import("../pg-core/roles.js").PgRole; +export declare const supabaseAuthAdminRole: import("../pg-core/roles.js").PgRole; +export declare const authUsers: import("../pg-core/index.js").PgTableWithColumns<{ + name: "users"; + schema: "auth"; + columns: { + id: import("../pg-core/index.js").PgColumn<{ + name: "id"; + tableName: "users"; + dataType: "string"; + columnType: "PgUUID"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + email: import("../pg-core/index.js").PgColumn<{ + name: "email"; + tableName: "users"; + dataType: "string"; + columnType: "PgVarchar"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, { + length: 255; + }>; + phone: import("../pg-core/index.js").PgColumn<{ + name: "phone"; + tableName: "users"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + emailConfirmedAt: import("../pg-core/index.js").PgColumn<{ + name: "email_confirmed_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + phoneConfirmedAt: import("../pg-core/index.js").PgColumn<{ + name: "phone_confirmed_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + lastSignInAt: import("../pg-core/index.js").PgColumn<{ + name: "last_sign_in_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + createdAt: import("../pg-core/index.js").PgColumn<{ + name: "created_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + updatedAt: import("../pg-core/index.js").PgColumn<{ + name: "updated_at"; + tableName: "users"; + dataType: "date"; + columnType: "PgTimestamp"; + data: Date; + driverParam: string; + notNull: false; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +export declare const realtimeMessages: import("../pg-core/index.js").PgTableWithColumns<{ + name: "messages"; + schema: "realtime"; + columns: { + id: import("../pg-core/index.js").PgColumn<{ + name: "id"; + tableName: "messages"; + dataType: "bigint"; + columnType: "PgBigSerial64"; + data: bigint; + driverParam: string; + notNull: true; + hasDefault: true; + isPrimaryKey: true; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: undefined; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + topic: import("../pg-core/index.js").PgColumn<{ + name: "topic"; + tableName: "messages"; + dataType: "string"; + columnType: "PgText"; + data: string; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: [string, ...string[]]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + extension: import("../pg-core/index.js").PgColumn<{ + name: "extension"; + tableName: "messages"; + dataType: "string"; + columnType: "PgText"; + data: "presence" | "broadcast" | "postgres_changes"; + driverParam: string; + notNull: true; + hasDefault: false; + isPrimaryKey: false; + isAutoincrement: false; + hasRuntimeDefault: false; + enumValues: ["presence", "broadcast", "postgres_changes"]; + baseColumn: never; + identity: undefined; + generated: undefined; + }, {}, {}>; + }; + dialect: "pg"; +}>; +export declare const authUid: import("../sql/sql.js").SQL; +export declare const realtimeTopic: import("../sql/sql.js").SQL; diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.js b/e-commerce/node_modules/drizzle-orm/supabase/rls.js new file mode 100644 index 0000000000000000000000000000000000000000..e11d3f40b14d53fb11797758935751cbd4325fc2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.js @@ -0,0 +1,44 @@ +import { bigserial, pgSchema, text, timestamp, uuid, varchar } from "../pg-core/index.js"; +import { pgRole } from "../pg-core/roles.js"; +import { sql } from "../sql/sql.js"; +const anonRole = pgRole("anon").existing(); +const authenticatedRole = pgRole("authenticated").existing(); +const serviceRole = pgRole("service_role").existing(); +const postgresRole = pgRole("postgres_role").existing(); +const supabaseAuthAdminRole = pgRole("supabase_auth_admin").existing(); +const auth = pgSchema("auth"); +const authUsers = auth.table("users", { + id: uuid().primaryKey().notNull(), + email: varchar({ length: 255 }), + phone: text().unique(), + emailConfirmedAt: timestamp("email_confirmed_at", { withTimezone: true }), + phoneConfirmedAt: timestamp("phone_confirmed_at", { withTimezone: true }), + lastSignInAt: timestamp("last_sign_in_at", { withTimezone: true }), + createdAt: timestamp("created_at", { withTimezone: true }), + updatedAt: timestamp("updated_at", { withTimezone: true }) +}); +const realtime = pgSchema("realtime"); +const realtimeMessages = realtime.table( + "messages", + { + id: bigserial({ mode: "bigint" }).primaryKey(), + topic: text().notNull(), + extension: text({ + enum: ["presence", "broadcast", "postgres_changes"] + }).notNull() + } +); +const authUid = sql`(select auth.uid())`; +const realtimeTopic = sql`realtime.topic()`; +export { + anonRole, + authUid, + authUsers, + authenticatedRole, + postgresRole, + realtimeMessages, + realtimeTopic, + serviceRole, + supabaseAuthAdminRole +}; +//# sourceMappingURL=rls.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/supabase/rls.js.map b/e-commerce/node_modules/drizzle-orm/supabase/rls.js.map new file mode 100644 index 0000000000000000000000000000000000000000..07a1ee24f84270ccfa888d47d01cc4b7a743ccb7 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/supabase/rls.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/supabase/rls.ts"],"sourcesContent":["import { bigserial, pgSchema, text, timestamp, uuid, varchar } from '~/pg-core/index.ts';\nimport { pgRole } from '~/pg-core/roles.ts';\nimport { sql } from '~/sql/sql.ts';\n\nexport const anonRole = pgRole('anon').existing();\nexport const authenticatedRole = pgRole('authenticated').existing();\nexport const serviceRole = pgRole('service_role').existing();\nexport const postgresRole = pgRole('postgres_role').existing();\nexport const supabaseAuthAdminRole = pgRole('supabase_auth_admin').existing();\n\n/* ------------------------------ auth schema; ------------------------------ */\nconst auth = pgSchema('auth');\n\nexport const authUsers = auth.table('users', {\n\tid: uuid().primaryKey().notNull(),\n\temail: varchar({ length: 255 }),\n\tphone: text().unique(),\n\temailConfirmedAt: timestamp('email_confirmed_at', { withTimezone: true }),\n\tphoneConfirmedAt: timestamp('phone_confirmed_at', { withTimezone: true }),\n\tlastSignInAt: timestamp('last_sign_in_at', { withTimezone: true }),\n\tcreatedAt: timestamp('created_at', { withTimezone: true }),\n\tupdatedAt: timestamp('updated_at', { withTimezone: true }),\n});\n\n/* ------------------------------ realtime schema; ------------------------------- */\nconst realtime = pgSchema('realtime');\n\nexport const realtimeMessages = realtime.table(\n\t'messages',\n\t{\n\t\tid: bigserial({ mode: 'bigint' }).primaryKey(),\n\t\ttopic: text().notNull(),\n\t\textension: text({\n\t\t\tenum: ['presence', 'broadcast', 'postgres_changes'],\n\t\t}).notNull(),\n\t},\n);\n\nexport const authUid = sql`(select auth.uid())`;\nexport const realtimeTopic = sql`realtime.topic()`;\n"],"mappings":"AAAA,SAAS,WAAW,UAAU,MAAM,WAAW,MAAM,eAAe;AACpE,SAAS,cAAc;AACvB,SAAS,WAAW;AAEb,MAAM,WAAW,OAAO,MAAM,EAAE,SAAS;AACzC,MAAM,oBAAoB,OAAO,eAAe,EAAE,SAAS;AAC3D,MAAM,cAAc,OAAO,cAAc,EAAE,SAAS;AACpD,MAAM,eAAe,OAAO,eAAe,EAAE,SAAS;AACtD,MAAM,wBAAwB,OAAO,qBAAqB,EAAE,SAAS;AAG5E,MAAM,OAAO,SAAS,MAAM;AAErB,MAAM,YAAY,KAAK,MAAM,SAAS;AAAA,EAC5C,IAAI,KAAK,EAAE,WAAW,EAAE,QAAQ;AAAA,EAChC,OAAO,QAAQ,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC9B,OAAO,KAAK,EAAE,OAAO;AAAA,EACrB,kBAAkB,UAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,kBAAkB,UAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,cAAc,UAAU,mBAAmB,EAAE,cAAc,KAAK,CAAC;AAAA,EACjE,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAAA,EACzD,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAC1D,CAAC;AAGD,MAAM,WAAW,SAAS,UAAU;AAE7B,MAAM,mBAAmB,SAAS;AAAA,EACxC;AAAA,EACA;AAAA,IACC,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,WAAW;AAAA,IAC7C,OAAO,KAAK,EAAE,QAAQ;AAAA,IACtB,WAAW,KAAK;AAAA,MACf,MAAM,CAAC,YAAY,aAAa,kBAAkB;AAAA,IACnD,CAAC,EAAE,QAAQ;AAAA,EACZ;AACD;AAEO,MAAM,UAAU;AAChB,MAAM,gBAAgB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.cjs b/e-commerce/node_modules/drizzle-orm/table.cjs new file mode 100644 index 0000000000000000000000000000000000000000..8a1565d1616ee09dc2ebfcd5e64ef917f9c53161 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.cjs @@ -0,0 +1,113 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var table_exports = {}; +__export(table_exports, { + BaseName: () => BaseName, + Columns: () => Columns, + ExtraConfigBuilder: () => ExtraConfigBuilder, + ExtraConfigColumns: () => ExtraConfigColumns, + IsAlias: () => IsAlias, + OriginalName: () => OriginalName, + Schema: () => Schema, + Table: () => Table, + getTableName: () => getTableName, + getTableUniqueName: () => getTableUniqueName, + isTable: () => isTable +}); +module.exports = __toCommonJS(table_exports); +var import_entity = require("./entity.cjs"); +var import_table_utils = require("./table.utils.cjs"); +const Schema = Symbol.for("drizzle:Schema"); +const Columns = Symbol.for("drizzle:Columns"); +const ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns"); +const OriginalName = Symbol.for("drizzle:OriginalName"); +const BaseName = Symbol.for("drizzle:BaseName"); +const IsAlias = Symbol.for("drizzle:IsAlias"); +const ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder"); +const IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable"); +class Table { + static [import_entity.entityKind] = "Table"; + /** @internal */ + static Symbol = { + Name: import_table_utils.TableName, + Schema, + OriginalName, + Columns, + ExtraConfigColumns, + BaseName, + IsAlias, + ExtraConfigBuilder + }; + /** + * @internal + * Can be changed if the table is aliased. + */ + [import_table_utils.TableName]; + /** + * @internal + * Used to store the original name of the table, before any aliasing. + */ + [OriginalName]; + /** @internal */ + [Schema]; + /** @internal */ + [Columns]; + /** @internal */ + [ExtraConfigColumns]; + /** + * @internal + * Used to store the table name before the transformation via the `tableCreator` functions. + */ + [BaseName]; + /** @internal */ + [IsAlias] = false; + /** @internal */ + [IsDrizzleTable] = true; + /** @internal */ + [ExtraConfigBuilder] = void 0; + constructor(name, schema, baseName) { + this[import_table_utils.TableName] = this[OriginalName] = name; + this[Schema] = schema; + this[BaseName] = baseName; + } +} +function isTable(table) { + return typeof table === "object" && table !== null && IsDrizzleTable in table; +} +function getTableName(table) { + return table[import_table_utils.TableName]; +} +function getTableUniqueName(table) { + return `${table[Schema] ?? "public"}.${table[import_table_utils.TableName]}`; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + BaseName, + Columns, + ExtraConfigBuilder, + ExtraConfigColumns, + IsAlias, + OriginalName, + Schema, + Table, + getTableName, + getTableUniqueName, + isTable +}); +//# sourceMappingURL=table.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.cjs.map b/e-commerce/node_modules/drizzle-orm/table.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..454a662df1403eabdbb89b0e45a8340d8020638b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.ts"],"sourcesContent":["import type { Column, GetColumnData } from './column.ts';\nimport { entityKind } from './entity.ts';\nimport type { OptionalKeyOnly, RequiredKeyOnly } from './operations.ts';\nimport type { SQLWrapper } from './sql/sql.ts';\nimport { TableName } from './table.utils.ts';\nimport type { Simplify, Update } from './utils.ts';\n\nexport interface TableConfig> {\n\tname: string;\n\tschema: string | undefined;\n\tcolumns: Record;\n\tdialect: string;\n}\n\nexport type UpdateTableConfig> = Required<\n\tUpdate\n>;\n\n/** @internal */\nexport const Schema = Symbol.for('drizzle:Schema');\n\n/** @internal */\nexport const Columns = Symbol.for('drizzle:Columns');\n\n/** @internal */\nexport const ExtraConfigColumns = Symbol.for('drizzle:ExtraConfigColumns');\n\n/** @internal */\nexport const OriginalName = Symbol.for('drizzle:OriginalName');\n\n/** @internal */\nexport const BaseName = Symbol.for('drizzle:BaseName');\n\n/** @internal */\nexport const IsAlias = Symbol.for('drizzle:IsAlias');\n\n/** @internal */\nexport const ExtraConfigBuilder = Symbol.for('drizzle:ExtraConfigBuilder');\n\nconst IsDrizzleTable = Symbol.for('drizzle:IsDrizzleTable');\n\nexport interface Table<\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tT extends TableConfig = TableConfig,\n> extends SQLWrapper {\n\t// SQLWrapper runtime implementation is defined in 'sql/sql.ts'\n}\n\nexport class Table implements SQLWrapper {\n\tstatic readonly [entityKind]: string = 'Table';\n\n\tdeclare readonly _: {\n\t\treadonly brand: 'Table';\n\t\treadonly config: T;\n\t\treadonly name: T['name'];\n\t\treadonly schema: T['schema'];\n\t\treadonly columns: T['columns'];\n\t\treadonly inferSelect: InferSelectModel>;\n\t\treadonly inferInsert: InferInsertModel>;\n\t};\n\n\tdeclare readonly $inferSelect: InferSelectModel>;\n\tdeclare readonly $inferInsert: InferInsertModel>;\n\n\t/** @internal */\n\tstatic readonly Symbol = {\n\t\tName: TableName as typeof TableName,\n\t\tSchema: Schema as typeof Schema,\n\t\tOriginalName: OriginalName as typeof OriginalName,\n\t\tColumns: Columns as typeof Columns,\n\t\tExtraConfigColumns: ExtraConfigColumns as typeof ExtraConfigColumns,\n\t\tBaseName: BaseName as typeof BaseName,\n\t\tIsAlias: IsAlias as typeof IsAlias,\n\t\tExtraConfigBuilder: ExtraConfigBuilder as typeof ExtraConfigBuilder,\n\t};\n\n\t/**\n\t * @internal\n\t * Can be changed if the table is aliased.\n\t */\n\t[TableName]: string;\n\n\t/**\n\t * @internal\n\t * Used to store the original name of the table, before any aliasing.\n\t */\n\t[OriginalName]: string;\n\n\t/** @internal */\n\t[Schema]: string | undefined;\n\n\t/** @internal */\n\t[Columns]!: T['columns'];\n\n\t/** @internal */\n\t[ExtraConfigColumns]!: Record;\n\n\t/**\n\t * @internal\n\t * Used to store the table name before the transformation via the `tableCreator` functions.\n\t */\n\t[BaseName]: string;\n\n\t/** @internal */\n\t[IsAlias] = false;\n\n\t/** @internal */\n\t[IsDrizzleTable] = true;\n\n\t/** @internal */\n\t[ExtraConfigBuilder]: ((self: any) => Record | unknown[]) | undefined = undefined;\n\n\tconstructor(name: string, schema: string | undefined, baseName: string) {\n\t\tthis[TableName] = this[OriginalName] = name;\n\t\tthis[Schema] = schema;\n\t\tthis[BaseName] = baseName;\n\t}\n}\n\nexport function isTable(table: unknown): table is Table {\n\treturn typeof table === 'object' && table !== null && IsDrizzleTable in table;\n}\n\n/**\n * Any table with a specified boundary.\n *\n * @example\n\t```ts\n\t// Any table with a specific name\n\ttype AnyUsersTable = AnyTable<{ name: 'users' }>;\n\t```\n *\n * To describe any table with any config, simply use `Table` without any type arguments, like this:\n *\n\t```ts\n\tfunction needsTable(table: Table) {\n\t\t...\n\t}\n\t```\n */\nexport type AnyTable> = Table>;\n\nexport function getTableName(table: T): T['_']['name'] {\n\treturn table[TableName];\n}\n\nexport function getTableUniqueName(table: T): `${T['_']['schema']}.${T['_']['name']}` {\n\treturn `${table[Schema] ?? 'public'}.${table[TableName]}`;\n}\n\nexport type MapColumnName =\n\tTDBColumNames extends true ? TColumn['_']['name']\n\t\t: TName;\n\nexport type InferModelFromColumns<\n\tTColumns extends Record,\n\tTInferMode extends 'select' | 'insert' = 'select',\n\tTConfig extends { dbColumnNames: boolean; override?: boolean } = { dbColumnNames: false; override: false },\n> = Simplify<\n\tTInferMode extends 'insert' ?\n\t\t\t& {\n\t\t\t\t[\n\t\t\t\t\tKey in keyof TColumns & string as RequiredKeyOnly<\n\t\t\t\t\t\tMapColumnName,\n\t\t\t\t\t\tTColumns[Key]\n\t\t\t\t\t>\n\t\t\t\t]: GetColumnData;\n\t\t\t}\n\t\t\t& {\n\t\t\t\t[\n\t\t\t\t\tKey in keyof TColumns & string as OptionalKeyOnly<\n\t\t\t\t\t\tMapColumnName,\n\t\t\t\t\t\tTColumns[Key],\n\t\t\t\t\t\tTConfig['override']\n\t\t\t\t\t>\n\t\t\t\t]?: GetColumnData | undefined;\n\t\t\t}\n\t\t: {\n\t\t\t[\n\t\t\t\tKey in keyof TColumns & string as MapColumnName<\n\t\t\t\t\tKey,\n\t\t\t\t\tTColumns[Key],\n\t\t\t\t\tTConfig['dbColumnNames']\n\t\t\t\t>\n\t\t\t]: GetColumnData;\n\t\t}\n>;\n\n/** @deprecated Use one of the alternatives: {@link InferSelectModel} / {@link InferInsertModel}, or `table.$inferSelect` / `table.$inferInsert`\n */\nexport type InferModel<\n\tTTable extends Table,\n\tTInferMode extends 'select' | 'insert' = 'select',\n\tTConfig extends { dbColumnNames: boolean } = { dbColumnNames: false },\n> = InferModelFromColumns;\n\nexport type InferSelectModel<\n\tTTable extends Table,\n\tTConfig extends { dbColumnNames: boolean } = { dbColumnNames: false },\n> = InferModelFromColumns;\n\nexport type InferInsertModel<\n\tTTable extends Table,\n\tTConfig extends { dbColumnNames: boolean; override?: boolean } = { dbColumnNames: false; override: false },\n> = InferModelFromColumns;\n\nexport type InferEnum = T extends { enumValues: readonly (infer U)[] } ? U\n\t: never;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAG3B,yBAA0B;AAenB,MAAM,SAAS,OAAO,IAAI,gBAAgB;AAG1C,MAAM,UAAU,OAAO,IAAI,iBAAiB;AAG5C,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAGlE,MAAM,eAAe,OAAO,IAAI,sBAAsB;AAGtD,MAAM,WAAW,OAAO,IAAI,kBAAkB;AAG9C,MAAM,UAAU,OAAO,IAAI,iBAAiB;AAG5C,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAEzE,MAAM,iBAAiB,OAAO,IAAI,wBAAwB;AASnD,MAAM,MAAiE;AAAA,EAC7E,QAAiB,wBAAU,IAAY;AAAA;AAAA,EAgBvC,OAAgB,SAAS;AAAA,IACxB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,CAAC,4BAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMV,CAAC,YAAY;AAAA;AAAA,EAGb,CAAC,MAAM;AAAA;AAAA,EAGP,CAAC,OAAO;AAAA;AAAA,EAGR,CAAC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,CAAC,QAAQ;AAAA;AAAA,EAGT,CAAC,OAAO,IAAI;AAAA;AAAA,EAGZ,CAAC,cAAc,IAAI;AAAA;AAAA,EAGnB,CAAC,kBAAkB,IAAsE;AAAA,EAEzF,YAAY,MAAc,QAA4B,UAAkB;AACvE,SAAK,4BAAS,IAAI,KAAK,YAAY,IAAI;AACvC,SAAK,MAAM,IAAI;AACf,SAAK,QAAQ,IAAI;AAAA,EAClB;AACD;AAEO,SAAS,QAAQ,OAAgC;AACvD,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,kBAAkB;AACzE;AAqBO,SAAS,aAA8B,OAA0B;AACvE,SAAO,MAAM,4BAAS;AACvB;AAEO,SAAS,mBAAoC,OAAmD;AACtG,SAAO,GAAG,MAAM,MAAM,KAAK,QAAQ,IAAI,MAAM,4BAAS,CAAC;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.d.cts b/e-commerce/node_modules/drizzle-orm/table.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..f3f2e66eebe7a0df43576d28d963a8c19936953e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.d.cts @@ -0,0 +1,86 @@ +import type { Column, GetColumnData } from "./column.cjs"; +import { entityKind } from "./entity.cjs"; +import type { OptionalKeyOnly, RequiredKeyOnly } from "./operations.cjs"; +import type { SQLWrapper } from "./sql/sql.cjs"; +import type { Simplify, Update } from "./utils.cjs"; +export interface TableConfig> { + name: string; + schema: string | undefined; + columns: Record; + dialect: string; +} +export type UpdateTableConfig> = Required>; +export interface Table extends SQLWrapper { +} +export declare class Table implements SQLWrapper { + static readonly [entityKind]: string; + readonly _: { + readonly brand: 'Table'; + readonly config: T; + readonly name: T['name']; + readonly schema: T['schema']; + readonly columns: T['columns']; + readonly inferSelect: InferSelectModel>; + readonly inferInsert: InferInsertModel>; + }; + readonly $inferSelect: InferSelectModel>; + readonly $inferInsert: InferInsertModel>; + constructor(name: string, schema: string | undefined, baseName: string); +} +export declare function isTable(table: unknown): table is Table; +/** + * Any table with a specified boundary. + * + * @example + ```ts + // Any table with a specific name + type AnyUsersTable = AnyTable<{ name: 'users' }>; + ``` + * + * To describe any table with any config, simply use `Table` without any type arguments, like this: + * + ```ts + function needsTable(table: Table) { + ... + } + ``` + */ +export type AnyTable> = Table>; +export declare function getTableName(table: T): T['_']['name']; +export declare function getTableUniqueName(table: T): `${T['_']['schema']}.${T['_']['name']}`; +export type MapColumnName = TDBColumNames extends true ? TColumn['_']['name'] : TName; +export type InferModelFromColumns, TInferMode extends 'select' | 'insert' = 'select', TConfig extends { + dbColumnNames: boolean; + override?: boolean; +} = { + dbColumnNames: false; + override: false; +}> = Simplify, TColumns[Key]>]: GetColumnData; +} & { + [Key in keyof TColumns & string as OptionalKeyOnly, TColumns[Key], TConfig['override']>]?: GetColumnData | undefined; +} : { + [Key in keyof TColumns & string as MapColumnName]: GetColumnData; +}>; +/** @deprecated Use one of the alternatives: {@link InferSelectModel} / {@link InferInsertModel}, or `table.$inferSelect` / `table.$inferInsert` + */ +export type InferModel = InferModelFromColumns; +export type InferSelectModel = InferModelFromColumns; +export type InferInsertModel = InferModelFromColumns; +export type InferEnum = T extends { + enumValues: readonly (infer U)[]; +} ? U : never; diff --git a/e-commerce/node_modules/drizzle-orm/table.d.ts b/e-commerce/node_modules/drizzle-orm/table.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdeb7ba6c3804a356ac349fe16d28c35f4bf69a2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.d.ts @@ -0,0 +1,86 @@ +import type { Column, GetColumnData } from "./column.js"; +import { entityKind } from "./entity.js"; +import type { OptionalKeyOnly, RequiredKeyOnly } from "./operations.js"; +import type { SQLWrapper } from "./sql/sql.js"; +import type { Simplify, Update } from "./utils.js"; +export interface TableConfig> { + name: string; + schema: string | undefined; + columns: Record; + dialect: string; +} +export type UpdateTableConfig> = Required>; +export interface Table extends SQLWrapper { +} +export declare class Table implements SQLWrapper { + static readonly [entityKind]: string; + readonly _: { + readonly brand: 'Table'; + readonly config: T; + readonly name: T['name']; + readonly schema: T['schema']; + readonly columns: T['columns']; + readonly inferSelect: InferSelectModel>; + readonly inferInsert: InferInsertModel>; + }; + readonly $inferSelect: InferSelectModel>; + readonly $inferInsert: InferInsertModel>; + constructor(name: string, schema: string | undefined, baseName: string); +} +export declare function isTable(table: unknown): table is Table; +/** + * Any table with a specified boundary. + * + * @example + ```ts + // Any table with a specific name + type AnyUsersTable = AnyTable<{ name: 'users' }>; + ``` + * + * To describe any table with any config, simply use `Table` without any type arguments, like this: + * + ```ts + function needsTable(table: Table) { + ... + } + ``` + */ +export type AnyTable> = Table>; +export declare function getTableName(table: T): T['_']['name']; +export declare function getTableUniqueName(table: T): `${T['_']['schema']}.${T['_']['name']}`; +export type MapColumnName = TDBColumNames extends true ? TColumn['_']['name'] : TName; +export type InferModelFromColumns, TInferMode extends 'select' | 'insert' = 'select', TConfig extends { + dbColumnNames: boolean; + override?: boolean; +} = { + dbColumnNames: false; + override: false; +}> = Simplify, TColumns[Key]>]: GetColumnData; +} & { + [Key in keyof TColumns & string as OptionalKeyOnly, TColumns[Key], TConfig['override']>]?: GetColumnData | undefined; +} : { + [Key in keyof TColumns & string as MapColumnName]: GetColumnData; +}>; +/** @deprecated Use one of the alternatives: {@link InferSelectModel} / {@link InferInsertModel}, or `table.$inferSelect` / `table.$inferInsert` + */ +export type InferModel = InferModelFromColumns; +export type InferSelectModel = InferModelFromColumns; +export type InferInsertModel = InferModelFromColumns; +export type InferEnum = T extends { + enumValues: readonly (infer U)[]; +} ? U : never; diff --git a/e-commerce/node_modules/drizzle-orm/table.js b/e-commerce/node_modules/drizzle-orm/table.js new file mode 100644 index 0000000000000000000000000000000000000000..4e1bce0c3d790aacd4f261614cdd188bc6efde79 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.js @@ -0,0 +1,79 @@ +import { entityKind } from "./entity.js"; +import { TableName } from "./table.utils.js"; +const Schema = Symbol.for("drizzle:Schema"); +const Columns = Symbol.for("drizzle:Columns"); +const ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns"); +const OriginalName = Symbol.for("drizzle:OriginalName"); +const BaseName = Symbol.for("drizzle:BaseName"); +const IsAlias = Symbol.for("drizzle:IsAlias"); +const ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder"); +const IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable"); +class Table { + static [entityKind] = "Table"; + /** @internal */ + static Symbol = { + Name: TableName, + Schema, + OriginalName, + Columns, + ExtraConfigColumns, + BaseName, + IsAlias, + ExtraConfigBuilder + }; + /** + * @internal + * Can be changed if the table is aliased. + */ + [TableName]; + /** + * @internal + * Used to store the original name of the table, before any aliasing. + */ + [OriginalName]; + /** @internal */ + [Schema]; + /** @internal */ + [Columns]; + /** @internal */ + [ExtraConfigColumns]; + /** + * @internal + * Used to store the table name before the transformation via the `tableCreator` functions. + */ + [BaseName]; + /** @internal */ + [IsAlias] = false; + /** @internal */ + [IsDrizzleTable] = true; + /** @internal */ + [ExtraConfigBuilder] = void 0; + constructor(name, schema, baseName) { + this[TableName] = this[OriginalName] = name; + this[Schema] = schema; + this[BaseName] = baseName; + } +} +function isTable(table) { + return typeof table === "object" && table !== null && IsDrizzleTable in table; +} +function getTableName(table) { + return table[TableName]; +} +function getTableUniqueName(table) { + return `${table[Schema] ?? "public"}.${table[TableName]}`; +} +export { + BaseName, + Columns, + ExtraConfigBuilder, + ExtraConfigColumns, + IsAlias, + OriginalName, + Schema, + Table, + getTableName, + getTableUniqueName, + isTable +}; +//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.js.map b/e-commerce/node_modules/drizzle-orm/table.js.map new file mode 100644 index 0000000000000000000000000000000000000000..342b03c57893dc559d1d80224de54d0a356523f0 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.ts"],"sourcesContent":["import type { Column, GetColumnData } from './column.ts';\nimport { entityKind } from './entity.ts';\nimport type { OptionalKeyOnly, RequiredKeyOnly } from './operations.ts';\nimport type { SQLWrapper } from './sql/sql.ts';\nimport { TableName } from './table.utils.ts';\nimport type { Simplify, Update } from './utils.ts';\n\nexport interface TableConfig> {\n\tname: string;\n\tschema: string | undefined;\n\tcolumns: Record;\n\tdialect: string;\n}\n\nexport type UpdateTableConfig> = Required<\n\tUpdate\n>;\n\n/** @internal */\nexport const Schema = Symbol.for('drizzle:Schema');\n\n/** @internal */\nexport const Columns = Symbol.for('drizzle:Columns');\n\n/** @internal */\nexport const ExtraConfigColumns = Symbol.for('drizzle:ExtraConfigColumns');\n\n/** @internal */\nexport const OriginalName = Symbol.for('drizzle:OriginalName');\n\n/** @internal */\nexport const BaseName = Symbol.for('drizzle:BaseName');\n\n/** @internal */\nexport const IsAlias = Symbol.for('drizzle:IsAlias');\n\n/** @internal */\nexport const ExtraConfigBuilder = Symbol.for('drizzle:ExtraConfigBuilder');\n\nconst IsDrizzleTable = Symbol.for('drizzle:IsDrizzleTable');\n\nexport interface Table<\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tT extends TableConfig = TableConfig,\n> extends SQLWrapper {\n\t// SQLWrapper runtime implementation is defined in 'sql/sql.ts'\n}\n\nexport class Table implements SQLWrapper {\n\tstatic readonly [entityKind]: string = 'Table';\n\n\tdeclare readonly _: {\n\t\treadonly brand: 'Table';\n\t\treadonly config: T;\n\t\treadonly name: T['name'];\n\t\treadonly schema: T['schema'];\n\t\treadonly columns: T['columns'];\n\t\treadonly inferSelect: InferSelectModel>;\n\t\treadonly inferInsert: InferInsertModel>;\n\t};\n\n\tdeclare readonly $inferSelect: InferSelectModel>;\n\tdeclare readonly $inferInsert: InferInsertModel>;\n\n\t/** @internal */\n\tstatic readonly Symbol = {\n\t\tName: TableName as typeof TableName,\n\t\tSchema: Schema as typeof Schema,\n\t\tOriginalName: OriginalName as typeof OriginalName,\n\t\tColumns: Columns as typeof Columns,\n\t\tExtraConfigColumns: ExtraConfigColumns as typeof ExtraConfigColumns,\n\t\tBaseName: BaseName as typeof BaseName,\n\t\tIsAlias: IsAlias as typeof IsAlias,\n\t\tExtraConfigBuilder: ExtraConfigBuilder as typeof ExtraConfigBuilder,\n\t};\n\n\t/**\n\t * @internal\n\t * Can be changed if the table is aliased.\n\t */\n\t[TableName]: string;\n\n\t/**\n\t * @internal\n\t * Used to store the original name of the table, before any aliasing.\n\t */\n\t[OriginalName]: string;\n\n\t/** @internal */\n\t[Schema]: string | undefined;\n\n\t/** @internal */\n\t[Columns]!: T['columns'];\n\n\t/** @internal */\n\t[ExtraConfigColumns]!: Record;\n\n\t/**\n\t * @internal\n\t * Used to store the table name before the transformation via the `tableCreator` functions.\n\t */\n\t[BaseName]: string;\n\n\t/** @internal */\n\t[IsAlias] = false;\n\n\t/** @internal */\n\t[IsDrizzleTable] = true;\n\n\t/** @internal */\n\t[ExtraConfigBuilder]: ((self: any) => Record | unknown[]) | undefined = undefined;\n\n\tconstructor(name: string, schema: string | undefined, baseName: string) {\n\t\tthis[TableName] = this[OriginalName] = name;\n\t\tthis[Schema] = schema;\n\t\tthis[BaseName] = baseName;\n\t}\n}\n\nexport function isTable(table: unknown): table is Table {\n\treturn typeof table === 'object' && table !== null && IsDrizzleTable in table;\n}\n\n/**\n * Any table with a specified boundary.\n *\n * @example\n\t```ts\n\t// Any table with a specific name\n\ttype AnyUsersTable = AnyTable<{ name: 'users' }>;\n\t```\n *\n * To describe any table with any config, simply use `Table` without any type arguments, like this:\n *\n\t```ts\n\tfunction needsTable(table: Table) {\n\t\t...\n\t}\n\t```\n */\nexport type AnyTable> = Table>;\n\nexport function getTableName(table: T): T['_']['name'] {\n\treturn table[TableName];\n}\n\nexport function getTableUniqueName(table: T): `${T['_']['schema']}.${T['_']['name']}` {\n\treturn `${table[Schema] ?? 'public'}.${table[TableName]}`;\n}\n\nexport type MapColumnName =\n\tTDBColumNames extends true ? TColumn['_']['name']\n\t\t: TName;\n\nexport type InferModelFromColumns<\n\tTColumns extends Record,\n\tTInferMode extends 'select' | 'insert' = 'select',\n\tTConfig extends { dbColumnNames: boolean; override?: boolean } = { dbColumnNames: false; override: false },\n> = Simplify<\n\tTInferMode extends 'insert' ?\n\t\t\t& {\n\t\t\t\t[\n\t\t\t\t\tKey in keyof TColumns & string as RequiredKeyOnly<\n\t\t\t\t\t\tMapColumnName,\n\t\t\t\t\t\tTColumns[Key]\n\t\t\t\t\t>\n\t\t\t\t]: GetColumnData;\n\t\t\t}\n\t\t\t& {\n\t\t\t\t[\n\t\t\t\t\tKey in keyof TColumns & string as OptionalKeyOnly<\n\t\t\t\t\t\tMapColumnName,\n\t\t\t\t\t\tTColumns[Key],\n\t\t\t\t\t\tTConfig['override']\n\t\t\t\t\t>\n\t\t\t\t]?: GetColumnData | undefined;\n\t\t\t}\n\t\t: {\n\t\t\t[\n\t\t\t\tKey in keyof TColumns & string as MapColumnName<\n\t\t\t\t\tKey,\n\t\t\t\t\tTColumns[Key],\n\t\t\t\t\tTConfig['dbColumnNames']\n\t\t\t\t>\n\t\t\t]: GetColumnData;\n\t\t}\n>;\n\n/** @deprecated Use one of the alternatives: {@link InferSelectModel} / {@link InferInsertModel}, or `table.$inferSelect` / `table.$inferInsert`\n */\nexport type InferModel<\n\tTTable extends Table,\n\tTInferMode extends 'select' | 'insert' = 'select',\n\tTConfig extends { dbColumnNames: boolean } = { dbColumnNames: false },\n> = InferModelFromColumns;\n\nexport type InferSelectModel<\n\tTTable extends Table,\n\tTConfig extends { dbColumnNames: boolean } = { dbColumnNames: false },\n> = InferModelFromColumns;\n\nexport type InferInsertModel<\n\tTTable extends Table,\n\tTConfig extends { dbColumnNames: boolean; override?: boolean } = { dbColumnNames: false; override: false },\n> = InferModelFromColumns;\n\nexport type InferEnum = T extends { enumValues: readonly (infer U)[] } ? U\n\t: never;\n"],"mappings":"AACA,SAAS,kBAAkB;AAG3B,SAAS,iBAAiB;AAenB,MAAM,SAAS,OAAO,IAAI,gBAAgB;AAG1C,MAAM,UAAU,OAAO,IAAI,iBAAiB;AAG5C,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAGlE,MAAM,eAAe,OAAO,IAAI,sBAAsB;AAGtD,MAAM,WAAW,OAAO,IAAI,kBAAkB;AAG9C,MAAM,UAAU,OAAO,IAAI,iBAAiB;AAG5C,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAEzE,MAAM,iBAAiB,OAAO,IAAI,wBAAwB;AASnD,MAAM,MAAiE;AAAA,EAC7E,QAAiB,UAAU,IAAY;AAAA;AAAA,EAgBvC,OAAgB,SAAS;AAAA,IACxB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,CAAC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMV,CAAC,YAAY;AAAA;AAAA,EAGb,CAAC,MAAM;AAAA;AAAA,EAGP,CAAC,OAAO;AAAA;AAAA,EAGR,CAAC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,CAAC,QAAQ;AAAA;AAAA,EAGT,CAAC,OAAO,IAAI;AAAA;AAAA,EAGZ,CAAC,cAAc,IAAI;AAAA;AAAA,EAGnB,CAAC,kBAAkB,IAAsE;AAAA,EAEzF,YAAY,MAAc,QAA4B,UAAkB;AACvE,SAAK,SAAS,IAAI,KAAK,YAAY,IAAI;AACvC,SAAK,MAAM,IAAI;AACf,SAAK,QAAQ,IAAI;AAAA,EAClB;AACD;AAEO,SAAS,QAAQ,OAAgC;AACvD,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,kBAAkB;AACzE;AAqBO,SAAS,aAA8B,OAA0B;AACvE,SAAO,MAAM,SAAS;AACvB;AAEO,SAAS,mBAAoC,OAAmD;AACtG,SAAO,GAAG,MAAM,MAAM,KAAK,QAAQ,IAAI,MAAM,SAAS,CAAC;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.cjs b/e-commerce/node_modules/drizzle-orm/table.utils.cjs new file mode 100644 index 0000000000000000000000000000000000000000..4238b6ed1f67ecb2457018080a818b68fddb7679 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.cjs @@ -0,0 +1,29 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var table_utils_exports = {}; +__export(table_utils_exports, { + TableName: () => TableName +}); +module.exports = __toCommonJS(table_utils_exports); +const TableName = Symbol.for("drizzle:Name"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TableName +}); +//# sourceMappingURL=table.utils.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.cjs.map b/e-commerce/node_modules/drizzle-orm/table.utils.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..60c9c4adecff9cff784d60edc188a1ad1d44c2f5 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.utils.ts"],"sourcesContent":["/** @internal */\nexport const TableName = Symbol.for('drizzle:Name');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,YAAY,OAAO,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.d.cts b/e-commerce/node_modules/drizzle-orm/table.utils.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.d.cts @@ -0,0 +1 @@ +export {}; diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.d.ts b/e-commerce/node_modules/drizzle-orm/table.utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.js b/e-commerce/node_modules/drizzle-orm/table.utils.js new file mode 100644 index 0000000000000000000000000000000000000000..0c70fc8c8543b863f914cd846fd2fa69cf0ffabf --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.js @@ -0,0 +1,5 @@ +const TableName = Symbol.for("drizzle:Name"); +export { + TableName +}; +//# sourceMappingURL=table.utils.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/table.utils.js.map b/e-commerce/node_modules/drizzle-orm/table.utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..135c5d9bfa0c59165c1725aed81b41791e850995 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/table.utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/table.utils.ts"],"sourcesContent":["/** @internal */\nexport const TableName = Symbol.for('drizzle:Name');\n"],"mappings":"AACO,MAAM,YAAY,OAAO,IAAI,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs new file mode 100644 index 0000000000000000000000000000000000000000..7f7fe50955c54065b2cd1b40306ec8da901b1588 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs @@ -0,0 +1,93 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var driver_exports = {}; +__export(driver_exports, { + TiDBServerlessDatabase: () => TiDBServerlessDatabase, + drizzle: () => drizzle +}); +module.exports = __toCommonJS(driver_exports); +var import_serverless = require("@tidbcloud/serverless"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_db = require("../mysql-core/db.cjs"); +var import_dialect = require("../mysql-core/dialect.cjs"); +var import_relations = require("../relations.cjs"); +var import_utils = require("../utils.cjs"); +var import_session = require("./session.cjs"); +class TiDBServerlessDatabase extends import_db.MySqlDatabase { + static [import_entity.entityKind] = "TiDBServerlessDatabase"; +} +function construct(client, config = {}) { + const dialect = new import_dialect.MySqlDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new import_logger.DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = (0, import_relations.extractTablesRelationalConfig)( + config.schema, + import_relations.createTableRelationsHelpers + ); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const session = new import_session.TiDBServerlessSession(client, dialect, void 0, schema, { logger, cache: config.cache }); + const db = new TiDBServerlessDatabase(dialect, session, schema, "default"); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +function drizzle(...params) { + if (typeof params[0] === "string") { + const instance = (0, import_serverless.connect)({ + url: params[0] + }); + return construct(instance, params[1]); + } + if ((0, import_utils.isConfig)(params[0])) { + const { connection, client, ...drizzleConfig } = params[0]; + if (client) return construct(client, drizzleConfig); + const instance = typeof connection === "string" ? (0, import_serverless.connect)({ + url: connection + }) : (0, import_serverless.connect)(connection); + return construct(instance, drizzleConfig); + } + return construct(params[0], params[1]); +} +((drizzle2) => { + function mock(config) { + return construct({}, config); + } + drizzle2.mock = mock; +})(drizzle || (drizzle = {})); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TiDBServerlessDatabase, + drizzle +}); +//# sourceMappingURL=driver.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..8fd9c718dc8db3de805ef955fa5742e754452895 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/driver.ts"],"sourcesContent":["import { type Config, connect, type Connection } from '@tidbcloud/serverless';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { MySqlDatabase } from '~/mysql-core/db.ts';\nimport { MySqlDialect } from '~/mysql-core/dialect.ts';\nimport {\n\tcreateTableRelationsHelpers,\n\textractTablesRelationalConfig,\n\ttype RelationalSchemaConfig,\n\ttype TablesRelationalConfig,\n} from '~/relations.ts';\nimport { type DrizzleConfig, isConfig } from '~/utils.ts';\nimport type { TiDBServerlessPreparedQueryHKT, TiDBServerlessQueryResultHKT } from './session.ts';\nimport { TiDBServerlessSession } from './session.ts';\n\nexport interface TiDBServerlessSDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class TiDBServerlessDatabase<\n\tTSchema extends Record = Record,\n> extends MySqlDatabase {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessDatabase';\n}\n\nfunction construct = Record>(\n\tclient: Connection,\n\tconfig: DrizzleConfig = {},\n): TiDBServerlessDatabase & {\n\t$client: Connection;\n} {\n\tconst dialect = new MySqlDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\tconfig.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst session = new TiDBServerlessSession(client, dialect, undefined, schema, { logger, cache: config.cache });\n\tconst db = new TiDBServerlessDatabase(dialect, session, schema as any, 'default') as TiDBServerlessDatabase;\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n\nexport function drizzle<\n\tTSchema extends Record = Record,\n\tTClient extends Connection = Connection,\n>(\n\t...params: [\n\t\tTClient | string,\n\t] | [\n\t\tTClient | string,\n\t\tDrizzleConfig,\n\t] | [\n\t\t& ({\n\t\t\tconnection: string | Config;\n\t\t} | {\n\t\t\tclient: TClient;\n\t\t})\n\t\t& DrizzleConfig,\n\t]\n): TiDBServerlessDatabase & {\n\t$client: TClient;\n} {\n\tif (typeof params[0] === 'string') {\n\t\tconst instance = connect({\n\t\t\turl: params[0],\n\t\t});\n\n\t\treturn construct(instance, params[1]) as any;\n\t}\n\n\tif (isConfig(params[0])) {\n\t\tconst { connection, client, ...drizzleConfig } = params[0] as\n\t\t\t& { connection?: Config | string; client?: TClient }\n\t\t\t& DrizzleConfig;\n\n\t\tif (client) return construct(client, drizzleConfig) as any;\n\n\t\tconst instance = typeof connection === 'string'\n\t\t\t? connect({\n\t\t\t\turl: connection,\n\t\t\t})\n\t\t\t: connect(connection!);\n\n\t\treturn construct(instance, drizzleConfig) as any;\n\t}\n\n\treturn construct(params[0] as TClient, params[1] as DrizzleConfig | undefined) as any;\n}\n\nexport namespace drizzle {\n\texport function mock = Record>(\n\t\tconfig?: DrizzleConfig,\n\t): TiDBServerlessDatabase & {\n\t\t$client: '$client is not available on drizzle.mock()';\n\t} {\n\t\treturn construct({} as any, config) as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsD;AACtD,oBAA2B;AAE3B,oBAA8B;AAC9B,gBAA8B;AAC9B,qBAA6B;AAC7B,uBAKO;AACP,mBAA6C;AAE7C,qBAAsC;AAO/B,MAAM,+BAEH,wBAAqF;AAAA,EAC9F,QAA0B,wBAAU,IAAY;AACjD;AAEA,SAAS,UACR,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,4BAAa,EAAE,QAAQ,OAAO,OAAO,CAAC;AAC1D,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,4BAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,mBAAe;AAAA,MACpB,OAAO;AAAA,MACP;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,UAAU,IAAI,qCAAsB,QAAQ,SAAS,QAAW,QAAQ,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAC7G,QAAM,KAAK,IAAI,uBAAuB,SAAS,SAAS,QAAe,SAAS;AAChF,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;AAEO,SAAS,WAIZ,QAeF;AACD,MAAI,OAAO,OAAO,CAAC,MAAM,UAAU;AAClC,UAAM,eAAW,2BAAQ;AAAA,MACxB,KAAK,OAAO,CAAC;AAAA,IACd,CAAC;AAED,WAAO,UAAU,UAAU,OAAO,CAAC,CAAC;AAAA,EACrC;AAEA,UAAI,uBAAS,OAAO,CAAC,CAAC,GAAG;AACxB,UAAM,EAAE,YAAY,QAAQ,GAAG,cAAc,IAAI,OAAO,CAAC;AAIzD,QAAI,OAAQ,QAAO,UAAU,QAAQ,aAAa;AAElD,UAAM,WAAW,OAAO,eAAe,eACpC,2BAAQ;AAAA,MACT,KAAK;AAAA,IACN,CAAC,QACC,2BAAQ,UAAW;AAEtB,WAAO,UAAU,UAAU,aAAa;AAAA,EACzC;AAEA,SAAO,UAAU,OAAO,CAAC,GAAc,OAAO,CAAC,CAAuC;AACvF;AAAA,CAEO,CAAUA,aAAV;AACC,WAAS,KACf,QAGC;AACD,WAAO,UAAU,CAAC,GAAU,MAAM;AAAA,EACnC;AANO,EAAAA,SAAS;AAAA,GADA;","names":["drizzle"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.cts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..f7e2920cf41ff1e9fdb3178cb081618ec8c1713c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.cts @@ -0,0 +1,32 @@ +import { type Config, type Connection } from '@tidbcloud/serverless'; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import { MySqlDatabase } from "../mysql-core/db.cjs"; +import { type DrizzleConfig } from "../utils.cjs"; +import type { TiDBServerlessPreparedQueryHKT, TiDBServerlessQueryResultHKT } from "./session.cjs"; +export interface TiDBServerlessSDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class TiDBServerlessDatabase = Record> extends MySqlDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record, TClient extends Connection = Connection>(...params: [ + TClient | string +] | [ + TClient | string, + DrizzleConfig +] | [ + ({ + connection: string | Config; + } | { + client: TClient; + }) & DrizzleConfig +]): TiDBServerlessDatabase & { + $client: TClient; +}; +export declare namespace drizzle { + function mock = Record>(config?: DrizzleConfig): TiDBServerlessDatabase & { + $client: '$client is not available on drizzle.mock()'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.ts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d768e29c28783180a39a3ff316d6f69d48b7c2f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.d.ts @@ -0,0 +1,32 @@ +import { type Config, type Connection } from '@tidbcloud/serverless'; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import { MySqlDatabase } from "../mysql-core/db.js"; +import { type DrizzleConfig } from "../utils.js"; +import type { TiDBServerlessPreparedQueryHKT, TiDBServerlessQueryResultHKT } from "./session.js"; +export interface TiDBServerlessSDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class TiDBServerlessDatabase = Record> extends MySqlDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record, TClient extends Connection = Connection>(...params: [ + TClient | string +] | [ + TClient | string, + DrizzleConfig +] | [ + ({ + connection: string | Config; + } | { + client: TClient; + }) & DrizzleConfig +]): TiDBServerlessDatabase & { + $client: TClient; +}; +export declare namespace drizzle { + function mock = Record>(config?: DrizzleConfig): TiDBServerlessDatabase & { + $client: '$client is not available on drizzle.mock()'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js new file mode 100644 index 0000000000000000000000000000000000000000..b930f77e5d61b6215febe4e5deaba0d51ae1ecc4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js @@ -0,0 +1,71 @@ +import { connect } from "@tidbcloud/serverless"; +import { entityKind } from "../entity.js"; +import { DefaultLogger } from "../logger.js"; +import { MySqlDatabase } from "../mysql-core/db.js"; +import { MySqlDialect } from "../mysql-core/dialect.js"; +import { + createTableRelationsHelpers, + extractTablesRelationalConfig +} from "../relations.js"; +import { isConfig } from "../utils.js"; +import { TiDBServerlessSession } from "./session.js"; +class TiDBServerlessDatabase extends MySqlDatabase { + static [entityKind] = "TiDBServerlessDatabase"; +} +function construct(client, config = {}) { + const dialect = new MySqlDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = extractTablesRelationalConfig( + config.schema, + createTableRelationsHelpers + ); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const session = new TiDBServerlessSession(client, dialect, void 0, schema, { logger, cache: config.cache }); + const db = new TiDBServerlessDatabase(dialect, session, schema, "default"); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +function drizzle(...params) { + if (typeof params[0] === "string") { + const instance = connect({ + url: params[0] + }); + return construct(instance, params[1]); + } + if (isConfig(params[0])) { + const { connection, client, ...drizzleConfig } = params[0]; + if (client) return construct(client, drizzleConfig); + const instance = typeof connection === "string" ? connect({ + url: connection + }) : connect(connection); + return construct(instance, drizzleConfig); + } + return construct(params[0], params[1]); +} +((drizzle2) => { + function mock(config) { + return construct({}, config); + } + drizzle2.mock = mock; +})(drizzle || (drizzle = {})); +export { + TiDBServerlessDatabase, + drizzle +}; +//# sourceMappingURL=driver.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b657e35df66f4079d55f66a913cec3a53f52f6ae --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/driver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/driver.ts"],"sourcesContent":["import { type Config, connect, type Connection } from '@tidbcloud/serverless';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { MySqlDatabase } from '~/mysql-core/db.ts';\nimport { MySqlDialect } from '~/mysql-core/dialect.ts';\nimport {\n\tcreateTableRelationsHelpers,\n\textractTablesRelationalConfig,\n\ttype RelationalSchemaConfig,\n\ttype TablesRelationalConfig,\n} from '~/relations.ts';\nimport { type DrizzleConfig, isConfig } from '~/utils.ts';\nimport type { TiDBServerlessPreparedQueryHKT, TiDBServerlessQueryResultHKT } from './session.ts';\nimport { TiDBServerlessSession } from './session.ts';\n\nexport interface TiDBServerlessSDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class TiDBServerlessDatabase<\n\tTSchema extends Record = Record,\n> extends MySqlDatabase {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessDatabase';\n}\n\nfunction construct = Record>(\n\tclient: Connection,\n\tconfig: DrizzleConfig = {},\n): TiDBServerlessDatabase & {\n\t$client: Connection;\n} {\n\tconst dialect = new MySqlDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\tconfig.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst session = new TiDBServerlessSession(client, dialect, undefined, schema, { logger, cache: config.cache });\n\tconst db = new TiDBServerlessDatabase(dialect, session, schema as any, 'default') as TiDBServerlessDatabase;\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n\nexport function drizzle<\n\tTSchema extends Record = Record,\n\tTClient extends Connection = Connection,\n>(\n\t...params: [\n\t\tTClient | string,\n\t] | [\n\t\tTClient | string,\n\t\tDrizzleConfig,\n\t] | [\n\t\t& ({\n\t\t\tconnection: string | Config;\n\t\t} | {\n\t\t\tclient: TClient;\n\t\t})\n\t\t& DrizzleConfig,\n\t]\n): TiDBServerlessDatabase & {\n\t$client: TClient;\n} {\n\tif (typeof params[0] === 'string') {\n\t\tconst instance = connect({\n\t\t\turl: params[0],\n\t\t});\n\n\t\treturn construct(instance, params[1]) as any;\n\t}\n\n\tif (isConfig(params[0])) {\n\t\tconst { connection, client, ...drizzleConfig } = params[0] as\n\t\t\t& { connection?: Config | string; client?: TClient }\n\t\t\t& DrizzleConfig;\n\n\t\tif (client) return construct(client, drizzleConfig) as any;\n\n\t\tconst instance = typeof connection === 'string'\n\t\t\t? connect({\n\t\t\t\turl: connection,\n\t\t\t})\n\t\t\t: connect(connection!);\n\n\t\treturn construct(instance, drizzleConfig) as any;\n\t}\n\n\treturn construct(params[0] as TClient, params[1] as DrizzleConfig | undefined) as any;\n}\n\nexport namespace drizzle {\n\texport function mock = Record>(\n\t\tconfig?: DrizzleConfig,\n\t): TiDBServerlessDatabase & {\n\t\t$client: '$client is not available on drizzle.mock()';\n\t} {\n\t\treturn construct({} as any, config) as any;\n\t}\n}\n"],"mappings":"AAAA,SAAsB,eAAgC;AACtD,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP,SAA6B,gBAAgB;AAE7C,SAAS,6BAA6B;AAO/B,MAAM,+BAEH,cAAqF;AAAA,EAC9F,QAA0B,UAAU,IAAY;AACjD;AAEA,SAAS,UACR,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,aAAa,EAAE,QAAQ,OAAO,OAAO,CAAC;AAC1D,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,cAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,eAAe;AAAA,MACpB,OAAO;AAAA,MACP;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,UAAU,IAAI,sBAAsB,QAAQ,SAAS,QAAW,QAAQ,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAC7G,QAAM,KAAK,IAAI,uBAAuB,SAAS,SAAS,QAAe,SAAS;AAChF,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;AAEO,SAAS,WAIZ,QAeF;AACD,MAAI,OAAO,OAAO,CAAC,MAAM,UAAU;AAClC,UAAM,WAAW,QAAQ;AAAA,MACxB,KAAK,OAAO,CAAC;AAAA,IACd,CAAC;AAED,WAAO,UAAU,UAAU,OAAO,CAAC,CAAC;AAAA,EACrC;AAEA,MAAI,SAAS,OAAO,CAAC,CAAC,GAAG;AACxB,UAAM,EAAE,YAAY,QAAQ,GAAG,cAAc,IAAI,OAAO,CAAC;AAIzD,QAAI,OAAQ,QAAO,UAAU,QAAQ,aAAa;AAElD,UAAM,WAAW,OAAO,eAAe,WACpC,QAAQ;AAAA,MACT,KAAK;AAAA,IACN,CAAC,IACC,QAAQ,UAAW;AAEtB,WAAO,UAAU,UAAU,aAAa;AAAA,EACzC;AAEA,SAAO,UAAU,OAAO,CAAC,GAAc,OAAO,CAAC,CAAuC;AACvF;AAAA,CAEO,CAAUA,aAAV;AACC,WAAS,KACf,QAGC;AACD,WAAO,UAAU,CAAC,GAAU,MAAM;AAAA,EACnC;AANO,EAAAA,SAAS;AAAA,GADA;","names":["drizzle"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..3f1a462e7bdca59493c0b00e8d881dba86e6b6ea --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var tidb_serverless_exports = {}; +module.exports = __toCommonJS(tidb_serverless_exports); +__reExport(tidb_serverless_exports, require("./driver.cjs"), module.exports); +__reExport(tidb_serverless_exports, require("./session.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./driver.cjs"), + ...require("./session.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..078df12bc1f928a01d2c76c50f5995eabb39d211 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAc,wBAAd;AACA,oCAAc,yBADd;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.cts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..b7d749dade04d95ea95fff584a889f4704f5d86f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.cts @@ -0,0 +1,2 @@ +export * from "./driver.cjs"; +export * from "./session.cjs"; diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.ts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b74eaceb03f40303e798cdb14943536693db242b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.d.ts @@ -0,0 +1,2 @@ +export * from "./driver.js"; +export * from "./session.js"; diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6a77b476c19f87ef52c4b4bd27bb1eff3c095323 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js @@ -0,0 +1,3 @@ +export * from "./driver.js"; +export * from "./session.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..30de15bd48d68abdd3f14644a2c3f93357f20239 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs new file mode 100644 index 0000000000000000000000000000000000000000..cb9d36fd8021e1acada1fad41d1b03aa935a670c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var migrator_exports = {}; +__export(migrator_exports, { + migrate: () => migrate +}); +module.exports = __toCommonJS(migrator_exports); +var import_migrator = require("../migrator.cjs"); +async function migrate(db, config) { + const migrations = (0, import_migrator.readMigrationFiles)(config); + await db.dialect.migrate(migrations, db.session, config); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + migrate +}); +//# sourceMappingURL=migrator.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..1fe36774a8d2bdacdf16f27cb15a9167b3d1bec4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { TiDBServerlessDatabase } from './driver.ts';\n\nexport async function migrate>(\n\tdb: TiDBServerlessDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.cts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..ea1ecda992b92a4fd7c42891d1b6e1e0d43a75d7 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.cts @@ -0,0 +1,3 @@ +import type { MigrationConfig } from "../migrator.cjs"; +import type { TiDBServerlessDatabase } from "./driver.cjs"; +export declare function migrate>(db: TiDBServerlessDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.ts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f662c9877b9f275a9bbf809329dc52cdf3079fe --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.d.ts @@ -0,0 +1,3 @@ +import type { MigrationConfig } from "../migrator.js"; +import type { TiDBServerlessDatabase } from "./driver.js"; +export declare function migrate>(db: TiDBServerlessDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js new file mode 100644 index 0000000000000000000000000000000000000000..75bc685b6186d6cd8c0307f9229368d22d4a790e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js @@ -0,0 +1,9 @@ +import { readMigrationFiles } from "../migrator.js"; +async function migrate(db, config) { + const migrations = readMigrationFiles(config); + await db.dialect.migrate(migrations, db.session, config); +} +export { + migrate +}; +//# sourceMappingURL=migrator.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1bac52ce9423957886f9aa6ec4e0c98559ed5a57 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/migrator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { TiDBServerlessDatabase } from './driver.ts';\n\nexport async function migrate>(\n\tdb: TiDBServerlessDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs new file mode 100644 index 0000000000000000000000000000000000000000..d6c5da2d8d07bc3330ff71fb1ef3cf90f16980ac --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs @@ -0,0 +1,179 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var session_exports = {}; +__export(session_exports, { + TiDBServerlessPreparedQuery: () => TiDBServerlessPreparedQuery, + TiDBServerlessSession: () => TiDBServerlessSession, + TiDBServerlessTransaction: () => TiDBServerlessTransaction +}); +module.exports = __toCommonJS(session_exports); +var import_core = require("../cache/core/index.cjs"); +var import_column = require("../column.cjs"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_session = require("../mysql-core/session.cjs"); +var import_sql = require("../sql/sql.cjs"); +var import_utils = require("../utils.cjs"); +const executeRawConfig = { fullResult: true }; +const queryConfig = { arrayMode: true }; +class TiDBServerlessPreparedQuery extends import_session.MySqlPreparedQuery { + constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, customResultMapper, generatedIds, returningIds) { + super(cache, queryMetadata, cacheConfig); + this.client = client; + this.queryString = queryString; + this.params = params; + this.logger = logger; + this.fields = fields; + this.customResultMapper = customResultMapper; + this.generatedIds = generatedIds; + this.returningIds = returningIds; + } + static [import_entity.entityKind] = "TiDBPreparedQuery"; + async execute(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues); + this.logger.logQuery(this.queryString, params); + const { fields, client, queryString, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this; + if (!fields && !customResultMapper) { + const res = await this.queryWithCache(queryString, params, async () => { + return await client.execute(queryString, params, executeRawConfig); + }); + const insertId = res.lastInsertId ?? 0; + const affectedRows = res.rowsAffected ?? 0; + if (returningIds) { + const returningResponse = []; + let j = 0; + for (let i = insertId; i < insertId + affectedRows; i++) { + for (const column of returningIds) { + const key = returningIds[0].path[0]; + if ((0, import_entity.is)(column.field, import_column.Column)) { + if (column.field.primary && column.field.autoIncrement) { + returningResponse.push({ [key]: i }); + } + if (column.field.defaultFn && generatedIds) { + returningResponse.push({ [key]: generatedIds[j][key] }); + } + } + } + j++; + } + return returningResponse; + } + return res; + } + const rows = await this.queryWithCache(queryString, params, async () => { + return await client.execute(queryString, params, queryConfig); + }); + if (customResultMapper) { + return customResultMapper(rows); + } + return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap)); + } + iterator(_placeholderValues) { + throw new Error("Streaming is not supported by the TiDB Cloud Serverless driver"); + } +} +class TiDBServerlessSession extends import_session.MySqlSession { + constructor(baseClient, dialect, tx, schema, options = {}) { + super(dialect); + this.baseClient = baseClient; + this.schema = schema; + this.options = options; + this.client = tx ?? baseClient; + this.logger = options.logger ?? new import_logger.NoopLogger(); + this.cache = options.cache ?? new import_core.NoopCache(); + } + static [import_entity.entityKind] = "TiDBServerlessSession"; + logger; + client; + cache; + prepareQuery(query, fields, customResultMapper, generatedIds, returningIds, queryMetadata, cacheConfig) { + return new TiDBServerlessPreparedQuery( + this.client, + query.sql, + query.params, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + customResultMapper, + generatedIds, + returningIds + ); + } + all(query) { + const querySql = this.dialect.sqlToQuery(query); + this.logger.logQuery(querySql.sql, querySql.params); + return this.client.execute(querySql.sql, querySql.params); + } + async count(sql2) { + const res = await this.execute(sql2); + return Number( + res["rows"][0]["count"] + ); + } + async transaction(transaction) { + const nativeTx = await this.baseClient.begin(); + try { + const session = new TiDBServerlessSession(this.baseClient, this.dialect, nativeTx, this.schema, this.options); + const tx = new TiDBServerlessTransaction( + this.dialect, + session, + this.schema + ); + const result = await transaction(tx); + await nativeTx.commit(); + return result; + } catch (err) { + await nativeTx.rollback(); + throw err; + } + } +} +class TiDBServerlessTransaction extends import_session.MySqlTransaction { + static [import_entity.entityKind] = "TiDBServerlessTransaction"; + constructor(dialect, session, schema, nestedIndex = 0) { + super(dialect, session, schema, nestedIndex, "default"); + } + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex + 1}`; + const tx = new TiDBServerlessTransaction( + this.dialect, + this.session, + this.schema, + this.nestedIndex + 1 + ); + await tx.execute(import_sql.sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await tx.execute(import_sql.sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await tx.execute(import_sql.sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TiDBServerlessPreparedQuery, + TiDBServerlessSession, + TiDBServerlessTransaction +}); +//# sourceMappingURL=session.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..5fbee6e13ac79fa9399f71da0f3b11a9dd203124 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/session.ts"],"sourcesContent":["import type { Connection, ExecuteOptions, FullResult, Tx } from '@tidbcloud/serverless';\nimport { type Cache, NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { Column } from '~/column.ts';\n\nimport { entityKind, is } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { MySqlDialect } from '~/mysql-core/dialect.ts';\nimport type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types.ts';\nimport {\n\tMySqlPreparedQuery,\n\ttype MySqlPreparedQueryConfig,\n\ttype MySqlPreparedQueryHKT,\n\ttype MySqlQueryResultHKT,\n\tMySqlSession,\n\tMySqlTransaction,\n} from '~/mysql-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query, type SQL, sql } from '~/sql/sql.ts';\nimport { type Assume, mapResultRow } from '~/utils.ts';\n\nconst executeRawConfig = { fullResult: true } satisfies ExecuteOptions;\nconst queryConfig = { arrayMode: true } satisfies ExecuteOptions;\n\nexport class TiDBServerlessPreparedQuery extends MySqlPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'TiDBPreparedQuery';\n\n\tconstructor(\n\t\tprivate client: Tx | Connection,\n\t\tprivate queryString: string,\n\t\tprivate params: unknown[],\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\t// Keys that were used in $default and the value that was generated for them\n\t\tprivate generatedIds?: Record[],\n\t\t// Keys that should be returned, it has the column with all properries + key from object\n\t\tprivate returningIds?: SelectedFieldsOrdered,\n\t) {\n\t\tsuper(cache, queryMetadata, cacheConfig);\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.queryString, params);\n\n\t\tconst { fields, client, queryString, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;\n\t\tif (!fields && !customResultMapper) {\n\t\t\tconst res = await this.queryWithCache(queryString, params, async () => {\n\t\t\t\treturn await client.execute(queryString, params, executeRawConfig) as FullResult;\n\t\t\t});\n\t\t\tconst insertId = res.lastInsertId ?? 0;\n\t\t\tconst affectedRows = res.rowsAffected ?? 0;\n\t\t\t// for each row, I need to check keys from\n\t\t\tif (returningIds) {\n\t\t\t\tconst returningResponse = [];\n\t\t\t\tlet j = 0;\n\t\t\t\tfor (let i = insertId; i < insertId + affectedRows; i++) {\n\t\t\t\t\tfor (const column of returningIds) {\n\t\t\t\t\t\tconst key = returningIds[0]!.path[0]!;\n\t\t\t\t\t\tif (is(column.field, Column)) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (column.field.primary && column.field.autoIncrement) {\n\t\t\t\t\t\t\t\treturningResponse.push({ [key]: i });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (column.field.defaultFn && generatedIds) {\n\t\t\t\t\t\t\t\t// generatedIds[rowIdx][key]\n\t\t\t\t\t\t\t\treturningResponse.push({ [key]: generatedIds[j]![key] });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\n\t\t\t\treturn returningResponse;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tconst rows = await this.queryWithCache(queryString, params, async () => {\n\t\t\treturn await client.execute(queryString, params, queryConfig) as unknown[][];\n\t\t});\n\n\t\tif (customResultMapper) {\n\t\t\treturn customResultMapper(rows);\n\t\t}\n\n\t\treturn rows.map((row) => mapResultRow(fields!, row, joinsNotNullableMap));\n\t}\n\n\toverride iterator(_placeholderValues?: Record): AsyncGenerator {\n\t\tthrow new Error('Streaming is not supported by the TiDB Cloud Serverless driver');\n\t}\n}\n\nexport interface TiDBServerlessSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class TiDBServerlessSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends MySqlSession {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessSession';\n\n\tprivate logger: Logger;\n\tprivate client: Tx | Connection;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate baseClient: Connection,\n\t\tdialect: MySqlDialect,\n\t\ttx: Tx | undefined,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: TiDBServerlessSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.client = tx ?? baseClient;\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tgeneratedIds?: Record[],\n\t\treturningIds?: SelectedFieldsOrdered,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): MySqlPreparedQuery {\n\t\treturn new TiDBServerlessPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery.sql,\n\t\t\tquery.params,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tcustomResultMapper,\n\t\t\tgeneratedIds,\n\t\t\treturningIds,\n\t\t);\n\t}\n\n\toverride all(query: SQL): Promise {\n\t\tconst querySql = this.dialect.sqlToQuery(query);\n\t\tthis.logger.logQuery(querySql.sql, querySql.params);\n\t\treturn this.client.execute(querySql.sql, querySql.params) as Promise;\n\t}\n\n\toverride async count(sql: SQL): Promise {\n\t\tconst res = await this.execute<{ rows: [{ count: string }] }>(sql);\n\n\t\treturn Number(\n\t\t\tres['rows'][0]['count'],\n\t\t);\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: TiDBServerlessTransaction) => Promise,\n\t): Promise {\n\t\tconst nativeTx = await this.baseClient.begin();\n\t\ttry {\n\t\t\tconst session = new TiDBServerlessSession(this.baseClient, this.dialect, nativeTx, this.schema, this.options);\n\t\t\tconst tx = new TiDBServerlessTransaction(\n\t\t\t\tthis.dialect,\n\t\t\t\tsession as MySqlSession,\n\t\t\t\tthis.schema,\n\t\t\t);\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait nativeTx.commit();\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait nativeTx.rollback();\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport class TiDBServerlessTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends MySqlTransaction {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessTransaction';\n\n\tconstructor(\n\t\tdialect: MySqlDialect,\n\t\tsession: MySqlSession,\n\t\tschema: RelationalSchemaConfig | undefined,\n\t\tnestedIndex = 0,\n\t) {\n\t\tsuper(dialect, session, schema, nestedIndex, 'default');\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: TiDBServerlessTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new TiDBServerlessTransaction(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis.schema,\n\t\t\tthis.nestedIndex + 1,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport interface TiDBServerlessQueryResultHKT extends MySqlQueryResultHKT {\n\ttype: FullResult;\n}\n\nexport interface TiDBServerlessPreparedQueryHKT extends MySqlPreparedQueryHKT {\n\ttype: TiDBServerlessPreparedQuery>;\n}\n"],"mappings":"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","names":["sql"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.cts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..42355ac019466c26ed75c808cbdace877b96cce2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.cts @@ -0,0 +1,60 @@ +import type { Connection, FullResult, Tx } from '@tidbcloud/serverless'; +import { type Cache } from "../cache/core/index.cjs"; +import type { WithCacheConfig } from "../cache/core/types.cjs"; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import type { MySqlDialect } from "../mysql-core/dialect.cjs"; +import type { SelectedFieldsOrdered } from "../mysql-core/query-builders/select.types.cjs"; +import { MySqlPreparedQuery, type MySqlPreparedQueryConfig, type MySqlPreparedQueryHKT, type MySqlQueryResultHKT, MySqlSession, MySqlTransaction } from "../mysql-core/session.cjs"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs"; +import { type Query, type SQL } from "../sql/sql.cjs"; +import { type Assume } from "../utils.cjs"; +export declare class TiDBServerlessPreparedQuery extends MySqlPreparedQuery { + private client; + private queryString; + private params; + private logger; + private fields; + private customResultMapper?; + private generatedIds?; + private returningIds?; + static readonly [entityKind]: string; + constructor(client: Tx | Connection, queryString: string, params: unknown[], logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined, generatedIds?: Record[] | undefined, returningIds?: SelectedFieldsOrdered | undefined); + execute(placeholderValues?: Record | undefined): Promise; + iterator(_placeholderValues?: Record): AsyncGenerator; +} +export interface TiDBServerlessSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class TiDBServerlessSession, TSchema extends TablesRelationalConfig> extends MySqlSession { + private baseClient; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private client; + private cache; + constructor(baseClient: Connection, dialect: MySqlDialect, tx: Tx | undefined, schema: RelationalSchemaConfig | undefined, options?: TiDBServerlessSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, customResultMapper?: (rows: unknown[][]) => T['execute'], generatedIds?: Record[], returningIds?: SelectedFieldsOrdered, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): MySqlPreparedQuery; + all(query: SQL): Promise; + count(sql: SQL): Promise; + transaction(transaction: (tx: TiDBServerlessTransaction) => Promise): Promise; +} +export declare class TiDBServerlessTransaction, TSchema extends TablesRelationalConfig> extends MySqlTransaction { + static readonly [entityKind]: string; + constructor(dialect: MySqlDialect, session: MySqlSession, schema: RelationalSchemaConfig | undefined, nestedIndex?: number); + transaction(transaction: (tx: TiDBServerlessTransaction) => Promise): Promise; +} +export interface TiDBServerlessQueryResultHKT extends MySqlQueryResultHKT { + type: FullResult; +} +export interface TiDBServerlessPreparedQueryHKT extends MySqlPreparedQueryHKT { + type: TiDBServerlessPreparedQuery>; +} diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.ts b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..673de3d609d82ae6869863bb01331b00b23f6e97 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.d.ts @@ -0,0 +1,60 @@ +import type { Connection, FullResult, Tx } from '@tidbcloud/serverless'; +import { type Cache } from "../cache/core/index.js"; +import type { WithCacheConfig } from "../cache/core/types.js"; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import type { MySqlDialect } from "../mysql-core/dialect.js"; +import type { SelectedFieldsOrdered } from "../mysql-core/query-builders/select.types.js"; +import { MySqlPreparedQuery, type MySqlPreparedQueryConfig, type MySqlPreparedQueryHKT, type MySqlQueryResultHKT, MySqlSession, MySqlTransaction } from "../mysql-core/session.js"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js"; +import { type Query, type SQL } from "../sql/sql.js"; +import { type Assume } from "../utils.js"; +export declare class TiDBServerlessPreparedQuery extends MySqlPreparedQuery { + private client; + private queryString; + private params; + private logger; + private fields; + private customResultMapper?; + private generatedIds?; + private returningIds?; + static readonly [entityKind]: string; + constructor(client: Tx | Connection, queryString: string, params: unknown[], logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined, generatedIds?: Record[] | undefined, returningIds?: SelectedFieldsOrdered | undefined); + execute(placeholderValues?: Record | undefined): Promise; + iterator(_placeholderValues?: Record): AsyncGenerator; +} +export interface TiDBServerlessSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class TiDBServerlessSession, TSchema extends TablesRelationalConfig> extends MySqlSession { + private baseClient; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private client; + private cache; + constructor(baseClient: Connection, dialect: MySqlDialect, tx: Tx | undefined, schema: RelationalSchemaConfig | undefined, options?: TiDBServerlessSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, customResultMapper?: (rows: unknown[][]) => T['execute'], generatedIds?: Record[], returningIds?: SelectedFieldsOrdered, queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): MySqlPreparedQuery; + all(query: SQL): Promise; + count(sql: SQL): Promise; + transaction(transaction: (tx: TiDBServerlessTransaction) => Promise): Promise; +} +export declare class TiDBServerlessTransaction, TSchema extends TablesRelationalConfig> extends MySqlTransaction { + static readonly [entityKind]: string; + constructor(dialect: MySqlDialect, session: MySqlSession, schema: RelationalSchemaConfig | undefined, nestedIndex?: number); + transaction(transaction: (tx: TiDBServerlessTransaction) => Promise): Promise; +} +export interface TiDBServerlessQueryResultHKT extends MySqlQueryResultHKT { + type: FullResult; +} +export interface TiDBServerlessPreparedQueryHKT extends MySqlPreparedQueryHKT { + type: TiDBServerlessPreparedQuery>; +} diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js new file mode 100644 index 0000000000000000000000000000000000000000..494ead9bb6ad76282cbe13a80441d8c1b5b435e2 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js @@ -0,0 +1,157 @@ +import { NoopCache } from "../cache/core/index.js"; +import { Column } from "../column.js"; +import { entityKind, is } from "../entity.js"; +import { NoopLogger } from "../logger.js"; +import { + MySqlPreparedQuery, + MySqlSession, + MySqlTransaction +} from "../mysql-core/session.js"; +import { fillPlaceholders, sql } from "../sql/sql.js"; +import { mapResultRow } from "../utils.js"; +const executeRawConfig = { fullResult: true }; +const queryConfig = { arrayMode: true }; +class TiDBServerlessPreparedQuery extends MySqlPreparedQuery { + constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, customResultMapper, generatedIds, returningIds) { + super(cache, queryMetadata, cacheConfig); + this.client = client; + this.queryString = queryString; + this.params = params; + this.logger = logger; + this.fields = fields; + this.customResultMapper = customResultMapper; + this.generatedIds = generatedIds; + this.returningIds = returningIds; + } + static [entityKind] = "TiDBPreparedQuery"; + async execute(placeholderValues = {}) { + const params = fillPlaceholders(this.params, placeholderValues); + this.logger.logQuery(this.queryString, params); + const { fields, client, queryString, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this; + if (!fields && !customResultMapper) { + const res = await this.queryWithCache(queryString, params, async () => { + return await client.execute(queryString, params, executeRawConfig); + }); + const insertId = res.lastInsertId ?? 0; + const affectedRows = res.rowsAffected ?? 0; + if (returningIds) { + const returningResponse = []; + let j = 0; + for (let i = insertId; i < insertId + affectedRows; i++) { + for (const column of returningIds) { + const key = returningIds[0].path[0]; + if (is(column.field, Column)) { + if (column.field.primary && column.field.autoIncrement) { + returningResponse.push({ [key]: i }); + } + if (column.field.defaultFn && generatedIds) { + returningResponse.push({ [key]: generatedIds[j][key] }); + } + } + } + j++; + } + return returningResponse; + } + return res; + } + const rows = await this.queryWithCache(queryString, params, async () => { + return await client.execute(queryString, params, queryConfig); + }); + if (customResultMapper) { + return customResultMapper(rows); + } + return rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap)); + } + iterator(_placeholderValues) { + throw new Error("Streaming is not supported by the TiDB Cloud Serverless driver"); + } +} +class TiDBServerlessSession extends MySqlSession { + constructor(baseClient, dialect, tx, schema, options = {}) { + super(dialect); + this.baseClient = baseClient; + this.schema = schema; + this.options = options; + this.client = tx ?? baseClient; + this.logger = options.logger ?? new NoopLogger(); + this.cache = options.cache ?? new NoopCache(); + } + static [entityKind] = "TiDBServerlessSession"; + logger; + client; + cache; + prepareQuery(query, fields, customResultMapper, generatedIds, returningIds, queryMetadata, cacheConfig) { + return new TiDBServerlessPreparedQuery( + this.client, + query.sql, + query.params, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + customResultMapper, + generatedIds, + returningIds + ); + } + all(query) { + const querySql = this.dialect.sqlToQuery(query); + this.logger.logQuery(querySql.sql, querySql.params); + return this.client.execute(querySql.sql, querySql.params); + } + async count(sql2) { + const res = await this.execute(sql2); + return Number( + res["rows"][0]["count"] + ); + } + async transaction(transaction) { + const nativeTx = await this.baseClient.begin(); + try { + const session = new TiDBServerlessSession(this.baseClient, this.dialect, nativeTx, this.schema, this.options); + const tx = new TiDBServerlessTransaction( + this.dialect, + session, + this.schema + ); + const result = await transaction(tx); + await nativeTx.commit(); + return result; + } catch (err) { + await nativeTx.rollback(); + throw err; + } + } +} +class TiDBServerlessTransaction extends MySqlTransaction { + static [entityKind] = "TiDBServerlessTransaction"; + constructor(dialect, session, schema, nestedIndex = 0) { + super(dialect, session, schema, nestedIndex, "default"); + } + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex + 1}`; + const tx = new TiDBServerlessTransaction( + this.dialect, + this.session, + this.schema, + this.nestedIndex + 1 + ); + await tx.execute(sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await tx.execute(sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await tx.execute(sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +export { + TiDBServerlessPreparedQuery, + TiDBServerlessSession, + TiDBServerlessTransaction +}; +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js.map b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js.map new file mode 100644 index 0000000000000000000000000000000000000000..06cbc22705840c5472355d7a918da1c1f5da06c3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tidb-serverless/session.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/tidb-serverless/session.ts"],"sourcesContent":["import type { Connection, ExecuteOptions, FullResult, Tx } from '@tidbcloud/serverless';\nimport { type Cache, NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { Column } from '~/column.ts';\n\nimport { entityKind, is } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { MySqlDialect } from '~/mysql-core/dialect.ts';\nimport type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types.ts';\nimport {\n\tMySqlPreparedQuery,\n\ttype MySqlPreparedQueryConfig,\n\ttype MySqlPreparedQueryHKT,\n\ttype MySqlQueryResultHKT,\n\tMySqlSession,\n\tMySqlTransaction,\n} from '~/mysql-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query, type SQL, sql } from '~/sql/sql.ts';\nimport { type Assume, mapResultRow } from '~/utils.ts';\n\nconst executeRawConfig = { fullResult: true } satisfies ExecuteOptions;\nconst queryConfig = { arrayMode: true } satisfies ExecuteOptions;\n\nexport class TiDBServerlessPreparedQuery extends MySqlPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'TiDBPreparedQuery';\n\n\tconstructor(\n\t\tprivate client: Tx | Connection,\n\t\tprivate queryString: string,\n\t\tprivate params: unknown[],\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\t// Keys that were used in $default and the value that was generated for them\n\t\tprivate generatedIds?: Record[],\n\t\t// Keys that should be returned, it has the column with all properries + key from object\n\t\tprivate returningIds?: SelectedFieldsOrdered,\n\t) {\n\t\tsuper(cache, queryMetadata, cacheConfig);\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.queryString, params);\n\n\t\tconst { fields, client, queryString, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;\n\t\tif (!fields && !customResultMapper) {\n\t\t\tconst res = await this.queryWithCache(queryString, params, async () => {\n\t\t\t\treturn await client.execute(queryString, params, executeRawConfig) as FullResult;\n\t\t\t});\n\t\t\tconst insertId = res.lastInsertId ?? 0;\n\t\t\tconst affectedRows = res.rowsAffected ?? 0;\n\t\t\t// for each row, I need to check keys from\n\t\t\tif (returningIds) {\n\t\t\t\tconst returningResponse = [];\n\t\t\t\tlet j = 0;\n\t\t\t\tfor (let i = insertId; i < insertId + affectedRows; i++) {\n\t\t\t\t\tfor (const column of returningIds) {\n\t\t\t\t\t\tconst key = returningIds[0]!.path[0]!;\n\t\t\t\t\t\tif (is(column.field, Column)) {\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\tif (column.field.primary && column.field.autoIncrement) {\n\t\t\t\t\t\t\t\treturningResponse.push({ [key]: i });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (column.field.defaultFn && generatedIds) {\n\t\t\t\t\t\t\t\t// generatedIds[rowIdx][key]\n\t\t\t\t\t\t\t\treturningResponse.push({ [key]: generatedIds[j]![key] });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tj++;\n\t\t\t\t}\n\n\t\t\t\treturn returningResponse;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tconst rows = await this.queryWithCache(queryString, params, async () => {\n\t\t\treturn await client.execute(queryString, params, queryConfig) as unknown[][];\n\t\t});\n\n\t\tif (customResultMapper) {\n\t\t\treturn customResultMapper(rows);\n\t\t}\n\n\t\treturn rows.map((row) => mapResultRow(fields!, row, joinsNotNullableMap));\n\t}\n\n\toverride iterator(_placeholderValues?: Record): AsyncGenerator {\n\t\tthrow new Error('Streaming is not supported by the TiDB Cloud Serverless driver');\n\t}\n}\n\nexport interface TiDBServerlessSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class TiDBServerlessSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends MySqlSession {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessSession';\n\n\tprivate logger: Logger;\n\tprivate client: Tx | Connection;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate baseClient: Connection,\n\t\tdialect: MySqlDialect,\n\t\ttx: Tx | undefined,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: TiDBServerlessSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.client = tx ?? baseClient;\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tgeneratedIds?: Record[],\n\t\treturningIds?: SelectedFieldsOrdered,\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): MySqlPreparedQuery {\n\t\treturn new TiDBServerlessPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery.sql,\n\t\t\tquery.params,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tcustomResultMapper,\n\t\t\tgeneratedIds,\n\t\t\treturningIds,\n\t\t);\n\t}\n\n\toverride all(query: SQL): Promise {\n\t\tconst querySql = this.dialect.sqlToQuery(query);\n\t\tthis.logger.logQuery(querySql.sql, querySql.params);\n\t\treturn this.client.execute(querySql.sql, querySql.params) as Promise;\n\t}\n\n\toverride async count(sql: SQL): Promise {\n\t\tconst res = await this.execute<{ rows: [{ count: string }] }>(sql);\n\n\t\treturn Number(\n\t\t\tres['rows'][0]['count'],\n\t\t);\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: TiDBServerlessTransaction) => Promise,\n\t): Promise {\n\t\tconst nativeTx = await this.baseClient.begin();\n\t\ttry {\n\t\t\tconst session = new TiDBServerlessSession(this.baseClient, this.dialect, nativeTx, this.schema, this.options);\n\t\t\tconst tx = new TiDBServerlessTransaction(\n\t\t\t\tthis.dialect,\n\t\t\t\tsession as MySqlSession,\n\t\t\t\tthis.schema,\n\t\t\t);\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait nativeTx.commit();\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait nativeTx.rollback();\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport class TiDBServerlessTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends MySqlTransaction {\n\tstatic override readonly [entityKind]: string = 'TiDBServerlessTransaction';\n\n\tconstructor(\n\t\tdialect: MySqlDialect,\n\t\tsession: MySqlSession,\n\t\tschema: RelationalSchemaConfig | undefined,\n\t\tnestedIndex = 0,\n\t) {\n\t\tsuper(dialect, session, schema, nestedIndex, 'default');\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: TiDBServerlessTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new TiDBServerlessTransaction(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis.schema,\n\t\t\tthis.nestedIndex + 1,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport interface TiDBServerlessQueryResultHKT extends MySqlQueryResultHKT {\n\ttype: FullResult;\n}\n\nexport interface TiDBServerlessPreparedQueryHKT extends MySqlPreparedQueryHKT {\n\ttype: TiDBServerlessPreparedQuery>;\n}\n"],"mappings":"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","names":["sql"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs b/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs new file mode 100644 index 0000000000000000000000000000000000000000..240751bf1119c64f9c661c62c99e4a47108a9cfd --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs @@ -0,0 +1,31 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var tracing_utils_exports = {}; +__export(tracing_utils_exports, { + iife: () => iife +}); +module.exports = __toCommonJS(tracing_utils_exports); +function iife(fn, ...args) { + return fn(...args); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + iife +}); +//# sourceMappingURL=tracing-utils.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs.map b/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..fc0b1e89ffb9083066f51389efd0b48cef95117e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/tracing-utils.ts"],"sourcesContent":["export function iife(fn: (...args: T) => U, ...args: T): U {\n\treturn fn(...args);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,KAA6B,OAA0B,MAAY;AAClF,SAAO,GAAG,GAAG,IAAI;AAClB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.d.cts b/e-commerce/node_modules/drizzle-orm/tracing-utils.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..237d9288238cb05f5607163a2ab43bc15d18c272 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.d.cts @@ -0,0 +1 @@ +export declare function iife(fn: (...args: T) => U, ...args: T): U; diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.d.ts b/e-commerce/node_modules/drizzle-orm/tracing-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..237d9288238cb05f5607163a2ab43bc15d18c272 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.d.ts @@ -0,0 +1 @@ +export declare function iife(fn: (...args: T) => U, ...args: T): U; diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.js b/e-commerce/node_modules/drizzle-orm/tracing-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..686c640ed38aa40ccb090a1e97cf8514376aba10 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.js @@ -0,0 +1,7 @@ +function iife(fn, ...args) { + return fn(...args); +} +export { + iife +}; +//# sourceMappingURL=tracing-utils.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing-utils.js.map b/e-commerce/node_modules/drizzle-orm/tracing-utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3e6b73070190085e0bc4c6d4849bb9fc72092884 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing-utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/tracing-utils.ts"],"sourcesContent":["export function iife(fn: (...args: T) => U, ...args: T): U {\n\treturn fn(...args);\n}\n"],"mappings":"AAAO,SAAS,KAA6B,OAA0B,MAAY;AAClF,SAAO,GAAG,GAAG,IAAI;AAClB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing.cjs b/e-commerce/node_modules/drizzle-orm/tracing.cjs new file mode 100644 index 0000000000000000000000000000000000000000..5cc4f51ed99fe53fcf1635633f40b3491c13a128 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.cjs @@ -0,0 +1,63 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var tracing_exports = {}; +__export(tracing_exports, { + tracer: () => tracer +}); +module.exports = __toCommonJS(tracing_exports); +var import_tracing_utils = require("./tracing-utils.cjs"); +var import_version = require("./version.cjs"); +let otel; +let rawTracer; +const tracer = { + startActiveSpan(name, fn) { + if (!otel) { + return fn(); + } + if (!rawTracer) { + rawTracer = otel.trace.getTracer("drizzle-orm", import_version.npmVersion); + } + return (0, import_tracing_utils.iife)( + (otel2, rawTracer2) => rawTracer2.startActiveSpan( + name, + (span) => { + try { + return fn(span); + } catch (e) { + span.setStatus({ + code: otel2.SpanStatusCode.ERROR, + message: e instanceof Error ? e.message : "Unknown error" + // eslint-disable-line no-instanceof/no-instanceof + }); + throw e; + } finally { + span.end(); + } + } + ), + otel, + rawTracer + ); + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + tracer +}); +//# sourceMappingURL=tracing.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing.cjs.map b/e-commerce/node_modules/drizzle-orm/tracing.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..ee57a84e9a9c86d04ad2fac8debb73aad75900eb --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/tracing.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { iife } from '~/tracing-utils.ts';\nimport { npmVersion } from '~/version.ts';\n\nlet otel: typeof import('@opentelemetry/api') | undefined;\nlet rawTracer: Tracer | undefined;\n// try {\n// \totel = await import('@opentelemetry/api');\n// } catch (err: any) {\n// \tif (err.code !== 'MODULE_NOT_FOUND' && err.code !== 'ERR_MODULE_NOT_FOUND') {\n// \t\tthrow err;\n// \t}\n// }\n\ntype SpanName =\n\t| 'drizzle.operation'\n\t| 'drizzle.prepareQuery'\n\t| 'drizzle.buildSQL'\n\t| 'drizzle.execute'\n\t| 'drizzle.driver.execute'\n\t| 'drizzle.mapResponse';\n\n/** @internal */\nexport const tracer = {\n\tstartActiveSpan unknown>(name: SpanName, fn: F): ReturnType {\n\t\tif (!otel) {\n\t\t\treturn fn() as ReturnType;\n\t\t}\n\n\t\tif (!rawTracer) {\n\t\t\trawTracer = otel.trace.getTracer('drizzle-orm', npmVersion);\n\t\t}\n\n\t\treturn iife(\n\t\t\t(otel, rawTracer) =>\n\t\t\t\trawTracer.startActiveSpan(\n\t\t\t\t\tname,\n\t\t\t\t\t((span: Span) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn fn(span);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tspan.setStatus({\n\t\t\t\t\t\t\t\tcode: otel.SpanStatusCode.ERROR,\n\t\t\t\t\t\t\t\tmessage: e instanceof Error ? e.message : 'Unknown error', // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tspan.end();\n\t\t\t\t\t\t}\n\t\t\t\t\t}) as F,\n\t\t\t\t),\n\t\t\totel,\n\t\t\trawTracer,\n\t\t);\n\t},\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAqB;AACrB,qBAA2B;AAE3B,IAAI;AACJ,IAAI;AAkBG,MAAM,SAAS;AAAA,EACrB,gBAAoD,MAAgB,IAAsB;AACzF,QAAI,CAAC,MAAM;AACV,aAAO,GAAG;AAAA,IACX;AAEA,QAAI,CAAC,WAAW;AACf,kBAAY,KAAK,MAAM,UAAU,eAAe,yBAAU;AAAA,IAC3D;AAEA,eAAO;AAAA,MACN,CAACA,OAAMC,eACNA,WAAU;AAAA,QACT;AAAA,QACC,CAAC,SAAe;AAChB,cAAI;AACH,mBAAO,GAAG,IAAI;AAAA,UACf,SAAS,GAAG;AACX,iBAAK,UAAU;AAAA,cACd,MAAMD,MAAK,eAAe;AAAA,cAC1B,SAAS,aAAa,QAAQ,EAAE,UAAU;AAAA;AAAA,YAC3C,CAAC;AACD,kBAAM;AAAA,UACP,UAAE;AACD,iBAAK,IAAI;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;","names":["otel","rawTracer"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing.d.cts b/e-commerce/node_modules/drizzle-orm/tracing.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.d.cts @@ -0,0 +1 @@ +export {}; diff --git a/e-commerce/node_modules/drizzle-orm/tracing.d.ts b/e-commerce/node_modules/drizzle-orm/tracing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/e-commerce/node_modules/drizzle-orm/tracing.js b/e-commerce/node_modules/drizzle-orm/tracing.js new file mode 100644 index 0000000000000000000000000000000000000000..a7c471bf9e589d03f63e4dba012d14e1aed9a9d3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.js @@ -0,0 +1,39 @@ +import { iife } from "./tracing-utils.js"; +import { npmVersion } from "./version.js"; +let otel; +let rawTracer; +const tracer = { + startActiveSpan(name, fn) { + if (!otel) { + return fn(); + } + if (!rawTracer) { + rawTracer = otel.trace.getTracer("drizzle-orm", npmVersion); + } + return iife( + (otel2, rawTracer2) => rawTracer2.startActiveSpan( + name, + (span) => { + try { + return fn(span); + } catch (e) { + span.setStatus({ + code: otel2.SpanStatusCode.ERROR, + message: e instanceof Error ? e.message : "Unknown error" + // eslint-disable-line no-instanceof/no-instanceof + }); + throw e; + } finally { + span.end(); + } + } + ), + otel, + rawTracer + ); + } +}; +export { + tracer +}; +//# sourceMappingURL=tracing.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/tracing.js.map b/e-commerce/node_modules/drizzle-orm/tracing.js.map new file mode 100644 index 0000000000000000000000000000000000000000..448bf44d190d596444e4b984b6fd83ad662d7328 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/tracing.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/tracing.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { iife } from '~/tracing-utils.ts';\nimport { npmVersion } from '~/version.ts';\n\nlet otel: typeof import('@opentelemetry/api') | undefined;\nlet rawTracer: Tracer | undefined;\n// try {\n// \totel = await import('@opentelemetry/api');\n// } catch (err: any) {\n// \tif (err.code !== 'MODULE_NOT_FOUND' && err.code !== 'ERR_MODULE_NOT_FOUND') {\n// \t\tthrow err;\n// \t}\n// }\n\ntype SpanName =\n\t| 'drizzle.operation'\n\t| 'drizzle.prepareQuery'\n\t| 'drizzle.buildSQL'\n\t| 'drizzle.execute'\n\t| 'drizzle.driver.execute'\n\t| 'drizzle.mapResponse';\n\n/** @internal */\nexport const tracer = {\n\tstartActiveSpan unknown>(name: SpanName, fn: F): ReturnType {\n\t\tif (!otel) {\n\t\t\treturn fn() as ReturnType;\n\t\t}\n\n\t\tif (!rawTracer) {\n\t\t\trawTracer = otel.trace.getTracer('drizzle-orm', npmVersion);\n\t\t}\n\n\t\treturn iife(\n\t\t\t(otel, rawTracer) =>\n\t\t\t\trawTracer.startActiveSpan(\n\t\t\t\t\tname,\n\t\t\t\t\t((span: Span) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn fn(span);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tspan.setStatus({\n\t\t\t\t\t\t\t\tcode: otel.SpanStatusCode.ERROR,\n\t\t\t\t\t\t\t\tmessage: e instanceof Error ? e.message : 'Unknown error', // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tspan.end();\n\t\t\t\t\t\t}\n\t\t\t\t\t}) as F,\n\t\t\t\t),\n\t\t\totel,\n\t\t\trawTracer,\n\t\t);\n\t},\n};\n"],"mappings":"AACA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAE3B,IAAI;AACJ,IAAI;AAkBG,MAAM,SAAS;AAAA,EACrB,gBAAoD,MAAgB,IAAsB;AACzF,QAAI,CAAC,MAAM;AACV,aAAO,GAAG;AAAA,IACX;AAEA,QAAI,CAAC,WAAW;AACf,kBAAY,KAAK,MAAM,UAAU,eAAe,UAAU;AAAA,IAC3D;AAEA,WAAO;AAAA,MACN,CAACA,OAAMC,eACNA,WAAU;AAAA,QACT;AAAA,QACC,CAAC,SAAe;AAChB,cAAI;AACH,mBAAO,GAAG,IAAI;AAAA,UACf,SAAS,GAAG;AACX,iBAAK,UAAU;AAAA,cACd,MAAMD,MAAK,eAAe;AAAA,cAC1B,SAAS,aAAa,QAAQ,EAAE,UAAU;AAAA;AAAA,YAC3C,CAAC;AACD,kBAAM;AAAA,UACP,UAAE;AACD,iBAAK,IAAI;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,MACD;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;","names":["otel","rawTracer"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/utils.cjs b/e-commerce/node_modules/drizzle-orm/utils.cjs new file mode 100644 index 0000000000000000000000000000000000000000..1c54925f894698ce327b068534c4bcd822a28214 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.cjs @@ -0,0 +1,208 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var utils_exports = {}; +__export(utils_exports, { + applyMixins: () => applyMixins, + getColumnNameAndConfig: () => getColumnNameAndConfig, + getTableColumns: () => getTableColumns, + getTableLikeName: () => getTableLikeName, + getViewSelectedFields: () => getViewSelectedFields, + haveSameKeys: () => haveSameKeys, + isConfig: () => isConfig, + mapResultRow: () => mapResultRow, + mapUpdateSet: () => mapUpdateSet, + orderSelectedFields: () => orderSelectedFields, + textDecoder: () => textDecoder +}); +module.exports = __toCommonJS(utils_exports); +var import_column = require("./column.cjs"); +var import_entity = require("./entity.cjs"); +var import_sql = require("./sql/sql.cjs"); +var import_subquery = require("./subquery.cjs"); +var import_table = require("./table.cjs"); +var import_view_common = require("./view-common.cjs"); +function mapResultRow(columns, row, joinsNotNullableMap) { + const nullifyMap = {}; + const result = columns.reduce( + (result2, { path, field }, columnIndex) => { + let decoder; + if ((0, import_entity.is)(field, import_column.Column)) { + decoder = field; + } else if ((0, import_entity.is)(field, import_sql.SQL)) { + decoder = field.decoder; + } else if ((0, import_entity.is)(field, import_subquery.Subquery)) { + decoder = field._.sql.decoder; + } else { + decoder = field.sql.decoder; + } + let node = result2; + for (const [pathChunkIndex, pathChunk] of path.entries()) { + if (pathChunkIndex < path.length - 1) { + if (!(pathChunk in node)) { + node[pathChunk] = {}; + } + node = node[pathChunk]; + } else { + const rawValue = row[columnIndex]; + const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue); + if (joinsNotNullableMap && (0, import_entity.is)(field, import_column.Column) && path.length === 2) { + const objectName = path[0]; + if (!(objectName in nullifyMap)) { + nullifyMap[objectName] = value === null ? (0, import_table.getTableName)(field.table) : false; + } else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== (0, import_table.getTableName)(field.table)) { + nullifyMap[objectName] = false; + } + } + } + } + return result2; + }, + {} + ); + if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) { + for (const [objectName, tableName] of Object.entries(nullifyMap)) { + if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) { + result[objectName] = null; + } + } + } + return result; +} +function orderSelectedFields(fields, pathPrefix) { + return Object.entries(fields).reduce((result, [name, field]) => { + if (typeof name !== "string") { + return result; + } + const newPath = pathPrefix ? [...pathPrefix, name] : [name]; + if ((0, import_entity.is)(field, import_column.Column) || (0, import_entity.is)(field, import_sql.SQL) || (0, import_entity.is)(field, import_sql.SQL.Aliased) || (0, import_entity.is)(field, import_subquery.Subquery)) { + result.push({ path: newPath, field }); + } else if ((0, import_entity.is)(field, import_table.Table)) { + result.push(...orderSelectedFields(field[import_table.Table.Symbol.Columns], newPath)); + } else { + result.push(...orderSelectedFields(field, newPath)); + } + return result; + }, []); +} +function haveSameKeys(left, right) { + const leftKeys = Object.keys(left); + const rightKeys = Object.keys(right); + if (leftKeys.length !== rightKeys.length) { + return false; + } + for (const [index, key] of leftKeys.entries()) { + if (key !== rightKeys[index]) { + return false; + } + } + return true; +} +function mapUpdateSet(table, values) { + const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => { + if ((0, import_entity.is)(value, import_sql.SQL) || (0, import_entity.is)(value, import_column.Column)) { + return [key, value]; + } else { + return [key, new import_sql.Param(value, table[import_table.Table.Symbol.Columns][key])]; + } + }); + if (entries.length === 0) { + throw new Error("No values to set"); + } + return Object.fromEntries(entries); +} +function applyMixins(baseClass, extendedClasses) { + for (const extendedClass of extendedClasses) { + for (const name of Object.getOwnPropertyNames(extendedClass.prototype)) { + if (name === "constructor") continue; + Object.defineProperty( + baseClass.prototype, + name, + Object.getOwnPropertyDescriptor(extendedClass.prototype, name) || /* @__PURE__ */ Object.create(null) + ); + } + } +} +function getTableColumns(table) { + return table[import_table.Table.Symbol.Columns]; +} +function getViewSelectedFields(view) { + return view[import_view_common.ViewBaseConfig].selectedFields; +} +function getTableLikeName(table) { + return (0, import_entity.is)(table, import_subquery.Subquery) ? table._.alias : (0, import_entity.is)(table, import_sql.View) ? table[import_view_common.ViewBaseConfig].name : (0, import_entity.is)(table, import_sql.SQL) ? void 0 : table[import_table.Table.Symbol.IsAlias] ? table[import_table.Table.Symbol.Name] : table[import_table.Table.Symbol.BaseName]; +} +function getColumnNameAndConfig(a, b) { + return { + name: typeof a === "string" && a.length > 0 ? a : "", + config: typeof a === "object" ? a : b + }; +} +const _ = {}; +const __ = {}; +function isConfig(data) { + if (typeof data !== "object" || data === null) return false; + if (data.constructor.name !== "Object") return false; + if ("logger" in data) { + const type = typeof data["logger"]; + if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false; + return true; + } + if ("schema" in data) { + const type = typeof data["schema"]; + if (type !== "object" && type !== "undefined") return false; + return true; + } + if ("casing" in data) { + const type = typeof data["casing"]; + if (type !== "string" && type !== "undefined") return false; + return true; + } + if ("mode" in data) { + if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false; + return true; + } + if ("connection" in data) { + const type = typeof data["connection"]; + if (type !== "string" && type !== "object" && type !== "undefined") return false; + return true; + } + if ("client" in data) { + const type = typeof data["client"]; + if (type !== "object" && type !== "function" && type !== "undefined") return false; + return true; + } + if (Object.keys(data).length === 0) return true; + return false; +} +const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + applyMixins, + getColumnNameAndConfig, + getTableColumns, + getTableLikeName, + getViewSelectedFields, + haveSameKeys, + isConfig, + mapResultRow, + mapUpdateSet, + orderSelectedFields, + textDecoder +}); +//# sourceMappingURL=utils.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/utils.cjs.map b/e-commerce/node_modules/drizzle-orm/utils.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..8a78dd501697e6e89997b206e8053586d8c163ea --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import type { Cache } from './cache/core/cache.ts';\nimport type { AnyColumn } from './column.ts';\nimport { Column } from './column.ts';\nimport { is } from './entity.ts';\nimport type { Logger } from './logger.ts';\nimport type { SelectedFieldsOrdered } from './operations.ts';\nimport type { TableLike } from './query-builders/select.types.ts';\nimport { Param, SQL, View } from './sql/sql.ts';\nimport type { DriverValueDecoder } from './sql/sql.ts';\nimport { Subquery } from './subquery.ts';\nimport { getTableName, Table } from './table.ts';\nimport { ViewBaseConfig } from './view-common.ts';\n\n/** @internal */\nexport function mapResultRow(\n\tcolumns: SelectedFieldsOrdered,\n\trow: unknown[],\n\tjoinsNotNullableMap: Record | undefined,\n): TResult {\n\t// Key -> nested object key, value -> table name if all fields in the nested object are from the same table, false otherwise\n\tconst nullifyMap: Record = {};\n\n\tconst result = columns.reduce>(\n\t\t(result, { path, field }, columnIndex) => {\n\t\t\tlet decoder: DriverValueDecoder;\n\t\t\tif (is(field, Column)) {\n\t\t\t\tdecoder = field;\n\t\t\t} else if (is(field, SQL)) {\n\t\t\t\tdecoder = field.decoder;\n\t\t\t} else if (is(field, Subquery)) {\n\t\t\t\tdecoder = field._.sql.decoder;\n\t\t\t} else {\n\t\t\t\tdecoder = field.sql.decoder;\n\t\t\t}\n\t\t\tlet node = result;\n\t\t\tfor (const [pathChunkIndex, pathChunk] of path.entries()) {\n\t\t\t\tif (pathChunkIndex < path.length - 1) {\n\t\t\t\t\tif (!(pathChunk in node)) {\n\t\t\t\t\t\tnode[pathChunk] = {};\n\t\t\t\t\t}\n\t\t\t\t\tnode = node[pathChunk];\n\t\t\t\t} else {\n\t\t\t\t\tconst rawValue = row[columnIndex]!;\n\t\t\t\t\tconst value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);\n\n\t\t\t\t\tif (joinsNotNullableMap && is(field, Column) && path.length === 2) {\n\t\t\t\t\t\tconst objectName = path[0]!;\n\t\t\t\t\t\tif (!(objectName in nullifyMap)) {\n\t\t\t\t\t\t\tnullifyMap[objectName] = value === null ? getTableName(field.table) : false;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\ttypeof nullifyMap[objectName] === 'string' && nullifyMap[objectName] !== getTableName(field.table)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnullifyMap[objectName] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t{},\n\t);\n\n\t// Nullify all nested objects from nullifyMap that are nullable\n\tif (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {\n\t\tfor (const [objectName, tableName] of Object.entries(nullifyMap)) {\n\t\t\tif (typeof tableName === 'string' && !joinsNotNullableMap[tableName]) {\n\t\t\t\tresult[objectName] = null;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result as TResult;\n}\n\n/** @internal */\nexport function orderSelectedFields(\n\tfields: Record,\n\tpathPrefix?: string[],\n): SelectedFieldsOrdered {\n\treturn Object.entries(fields).reduce>((result, [name, field]) => {\n\t\tif (typeof name !== 'string') {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst newPath = pathPrefix ? [...pathPrefix, name] : [name];\n\t\tif (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased) || is(field, Subquery)) {\n\t\t\tresult.push({ path: newPath, field });\n\t\t} else if (is(field, Table)) {\n\t\t\tresult.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));\n\t\t} else {\n\t\t\tresult.push(...orderSelectedFields(field as Record, newPath));\n\t\t}\n\t\treturn result;\n\t}, []) as SelectedFieldsOrdered;\n}\n\nexport function haveSameKeys(left: Record, right: Record) {\n\tconst leftKeys = Object.keys(left);\n\tconst rightKeys = Object.keys(right);\n\n\tif (leftKeys.length !== rightKeys.length) {\n\t\treturn false;\n\t}\n\n\tfor (const [index, key] of leftKeys.entries()) {\n\t\tif (key !== rightKeys[index]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/** @internal */\nexport function mapUpdateSet(table: Table, values: Record): UpdateSet {\n\tconst entries: [string, UpdateSet[string]][] = Object.entries(values)\n\t\t.filter(([, value]) => value !== undefined)\n\t\t.map(([key, value]) => {\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (is(value, SQL) || is(value, Column)) {\n\t\t\t\treturn [key, value];\n\t\t\t} else {\n\t\t\t\treturn [key, new Param(value, table[Table.Symbol.Columns][key])];\n\t\t\t}\n\t\t});\n\n\tif (entries.length === 0) {\n\t\tthrow new Error('No values to set');\n\t}\n\n\treturn Object.fromEntries(entries);\n}\n\nexport type UpdateSet = Record;\n\nexport type OneOrMany = T | T[];\n\nexport type Update =\n\t& {\n\t\t[K in Exclude]: T[K];\n\t}\n\t& TUpdate;\n\nexport type Simplify =\n\t& {\n\t\t// @ts-ignore - \"Type parameter 'K' has a circular constraint\", not sure why\n\t\t[K in keyof T]: T[K];\n\t}\n\t& {};\n\nexport type Not = T extends true ? false : true;\n\nexport type IsNever = [T] extends [never] ? true : false;\n\nexport type IsUnion = (T extends any ? (U extends T ? false : true) : never) extends false ? false\n\t: true;\n\nexport type SingleKeyObject = IsNever extends true ? never\n\t: IsUnion extends true ? DrizzleTypeError\n\t: T;\n\nexport type FromSingleKeyObject = IsNever extends true ? never\n\t: IsUnion extends true ? DrizzleTypeError\n\t: Result;\n\nexport type SimplifyMappedType = [T] extends [unknown] ? T : never;\n\nexport type ShallowRecord = SimplifyMappedType<{ [P in K]: T }>;\n\nexport type Assume = T extends U ? T : U;\n\nexport type Equal = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? true : false;\n\nexport interface DrizzleTypeError {\n\t$drizzleTypeError: T;\n}\n\nexport type ValueOrArray = T | T[];\n\n/** @internal */\nexport function applyMixins(baseClass: any, extendedClasses: any[]) {\n\tfor (const extendedClass of extendedClasses) {\n\t\tfor (const name of Object.getOwnPropertyNames(extendedClass.prototype)) {\n\t\t\tif (name === 'constructor') continue;\n\n\t\t\tObject.defineProperty(\n\t\t\t\tbaseClass.prototype,\n\t\t\t\tname,\n\t\t\t\tObject.getOwnPropertyDescriptor(extendedClass.prototype, name) || Object.create(null),\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport type Or = T1 extends true ? true : T2 extends true ? true : false;\n\nexport type IfThenElse = If extends true ? Then : Else;\n\nexport type PromiseOf = T extends Promise ? U : T;\n\nexport type Writable = {\n\t-readonly [P in keyof T]: T[P];\n};\n\nexport type NonArray = T extends any[] ? never : T;\n\nexport function getTableColumns(table: T): T['_']['columns'] {\n\treturn table[Table.Symbol.Columns];\n}\n\nexport function getViewSelectedFields(view: T): T['_']['selectedFields'] {\n\treturn view[ViewBaseConfig].selectedFields;\n}\n\n/** @internal */\nexport function getTableLikeName(table: TableLike): string | undefined {\n\treturn is(table, Subquery)\n\t\t? table._.alias\n\t\t: is(table, View)\n\t\t? table[ViewBaseConfig].name\n\t\t: is(table, SQL)\n\t\t? undefined\n\t\t: table[Table.Symbol.IsAlias]\n\t\t? table[Table.Symbol.Name]\n\t\t: table[Table.Symbol.BaseName];\n}\n\nexport type ColumnsWithTable<\n\tTTableName extends string,\n\tTForeignTableName extends string,\n\tTColumns extends AnyColumn<{ tableName: TTableName }>[],\n> = { [Key in keyof TColumns]: AnyColumn<{ tableName: TForeignTableName }> };\n\nexport type Casing = 'snake_case' | 'camelCase';\n\nexport interface DrizzleConfig = Record> {\n\tlogger?: boolean | Logger;\n\tschema?: TSchema;\n\tcasing?: Casing;\n\tcache?: Cache;\n}\nexport type ValidateShape = T extends ValidShape\n\t? Exclude extends never ? TResult\n\t: DrizzleTypeError<\n\t\t`Invalid key(s): ${Exclude<(keyof T) & (string | number | bigint | boolean | null | undefined), keyof ValidShape>}`\n\t>\n\t: never;\n\nexport type KnownKeysOnly = {\n\t[K in keyof T]: K extends keyof U ? T[K] : never;\n};\n\nexport type IsAny = 0 extends (1 & T) ? true : false;\n\n/** @internal */\nexport function getColumnNameAndConfig<\n\tTConfig extends Record | undefined,\n>(a: string | TConfig | undefined, b: TConfig | undefined) {\n\treturn {\n\t\tname: typeof a === 'string' && a.length > 0 ? a : '' as string,\n\t\tconfig: typeof a === 'object' ? a : b as TConfig,\n\t};\n}\n\nexport type IfNotImported = unknown extends T ? Y : N;\n\nexport type ImportTypeError =\n\t`Please install \\`${TPackageName}\\` to allow Drizzle ORM to connect to the database`;\n\nexport type RequireAtLeastOne = Keys extends any\n\t? Required> & Partial>\n\t: never;\n\ntype ExpectedConfigShape = {\n\tlogger?: boolean | {\n\t\tlogQuery(query: string, params: unknown[]): void;\n\t};\n\tschema?: Record;\n\tcasing?: 'snake_case' | 'camelCase';\n};\n\n// If this errors, you must update config shape checker function with new config specs\nconst _: DrizzleConfig = {} as ExpectedConfigShape;\nconst __: ExpectedConfigShape = {} as DrizzleConfig;\n\nexport function isConfig(data: any): boolean {\n\tif (typeof data !== 'object' || data === null) return false;\n\n\tif (data.constructor.name !== 'Object') return false;\n\n\tif ('logger' in data) {\n\t\tconst type = typeof data['logger'];\n\t\tif (\n\t\t\ttype !== 'boolean' && (type !== 'object' || typeof data['logger']['logQuery'] !== 'function')\n\t\t\t&& type !== 'undefined'\n\t\t) return false;\n\n\t\treturn true;\n\t}\n\n\tif ('schema' in data) {\n\t\tconst type = typeof data['schema'];\n\t\tif (type !== 'object' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('casing' in data) {\n\t\tconst type = typeof data['casing'];\n\t\tif (type !== 'string' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('mode' in data) {\n\t\tif (data['mode'] !== 'default' || data['mode'] !== 'planetscale' || data['mode'] !== undefined) return false;\n\n\t\treturn true;\n\t}\n\n\tif ('connection' in data) {\n\t\tconst type = typeof data['connection'];\n\t\tif (type !== 'string' && type !== 'object' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('client' in data) {\n\t\tconst type = typeof data['client'];\n\t\tif (type !== 'object' && type !== 'function' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif (Object.keys(data).length === 0) return true;\n\n\treturn false;\n}\n\nexport type NeonAuthToken = string | (() => string | Promise);\n\nexport const textDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder();\n"],"mappings":"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","names":["result"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/utils.d.cts b/e-commerce/node_modules/drizzle-orm/utils.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..43de1d70760c76e81cfa5cd06e63934bd67cc96e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.d.cts @@ -0,0 +1,63 @@ +import type { Cache } from "./cache/core/cache.cjs"; +import type { AnyColumn } from "./column.cjs"; +import type { Logger } from "./logger.cjs"; +import { Param, SQL, View } from "./sql/sql.cjs"; +import { Table } from "./table.cjs"; +export declare function haveSameKeys(left: Record, right: Record): boolean; +export type UpdateSet = Record; +export type OneOrMany = T | T[]; +export type Update = { + [K in Exclude]: T[K]; +} & TUpdate; +export type Simplify = { + [K in keyof T]: T[K]; +} & {}; +export type Not = T extends true ? false : true; +export type IsNever = [T] extends [never] ? true : false; +export type IsUnion = (T extends any ? (U extends T ? false : true) : never) extends false ? false : true; +export type SingleKeyObject = IsNever extends true ? never : IsUnion extends true ? DrizzleTypeError : T; +export type FromSingleKeyObject = IsNever extends true ? never : IsUnion extends true ? DrizzleTypeError : Result; +export type SimplifyMappedType = [T] extends [unknown] ? T : never; +export type ShallowRecord = SimplifyMappedType<{ + [P in K]: T; +}>; +export type Assume = T extends U ? T : U; +export type Equal = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? true : false; +export interface DrizzleTypeError { + $drizzleTypeError: T; +} +export type ValueOrArray = T | T[]; +export type Or = T1 extends true ? true : T2 extends true ? true : false; +export type IfThenElse = If extends true ? Then : Else; +export type PromiseOf = T extends Promise ? U : T; +export type Writable = { + -readonly [P in keyof T]: T[P]; +}; +export type NonArray = T extends any[] ? never : T; +export declare function getTableColumns(table: T): T['_']['columns']; +export declare function getViewSelectedFields(view: T): T['_']['selectedFields']; +export type ColumnsWithTable[]> = { + [Key in keyof TColumns]: AnyColumn<{ + tableName: TForeignTableName; + }>; +}; +export type Casing = 'snake_case' | 'camelCase'; +export interface DrizzleConfig = Record> { + logger?: boolean | Logger; + schema?: TSchema; + casing?: Casing; + cache?: Cache; +} +export type ValidateShape = T extends ValidShape ? Exclude extends never ? TResult : DrizzleTypeError<`Invalid key(s): ${Exclude<(keyof T) & (string | number | bigint | boolean | null | undefined), keyof ValidShape>}`> : never; +export type KnownKeysOnly = { + [K in keyof T]: K extends keyof U ? T[K] : never; +}; +export type IsAny = 0 extends (1 & T) ? true : false; +export type IfNotImported = unknown extends T ? Y : N; +export type ImportTypeError = `Please install \`${TPackageName}\` to allow Drizzle ORM to connect to the database`; +export type RequireAtLeastOne = Keys extends any ? Required> & Partial> : never; +export declare function isConfig(data: any): boolean; +export type NeonAuthToken = string | (() => string | Promise); +export declare const textDecoder: TextDecoder | null; diff --git a/e-commerce/node_modules/drizzle-orm/utils.d.ts b/e-commerce/node_modules/drizzle-orm/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc964986ba05651f22cd9883a0ed68ac8dd55ef7 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.d.ts @@ -0,0 +1,63 @@ +import type { Cache } from "./cache/core/cache.js"; +import type { AnyColumn } from "./column.js"; +import type { Logger } from "./logger.js"; +import { Param, SQL, View } from "./sql/sql.js"; +import { Table } from "./table.js"; +export declare function haveSameKeys(left: Record, right: Record): boolean; +export type UpdateSet = Record; +export type OneOrMany = T | T[]; +export type Update = { + [K in Exclude]: T[K]; +} & TUpdate; +export type Simplify = { + [K in keyof T]: T[K]; +} & {}; +export type Not = T extends true ? false : true; +export type IsNever = [T] extends [never] ? true : false; +export type IsUnion = (T extends any ? (U extends T ? false : true) : never) extends false ? false : true; +export type SingleKeyObject = IsNever extends true ? never : IsUnion extends true ? DrizzleTypeError : T; +export type FromSingleKeyObject = IsNever extends true ? never : IsUnion extends true ? DrizzleTypeError : Result; +export type SimplifyMappedType = [T] extends [unknown] ? T : never; +export type ShallowRecord = SimplifyMappedType<{ + [P in K]: T; +}>; +export type Assume = T extends U ? T : U; +export type Equal = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? true : false; +export interface DrizzleTypeError { + $drizzleTypeError: T; +} +export type ValueOrArray = T | T[]; +export type Or = T1 extends true ? true : T2 extends true ? true : false; +export type IfThenElse = If extends true ? Then : Else; +export type PromiseOf = T extends Promise ? U : T; +export type Writable = { + -readonly [P in keyof T]: T[P]; +}; +export type NonArray = T extends any[] ? never : T; +export declare function getTableColumns(table: T): T['_']['columns']; +export declare function getViewSelectedFields(view: T): T['_']['selectedFields']; +export type ColumnsWithTable[]> = { + [Key in keyof TColumns]: AnyColumn<{ + tableName: TForeignTableName; + }>; +}; +export type Casing = 'snake_case' | 'camelCase'; +export interface DrizzleConfig = Record> { + logger?: boolean | Logger; + schema?: TSchema; + casing?: Casing; + cache?: Cache; +} +export type ValidateShape = T extends ValidShape ? Exclude extends never ? TResult : DrizzleTypeError<`Invalid key(s): ${Exclude<(keyof T) & (string | number | bigint | boolean | null | undefined), keyof ValidShape>}`> : never; +export type KnownKeysOnly = { + [K in keyof T]: K extends keyof U ? T[K] : never; +}; +export type IsAny = 0 extends (1 & T) ? true : false; +export type IfNotImported = unknown extends T ? Y : N; +export type ImportTypeError = `Please install \`${TPackageName}\` to allow Drizzle ORM to connect to the database`; +export type RequireAtLeastOne = Keys extends any ? Required> & Partial> : never; +export declare function isConfig(data: any): boolean; +export type NeonAuthToken = string | (() => string | Promise); +export declare const textDecoder: TextDecoder | null; diff --git a/e-commerce/node_modules/drizzle-orm/utils.js b/e-commerce/node_modules/drizzle-orm/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..898bdf8dfb1a6ad54b6dffa31eb4364353545e47 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.js @@ -0,0 +1,174 @@ +import { Column } from "./column.js"; +import { is } from "./entity.js"; +import { Param, SQL, View } from "./sql/sql.js"; +import { Subquery } from "./subquery.js"; +import { getTableName, Table } from "./table.js"; +import { ViewBaseConfig } from "./view-common.js"; +function mapResultRow(columns, row, joinsNotNullableMap) { + const nullifyMap = {}; + const result = columns.reduce( + (result2, { path, field }, columnIndex) => { + let decoder; + if (is(field, Column)) { + decoder = field; + } else if (is(field, SQL)) { + decoder = field.decoder; + } else if (is(field, Subquery)) { + decoder = field._.sql.decoder; + } else { + decoder = field.sql.decoder; + } + let node = result2; + for (const [pathChunkIndex, pathChunk] of path.entries()) { + if (pathChunkIndex < path.length - 1) { + if (!(pathChunk in node)) { + node[pathChunk] = {}; + } + node = node[pathChunk]; + } else { + const rawValue = row[columnIndex]; + const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue); + if (joinsNotNullableMap && is(field, Column) && path.length === 2) { + const objectName = path[0]; + if (!(objectName in nullifyMap)) { + nullifyMap[objectName] = value === null ? getTableName(field.table) : false; + } else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) { + nullifyMap[objectName] = false; + } + } + } + } + return result2; + }, + {} + ); + if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) { + for (const [objectName, tableName] of Object.entries(nullifyMap)) { + if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) { + result[objectName] = null; + } + } + } + return result; +} +function orderSelectedFields(fields, pathPrefix) { + return Object.entries(fields).reduce((result, [name, field]) => { + if (typeof name !== "string") { + return result; + } + const newPath = pathPrefix ? [...pathPrefix, name] : [name]; + if (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased) || is(field, Subquery)) { + result.push({ path: newPath, field }); + } else if (is(field, Table)) { + result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath)); + } else { + result.push(...orderSelectedFields(field, newPath)); + } + return result; + }, []); +} +function haveSameKeys(left, right) { + const leftKeys = Object.keys(left); + const rightKeys = Object.keys(right); + if (leftKeys.length !== rightKeys.length) { + return false; + } + for (const [index, key] of leftKeys.entries()) { + if (key !== rightKeys[index]) { + return false; + } + } + return true; +} +function mapUpdateSet(table, values) { + const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => { + if (is(value, SQL) || is(value, Column)) { + return [key, value]; + } else { + return [key, new Param(value, table[Table.Symbol.Columns][key])]; + } + }); + if (entries.length === 0) { + throw new Error("No values to set"); + } + return Object.fromEntries(entries); +} +function applyMixins(baseClass, extendedClasses) { + for (const extendedClass of extendedClasses) { + for (const name of Object.getOwnPropertyNames(extendedClass.prototype)) { + if (name === "constructor") continue; + Object.defineProperty( + baseClass.prototype, + name, + Object.getOwnPropertyDescriptor(extendedClass.prototype, name) || /* @__PURE__ */ Object.create(null) + ); + } + } +} +function getTableColumns(table) { + return table[Table.Symbol.Columns]; +} +function getViewSelectedFields(view) { + return view[ViewBaseConfig].selectedFields; +} +function getTableLikeName(table) { + return is(table, Subquery) ? table._.alias : is(table, View) ? table[ViewBaseConfig].name : is(table, SQL) ? void 0 : table[Table.Symbol.IsAlias] ? table[Table.Symbol.Name] : table[Table.Symbol.BaseName]; +} +function getColumnNameAndConfig(a, b) { + return { + name: typeof a === "string" && a.length > 0 ? a : "", + config: typeof a === "object" ? a : b + }; +} +const _ = {}; +const __ = {}; +function isConfig(data) { + if (typeof data !== "object" || data === null) return false; + if (data.constructor.name !== "Object") return false; + if ("logger" in data) { + const type = typeof data["logger"]; + if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false; + return true; + } + if ("schema" in data) { + const type = typeof data["schema"]; + if (type !== "object" && type !== "undefined") return false; + return true; + } + if ("casing" in data) { + const type = typeof data["casing"]; + if (type !== "string" && type !== "undefined") return false; + return true; + } + if ("mode" in data) { + if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false; + return true; + } + if ("connection" in data) { + const type = typeof data["connection"]; + if (type !== "string" && type !== "object" && type !== "undefined") return false; + return true; + } + if ("client" in data) { + const type = typeof data["client"]; + if (type !== "object" && type !== "function" && type !== "undefined") return false; + return true; + } + if (Object.keys(data).length === 0) return true; + return false; +} +const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder(); +export { + applyMixins, + getColumnNameAndConfig, + getTableColumns, + getTableLikeName, + getViewSelectedFields, + haveSameKeys, + isConfig, + mapResultRow, + mapUpdateSet, + orderSelectedFields, + textDecoder +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/utils.js.map b/e-commerce/node_modules/drizzle-orm/utils.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ebecb343046cdfccb4e97ac0f97c6c0f7a8a49c1 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import type { Cache } from './cache/core/cache.ts';\nimport type { AnyColumn } from './column.ts';\nimport { Column } from './column.ts';\nimport { is } from './entity.ts';\nimport type { Logger } from './logger.ts';\nimport type { SelectedFieldsOrdered } from './operations.ts';\nimport type { TableLike } from './query-builders/select.types.ts';\nimport { Param, SQL, View } from './sql/sql.ts';\nimport type { DriverValueDecoder } from './sql/sql.ts';\nimport { Subquery } from './subquery.ts';\nimport { getTableName, Table } from './table.ts';\nimport { ViewBaseConfig } from './view-common.ts';\n\n/** @internal */\nexport function mapResultRow(\n\tcolumns: SelectedFieldsOrdered,\n\trow: unknown[],\n\tjoinsNotNullableMap: Record | undefined,\n): TResult {\n\t// Key -> nested object key, value -> table name if all fields in the nested object are from the same table, false otherwise\n\tconst nullifyMap: Record = {};\n\n\tconst result = columns.reduce>(\n\t\t(result, { path, field }, columnIndex) => {\n\t\t\tlet decoder: DriverValueDecoder;\n\t\t\tif (is(field, Column)) {\n\t\t\t\tdecoder = field;\n\t\t\t} else if (is(field, SQL)) {\n\t\t\t\tdecoder = field.decoder;\n\t\t\t} else if (is(field, Subquery)) {\n\t\t\t\tdecoder = field._.sql.decoder;\n\t\t\t} else {\n\t\t\t\tdecoder = field.sql.decoder;\n\t\t\t}\n\t\t\tlet node = result;\n\t\t\tfor (const [pathChunkIndex, pathChunk] of path.entries()) {\n\t\t\t\tif (pathChunkIndex < path.length - 1) {\n\t\t\t\t\tif (!(pathChunk in node)) {\n\t\t\t\t\t\tnode[pathChunk] = {};\n\t\t\t\t\t}\n\t\t\t\t\tnode = node[pathChunk];\n\t\t\t\t} else {\n\t\t\t\t\tconst rawValue = row[columnIndex]!;\n\t\t\t\t\tconst value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);\n\n\t\t\t\t\tif (joinsNotNullableMap && is(field, Column) && path.length === 2) {\n\t\t\t\t\t\tconst objectName = path[0]!;\n\t\t\t\t\t\tif (!(objectName in nullifyMap)) {\n\t\t\t\t\t\t\tnullifyMap[objectName] = value === null ? getTableName(field.table) : false;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\ttypeof nullifyMap[objectName] === 'string' && nullifyMap[objectName] !== getTableName(field.table)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnullifyMap[objectName] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t{},\n\t);\n\n\t// Nullify all nested objects from nullifyMap that are nullable\n\tif (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {\n\t\tfor (const [objectName, tableName] of Object.entries(nullifyMap)) {\n\t\t\tif (typeof tableName === 'string' && !joinsNotNullableMap[tableName]) {\n\t\t\t\tresult[objectName] = null;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result as TResult;\n}\n\n/** @internal */\nexport function orderSelectedFields(\n\tfields: Record,\n\tpathPrefix?: string[],\n): SelectedFieldsOrdered {\n\treturn Object.entries(fields).reduce>((result, [name, field]) => {\n\t\tif (typeof name !== 'string') {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst newPath = pathPrefix ? [...pathPrefix, name] : [name];\n\t\tif (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased) || is(field, Subquery)) {\n\t\t\tresult.push({ path: newPath, field });\n\t\t} else if (is(field, Table)) {\n\t\t\tresult.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));\n\t\t} else {\n\t\t\tresult.push(...orderSelectedFields(field as Record, newPath));\n\t\t}\n\t\treturn result;\n\t}, []) as SelectedFieldsOrdered;\n}\n\nexport function haveSameKeys(left: Record, right: Record) {\n\tconst leftKeys = Object.keys(left);\n\tconst rightKeys = Object.keys(right);\n\n\tif (leftKeys.length !== rightKeys.length) {\n\t\treturn false;\n\t}\n\n\tfor (const [index, key] of leftKeys.entries()) {\n\t\tif (key !== rightKeys[index]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/** @internal */\nexport function mapUpdateSet(table: Table, values: Record): UpdateSet {\n\tconst entries: [string, UpdateSet[string]][] = Object.entries(values)\n\t\t.filter(([, value]) => value !== undefined)\n\t\t.map(([key, value]) => {\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (is(value, SQL) || is(value, Column)) {\n\t\t\t\treturn [key, value];\n\t\t\t} else {\n\t\t\t\treturn [key, new Param(value, table[Table.Symbol.Columns][key])];\n\t\t\t}\n\t\t});\n\n\tif (entries.length === 0) {\n\t\tthrow new Error('No values to set');\n\t}\n\n\treturn Object.fromEntries(entries);\n}\n\nexport type UpdateSet = Record;\n\nexport type OneOrMany = T | T[];\n\nexport type Update =\n\t& {\n\t\t[K in Exclude]: T[K];\n\t}\n\t& TUpdate;\n\nexport type Simplify =\n\t& {\n\t\t// @ts-ignore - \"Type parameter 'K' has a circular constraint\", not sure why\n\t\t[K in keyof T]: T[K];\n\t}\n\t& {};\n\nexport type Not = T extends true ? false : true;\n\nexport type IsNever = [T] extends [never] ? true : false;\n\nexport type IsUnion = (T extends any ? (U extends T ? false : true) : never) extends false ? false\n\t: true;\n\nexport type SingleKeyObject = IsNever extends true ? never\n\t: IsUnion extends true ? DrizzleTypeError\n\t: T;\n\nexport type FromSingleKeyObject = IsNever extends true ? never\n\t: IsUnion extends true ? DrizzleTypeError\n\t: Result;\n\nexport type SimplifyMappedType = [T] extends [unknown] ? T : never;\n\nexport type ShallowRecord = SimplifyMappedType<{ [P in K]: T }>;\n\nexport type Assume = T extends U ? T : U;\n\nexport type Equal = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? true : false;\n\nexport interface DrizzleTypeError {\n\t$drizzleTypeError: T;\n}\n\nexport type ValueOrArray = T | T[];\n\n/** @internal */\nexport function applyMixins(baseClass: any, extendedClasses: any[]) {\n\tfor (const extendedClass of extendedClasses) {\n\t\tfor (const name of Object.getOwnPropertyNames(extendedClass.prototype)) {\n\t\t\tif (name === 'constructor') continue;\n\n\t\t\tObject.defineProperty(\n\t\t\t\tbaseClass.prototype,\n\t\t\t\tname,\n\t\t\t\tObject.getOwnPropertyDescriptor(extendedClass.prototype, name) || Object.create(null),\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport type Or = T1 extends true ? true : T2 extends true ? true : false;\n\nexport type IfThenElse = If extends true ? Then : Else;\n\nexport type PromiseOf = T extends Promise ? U : T;\n\nexport type Writable = {\n\t-readonly [P in keyof T]: T[P];\n};\n\nexport type NonArray = T extends any[] ? never : T;\n\nexport function getTableColumns(table: T): T['_']['columns'] {\n\treturn table[Table.Symbol.Columns];\n}\n\nexport function getViewSelectedFields(view: T): T['_']['selectedFields'] {\n\treturn view[ViewBaseConfig].selectedFields;\n}\n\n/** @internal */\nexport function getTableLikeName(table: TableLike): string | undefined {\n\treturn is(table, Subquery)\n\t\t? table._.alias\n\t\t: is(table, View)\n\t\t? table[ViewBaseConfig].name\n\t\t: is(table, SQL)\n\t\t? undefined\n\t\t: table[Table.Symbol.IsAlias]\n\t\t? table[Table.Symbol.Name]\n\t\t: table[Table.Symbol.BaseName];\n}\n\nexport type ColumnsWithTable<\n\tTTableName extends string,\n\tTForeignTableName extends string,\n\tTColumns extends AnyColumn<{ tableName: TTableName }>[],\n> = { [Key in keyof TColumns]: AnyColumn<{ tableName: TForeignTableName }> };\n\nexport type Casing = 'snake_case' | 'camelCase';\n\nexport interface DrizzleConfig = Record> {\n\tlogger?: boolean | Logger;\n\tschema?: TSchema;\n\tcasing?: Casing;\n\tcache?: Cache;\n}\nexport type ValidateShape = T extends ValidShape\n\t? Exclude extends never ? TResult\n\t: DrizzleTypeError<\n\t\t`Invalid key(s): ${Exclude<(keyof T) & (string | number | bigint | boolean | null | undefined), keyof ValidShape>}`\n\t>\n\t: never;\n\nexport type KnownKeysOnly = {\n\t[K in keyof T]: K extends keyof U ? T[K] : never;\n};\n\nexport type IsAny = 0 extends (1 & T) ? true : false;\n\n/** @internal */\nexport function getColumnNameAndConfig<\n\tTConfig extends Record | undefined,\n>(a: string | TConfig | undefined, b: TConfig | undefined) {\n\treturn {\n\t\tname: typeof a === 'string' && a.length > 0 ? a : '' as string,\n\t\tconfig: typeof a === 'object' ? a : b as TConfig,\n\t};\n}\n\nexport type IfNotImported = unknown extends T ? Y : N;\n\nexport type ImportTypeError =\n\t`Please install \\`${TPackageName}\\` to allow Drizzle ORM to connect to the database`;\n\nexport type RequireAtLeastOne = Keys extends any\n\t? Required> & Partial>\n\t: never;\n\ntype ExpectedConfigShape = {\n\tlogger?: boolean | {\n\t\tlogQuery(query: string, params: unknown[]): void;\n\t};\n\tschema?: Record;\n\tcasing?: 'snake_case' | 'camelCase';\n};\n\n// If this errors, you must update config shape checker function with new config specs\nconst _: DrizzleConfig = {} as ExpectedConfigShape;\nconst __: ExpectedConfigShape = {} as DrizzleConfig;\n\nexport function isConfig(data: any): boolean {\n\tif (typeof data !== 'object' || data === null) return false;\n\n\tif (data.constructor.name !== 'Object') return false;\n\n\tif ('logger' in data) {\n\t\tconst type = typeof data['logger'];\n\t\tif (\n\t\t\ttype !== 'boolean' && (type !== 'object' || typeof data['logger']['logQuery'] !== 'function')\n\t\t\t&& type !== 'undefined'\n\t\t) return false;\n\n\t\treturn true;\n\t}\n\n\tif ('schema' in data) {\n\t\tconst type = typeof data['schema'];\n\t\tif (type !== 'object' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('casing' in data) {\n\t\tconst type = typeof data['casing'];\n\t\tif (type !== 'string' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('mode' in data) {\n\t\tif (data['mode'] !== 'default' || data['mode'] !== 'planetscale' || data['mode'] !== undefined) return false;\n\n\t\treturn true;\n\t}\n\n\tif ('connection' in data) {\n\t\tconst type = typeof data['connection'];\n\t\tif (type !== 'string' && type !== 'object' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif ('client' in data) {\n\t\tconst type = typeof data['client'];\n\t\tif (type !== 'object' && type !== 'function' && type !== 'undefined') return false;\n\n\t\treturn true;\n\t}\n\n\tif (Object.keys(data).length === 0) return true;\n\n\treturn false;\n}\n\nexport type NeonAuthToken = string | (() => string | Promise);\n\nexport const textDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder();\n"],"mappings":"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","names":["result"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs new file mode 100644 index 0000000000000000000000000000000000000000..f8d7c8e006b34ff42bdaf27c38accc2693c8d68d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs @@ -0,0 +1,100 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var driver_exports = {}; +__export(driver_exports, { + VercelPgDatabase: () => VercelPgDatabase, + VercelPgDriver: () => VercelPgDriver, + drizzle: () => drizzle +}); +module.exports = __toCommonJS(driver_exports); +var import_postgres = require("@vercel/postgres"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_db = require("../pg-core/db.cjs"); +var import_pg_core = require("../pg-core/index.cjs"); +var import_relations = require("../relations.cjs"); +var import_utils = require("../utils.cjs"); +var import_session = require("./session.cjs"); +class VercelPgDriver { + constructor(client, dialect, options = {}) { + this.client = client; + this.dialect = dialect; + this.options = options; + } + static [import_entity.entityKind] = "VercelPgDriver"; + createSession(schema) { + return new import_session.VercelPgSession(this.client, this.dialect, schema, { + logger: this.options.logger, + cache: this.options.cache + }); + } +} +class VercelPgDatabase extends import_db.PgDatabase { + static [import_entity.entityKind] = "VercelPgDatabase"; +} +function construct(client, config = {}) { + const dialect = new import_pg_core.PgDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new import_logger.DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = (0, import_relations.extractTablesRelationalConfig)( + config.schema, + import_relations.createTableRelationsHelpers + ); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const driver = new VercelPgDriver(client, dialect, { logger, cache: config.cache }); + const session = driver.createSession(schema); + const db = new VercelPgDatabase(dialect, session, schema); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +function drizzle(...params) { + if ((0, import_utils.isConfig)(params[0])) { + const { client, ...drizzleConfig } = params[0]; + return construct(client ?? import_postgres.sql, drizzleConfig); + } + return construct(params[0] ?? import_postgres.sql, params[1]); +} +((drizzle2) => { + function mock(config) { + return construct({}, config); + } + drizzle2.mock = mock; +})(drizzle || (drizzle = {})); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + VercelPgDatabase, + VercelPgDriver, + drizzle +}); +//# sourceMappingURL=driver.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..fa4052391dafde7991a6271b822643e3fe85fe9e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/driver.ts"],"sourcesContent":["import { sql } from '@vercel/postgres';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase } from '~/pg-core/db.ts';\nimport { PgDialect } from '~/pg-core/index.ts';\nimport {\n\tcreateTableRelationsHelpers,\n\textractTablesRelationalConfig,\n\ttype RelationalSchemaConfig,\n\ttype TablesRelationalConfig,\n} from '~/relations.ts';\nimport { type DrizzleConfig, isConfig } from '~/utils.ts';\nimport { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from './session.ts';\n\nexport interface VercelPgDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class VercelPgDriver {\n\tstatic readonly [entityKind]: string = 'VercelPgDriver';\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tprivate dialect: PgDialect,\n\t\tprivate options: VercelPgDriverOptions = {},\n\t) {\n\t}\n\n\tcreateSession(\n\t\tschema: RelationalSchemaConfig | undefined,\n\t): VercelPgSession, TablesRelationalConfig> {\n\t\treturn new VercelPgSession(this.client, this.dialect, schema, {\n\t\t\tlogger: this.options.logger,\n\t\t\tcache: this.options.cache,\n\t\t});\n\t}\n}\n\nexport class VercelPgDatabase<\n\tTSchema extends Record = Record,\n> extends PgDatabase {\n\tstatic override readonly [entityKind]: string = 'VercelPgDatabase';\n}\n\nfunction construct = Record>(\n\tclient: VercelPgClient,\n\tconfig: DrizzleConfig = {},\n): VercelPgDatabase & {\n\t$client: VercelPgClient;\n} {\n\tconst dialect = new PgDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\tconfig.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst driver = new VercelPgDriver(client, dialect, { logger, cache: config.cache });\n\tconst session = driver.createSession(schema);\n\tconst db = new VercelPgDatabase(dialect, session, schema as any) as VercelPgDatabase;\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n\nexport function drizzle<\n\tTSchema extends Record = Record,\n\tTClient extends VercelPgClient = typeof sql,\n>(\n\t...params: [] | [\n\t\tTClient,\n\t] | [\n\t\tTClient,\n\t\tDrizzleConfig,\n\t] | [\n\t\t(\n\t\t\t& DrizzleConfig\n\t\t\t& ({\n\t\t\t\tclient?: TClient;\n\t\t\t})\n\t\t),\n\t]\n): VercelPgDatabase & {\n\t$client: VercelPgClient extends TClient ? typeof sql : TClient;\n} {\n\tif (isConfig(params[0])) {\n\t\tconst { client, ...drizzleConfig } = params[0] as ({ client?: TClient } & DrizzleConfig);\n\t\treturn construct(client ?? sql, drizzleConfig) as any;\n\t}\n\n\treturn construct((params[0] ?? sql) as TClient, params[1] as DrizzleConfig | undefined) as any;\n}\n\nexport namespace drizzle {\n\texport function mock = Record>(\n\t\tconfig?: DrizzleConfig,\n\t): VercelPgDatabase & {\n\t\t$client: '$client is not available on drizzle.mock()';\n\t} {\n\t\treturn construct({} as any, config) as any;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AAEpB,oBAA2B;AAE3B,oBAA8B;AAC9B,gBAA2B;AAC3B,qBAA0B;AAC1B,uBAKO;AACP,mBAA6C;AAC7C,qBAAkF;AAO3E,MAAM,eAAe;AAAA,EAG3B,YACS,QACA,SACA,UAAiC,CAAC,GACzC;AAHO;AACA;AACA;AAAA,EAET;AAAA,EAPA,QAAiB,wBAAU,IAAY;AAAA,EASvC,cACC,QACmE;AACnE,WAAO,IAAI,+BAAgB,KAAK,QAAQ,KAAK,SAAS,QAAQ;AAAA,MAC7D,QAAQ,KAAK,QAAQ;AAAA,MACrB,OAAO,KAAK,QAAQ;AAAA,IACrB,CAAC;AAAA,EACF;AACD;AAEO,MAAM,yBAEH,qBAA4C;AAAA,EACrD,QAA0B,wBAAU,IAAY;AACjD;AAEA,SAAS,UACR,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,yBAAU,EAAE,QAAQ,OAAO,OAAO,CAAC;AACvD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,4BAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,mBAAe;AAAA,MACpB,OAAO;AAAA,MACP;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,SAAS,IAAI,eAAe,QAAQ,SAAS,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAClF,QAAM,UAAU,OAAO,cAAc,MAAM;AAC3C,QAAM,KAAK,IAAI,iBAAiB,SAAS,SAAS,MAAa;AAC/D,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;AAEO,SAAS,WAIZ,QAeF;AACD,UAAI,uBAAS,OAAO,CAAC,CAAC,GAAG;AACxB,UAAM,EAAE,QAAQ,GAAG,cAAc,IAAI,OAAO,CAAC;AAC7C,WAAO,UAAU,UAAU,qBAAK,aAAa;AAAA,EAC9C;AAEA,SAAO,UAAW,OAAO,CAAC,KAAK,qBAAiB,OAAO,CAAC,CAAuC;AAChG;AAAA,CAEO,CAAUA,aAAV;AACC,WAAS,KACf,QAGC;AACD,WAAO,UAAU,CAAC,GAAU,MAAM;AAAA,EACnC;AANO,EAAAA,SAAS;AAAA,GADA;","names":["drizzle"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.cts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..4f69128d007a1d15f61ef5fe1a5935703d7f7697 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.cts @@ -0,0 +1,41 @@ +import { sql } from '@vercel/postgres'; +import type { Cache } from "../cache/core/cache.cjs"; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import { PgDatabase } from "../pg-core/db.cjs"; +import { PgDialect } from "../pg-core/index.cjs"; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from "../relations.cjs"; +import { type DrizzleConfig } from "../utils.cjs"; +import { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from "./session.cjs"; +export interface VercelPgDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class VercelPgDriver { + private client; + private dialect; + private options; + static readonly [entityKind]: string; + constructor(client: VercelPgClient, dialect: PgDialect, options?: VercelPgDriverOptions); + createSession(schema: RelationalSchemaConfig | undefined): VercelPgSession, TablesRelationalConfig>; +} +export declare class VercelPgDatabase = Record> extends PgDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record, TClient extends VercelPgClient = typeof sql>(...params: [] | [ + TClient +] | [ + TClient, + DrizzleConfig +] | [ + (DrizzleConfig & ({ + client?: TClient; + })) +]): VercelPgDatabase & { + $client: VercelPgClient extends TClient ? typeof sql : TClient; +}; +export declare namespace drizzle { + function mock = Record>(config?: DrizzleConfig): VercelPgDatabase & { + $client: '$client is not available on drizzle.mock()'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.ts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64a59e8a36c504d4ac56a1bcd323cca620f172e4 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.d.ts @@ -0,0 +1,41 @@ +import { sql } from '@vercel/postgres'; +import type { Cache } from "../cache/core/cache.js"; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import { PgDatabase } from "../pg-core/db.js"; +import { PgDialect } from "../pg-core/index.js"; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from "../relations.js"; +import { type DrizzleConfig } from "../utils.js"; +import { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from "./session.js"; +export interface VercelPgDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class VercelPgDriver { + private client; + private dialect; + private options; + static readonly [entityKind]: string; + constructor(client: VercelPgClient, dialect: PgDialect, options?: VercelPgDriverOptions); + createSession(schema: RelationalSchemaConfig | undefined): VercelPgSession, TablesRelationalConfig>; +} +export declare class VercelPgDatabase = Record> extends PgDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record, TClient extends VercelPgClient = typeof sql>(...params: [] | [ + TClient +] | [ + TClient, + DrizzleConfig +] | [ + (DrizzleConfig & ({ + client?: TClient; + })) +]): VercelPgDatabase & { + $client: VercelPgClient extends TClient ? typeof sql : TClient; +}; +export declare namespace drizzle { + function mock = Record>(config?: DrizzleConfig): VercelPgDatabase & { + $client: '$client is not available on drizzle.mock()'; + }; +} diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js new file mode 100644 index 0000000000000000000000000000000000000000..afcfb8e39fdb77821b218a8befd4902fb281292d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js @@ -0,0 +1,77 @@ +import { sql } from "@vercel/postgres"; +import { entityKind } from "../entity.js"; +import { DefaultLogger } from "../logger.js"; +import { PgDatabase } from "../pg-core/db.js"; +import { PgDialect } from "../pg-core/index.js"; +import { + createTableRelationsHelpers, + extractTablesRelationalConfig +} from "../relations.js"; +import { isConfig } from "../utils.js"; +import { VercelPgSession } from "./session.js"; +class VercelPgDriver { + constructor(client, dialect, options = {}) { + this.client = client; + this.dialect = dialect; + this.options = options; + } + static [entityKind] = "VercelPgDriver"; + createSession(schema) { + return new VercelPgSession(this.client, this.dialect, schema, { + logger: this.options.logger, + cache: this.options.cache + }); + } +} +class VercelPgDatabase extends PgDatabase { + static [entityKind] = "VercelPgDatabase"; +} +function construct(client, config = {}) { + const dialect = new PgDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = extractTablesRelationalConfig( + config.schema, + createTableRelationsHelpers + ); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const driver = new VercelPgDriver(client, dialect, { logger, cache: config.cache }); + const session = driver.createSession(schema); + const db = new VercelPgDatabase(dialect, session, schema); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +function drizzle(...params) { + if (isConfig(params[0])) { + const { client, ...drizzleConfig } = params[0]; + return construct(client ?? sql, drizzleConfig); + } + return construct(params[0] ?? sql, params[1]); +} +((drizzle2) => { + function mock(config) { + return construct({}, config); + } + drizzle2.mock = mock; +})(drizzle || (drizzle = {})); +export { + VercelPgDatabase, + VercelPgDriver, + drizzle +}; +//# sourceMappingURL=driver.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js.map new file mode 100644 index 0000000000000000000000000000000000000000..17cc494fc9e3b33481ce20490265b7db9d156d23 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/driver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/driver.ts"],"sourcesContent":["import { sql } from '@vercel/postgres';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase } from '~/pg-core/db.ts';\nimport { PgDialect } from '~/pg-core/index.ts';\nimport {\n\tcreateTableRelationsHelpers,\n\textractTablesRelationalConfig,\n\ttype RelationalSchemaConfig,\n\ttype TablesRelationalConfig,\n} from '~/relations.ts';\nimport { type DrizzleConfig, isConfig } from '~/utils.ts';\nimport { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from './session.ts';\n\nexport interface VercelPgDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class VercelPgDriver {\n\tstatic readonly [entityKind]: string = 'VercelPgDriver';\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tprivate dialect: PgDialect,\n\t\tprivate options: VercelPgDriverOptions = {},\n\t) {\n\t}\n\n\tcreateSession(\n\t\tschema: RelationalSchemaConfig | undefined,\n\t): VercelPgSession, TablesRelationalConfig> {\n\t\treturn new VercelPgSession(this.client, this.dialect, schema, {\n\t\t\tlogger: this.options.logger,\n\t\t\tcache: this.options.cache,\n\t\t});\n\t}\n}\n\nexport class VercelPgDatabase<\n\tTSchema extends Record = Record,\n> extends PgDatabase {\n\tstatic override readonly [entityKind]: string = 'VercelPgDatabase';\n}\n\nfunction construct = Record>(\n\tclient: VercelPgClient,\n\tconfig: DrizzleConfig = {},\n): VercelPgDatabase & {\n\t$client: VercelPgClient;\n} {\n\tconst dialect = new PgDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(\n\t\t\tconfig.schema,\n\t\t\tcreateTableRelationsHelpers,\n\t\t);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst driver = new VercelPgDriver(client, dialect, { logger, cache: config.cache });\n\tconst session = driver.createSession(schema);\n\tconst db = new VercelPgDatabase(dialect, session, schema as any) as VercelPgDatabase;\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n\nexport function drizzle<\n\tTSchema extends Record = Record,\n\tTClient extends VercelPgClient = typeof sql,\n>(\n\t...params: [] | [\n\t\tTClient,\n\t] | [\n\t\tTClient,\n\t\tDrizzleConfig,\n\t] | [\n\t\t(\n\t\t\t& DrizzleConfig\n\t\t\t& ({\n\t\t\t\tclient?: TClient;\n\t\t\t})\n\t\t),\n\t]\n): VercelPgDatabase & {\n\t$client: VercelPgClient extends TClient ? typeof sql : TClient;\n} {\n\tif (isConfig(params[0])) {\n\t\tconst { client, ...drizzleConfig } = params[0] as ({ client?: TClient } & DrizzleConfig);\n\t\treturn construct(client ?? sql, drizzleConfig) as any;\n\t}\n\n\treturn construct((params[0] ?? sql) as TClient, params[1] as DrizzleConfig | undefined) as any;\n}\n\nexport namespace drizzle {\n\texport function mock = Record>(\n\t\tconfig?: DrizzleConfig,\n\t): VercelPgDatabase & {\n\t\t$client: '$client is not available on drizzle.mock()';\n\t} {\n\t\treturn construct({} as any, config) as any;\n\t}\n}\n"],"mappings":"AAAA,SAAS,WAAW;AAEpB,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,OAGM;AACP,SAA6B,gBAAgB;AAC7C,SAA2D,uBAAuB;AAO3E,MAAM,eAAe;AAAA,EAG3B,YACS,QACA,SACA,UAAiC,CAAC,GACzC;AAHO;AACA;AACA;AAAA,EAET;AAAA,EAPA,QAAiB,UAAU,IAAY;AAAA,EASvC,cACC,QACmE;AACnE,WAAO,IAAI,gBAAgB,KAAK,QAAQ,KAAK,SAAS,QAAQ;AAAA,MAC7D,QAAQ,KAAK,QAAQ;AAAA,MACrB,OAAO,KAAK,QAAQ;AAAA,IACrB,CAAC;AAAA,EACF;AACD;AAEO,MAAM,yBAEH,WAA4C;AAAA,EACrD,QAA0B,UAAU,IAAY;AACjD;AAEA,SAAS,UACR,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,UAAU,EAAE,QAAQ,OAAO,OAAO,CAAC;AACvD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,cAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,eAAe;AAAA,MACpB,OAAO;AAAA,MACP;AAAA,IACD;AACA,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,SAAS,IAAI,eAAe,QAAQ,SAAS,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAClF,QAAM,UAAU,OAAO,cAAc,MAAM;AAC3C,QAAM,KAAK,IAAI,iBAAiB,SAAS,SAAS,MAAa;AAC/D,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;AAEO,SAAS,WAIZ,QAeF;AACD,MAAI,SAAS,OAAO,CAAC,CAAC,GAAG;AACxB,UAAM,EAAE,QAAQ,GAAG,cAAc,IAAI,OAAO,CAAC;AAC7C,WAAO,UAAU,UAAU,KAAK,aAAa;AAAA,EAC9C;AAEA,SAAO,UAAW,OAAO,CAAC,KAAK,KAAiB,OAAO,CAAC,CAAuC;AAChG;AAAA,CAEO,CAAUA,aAAV;AACC,WAAS,KACf,QAGC;AACD,WAAO,UAAU,CAAC,GAAU,MAAM;AAAA,EACnC;AANO,EAAAA,SAAS;AAAA,GADA;","names":["drizzle"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..77abf8506e332ac43c693f3d76c5eab4ee22e415 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var vercel_postgres_exports = {}; +module.exports = __toCommonJS(vercel_postgres_exports); +__reExport(vercel_postgres_exports, require("./driver.cjs"), module.exports); +__reExport(vercel_postgres_exports, require("./session.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./driver.cjs"), + ...require("./session.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..781893e8a79ac343cc1a6bb06a2b6bf31d8dbe8d --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAc,wBAAd;AACA,oCAAc,yBADd;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.cts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..b7d749dade04d95ea95fff584a889f4704f5d86f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.cts @@ -0,0 +1,2 @@ +export * from "./driver.cjs"; +export * from "./session.cjs"; diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.ts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b74eaceb03f40303e798cdb14943536693db242b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.d.ts @@ -0,0 +1,2 @@ +export * from "./driver.js"; +export * from "./session.js"; diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6a77b476c19f87ef52c4b4bd27bb1eff3c095323 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js @@ -0,0 +1,3 @@ +export * from "./driver.js"; +export * from "./session.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..8b50fd8ad518eb3d173dd2b4a2b57d2cf77b88a3 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs new file mode 100644 index 0000000000000000000000000000000000000000..cb9d36fd8021e1acada1fad41d1b03aa935a670c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs @@ -0,0 +1,33 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var migrator_exports = {}; +__export(migrator_exports, { + migrate: () => migrate +}); +module.exports = __toCommonJS(migrator_exports); +var import_migrator = require("../migrator.cjs"); +async function migrate(db, config) { + const migrations = (0, import_migrator.readMigrationFiles)(config); + await db.dialect.migrate(migrations, db.session, config); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + migrate +}); +//# sourceMappingURL=migrator.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..522ce0756e2283ec76727cf972b0c638d7b4e050 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { VercelPgDatabase } from './driver.ts';\n\nexport async function migrate>(\n\tdb: VercelPgDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.cts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..bd354d7c7a8e45dd84097728d3379e9bc5ec6f67 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.cts @@ -0,0 +1,3 @@ +import type { MigrationConfig } from "../migrator.cjs"; +import type { VercelPgDatabase } from "./driver.cjs"; +export declare function migrate>(db: VercelPgDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.ts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c584b27baf1b2c8de82f0303ef75939fbfb332a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.d.ts @@ -0,0 +1,3 @@ +import type { MigrationConfig } from "../migrator.js"; +import type { VercelPgDatabase } from "./driver.js"; +export declare function migrate>(db: VercelPgDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js new file mode 100644 index 0000000000000000000000000000000000000000..75bc685b6186d6cd8c0307f9229368d22d4a790e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js @@ -0,0 +1,9 @@ +import { readMigrationFiles } from "../migrator.js"; +async function migrate(db, config) { + const migrations = readMigrationFiles(config); + await db.dialect.migrate(migrations, db.session, config); +} +export { + migrate +}; +//# sourceMappingURL=migrator.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e4b0e2d2d1b5da65be391403c54246af72e7e870 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/migrator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { VercelPgDatabase } from './driver.ts';\n\nexport async function migrate>(\n\tdb: VercelPgDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0c810a243b19d3e78f2695cf7403a0d44f39c023 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs @@ -0,0 +1,246 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var session_exports = {}; +__export(session_exports, { + VercelPgPreparedQuery: () => VercelPgPreparedQuery, + VercelPgSession: () => VercelPgSession, + VercelPgTransaction: () => VercelPgTransaction +}); +module.exports = __toCommonJS(session_exports); +var import_postgres = require("@vercel/postgres"); +var import_cache = require("../cache/core/cache.cjs"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_pg_core = require("../pg-core/index.cjs"); +var import_session = require("../pg-core/session.cjs"); +var import_sql = require("../sql/sql.cjs"); +var import_utils = require("../utils.cjs"); +class VercelPgPreparedQuery extends import_session.PgPreparedQuery { + constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, name, _isResponseInArrayMode, customResultMapper) { + super({ sql: queryString, params }, cache, queryMetadata, cacheConfig); + this.client = client; + this.params = params; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + this.rawQuery = { + name, + text: queryString, + types: { + // @ts-ignore + getTypeParser: (typeId, format) => { + if (typeId === import_postgres.types.builtins.TIMESTAMPTZ) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.TIMESTAMP) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.DATE) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.INTERVAL) { + return (val) => val; + } + if (typeId === 1231) { + return (val) => val; + } + if (typeId === 1115) { + return (val) => val; + } + if (typeId === 1185) { + return (val) => val; + } + if (typeId === 1187) { + return (val) => val; + } + if (typeId === 1182) { + return (val) => val; + } + return import_postgres.types.getTypeParser(typeId, format); + } + } + }; + this.queryConfig = { + name, + text: queryString, + rowMode: "array", + types: { + // @ts-ignore + getTypeParser: (typeId, format) => { + if (typeId === import_postgres.types.builtins.TIMESTAMPTZ) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.TIMESTAMP) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.DATE) { + return (val) => val; + } + if (typeId === import_postgres.types.builtins.INTERVAL) { + return (val) => val; + } + if (typeId === 1231) { + return (val) => val; + } + if (typeId === 1115) { + return (val) => val; + } + if (typeId === 1185) { + return (val) => val; + } + if (typeId === 1187) { + return (val) => val; + } + if (typeId === 1182) { + return (val) => val; + } + return import_postgres.types.getTypeParser(typeId, format); + } + } + }; + } + static [import_entity.entityKind] = "VercelPgPreparedQuery"; + rawQuery; + queryConfig; + async execute(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + const { fields, rawQuery, client, queryConfig: query, joinsNotNullableMap, customResultMapper } = this; + if (!fields && !customResultMapper) { + return this.queryWithCache(rawQuery.text, params, async () => { + return await client.query(rawQuery, params); + }); + } + const { rows } = await this.queryWithCache(query.text, params, async () => { + return await client.query(query, params); + }); + if (customResultMapper) { + return customResultMapper(rows); + } + return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap)); + } + all(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + return this.queryWithCache(this.rawQuery.text, params, async () => { + return await this.client.query(this.rawQuery, params); + }).then((result) => result.rows); + } + values(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + return this.queryWithCache(this.queryConfig.text, params, async () => { + return await this.client.query(this.queryConfig, params); + }).then((result) => result.rows); + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +class VercelPgSession extends import_session.PgSession { + constructor(client, dialect, schema, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.options = options; + this.logger = options.logger ?? new import_logger.NoopLogger(); + this.cache = options.cache ?? new import_cache.NoopCache(); + } + static [import_entity.entityKind] = "VercelPgSession"; + logger; + cache; + prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new VercelPgPreparedQuery( + this.client, + query.sql, + query.params, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + name, + isResponseInArrayMode, + customResultMapper + ); + } + async query(query, params) { + this.logger.logQuery(query, params); + const result = await this.client.query({ + rowMode: "array", + text: query, + values: params + }); + return result; + } + async queryObjects(query, params) { + return this.client.query(query, params); + } + async count(sql2) { + const result = await this.execute(sql2); + return Number(result["rows"][0]["count"]); + } + async transaction(transaction, config) { + const session = this.client instanceof import_postgres.VercelPool ? new VercelPgSession(await this.client.connect(), this.dialect, this.schema, this.options) : this; + const tx = new VercelPgTransaction(this.dialect, session, this.schema); + await tx.execute(import_sql.sql`begin${config ? import_sql.sql` ${tx.getTransactionConfigSQL(config)}` : void 0}`); + try { + const result = await transaction(tx); + await tx.execute(import_sql.sql`commit`); + return result; + } catch (error) { + await tx.execute(import_sql.sql`rollback`); + throw error; + } finally { + if (this.client instanceof import_postgres.VercelPool) { + session.client.release(); + } + } + } +} +class VercelPgTransaction extends import_pg_core.PgTransaction { + static [import_entity.entityKind] = "VercelPgTransaction"; + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex + 1}`; + const tx = new VercelPgTransaction( + this.dialect, + this.session, + this.schema, + this.nestedIndex + 1 + ); + await tx.execute(import_sql.sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await tx.execute(import_sql.sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await tx.execute(import_sql.sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + VercelPgPreparedQuery, + VercelPgSession, + VercelPgTransaction +}); +//# sourceMappingURL=session.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..b5d660fcb1bebe1c95b9b74f56048a1ea4b7ed37 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/session.ts"],"sourcesContent":["import {\n\ttype QueryArrayConfig,\n\ttype QueryConfig,\n\ttype QueryResult,\n\ttype QueryResultRow,\n\ttypes,\n\ttype VercelClient,\n\tVercelPool,\n\ttype VercelPoolClient,\n} from '@vercel/postgres';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport { type PgDialect, PgTransaction } from '~/pg-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query, type SQL, sql } from '~/sql/sql.ts';\nimport { type Assume, mapResultRow } from '~/utils.ts';\n\nexport type VercelPgClient = VercelPool | VercelClient | VercelPoolClient;\n\nexport class VercelPgPreparedQuery extends PgPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'VercelPgPreparedQuery';\n\n\tprivate rawQuery: QueryConfig;\n\tprivate queryConfig: QueryArrayConfig;\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tqueryString: string,\n\t\tprivate params: unknown[],\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t) {\n\t\tsuper({ sql: queryString, params }, cache, queryMetadata, cacheConfig);\n\t\tthis.rawQuery = {\n\t\t\tname,\n\t\t\ttext: queryString,\n\t\t\ttypes: {\n\t\t\t\t// @ts-ignore\n\t\t\t\tgetTypeParser: (typeId, format) => {\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMPTZ) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMP) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.DATE) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.INTERVAL) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// numeric[]\n\t\t\t\t\tif (typeId === 1231 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp[]\n\t\t\t\t\tif (typeId === 1115 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp with timezone[]\n\t\t\t\t\tif (typeId === 1185 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// interval[]\n\t\t\t\t\tif (typeId === 1187 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// date[]\n\t\t\t\t\tif (typeId === 1182 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn types.getTypeParser(typeId, format);\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\tthis.queryConfig = {\n\t\t\tname,\n\t\t\ttext: queryString,\n\t\t\trowMode: 'array',\n\t\t\ttypes: {\n\t\t\t\t// @ts-ignore\n\t\t\t\tgetTypeParser: (typeId, format) => {\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMPTZ) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMP) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.DATE) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.INTERVAL) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// numeric[]\n\t\t\t\t\tif (typeId === 1231 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp[]\n\t\t\t\t\tif (typeId === 1115 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp with timezone[]\n\t\t\t\t\tif (typeId === 1185 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// interval[]\n\t\t\t\t\tif (typeId === 1187 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// date[]\n\t\t\t\t\tif (typeId === 1182 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn types.getTypeParser(typeId, format);\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\n\t\tconst { fields, rawQuery, client, queryConfig: query, joinsNotNullableMap, customResultMapper } = this;\n\t\tif (!fields && !customResultMapper) {\n\t\t\treturn this.queryWithCache(rawQuery.text, params, async () => {\n\t\t\t\treturn await client.query(rawQuery, params);\n\t\t\t});\n\t\t}\n\n\t\tconst { rows } = await this.queryWithCache(query.text, params, async () => {\n\t\t\treturn await client.query(query, params);\n\t\t});\n\n\t\tif (customResultMapper) {\n\t\t\treturn customResultMapper(rows);\n\t\t}\n\n\t\treturn rows.map((row) => mapResultRow(fields!, row, joinsNotNullableMap));\n\t}\n\n\tall(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\t\treturn this.queryWithCache(this.rawQuery.text, params, async () => {\n\t\t\treturn await this.client.query(this.rawQuery, params);\n\t\t}).then((result) => result.rows);\n\t}\n\n\tvalues(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\t\treturn this.queryWithCache(this.queryConfig.text, params, async () => {\n\t\t\treturn await this.client.query(this.queryConfig, params);\n\t\t}).then((result) => result.rows);\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode(): boolean {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n\nexport interface VercelPgSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class VercelPgSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends PgSession {\n\tstatic override readonly [entityKind]: string = 'VercelPgSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tdialect: PgDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: VercelPgSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgPreparedQuery {\n\t\treturn new VercelPgPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery.sql,\n\t\t\tquery.params,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tname,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync query(query: string, params: unknown[]): Promise {\n\t\tthis.logger.logQuery(query, params);\n\t\tconst result = await this.client.query({\n\t\t\trowMode: 'array',\n\t\t\ttext: query,\n\t\t\tvalues: params,\n\t\t});\n\t\treturn result;\n\t}\n\n\tasync queryObjects(\n\t\tquery: string,\n\t\tparams: unknown[],\n\t): Promise> {\n\t\treturn this.client.query(query, params);\n\t}\n\n\toverride async count(sql: SQL): Promise {\n\t\tconst result = await this.execute(sql);\n\n\t\treturn Number((result as any)['rows'][0]['count']);\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: VercelPgTransaction) => Promise,\n\t\tconfig?: PgTransactionConfig | undefined,\n\t): Promise {\n\t\tconst session = this.client instanceof VercelPool // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t? new VercelPgSession(await this.client.connect(), this.dialect, this.schema, this.options)\n\t\t\t: this;\n\t\tconst tx = new VercelPgTransaction(this.dialect, session, this.schema);\n\t\tawait tx.execute(sql`begin${config ? sql` ${tx.getTransactionConfigSQL(config)}` : undefined}`);\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql`commit`);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tawait tx.execute(sql`rollback`);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.client instanceof VercelPool) { // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t\t(session.client as VercelPoolClient).release();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class VercelPgTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends PgTransaction {\n\tstatic override readonly [entityKind]: string = 'VercelPgTransaction';\n\n\toverride async transaction(\n\t\ttransaction: (tx: VercelPgTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new VercelPgTransaction(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis.schema,\n\t\t\tthis.nestedIndex + 1,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport interface VercelPgQueryResultHKT extends PgQueryResultHKT {\n\ttype: QueryResult>;\n}\n"],"mappings":"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","names":["sql"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.cts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..3b4162e29dee41bc04238e7a5ae024f8818a7d31 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.cts @@ -0,0 +1,59 @@ +import { type QueryResult, type QueryResultRow, type VercelClient, VercelPool, type VercelPoolClient } from '@vercel/postgres'; +import type { Cache } from "../cache/core/cache.cjs"; +import type { WithCacheConfig } from "../cache/core/types.cjs"; +import { entityKind } from "../entity.cjs"; +import { type Logger } from "../logger.cjs"; +import { type PgDialect, PgTransaction } from "../pg-core/index.cjs"; +import type { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.cjs"; +import type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from "../pg-core/session.cjs"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.cjs"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs"; +import { type Query, type SQL } from "../sql/sql.cjs"; +import { type Assume } from "../utils.cjs"; +export type VercelPgClient = VercelPool | VercelClient | VercelPoolClient; +export declare class VercelPgPreparedQuery extends PgPreparedQuery { + private client; + private params; + private logger; + private fields; + private _isResponseInArrayMode; + private customResultMapper?; + static readonly [entityKind]: string; + private rawQuery; + private queryConfig; + constructor(client: VercelPgClient, queryString: string, params: unknown[], logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, name: string | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined); + execute(placeholderValues?: Record | undefined): Promise; + all(placeholderValues?: Record | undefined): Promise; + values(placeholderValues?: Record | undefined): Promise; +} +export interface VercelPgSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class VercelPgSession, TSchema extends TablesRelationalConfig> extends PgSession { + private client; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: VercelPgClient, dialect: PgDialect, schema: RelationalSchemaConfig | undefined, options?: VercelPgSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): PgPreparedQuery; + query(query: string, params: unknown[]): Promise; + queryObjects(query: string, params: unknown[]): Promise>; + count(sql: SQL): Promise; + transaction(transaction: (tx: VercelPgTransaction) => Promise, config?: PgTransactionConfig | undefined): Promise; +} +export declare class VercelPgTransaction, TSchema extends TablesRelationalConfig> extends PgTransaction { + static readonly [entityKind]: string; + transaction(transaction: (tx: VercelPgTransaction) => Promise): Promise; +} +export interface VercelPgQueryResultHKT extends PgQueryResultHKT { + type: QueryResult>; +} diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.ts b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b7f79d23ff0f033ee6df79e6825870cd3a8ea7b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.d.ts @@ -0,0 +1,59 @@ +import { type QueryResult, type QueryResultRow, type VercelClient, VercelPool, type VercelPoolClient } from '@vercel/postgres'; +import type { Cache } from "../cache/core/cache.js"; +import type { WithCacheConfig } from "../cache/core/types.js"; +import { entityKind } from "../entity.js"; +import { type Logger } from "../logger.js"; +import { type PgDialect, PgTransaction } from "../pg-core/index.js"; +import type { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.js"; +import type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from "../pg-core/session.js"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.js"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js"; +import { type Query, type SQL } from "../sql/sql.js"; +import { type Assume } from "../utils.js"; +export type VercelPgClient = VercelPool | VercelClient | VercelPoolClient; +export declare class VercelPgPreparedQuery extends PgPreparedQuery { + private client; + private params; + private logger; + private fields; + private _isResponseInArrayMode; + private customResultMapper?; + static readonly [entityKind]: string; + private rawQuery; + private queryConfig; + constructor(client: VercelPgClient, queryString: string, params: unknown[], logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, name: string | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined); + execute(placeholderValues?: Record | undefined): Promise; + all(placeholderValues?: Record | undefined): Promise; + values(placeholderValues?: Record | undefined): Promise; +} +export interface VercelPgSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class VercelPgSession, TSchema extends TablesRelationalConfig> extends PgSession { + private client; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: VercelPgClient, dialect: PgDialect, schema: RelationalSchemaConfig | undefined, options?: VercelPgSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): PgPreparedQuery; + query(query: string, params: unknown[]): Promise; + queryObjects(query: string, params: unknown[]): Promise>; + count(sql: SQL): Promise; + transaction(transaction: (tx: VercelPgTransaction) => Promise, config?: PgTransactionConfig | undefined): Promise; +} +export declare class VercelPgTransaction, TSchema extends TablesRelationalConfig> extends PgTransaction { + static readonly [entityKind]: string; + transaction(transaction: (tx: VercelPgTransaction) => Promise): Promise; +} +export interface VercelPgQueryResultHKT extends PgQueryResultHKT { + type: QueryResult>; +} diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js new file mode 100644 index 0000000000000000000000000000000000000000..62254bebbb096697cbcd6baf9ec7dfd30432be33 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js @@ -0,0 +1,223 @@ +import { + types, + VercelPool +} from "@vercel/postgres"; +import { NoopCache } from "../cache/core/cache.js"; +import { entityKind } from "../entity.js"; +import { NoopLogger } from "../logger.js"; +import { PgTransaction } from "../pg-core/index.js"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.js"; +import { fillPlaceholders, sql } from "../sql/sql.js"; +import { mapResultRow } from "../utils.js"; +class VercelPgPreparedQuery extends PgPreparedQuery { + constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, name, _isResponseInArrayMode, customResultMapper) { + super({ sql: queryString, params }, cache, queryMetadata, cacheConfig); + this.client = client; + this.params = params; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + this.rawQuery = { + name, + text: queryString, + types: { + // @ts-ignore + getTypeParser: (typeId, format) => { + if (typeId === types.builtins.TIMESTAMPTZ) { + return (val) => val; + } + if (typeId === types.builtins.TIMESTAMP) { + return (val) => val; + } + if (typeId === types.builtins.DATE) { + return (val) => val; + } + if (typeId === types.builtins.INTERVAL) { + return (val) => val; + } + if (typeId === 1231) { + return (val) => val; + } + if (typeId === 1115) { + return (val) => val; + } + if (typeId === 1185) { + return (val) => val; + } + if (typeId === 1187) { + return (val) => val; + } + if (typeId === 1182) { + return (val) => val; + } + return types.getTypeParser(typeId, format); + } + } + }; + this.queryConfig = { + name, + text: queryString, + rowMode: "array", + types: { + // @ts-ignore + getTypeParser: (typeId, format) => { + if (typeId === types.builtins.TIMESTAMPTZ) { + return (val) => val; + } + if (typeId === types.builtins.TIMESTAMP) { + return (val) => val; + } + if (typeId === types.builtins.DATE) { + return (val) => val; + } + if (typeId === types.builtins.INTERVAL) { + return (val) => val; + } + if (typeId === 1231) { + return (val) => val; + } + if (typeId === 1115) { + return (val) => val; + } + if (typeId === 1185) { + return (val) => val; + } + if (typeId === 1187) { + return (val) => val; + } + if (typeId === 1182) { + return (val) => val; + } + return types.getTypeParser(typeId, format); + } + } + }; + } + static [entityKind] = "VercelPgPreparedQuery"; + rawQuery; + queryConfig; + async execute(placeholderValues = {}) { + const params = fillPlaceholders(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + const { fields, rawQuery, client, queryConfig: query, joinsNotNullableMap, customResultMapper } = this; + if (!fields && !customResultMapper) { + return this.queryWithCache(rawQuery.text, params, async () => { + return await client.query(rawQuery, params); + }); + } + const { rows } = await this.queryWithCache(query.text, params, async () => { + return await client.query(query, params); + }); + if (customResultMapper) { + return customResultMapper(rows); + } + return rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap)); + } + all(placeholderValues = {}) { + const params = fillPlaceholders(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + return this.queryWithCache(this.rawQuery.text, params, async () => { + return await this.client.query(this.rawQuery, params); + }).then((result) => result.rows); + } + values(placeholderValues = {}) { + const params = fillPlaceholders(this.params, placeholderValues); + this.logger.logQuery(this.rawQuery.text, params); + return this.queryWithCache(this.queryConfig.text, params, async () => { + return await this.client.query(this.queryConfig, params); + }).then((result) => result.rows); + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +class VercelPgSession extends PgSession { + constructor(client, dialect, schema, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.options = options; + this.logger = options.logger ?? new NoopLogger(); + this.cache = options.cache ?? new NoopCache(); + } + static [entityKind] = "VercelPgSession"; + logger; + cache; + prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new VercelPgPreparedQuery( + this.client, + query.sql, + query.params, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + name, + isResponseInArrayMode, + customResultMapper + ); + } + async query(query, params) { + this.logger.logQuery(query, params); + const result = await this.client.query({ + rowMode: "array", + text: query, + values: params + }); + return result; + } + async queryObjects(query, params) { + return this.client.query(query, params); + } + async count(sql2) { + const result = await this.execute(sql2); + return Number(result["rows"][0]["count"]); + } + async transaction(transaction, config) { + const session = this.client instanceof VercelPool ? new VercelPgSession(await this.client.connect(), this.dialect, this.schema, this.options) : this; + const tx = new VercelPgTransaction(this.dialect, session, this.schema); + await tx.execute(sql`begin${config ? sql` ${tx.getTransactionConfigSQL(config)}` : void 0}`); + try { + const result = await transaction(tx); + await tx.execute(sql`commit`); + return result; + } catch (error) { + await tx.execute(sql`rollback`); + throw error; + } finally { + if (this.client instanceof VercelPool) { + session.client.release(); + } + } + } +} +class VercelPgTransaction extends PgTransaction { + static [entityKind] = "VercelPgTransaction"; + async transaction(transaction) { + const savepointName = `sp${this.nestedIndex + 1}`; + const tx = new VercelPgTransaction( + this.dialect, + this.session, + this.schema, + this.nestedIndex + 1 + ); + await tx.execute(sql.raw(`savepoint ${savepointName}`)); + try { + const result = await transaction(tx); + await tx.execute(sql.raw(`release savepoint ${savepointName}`)); + return result; + } catch (err) { + await tx.execute(sql.raw(`rollback to savepoint ${savepointName}`)); + throw err; + } + } +} +export { + VercelPgPreparedQuery, + VercelPgSession, + VercelPgTransaction +}; +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js.map b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2768c444207f80b13c5760784d13e6676a36b918 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/vercel-postgres/session.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/vercel-postgres/session.ts"],"sourcesContent":["import {\n\ttype QueryArrayConfig,\n\ttype QueryConfig,\n\ttype QueryResult,\n\ttype QueryResultRow,\n\ttypes,\n\ttype VercelClient,\n\tVercelPool,\n\ttype VercelPoolClient,\n} from '@vercel/postgres';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { NoopCache } from '~/cache/core/cache.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport { type PgDialect, PgTransaction } from '~/pg-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query, type SQL, sql } from '~/sql/sql.ts';\nimport { type Assume, mapResultRow } from '~/utils.ts';\n\nexport type VercelPgClient = VercelPool | VercelClient | VercelPoolClient;\n\nexport class VercelPgPreparedQuery extends PgPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'VercelPgPreparedQuery';\n\n\tprivate rawQuery: QueryConfig;\n\tprivate queryConfig: QueryArrayConfig;\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tqueryString: string,\n\t\tprivate params: unknown[],\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t) {\n\t\tsuper({ sql: queryString, params }, cache, queryMetadata, cacheConfig);\n\t\tthis.rawQuery = {\n\t\t\tname,\n\t\t\ttext: queryString,\n\t\t\ttypes: {\n\t\t\t\t// @ts-ignore\n\t\t\t\tgetTypeParser: (typeId, format) => {\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMPTZ) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMP) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.DATE) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.INTERVAL) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// numeric[]\n\t\t\t\t\tif (typeId === 1231 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp[]\n\t\t\t\t\tif (typeId === 1115 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp with timezone[]\n\t\t\t\t\tif (typeId === 1185 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// interval[]\n\t\t\t\t\tif (typeId === 1187 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// date[]\n\t\t\t\t\tif (typeId === 1182 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn types.getTypeParser(typeId, format);\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\tthis.queryConfig = {\n\t\t\tname,\n\t\t\ttext: queryString,\n\t\t\trowMode: 'array',\n\t\t\ttypes: {\n\t\t\t\t// @ts-ignore\n\t\t\t\tgetTypeParser: (typeId, format) => {\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMPTZ) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.TIMESTAMP) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.DATE) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeId === types.builtins.INTERVAL) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// numeric[]\n\t\t\t\t\tif (typeId === 1231 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp[]\n\t\t\t\t\tif (typeId === 1115 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// timestamp with timezone[]\n\t\t\t\t\tif (typeId === 1185 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// interval[]\n\t\t\t\t\tif (typeId === 1187 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// date[]\n\t\t\t\t\tif (typeId === 1182 as any) {\n\t\t\t\t\t\treturn (val: any) => val;\n\t\t\t\t\t}\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\treturn types.getTypeParser(typeId, format);\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\n\t\tconst { fields, rawQuery, client, queryConfig: query, joinsNotNullableMap, customResultMapper } = this;\n\t\tif (!fields && !customResultMapper) {\n\t\t\treturn this.queryWithCache(rawQuery.text, params, async () => {\n\t\t\t\treturn await client.query(rawQuery, params);\n\t\t\t});\n\t\t}\n\n\t\tconst { rows } = await this.queryWithCache(query.text, params, async () => {\n\t\t\treturn await client.query(query, params);\n\t\t});\n\n\t\tif (customResultMapper) {\n\t\t\treturn customResultMapper(rows);\n\t\t}\n\n\t\treturn rows.map((row) => mapResultRow(fields!, row, joinsNotNullableMap));\n\t}\n\n\tall(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\t\treturn this.queryWithCache(this.rawQuery.text, params, async () => {\n\t\t\treturn await this.client.query(this.rawQuery, params);\n\t\t}).then((result) => result.rows);\n\t}\n\n\tvalues(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.params, placeholderValues);\n\t\tthis.logger.logQuery(this.rawQuery.text, params);\n\t\treturn this.queryWithCache(this.queryConfig.text, params, async () => {\n\t\t\treturn await this.client.query(this.queryConfig, params);\n\t\t}).then((result) => result.rows);\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode(): boolean {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n\nexport interface VercelPgSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class VercelPgSession<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends PgSession {\n\tstatic override readonly [entityKind]: string = 'VercelPgSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: VercelPgClient,\n\t\tdialect: PgDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: VercelPgSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgPreparedQuery {\n\t\treturn new VercelPgPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery.sql,\n\t\t\tquery.params,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tname,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync query(query: string, params: unknown[]): Promise {\n\t\tthis.logger.logQuery(query, params);\n\t\tconst result = await this.client.query({\n\t\t\trowMode: 'array',\n\t\t\ttext: query,\n\t\t\tvalues: params,\n\t\t});\n\t\treturn result;\n\t}\n\n\tasync queryObjects(\n\t\tquery: string,\n\t\tparams: unknown[],\n\t): Promise> {\n\t\treturn this.client.query(query, params);\n\t}\n\n\toverride async count(sql: SQL): Promise {\n\t\tconst result = await this.execute(sql);\n\n\t\treturn Number((result as any)['rows'][0]['count']);\n\t}\n\n\toverride async transaction(\n\t\ttransaction: (tx: VercelPgTransaction) => Promise,\n\t\tconfig?: PgTransactionConfig | undefined,\n\t): Promise {\n\t\tconst session = this.client instanceof VercelPool // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t? new VercelPgSession(await this.client.connect(), this.dialect, this.schema, this.options)\n\t\t\t: this;\n\t\tconst tx = new VercelPgTransaction(this.dialect, session, this.schema);\n\t\tawait tx.execute(sql`begin${config ? sql` ${tx.getTransactionConfigSQL(config)}` : undefined}`);\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql`commit`);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tawait tx.execute(sql`rollback`);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tif (this.client instanceof VercelPool) { // eslint-disable-line no-instanceof/no-instanceof\n\t\t\t\t(session.client as VercelPoolClient).release();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class VercelPgTransaction<\n\tTFullSchema extends Record,\n\tTSchema extends TablesRelationalConfig,\n> extends PgTransaction {\n\tstatic override readonly [entityKind]: string = 'VercelPgTransaction';\n\n\toverride async transaction(\n\t\ttransaction: (tx: VercelPgTransaction) => Promise,\n\t): Promise {\n\t\tconst savepointName = `sp${this.nestedIndex + 1}`;\n\t\tconst tx = new VercelPgTransaction(\n\t\t\tthis.dialect,\n\t\t\tthis.session,\n\t\t\tthis.schema,\n\t\t\tthis.nestedIndex + 1,\n\t\t);\n\t\tawait tx.execute(sql.raw(`savepoint ${savepointName}`));\n\t\ttry {\n\t\t\tconst result = await transaction(tx);\n\t\t\tawait tx.execute(sql.raw(`release savepoint ${savepointName}`));\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tawait tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n\nexport interface VercelPgQueryResultHKT extends PgQueryResultHKT {\n\ttype: QueryResult>;\n}\n"],"mappings":"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","names":["sql"]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/version.cjs b/e-commerce/node_modules/drizzle-orm/version.cjs new file mode 100644 index 0000000000000000000000000000000000000000..bd3d36cad208802f72ab7c2329441a975655bd03 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.cjs @@ -0,0 +1,37 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/version.ts +var version_exports = {}; +__export(version_exports, { + compatibilityVersion: () => compatibilityVersion, + npmVersion: () => version +}); +module.exports = __toCommonJS(version_exports); + +// package.json +var version = "0.45.4"; + +// src/version.ts +var compatibilityVersion = 10; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + compatibilityVersion, + npmVersion +}); diff --git a/e-commerce/node_modules/drizzle-orm/version.cjs.map b/e-commerce/node_modules/drizzle-orm/version.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..b349efa3b0d4b8f3d3e6b8d09d1f7472d77275db --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// @ts-ignore - imported using Rollup json plugin\nexport { version as npmVersion } from '../package.json';\n// In version 7, we changed the PostgreSQL indexes API\nexport const compatibilityVersion = 10;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAsC;AAE/B,MAAM,uBAAuB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/version.d.cts b/e-commerce/node_modules/drizzle-orm/version.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..a6d9ce0045f8c3bf6527b29c5503830b5cf53a68 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.d.cts @@ -0,0 +1,5 @@ +var version = "0.45.4"; + +declare const compatibilityVersion = 10; + +export { compatibilityVersion, version as npmVersion }; diff --git a/e-commerce/node_modules/drizzle-orm/version.d.ts b/e-commerce/node_modules/drizzle-orm/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6d9ce0045f8c3bf6527b29c5503830b5cf53a68 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.d.ts @@ -0,0 +1,5 @@ +var version = "0.45.4"; + +declare const compatibilityVersion = 10; + +export { compatibilityVersion, version as npmVersion }; diff --git a/e-commerce/node_modules/drizzle-orm/version.js b/e-commerce/node_modules/drizzle-orm/version.js new file mode 100644 index 0000000000000000000000000000000000000000..de1826bfe80efb8214285ad2e8ba8ddea3ccb86a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.js @@ -0,0 +1,9 @@ +// package.json +var version = "0.45.4"; + +// src/version.ts +var compatibilityVersion = 10; +export { + compatibilityVersion, + version as npmVersion +}; diff --git a/e-commerce/node_modules/drizzle-orm/version.js.map b/e-commerce/node_modules/drizzle-orm/version.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b58942241963eed1a7e49e826cd5b070cd813985 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/version.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// @ts-ignore - imported using Rollup json plugin\nexport { version as npmVersion } from '../package.json';\n// In version 7, we changed the PostgreSQL indexes API\nexport const compatibilityVersion = 10;\n"],"mappings":"AACA,SAAoB,eAAkB;AAE/B,MAAM,uBAAuB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/view-common.cjs b/e-commerce/node_modules/drizzle-orm/view-common.cjs new file mode 100644 index 0000000000000000000000000000000000000000..3fedeb1ee41110f014ea32aed1c3315cb0d70a7e --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.cjs @@ -0,0 +1,29 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var view_common_exports = {}; +__export(view_common_exports, { + ViewBaseConfig: () => ViewBaseConfig +}); +module.exports = __toCommonJS(view_common_exports); +const ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig"); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ViewBaseConfig +}); +//# sourceMappingURL=view-common.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/view-common.cjs.map b/e-commerce/node_modules/drizzle-orm/view-common.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..63290ba0fc1c11a1f45f6d47244f9eb32432a75b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/view-common.ts"],"sourcesContent":["export const ViewBaseConfig = Symbol.for('drizzle:ViewBaseConfig');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,iBAAiB,OAAO,IAAI,wBAAwB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/view-common.d.cts b/e-commerce/node_modules/drizzle-orm/view-common.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..eef5c1eaf10a1521dbca6cdc4fdd80d4cc909219 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.d.cts @@ -0,0 +1 @@ +export declare const ViewBaseConfig: unique symbol; diff --git a/e-commerce/node_modules/drizzle-orm/view-common.d.ts b/e-commerce/node_modules/drizzle-orm/view-common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eef5c1eaf10a1521dbca6cdc4fdd80d4cc909219 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.d.ts @@ -0,0 +1 @@ +export declare const ViewBaseConfig: unique symbol; diff --git a/e-commerce/node_modules/drizzle-orm/view-common.js b/e-commerce/node_modules/drizzle-orm/view-common.js new file mode 100644 index 0000000000000000000000000000000000000000..550578e35e025d5fed77e3233e31d5d50a55309c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.js @@ -0,0 +1,5 @@ +const ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig"); +export { + ViewBaseConfig +}; +//# sourceMappingURL=view-common.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/view-common.js.map b/e-commerce/node_modules/drizzle-orm/view-common.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7eac45a1a49048ebfe67ef918ee891e13a87887f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/view-common.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/view-common.ts"],"sourcesContent":["export const ViewBaseConfig = Symbol.for('drizzle:ViewBaseConfig');\n"],"mappings":"AAAO,MAAM,iBAAiB,OAAO,IAAI,wBAAwB;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs b/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs new file mode 100644 index 0000000000000000000000000000000000000000..fc92546e5ac27d437b1225c71954d37d76521f6c --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs @@ -0,0 +1,89 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var driver_exports = {}; +__export(driver_exports, { + XataHttpDatabase: () => XataHttpDatabase, + XataHttpDriver: () => XataHttpDriver, + drizzle: () => drizzle +}); +module.exports = __toCommonJS(driver_exports); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_db = require("../pg-core/db.cjs"); +var import_dialect = require("../pg-core/dialect.cjs"); +var import_relations = require("../relations.cjs"); +var import_session = require("./session.cjs"); +class XataHttpDriver { + constructor(client, dialect, options = {}) { + this.client = client; + this.dialect = dialect; + this.options = options; + this.initMappers(); + } + static [import_entity.entityKind] = "XataDriver"; + createSession(schema) { + return new import_session.XataHttpSession(this.client, this.dialect, schema, { + logger: this.options.logger, + cache: this.options.cache + }); + } + initMappers() { + } +} +class XataHttpDatabase extends import_db.PgDatabase { + static [import_entity.entityKind] = "XataHttpDatabase"; +} +function drizzle(client, config = {}) { + const dialect = new import_dialect.PgDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new import_logger.DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = (0, import_relations.extractTablesRelationalConfig)(config.schema, import_relations.createTableRelationsHelpers); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const driver = new XataHttpDriver(client, dialect, { logger, cache: config.cache }); + const session = driver.createSession(schema); + const db = new XataHttpDatabase( + dialect, + session, + schema + ); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + XataHttpDatabase, + XataHttpDriver, + drizzle +}); +//# sourceMappingURL=driver.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs.map b/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..c7d7df4f544d8fb22c9ef66c48f94a63fa82e817 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/driver.ts"],"sourcesContent":["import type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase } from '~/pg-core/db.ts';\nimport { PgDialect } from '~/pg-core/dialect.ts';\nimport type { ExtractTablesWithRelations, RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { createTableRelationsHelpers, extractTablesRelationalConfig } from '~/relations.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport type { XataHttpClient, XataHttpQueryResultHKT } from './session.ts';\nimport { XataHttpSession } from './session.ts';\n\nexport interface XataDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class XataHttpDriver {\n\tstatic readonly [entityKind]: string = 'XataDriver';\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tprivate dialect: PgDialect,\n\t\tprivate options: XataDriverOptions = {},\n\t) {\n\t\tthis.initMappers();\n\t}\n\n\tcreateSession(\n\t\tschema: RelationalSchemaConfig | undefined,\n\t): XataHttpSession, TablesRelationalConfig> {\n\t\treturn new XataHttpSession(this.client, this.dialect, schema, {\n\t\t\tlogger: this.options.logger,\n\t\t\tcache: this.options.cache,\n\t\t});\n\t}\n\n\tinitMappers() {\n\t\t// TODO: Add custom type parsers\n\t}\n}\n\nexport class XataHttpDatabase = Record>\n\textends PgDatabase\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpDatabase';\n\n\t/** @internal */\n\tdeclare readonly session: XataHttpSession>;\n}\n\nexport function drizzle = Record>(\n\tclient: XataHttpClient,\n\tconfig: DrizzleConfig = {},\n): XataHttpDatabase & {\n\t$client: XataHttpClient;\n} {\n\tconst dialect = new PgDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(config.schema, createTableRelationsHelpers);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst driver = new XataHttpDriver(client, dialect, { logger, cache: config.cache });\n\tconst session = driver.createSession(schema);\n\n\tconst db = new XataHttpDatabase(\n\t\tdialect,\n\t\tsession,\n\t\tschema as RelationalSchemaConfig> | undefined,\n\t);\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAE3B,oBAA8B;AAC9B,gBAA2B;AAC3B,qBAA0B;AAE1B,uBAA2E;AAG3E,qBAAgC;AAOzB,MAAM,eAAe;AAAA,EAG3B,YACS,QACA,SACA,UAA6B,CAAC,GACrC;AAHO;AACA;AACA;AAER,SAAK,YAAY;AAAA,EAClB;AAAA,EARA,QAAiB,wBAAU,IAAY;AAAA,EAUvC,cACC,QACmE;AACnE,WAAO,IAAI,+BAAgB,KAAK,QAAQ,KAAK,SAAS,QAAQ;AAAA,MAC7D,QAAQ,KAAK,QAAQ;AAAA,MACrB,OAAO,KAAK,QAAQ;AAAA,IACrB,CAAC;AAAA,EACF;AAAA,EAEA,cAAc;AAAA,EAEd;AACD;AAEO,MAAM,yBACJ,qBACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAIjD;AAEO,SAAS,QACf,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,yBAAU,EAAE,QAAQ,OAAO,OAAO,CAAC;AACvD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,4BAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,mBAAe,gDAA8B,OAAO,QAAQ,4CAA2B;AAC7F,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,SAAS,IAAI,eAAe,QAAQ,SAAS,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAClF,QAAM,UAAU,OAAO,cAAc,MAAM;AAE3C,QAAM,KAAK,IAAI;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.cts b/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..c388ce4403252042c50dbe01c3f9053a947b4a61 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.cts @@ -0,0 +1,28 @@ +import type { Cache } from "../cache/core/cache.cjs"; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import { PgDatabase } from "../pg-core/db.cjs"; +import { PgDialect } from "../pg-core/dialect.cjs"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs"; +import type { DrizzleConfig } from "../utils.cjs"; +import type { XataHttpClient, XataHttpQueryResultHKT } from "./session.cjs"; +import { XataHttpSession } from "./session.cjs"; +export interface XataDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class XataHttpDriver { + private client; + private dialect; + private options; + static readonly [entityKind]: string; + constructor(client: XataHttpClient, dialect: PgDialect, options?: XataDriverOptions); + createSession(schema: RelationalSchemaConfig | undefined): XataHttpSession, TablesRelationalConfig>; + initMappers(): void; +} +export declare class XataHttpDatabase = Record> extends PgDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record>(client: XataHttpClient, config?: DrizzleConfig): XataHttpDatabase & { + $client: XataHttpClient; +}; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.ts b/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62ea4260416665398ec58ef9bd5a95fe34eadd80 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.d.ts @@ -0,0 +1,28 @@ +import type { Cache } from "../cache/core/cache.js"; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import { PgDatabase } from "../pg-core/db.js"; +import { PgDialect } from "../pg-core/dialect.js"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js"; +import type { DrizzleConfig } from "../utils.js"; +import type { XataHttpClient, XataHttpQueryResultHKT } from "./session.js"; +import { XataHttpSession } from "./session.js"; +export interface XataDriverOptions { + logger?: Logger; + cache?: Cache; +} +export declare class XataHttpDriver { + private client; + private dialect; + private options; + static readonly [entityKind]: string; + constructor(client: XataHttpClient, dialect: PgDialect, options?: XataDriverOptions); + createSession(schema: RelationalSchemaConfig | undefined): XataHttpSession, TablesRelationalConfig>; + initMappers(): void; +} +export declare class XataHttpDatabase = Record> extends PgDatabase { + static readonly [entityKind]: string; +} +export declare function drizzle = Record>(client: XataHttpClient, config?: DrizzleConfig): XataHttpDatabase & { + $client: XataHttpClient; +}; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.js b/e-commerce/node_modules/drizzle-orm/xata-http/driver.js new file mode 100644 index 0000000000000000000000000000000000000000..47dedaea9deff143126a6a401fefaa6b4945c247 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.js @@ -0,0 +1,63 @@ +import { entityKind } from "../entity.js"; +import { DefaultLogger } from "../logger.js"; +import { PgDatabase } from "../pg-core/db.js"; +import { PgDialect } from "../pg-core/dialect.js"; +import { createTableRelationsHelpers, extractTablesRelationalConfig } from "../relations.js"; +import { XataHttpSession } from "./session.js"; +class XataHttpDriver { + constructor(client, dialect, options = {}) { + this.client = client; + this.dialect = dialect; + this.options = options; + this.initMappers(); + } + static [entityKind] = "XataDriver"; + createSession(schema) { + return new XataHttpSession(this.client, this.dialect, schema, { + logger: this.options.logger, + cache: this.options.cache + }); + } + initMappers() { + } +} +class XataHttpDatabase extends PgDatabase { + static [entityKind] = "XataHttpDatabase"; +} +function drizzle(client, config = {}) { + const dialect = new PgDialect({ casing: config.casing }); + let logger; + if (config.logger === true) { + logger = new DefaultLogger(); + } else if (config.logger !== false) { + logger = config.logger; + } + let schema; + if (config.schema) { + const tablesConfig = extractTablesRelationalConfig(config.schema, createTableRelationsHelpers); + schema = { + fullSchema: config.schema, + schema: tablesConfig.tables, + tableNamesMap: tablesConfig.tableNamesMap + }; + } + const driver = new XataHttpDriver(client, dialect, { logger, cache: config.cache }); + const session = driver.createSession(schema); + const db = new XataHttpDatabase( + dialect, + session, + schema + ); + db.$client = client; + db.$cache = config.cache; + if (db.$cache) { + db.$cache["invalidate"] = config.cache?.onMutate; + } + return db; +} +export { + XataHttpDatabase, + XataHttpDriver, + drizzle +}; +//# sourceMappingURL=driver.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/driver.js.map b/e-commerce/node_modules/drizzle-orm/xata-http/driver.js.map new file mode 100644 index 0000000000000000000000000000000000000000..161b084673072fdaf5e1957a95882a3ddc8b0dfe --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/driver.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/driver.ts"],"sourcesContent":["import type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase } from '~/pg-core/db.ts';\nimport { PgDialect } from '~/pg-core/dialect.ts';\nimport type { ExtractTablesWithRelations, RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { createTableRelationsHelpers, extractTablesRelationalConfig } from '~/relations.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport type { XataHttpClient, XataHttpQueryResultHKT } from './session.ts';\nimport { XataHttpSession } from './session.ts';\n\nexport interface XataDriverOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class XataHttpDriver {\n\tstatic readonly [entityKind]: string = 'XataDriver';\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tprivate dialect: PgDialect,\n\t\tprivate options: XataDriverOptions = {},\n\t) {\n\t\tthis.initMappers();\n\t}\n\n\tcreateSession(\n\t\tschema: RelationalSchemaConfig | undefined,\n\t): XataHttpSession, TablesRelationalConfig> {\n\t\treturn new XataHttpSession(this.client, this.dialect, schema, {\n\t\t\tlogger: this.options.logger,\n\t\t\tcache: this.options.cache,\n\t\t});\n\t}\n\n\tinitMappers() {\n\t\t// TODO: Add custom type parsers\n\t}\n}\n\nexport class XataHttpDatabase = Record>\n\textends PgDatabase\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpDatabase';\n\n\t/** @internal */\n\tdeclare readonly session: XataHttpSession>;\n}\n\nexport function drizzle = Record>(\n\tclient: XataHttpClient,\n\tconfig: DrizzleConfig = {},\n): XataHttpDatabase & {\n\t$client: XataHttpClient;\n} {\n\tconst dialect = new PgDialect({ casing: config.casing });\n\tlet logger;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\tlet schema: RelationalSchemaConfig | undefined;\n\tif (config.schema) {\n\t\tconst tablesConfig = extractTablesRelationalConfig(config.schema, createTableRelationsHelpers);\n\t\tschema = {\n\t\t\tfullSchema: config.schema,\n\t\t\tschema: tablesConfig.tables,\n\t\t\ttableNamesMap: tablesConfig.tableNamesMap,\n\t\t};\n\t}\n\n\tconst driver = new XataHttpDriver(client, dialect, { logger, cache: config.cache });\n\tconst session = driver.createSession(schema);\n\n\tconst db = new XataHttpDatabase(\n\t\tdialect,\n\t\tsession,\n\t\tschema as RelationalSchemaConfig> | undefined,\n\t);\n\t( db).$client = client;\n\t( db).$cache = config.cache;\n\tif (( db).$cache) {\n\t\t( db).$cache['invalidate'] = config.cache?.onMutate;\n\t}\n\n\treturn db as any;\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAE1B,SAAS,6BAA6B,qCAAqC;AAG3E,SAAS,uBAAuB;AAOzB,MAAM,eAAe;AAAA,EAG3B,YACS,QACA,SACA,UAA6B,CAAC,GACrC;AAHO;AACA;AACA;AAER,SAAK,YAAY;AAAA,EAClB;AAAA,EARA,QAAiB,UAAU,IAAY;AAAA,EAUvC,cACC,QACmE;AACnE,WAAO,IAAI,gBAAgB,KAAK,QAAQ,KAAK,SAAS,QAAQ;AAAA,MAC7D,QAAQ,KAAK,QAAQ;AAAA,MACrB,OAAO,KAAK,QAAQ;AAAA,IACrB,CAAC;AAAA,EACF;AAAA,EAEA,cAAc;AAAA,EAEd;AACD;AAEO,MAAM,yBACJ,WACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAIjD;AAEO,SAAS,QACf,QACA,SAAiC,CAAC,GAGjC;AACD,QAAM,UAAU,IAAI,UAAU,EAAE,QAAQ,OAAO,OAAO,CAAC;AACvD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,cAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,MAAI;AACJ,MAAI,OAAO,QAAQ;AAClB,UAAM,eAAe,8BAA8B,OAAO,QAAQ,2BAA2B;AAC7F,aAAS;AAAA,MACR,YAAY,OAAO;AAAA,MACnB,QAAQ,aAAa;AAAA,MACrB,eAAe,aAAa;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,SAAS,IAAI,eAAe,QAAQ,SAAS,EAAE,QAAQ,OAAO,OAAO,MAAM,CAAC;AAClF,QAAM,UAAU,OAAO,cAAc,MAAM;AAE3C,QAAM,KAAK,IAAI;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,EAAO,GAAI,UAAU;AACrB,EAAO,GAAI,SAAS,OAAO;AAC3B,MAAW,GAAI,QAAQ;AACtB,IAAO,GAAI,OAAO,YAAY,IAAI,OAAO,OAAO;AAAA,EACjD;AAEA,SAAO;AACR;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs b/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..1e8e2b9b5d8f574ac0d8a6961821ec6eeacd1e44 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var xata_http_exports = {}; +module.exports = __toCommonJS(xata_http_exports); +__reExport(xata_http_exports, require("./driver.cjs"), module.exports); +__reExport(xata_http_exports, require("./session.cjs"), module.exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + ...require("./driver.cjs"), + ...require("./session.cjs") +}); +//# sourceMappingURL=index.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs.map b/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..7ef895ff16572ec8cf5366f057214c7ebdd4025a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAc,wBAAd;AACA,8BAAc,yBADd;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.d.cts b/e-commerce/node_modules/drizzle-orm/xata-http/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..b7d749dade04d95ea95fff584a889f4704f5d86f --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.d.cts @@ -0,0 +1,2 @@ +export * from "./driver.cjs"; +export * from "./session.cjs"; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.d.ts b/e-commerce/node_modules/drizzle-orm/xata-http/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b74eaceb03f40303e798cdb14943536693db242b --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.d.ts @@ -0,0 +1,2 @@ +export * from "./driver.js"; +export * from "./session.js"; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.js b/e-commerce/node_modules/drizzle-orm/xata-http/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6a77b476c19f87ef52c4b4bd27bb1eff3c095323 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.js @@ -0,0 +1,3 @@ +export * from "./driver.js"; +export * from "./session.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/index.js.map b/e-commerce/node_modules/drizzle-orm/xata-http/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ac4ab62c6de823a2a31cd4583b3526bca5ddc998 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs new file mode 100644 index 0000000000000000000000000000000000000000..b397dba7c5ba4586b7e67d0eb11d5c936f84792a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs @@ -0,0 +1,56 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var migrator_exports = {}; +__export(migrator_exports, { + migrate: () => migrate +}); +module.exports = __toCommonJS(migrator_exports); +var import_migrator = require("../migrator.cjs"); +var import_sql = require("../sql/sql.cjs"); +async function migrate(db, config) { + const migrations = (0, import_migrator.readMigrationFiles)(config); + const migrationsTable = config.migrationsTable ?? "__drizzle_migrations"; + const migrationTableCreate = import_sql.sql` + CREATE TABLE IF NOT EXISTS ${import_sql.sql.identifier(migrationsTable)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at bigint + ) + `; + await db.session.execute(migrationTableCreate); + const dbMigrations = await db.session.all( + import_sql.sql`select id, hash, created_at from ${import_sql.sql.identifier(migrationsTable)} order by created_at desc limit 1` + ); + const lastDbMigration = dbMigrations[0]; + for await (const migration of migrations) { + if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) { + for (const stmt of migration.sql) { + await db.session.execute(import_sql.sql.raw(stmt)); + } + await db.session.execute( + import_sql.sql`insert into ${import_sql.sql.identifier(migrationsTable)} ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})` + ); + } + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + migrate +}); +//# sourceMappingURL=migrator.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs.map b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..9ff4902c7b3ef3cc57b9e216a3f3ae77f68c17c6 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/migrator.ts"],"sourcesContent":["import { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { XataHttpDatabase } from './driver.ts';\n\nexport interface MigrationConfig {\n\tmigrationsFolder: string;\n\tmigrationsTable?: string;\n}\n\n/**\n * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database\n *\n * NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails,\n * no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.\n * @param db - drizzle db instance\n * @param config - path to migration folder generated by drizzle-kit\n */ export async function migrate>(\n\tdb: XataHttpDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tconst migrationsTable = config.migrationsTable ?? '__drizzle_migrations';\n\tconst migrationTableCreate = sql`\n\t\tCREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} (\n\t\t\tid SERIAL PRIMARY KEY,\n\t\t\thash text NOT NULL,\n\t\t\tcreated_at bigint\n\t\t)\n\t`;\n\tawait db.session.execute(migrationTableCreate);\n\n\tconst dbMigrations = await db.session.all<{\n\t\tid: number;\n\t\thash: string;\n\t\tcreated_at: string;\n\t}>(\n\t\tsql`select id, hash, created_at from ${sql.identifier(migrationsTable)} order by created_at desc limit 1`,\n\t);\n\n\tconst lastDbMigration = dbMigrations[0];\n\n\tfor await (const migration of migrations) {\n\t\tif (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {\n\t\t\tfor (const stmt of migration.sql) {\n\t\t\t\tawait db.session.execute(sql.raw(stmt));\n\t\t\t}\n\n\t\t\tawait db.session.execute(\n\t\t\t\tsql`insert into ${\n\t\t\t\t\tsql.identifier(migrationsTable)\n\t\t\t\t} (\"hash\", \"created_at\") values(${migration.hash}, ${migration.folderMillis})`,\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAmC;AACnC,iBAAoB;AAehB,eAAsB,QACzB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,kBAAkB,OAAO,mBAAmB;AAClD,QAAM,uBAAuB;AAAA,+BACC,eAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D,QAAM,GAAG,QAAQ,QAAQ,oBAAoB;AAE7C,QAAM,eAAe,MAAM,GAAG,QAAQ;AAAA,IAKrC,kDAAuC,eAAI,WAAW,eAAe,CAAC;AAAA,EACvE;AAEA,QAAM,kBAAkB,aAAa,CAAC;AAEtC,mBAAiB,aAAa,YAAY;AACzC,QAAI,CAAC,mBAAmB,OAAO,gBAAgB,UAAU,IAAI,UAAU,cAAc;AACpF,iBAAW,QAAQ,UAAU,KAAK;AACjC,cAAM,GAAG,QAAQ,QAAQ,eAAI,IAAI,IAAI,CAAC;AAAA,MACvC;AAEA,YAAM,GAAG,QAAQ;AAAA,QAChB,6BACC,eAAI,WAAW,eAAe,CAC/B,kCAAkC,UAAU,IAAI,KAAK,UAAU,YAAY;AAAA,MAC5E;AAAA,IACD;AAAA,EACD;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.cts b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..6887793a615d16d84252835affb43c63fdd83e3a --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.cts @@ -0,0 +1,13 @@ +import type { XataHttpDatabase } from "./driver.cjs"; +export interface MigrationConfig { + migrationsFolder: string; + migrationsTable?: string; +} +/** + * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database + * + * NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails, + * no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself. + * @param db - drizzle db instance + * @param config - path to migration folder generated by drizzle-kit + */ export declare function migrate>(db: XataHttpDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.ts b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e24964fc6c13452421dff0b67818fb39e0752656 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.d.ts @@ -0,0 +1,13 @@ +import type { XataHttpDatabase } from "./driver.js"; +export interface MigrationConfig { + migrationsFolder: string; + migrationsTable?: string; +} +/** + * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database + * + * NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails, + * no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself. + * @param db - drizzle db instance + * @param config - path to migration folder generated by drizzle-kit + */ export declare function migrate>(db: XataHttpDatabase, config: MigrationConfig): Promise; diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js new file mode 100644 index 0000000000000000000000000000000000000000..bee1cb954d6d7cba6e9db527b43deb99449d51d8 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js @@ -0,0 +1,32 @@ +import { readMigrationFiles } from "../migrator.js"; +import { sql } from "../sql/sql.js"; +async function migrate(db, config) { + const migrations = readMigrationFiles(config); + const migrationsTable = config.migrationsTable ?? "__drizzle_migrations"; + const migrationTableCreate = sql` + CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at bigint + ) + `; + await db.session.execute(migrationTableCreate); + const dbMigrations = await db.session.all( + sql`select id, hash, created_at from ${sql.identifier(migrationsTable)} order by created_at desc limit 1` + ); + const lastDbMigration = dbMigrations[0]; + for await (const migration of migrations) { + if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) { + for (const stmt of migration.sql) { + await db.session.execute(sql.raw(stmt)); + } + await db.session.execute( + sql`insert into ${sql.identifier(migrationsTable)} ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})` + ); + } + } +} +export { + migrate +}; +//# sourceMappingURL=migrator.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js.map b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js.map new file mode 100644 index 0000000000000000000000000000000000000000..afeb8ce40080e3b2044f1ef8c21c0702194e7a26 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/migrator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/migrator.ts"],"sourcesContent":["import { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { XataHttpDatabase } from './driver.ts';\n\nexport interface MigrationConfig {\n\tmigrationsFolder: string;\n\tmigrationsTable?: string;\n}\n\n/**\n * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database\n *\n * NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails,\n * no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.\n * @param db - drizzle db instance\n * @param config - path to migration folder generated by drizzle-kit\n */ export async function migrate>(\n\tdb: XataHttpDatabase,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tconst migrationsTable = config.migrationsTable ?? '__drizzle_migrations';\n\tconst migrationTableCreate = sql`\n\t\tCREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} (\n\t\t\tid SERIAL PRIMARY KEY,\n\t\t\thash text NOT NULL,\n\t\t\tcreated_at bigint\n\t\t)\n\t`;\n\tawait db.session.execute(migrationTableCreate);\n\n\tconst dbMigrations = await db.session.all<{\n\t\tid: number;\n\t\thash: string;\n\t\tcreated_at: string;\n\t}>(\n\t\tsql`select id, hash, created_at from ${sql.identifier(migrationsTable)} order by created_at desc limit 1`,\n\t);\n\n\tconst lastDbMigration = dbMigrations[0];\n\n\tfor await (const migration of migrations) {\n\t\tif (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {\n\t\t\tfor (const stmt of migration.sql) {\n\t\t\t\tawait db.session.execute(sql.raw(stmt));\n\t\t\t}\n\n\t\t\tawait db.session.execute(\n\t\t\t\tsql`insert into ${\n\t\t\t\t\tsql.identifier(migrationsTable)\n\t\t\t\t} (\"hash\", \"created_at\") values(${migration.hash}, ${migration.folderMillis})`,\n\t\t\t);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AACnC,SAAS,WAAW;AAehB,eAAsB,QACzB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,kBAAkB,OAAO,mBAAmB;AAClD,QAAM,uBAAuB;AAAA,+BACC,IAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D,QAAM,GAAG,QAAQ,QAAQ,oBAAoB;AAE7C,QAAM,eAAe,MAAM,GAAG,QAAQ;AAAA,IAKrC,uCAAuC,IAAI,WAAW,eAAe,CAAC;AAAA,EACvE;AAEA,QAAM,kBAAkB,aAAa,CAAC;AAEtC,mBAAiB,aAAa,YAAY;AACzC,QAAI,CAAC,mBAAmB,OAAO,gBAAgB,UAAU,IAAI,UAAU,cAAc;AACpF,iBAAW,QAAQ,UAAU,KAAK;AACjC,cAAM,GAAG,QAAQ,QAAQ,IAAI,IAAI,IAAI,CAAC;AAAA,MACvC;AAEA,YAAM,GAAG,QAAQ;AAAA,QAChB,kBACC,IAAI,WAAW,eAAe,CAC/B,kCAAkC,UAAU,IAAI,KAAK,UAAU,YAAY;AAAA,MAC5E;AAAA,IACD;AAAA,EACD;AACD;","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs b/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs new file mode 100644 index 0000000000000000000000000000000000000000..a87e9d2d9aca76fff3870d235e1a5b9c449b3d73 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs @@ -0,0 +1,135 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var session_exports = {}; +__export(session_exports, { + XataHttpPreparedQuery: () => XataHttpPreparedQuery, + XataHttpSession: () => XataHttpSession, + XataTransaction: () => XataTransaction +}); +module.exports = __toCommonJS(session_exports); +var import_core = require("../cache/core/index.cjs"); +var import_entity = require("../entity.cjs"); +var import_logger = require("../logger.cjs"); +var import_pg_core = require("../pg-core/index.cjs"); +var import_session = require("../pg-core/session.cjs"); +var import_sql = require("../sql/sql.cjs"); +var import_utils = require("../utils.cjs"); +class XataHttpPreparedQuery extends import_session.PgPreparedQuery { + constructor(client, query, logger, cache, queryMetadata, cacheConfig, fields, _isResponseInArrayMode, customResultMapper) { + super(query, cache, queryMetadata, cacheConfig); + this.client = client; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + } + static [import_entity.entityKind] = "XataHttpPreparedQuery"; + async execute(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + const { fields, client, query, customResultMapper, joinsNotNullableMap } = this; + if (!fields && !customResultMapper) { + return this.queryWithCache(query.sql, params, async () => { + return await client.sql({ statement: query.sql, params }); + }); + } + const { rows, warning } = await this.queryWithCache(query.sql, params, async () => { + return await client.sql({ statement: query.sql, params, responseType: "array" }); + }); + if (warning) console.warn(warning); + return customResultMapper ? customResultMapper(rows) : rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap)); + } + all(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + return this.queryWithCache(this.query.sql, params, async () => { + return this.client.sql({ statement: this.query.sql, params, responseType: "array" }); + }).then((result) => result.rows); + } + values(placeholderValues = {}) { + const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + return this.queryWithCache(this.query.sql, params, async () => { + return this.client.sql({ statement: this.query.sql, params }); + }).then((result) => result.records); + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +class XataHttpSession extends import_session.PgSession { + constructor(client, dialect, schema, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.options = options; + this.logger = options.logger ?? new import_logger.NoopLogger(); + this.cache = options.cache ?? new import_core.NoopCache(); + } + static [import_entity.entityKind] = "XataHttpSession"; + logger; + cache; + prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new XataHttpPreparedQuery( + this.client, + query, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + isResponseInArrayMode, + customResultMapper + ); + } + async query(query, params) { + this.logger.logQuery(query, params); + const result = await this.client.sql({ statement: query, params, responseType: "array" }); + return { + rowCount: result.rows.length, + rows: result.rows, + rowAsArray: true + }; + } + async queryObjects(query, params) { + const result = await this.client.sql({ statement: query, params }); + return { + rowCount: result.records.length, + rows: result.records, + rowAsArray: false + }; + } + async transaction(_transaction, _config = {}) { + throw new Error("No transactions support in Xata Http driver"); + } +} +class XataTransaction extends import_pg_core.PgTransaction { + static [import_entity.entityKind] = "XataHttpTransaction"; + async transaction(_transaction) { + throw new Error("No transactions support in Xata Http driver"); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + XataHttpPreparedQuery, + XataHttpSession, + XataTransaction +}); +//# sourceMappingURL=session.cjs.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs.map b/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs.map new file mode 100644 index 0000000000000000000000000000000000000000..176610c11837e1f254e1ff0849a17d0509109829 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/session.ts"],"sourcesContent":["import type { SQLPluginResult, SQLQueryResult } from '@xata.io/client';\nimport type { Cache } from '~/cache/core/index.ts';\nimport { NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { PgDialect } from '~/pg-core/dialect.ts';\nimport { PgTransaction } from '~/pg-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query } from '~/sql/sql.ts';\nimport { mapResultRow } from '~/utils.ts';\n\nexport type XataHttpClient = {\n\tsql: SQLPluginResult;\n};\n\nexport interface QueryResults {\n\trowCount: number;\n\trows: ArrayMode extends 'array' ? any[][] : Record[];\n\trowAsArray: ArrayMode extends 'array' ? true : false;\n}\n\nexport class XataHttpPreparedQuery extends PgPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'XataHttpPreparedQuery';\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tquery: Query,\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t) {\n\t\tsuper(query, cache, queryMetadata, cacheConfig);\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.query.sql, params);\n\n\t\tconst { fields, client, query, customResultMapper, joinsNotNullableMap } = this;\n\n\t\tif (!fields && !customResultMapper) {\n\t\t\treturn this.queryWithCache(query.sql, params, async () => {\n\t\t\t\treturn await client.sql>({ statement: query.sql, params });\n\t\t\t});\n\t\t}\n\n\t\tconst { rows, warning } = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await client.sql({ statement: query.sql, params, responseType: 'array' });\n\t\t});\n\n\t\tif (warning) console.warn(warning);\n\n\t\treturn customResultMapper\n\t\t\t? customResultMapper(rows as unknown[][])\n\t\t\t: rows.map((row) => mapResultRow(fields!, row as unknown[], joinsNotNullableMap));\n\t}\n\n\tall(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn this.client.sql({ statement: this.query.sql, params, responseType: 'array' });\n\t\t}).then((result) => result.rows);\n\t}\n\n\tvalues(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn this.client.sql({ statement: this.query.sql, params });\n\t\t}).then((result) => result.records);\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode() {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n\nexport interface XataHttpSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class XataHttpSession, TSchema extends TablesRelationalConfig>\n\textends PgSession<\n\t\tXataHttpQueryResultHKT,\n\t\tTFullSchema,\n\t\tTSchema\n\t>\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tdialect: PgDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: XataHttpSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgPreparedQuery {\n\t\treturn new XataHttpPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync query(query: string, params: unknown[]): Promise> {\n\t\tthis.logger.logQuery(query, params);\n\t\tconst result = await this.client.sql({ statement: query, params, responseType: 'array' });\n\n\t\treturn {\n\t\t\trowCount: result.rows.length,\n\t\t\trows: result.rows,\n\t\t\trowAsArray: true,\n\t\t};\n\t}\n\n\tasync queryObjects(query: string, params: unknown[]): Promise> {\n\t\tconst result = await this.client.sql>({ statement: query, params });\n\n\t\treturn {\n\t\t\trowCount: result.records.length,\n\t\t\trows: result.records,\n\t\t\trowAsArray: false,\n\t\t};\n\t}\n\n\toverride async transaction(\n\t\t_transaction: (tx: XataTransaction) => Promise,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t_config: PgTransactionConfig = {},\n\t): Promise {\n\t\tthrow new Error('No transactions support in Xata Http driver');\n\t}\n}\n\nexport class XataTransaction, TSchema extends TablesRelationalConfig>\n\textends PgTransaction<\n\t\tXataHttpQueryResultHKT,\n\t\tTFullSchema,\n\t\tTSchema\n\t>\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpTransaction';\n\n\toverride async transaction(_transaction: (tx: XataTransaction) => Promise): Promise {\n\t\tthrow new Error('No transactions support in Xata Http driver');\n\t}\n}\n\nexport interface XataHttpQueryResultHKT extends PgQueryResultHKT {\n\ttype: SQLQueryResult;\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.d.cts b/e-commerce/node_modules/drizzle-orm/xata-http/session.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..3f6a3b0ff05759645c7ca2b91f71693b97655297 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.d.cts @@ -0,0 +1,62 @@ +import type { SQLPluginResult, SQLQueryResult } from '@xata.io/client'; +import type { Cache } from "../cache/core/index.cjs"; +import type { WithCacheConfig } from "../cache/core/types.cjs"; +import { entityKind } from "../entity.cjs"; +import type { Logger } from "../logger.cjs"; +import type { PgDialect } from "../pg-core/dialect.cjs"; +import { PgTransaction } from "../pg-core/index.cjs"; +import type { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.cjs"; +import type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from "../pg-core/session.cjs"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.cjs"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs"; +import { type Query } from "../sql/sql.cjs"; +export type XataHttpClient = { + sql: SQLPluginResult; +}; +export interface QueryResults { + rowCount: number; + rows: ArrayMode extends 'array' ? any[][] : Record[]; + rowAsArray: ArrayMode extends 'array' ? true : false; +} +export declare class XataHttpPreparedQuery extends PgPreparedQuery { + private client; + private logger; + private fields; + private _isResponseInArrayMode; + private customResultMapper?; + static readonly [entityKind]: string; + constructor(client: XataHttpClient, query: Query, logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined); + execute(placeholderValues?: Record | undefined): Promise; + all(placeholderValues?: Record | undefined): Promise; + values(placeholderValues?: Record | undefined): Promise; +} +export interface XataHttpSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class XataHttpSession, TSchema extends TablesRelationalConfig> extends PgSession { + private client; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: XataHttpClient, dialect: PgDialect, schema: RelationalSchemaConfig | undefined, options?: XataHttpSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): PgPreparedQuery; + query(query: string, params: unknown[]): Promise>; + queryObjects(query: string, params: unknown[]): Promise>; + transaction(_transaction: (tx: XataTransaction) => Promise, _config?: PgTransactionConfig): Promise; +} +export declare class XataTransaction, TSchema extends TablesRelationalConfig> extends PgTransaction { + static readonly [entityKind]: string; + transaction(_transaction: (tx: XataTransaction) => Promise): Promise; +} +export interface XataHttpQueryResultHKT extends PgQueryResultHKT { + type: SQLQueryResult; +} diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.d.ts b/e-commerce/node_modules/drizzle-orm/xata-http/session.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c92799c871cb0829d89231c6aaf0eaf14cf761f5 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.d.ts @@ -0,0 +1,62 @@ +import type { SQLPluginResult, SQLQueryResult } from '@xata.io/client'; +import type { Cache } from "../cache/core/index.js"; +import type { WithCacheConfig } from "../cache/core/types.js"; +import { entityKind } from "../entity.js"; +import type { Logger } from "../logger.js"; +import type { PgDialect } from "../pg-core/dialect.js"; +import { PgTransaction } from "../pg-core/index.js"; +import type { SelectedFieldsOrdered } from "../pg-core/query-builders/select.types.js"; +import type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from "../pg-core/session.js"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.js"; +import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js"; +import { type Query } from "../sql/sql.js"; +export type XataHttpClient = { + sql: SQLPluginResult; +}; +export interface QueryResults { + rowCount: number; + rows: ArrayMode extends 'array' ? any[][] : Record[]; + rowAsArray: ArrayMode extends 'array' ? true : false; +} +export declare class XataHttpPreparedQuery extends PgPreparedQuery { + private client; + private logger; + private fields; + private _isResponseInArrayMode; + private customResultMapper?; + static readonly [entityKind]: string; + constructor(client: XataHttpClient, query: Query, logger: Logger, cache: Cache, queryMetadata: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + } | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined); + execute(placeholderValues?: Record | undefined): Promise; + all(placeholderValues?: Record | undefined): Promise; + values(placeholderValues?: Record | undefined): Promise; +} +export interface XataHttpSessionOptions { + logger?: Logger; + cache?: Cache; +} +export declare class XataHttpSession, TSchema extends TablesRelationalConfig> extends PgSession { + private client; + private schema; + private options; + static readonly [entityKind]: string; + private logger; + private cache; + constructor(client: XataHttpClient, dialect: PgDialect, schema: RelationalSchemaConfig | undefined, options?: XataHttpSessionOptions); + prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute'], queryMetadata?: { + type: 'select' | 'update' | 'delete' | 'insert'; + tables: string[]; + }, cacheConfig?: WithCacheConfig): PgPreparedQuery; + query(query: string, params: unknown[]): Promise>; + queryObjects(query: string, params: unknown[]): Promise>; + transaction(_transaction: (tx: XataTransaction) => Promise, _config?: PgTransactionConfig): Promise; +} +export declare class XataTransaction, TSchema extends TablesRelationalConfig> extends PgTransaction { + static readonly [entityKind]: string; + transaction(_transaction: (tx: XataTransaction) => Promise): Promise; +} +export interface XataHttpQueryResultHKT extends PgQueryResultHKT { + type: SQLQueryResult; +} diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.js b/e-commerce/node_modules/drizzle-orm/xata-http/session.js new file mode 100644 index 0000000000000000000000000000000000000000..1a13fc5982f603a0aaa9e5e4cd533a468e4553c8 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.js @@ -0,0 +1,109 @@ +import { NoopCache } from "../cache/core/index.js"; +import { entityKind } from "../entity.js"; +import { NoopLogger } from "../logger.js"; +import { PgTransaction } from "../pg-core/index.js"; +import { PgPreparedQuery, PgSession } from "../pg-core/session.js"; +import { fillPlaceholders } from "../sql/sql.js"; +import { mapResultRow } from "../utils.js"; +class XataHttpPreparedQuery extends PgPreparedQuery { + constructor(client, query, logger, cache, queryMetadata, cacheConfig, fields, _isResponseInArrayMode, customResultMapper) { + super(query, cache, queryMetadata, cacheConfig); + this.client = client; + this.logger = logger; + this.fields = fields; + this._isResponseInArrayMode = _isResponseInArrayMode; + this.customResultMapper = customResultMapper; + } + static [entityKind] = "XataHttpPreparedQuery"; + async execute(placeholderValues = {}) { + const params = fillPlaceholders(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + const { fields, client, query, customResultMapper, joinsNotNullableMap } = this; + if (!fields && !customResultMapper) { + return this.queryWithCache(query.sql, params, async () => { + return await client.sql({ statement: query.sql, params }); + }); + } + const { rows, warning } = await this.queryWithCache(query.sql, params, async () => { + return await client.sql({ statement: query.sql, params, responseType: "array" }); + }); + if (warning) console.warn(warning); + return customResultMapper ? customResultMapper(rows) : rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap)); + } + all(placeholderValues = {}) { + const params = fillPlaceholders(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + return this.queryWithCache(this.query.sql, params, async () => { + return this.client.sql({ statement: this.query.sql, params, responseType: "array" }); + }).then((result) => result.rows); + } + values(placeholderValues = {}) { + const params = fillPlaceholders(this.query.params, placeholderValues); + this.logger.logQuery(this.query.sql, params); + return this.queryWithCache(this.query.sql, params, async () => { + return this.client.sql({ statement: this.query.sql, params }); + }).then((result) => result.records); + } + /** @internal */ + isResponseInArrayMode() { + return this._isResponseInArrayMode; + } +} +class XataHttpSession extends PgSession { + constructor(client, dialect, schema, options = {}) { + super(dialect); + this.client = client; + this.schema = schema; + this.options = options; + this.logger = options.logger ?? new NoopLogger(); + this.cache = options.cache ?? new NoopCache(); + } + static [entityKind] = "XataHttpSession"; + logger; + cache; + prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) { + return new XataHttpPreparedQuery( + this.client, + query, + this.logger, + this.cache, + queryMetadata, + cacheConfig, + fields, + isResponseInArrayMode, + customResultMapper + ); + } + async query(query, params) { + this.logger.logQuery(query, params); + const result = await this.client.sql({ statement: query, params, responseType: "array" }); + return { + rowCount: result.rows.length, + rows: result.rows, + rowAsArray: true + }; + } + async queryObjects(query, params) { + const result = await this.client.sql({ statement: query, params }); + return { + rowCount: result.records.length, + rows: result.records, + rowAsArray: false + }; + } + async transaction(_transaction, _config = {}) { + throw new Error("No transactions support in Xata Http driver"); + } +} +class XataTransaction extends PgTransaction { + static [entityKind] = "XataHttpTransaction"; + async transaction(_transaction) { + throw new Error("No transactions support in Xata Http driver"); + } +} +export { + XataHttpPreparedQuery, + XataHttpSession, + XataTransaction +}; +//# sourceMappingURL=session.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/drizzle-orm/xata-http/session.js.map b/e-commerce/node_modules/drizzle-orm/xata-http/session.js.map new file mode 100644 index 0000000000000000000000000000000000000000..af47d7837d69b6f9e098c57ba0d212f098c91c01 --- /dev/null +++ b/e-commerce/node_modules/drizzle-orm/xata-http/session.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/xata-http/session.ts"],"sourcesContent":["import type { SQLPluginResult, SQLQueryResult } from '@xata.io/client';\nimport type { Cache } from '~/cache/core/index.ts';\nimport { NoopCache } from '~/cache/core/index.ts';\nimport type { WithCacheConfig } from '~/cache/core/types.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { NoopLogger } from '~/logger.ts';\nimport type { PgDialect } from '~/pg-core/dialect.ts';\nimport { PgTransaction } from '~/pg-core/index.ts';\nimport type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';\nimport type { PgQueryResultHKT, PgTransactionConfig, PreparedQueryConfig } from '~/pg-core/session.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/session.ts';\nimport type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';\nimport { fillPlaceholders, type Query } from '~/sql/sql.ts';\nimport { mapResultRow } from '~/utils.ts';\n\nexport type XataHttpClient = {\n\tsql: SQLPluginResult;\n};\n\nexport interface QueryResults {\n\trowCount: number;\n\trows: ArrayMode extends 'array' ? any[][] : Record[];\n\trowAsArray: ArrayMode extends 'array' ? true : false;\n}\n\nexport class XataHttpPreparedQuery extends PgPreparedQuery {\n\tstatic override readonly [entityKind]: string = 'XataHttpPreparedQuery';\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tquery: Query,\n\t\tprivate logger: Logger,\n\t\tcache: Cache,\n\t\tqueryMetadata: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t} | undefined,\n\t\tcacheConfig: WithCacheConfig | undefined,\n\t\tprivate fields: SelectedFieldsOrdered | undefined,\n\t\tprivate _isResponseInArrayMode: boolean,\n\t\tprivate customResultMapper?: (rows: unknown[][]) => T['execute'],\n\t) {\n\t\tsuper(query, cache, queryMetadata, cacheConfig);\n\t}\n\n\tasync execute(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\n\t\tthis.logger.logQuery(this.query.sql, params);\n\n\t\tconst { fields, client, query, customResultMapper, joinsNotNullableMap } = this;\n\n\t\tif (!fields && !customResultMapper) {\n\t\t\treturn this.queryWithCache(query.sql, params, async () => {\n\t\t\t\treturn await client.sql>({ statement: query.sql, params });\n\t\t\t});\n\t\t}\n\n\t\tconst { rows, warning } = await this.queryWithCache(query.sql, params, async () => {\n\t\t\treturn await client.sql({ statement: query.sql, params, responseType: 'array' });\n\t\t});\n\n\t\tif (warning) console.warn(warning);\n\n\t\treturn customResultMapper\n\t\t\t? customResultMapper(rows as unknown[][])\n\t\t\t: rows.map((row) => mapResultRow(fields!, row as unknown[], joinsNotNullableMap));\n\t}\n\n\tall(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn this.client.sql({ statement: this.query.sql, params, responseType: 'array' });\n\t\t}).then((result) => result.rows);\n\t}\n\n\tvalues(placeholderValues: Record | undefined = {}): Promise {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues);\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.queryWithCache(this.query.sql, params, async () => {\n\t\t\treturn this.client.sql({ statement: this.query.sql, params });\n\t\t}).then((result) => result.records);\n\t}\n\n\t/** @internal */\n\tisResponseInArrayMode() {\n\t\treturn this._isResponseInArrayMode;\n\t}\n}\n\nexport interface XataHttpSessionOptions {\n\tlogger?: Logger;\n\tcache?: Cache;\n}\n\nexport class XataHttpSession, TSchema extends TablesRelationalConfig>\n\textends PgSession<\n\t\tXataHttpQueryResultHKT,\n\t\tTFullSchema,\n\t\tTSchema\n\t>\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpSession';\n\n\tprivate logger: Logger;\n\tprivate cache: Cache;\n\n\tconstructor(\n\t\tprivate client: XataHttpClient,\n\t\tdialect: PgDialect,\n\t\tprivate schema: RelationalSchemaConfig | undefined,\n\t\tprivate options: XataHttpSessionOptions = {},\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t\tthis.cache = options.cache ?? new NoopCache();\n\t}\n\n\tprepareQuery(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\tname: string | undefined,\n\t\tisResponseInArrayMode: boolean,\n\t\tcustomResultMapper?: (rows: unknown[][]) => T['execute'],\n\t\tqueryMetadata?: {\n\t\t\ttype: 'select' | 'update' | 'delete' | 'insert';\n\t\t\ttables: string[];\n\t\t},\n\t\tcacheConfig?: WithCacheConfig,\n\t): PgPreparedQuery {\n\t\treturn new XataHttpPreparedQuery(\n\t\t\tthis.client,\n\t\t\tquery,\n\t\t\tthis.logger,\n\t\t\tthis.cache,\n\t\t\tqueryMetadata,\n\t\t\tcacheConfig,\n\t\t\tfields,\n\t\t\tisResponseInArrayMode,\n\t\t\tcustomResultMapper,\n\t\t);\n\t}\n\n\tasync query(query: string, params: unknown[]): Promise> {\n\t\tthis.logger.logQuery(query, params);\n\t\tconst result = await this.client.sql({ statement: query, params, responseType: 'array' });\n\n\t\treturn {\n\t\t\trowCount: result.rows.length,\n\t\t\trows: result.rows,\n\t\t\trowAsArray: true,\n\t\t};\n\t}\n\n\tasync queryObjects(query: string, params: unknown[]): Promise> {\n\t\tconst result = await this.client.sql>({ statement: query, params });\n\n\t\treturn {\n\t\t\trowCount: result.records.length,\n\t\t\trows: result.records,\n\t\t\trowAsArray: false,\n\t\t};\n\t}\n\n\toverride async transaction(\n\t\t_transaction: (tx: XataTransaction) => Promise,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t_config: PgTransactionConfig = {},\n\t): Promise {\n\t\tthrow new Error('No transactions support in Xata Http driver');\n\t}\n}\n\nexport class XataTransaction, TSchema extends TablesRelationalConfig>\n\textends PgTransaction<\n\t\tXataHttpQueryResultHKT,\n\t\tTFullSchema,\n\t\tTSchema\n\t>\n{\n\tstatic override readonly [entityKind]: string = 'XataHttpTransaction';\n\n\toverride async transaction(_transaction: (tx: XataTransaction) => Promise): Promise {\n\t\tthrow new Error('No transactions support in Xata Http driver');\n\t}\n}\n\nexport interface XataHttpQueryResultHKT extends PgQueryResultHKT {\n\ttype: SQLQueryResult;\n}\n"],"mappings":"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","names":[]} \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/LICENSE b/e-commerce/node_modules/electron-to-chromium/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6c7b614d4e9f517d6d57c7fe26bd9d7d565a0b7f --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/LICENSE @@ -0,0 +1,5 @@ +Copyright 2018 Kilian Valkhof + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +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/e-commerce/node_modules/electron-to-chromium/README.md b/e-commerce/node_modules/electron-to-chromium/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e3c9d5df8adf043745502661d6b5806eadebd6b4 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/README.md @@ -0,0 +1,186 @@ +### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof) + +#### Other projects: + +- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once +- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website +- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad + +--- + +# Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield) + +This repository provides a mapping of Electron versions to the Chromium version that it uses. + +This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat). + +**Supported by:** + + + + + + +## Install +Install using `npm install electron-to-chromium`. + +## Usage +To include Electron-to-Chromium, require it: + +```js +var e2c = require('electron-to-chromium'); +``` + +### Properties +The Electron-to-Chromium object has 4 properties to use: + +#### `versions` +An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value. + +```js +var versions = e2c.versions; +console.log(versions['1.4']); +// returns "53" +``` + +#### `fullVersions` +An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value. + +```js +var versions = e2c.fullVersions; +console.log(versions['1.4.11']); +// returns "53.0.2785.143" +``` + +#### `chromiumVersions` +An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value. + +```js +var versions = e2c.chromiumVersions; +console.log(versions['54']); +// returns "1.4" +``` + +#### `fullChromiumVersions` +An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value. + +```js +var versions = e2c.fullChromiumVersions; +console.log(versions['54.0.2840.101']); +// returns ["1.5.1", "1.5.0"] +``` +### Functions + +#### `electronToChromium(query)` +Arguments: +* Query: string or number, required. A major or full Electron version. + +A function that returns the corresponding Chromium version for a given Electron function. Returns a string. + +If you provide it with a major Electron version, it will return a major Chromium version: + +```js +var chromeVersion = e2c.electronToChromium('1.4'); +// chromeVersion is "53" +``` + +If you provide it with a full Electron version, it will return the full Chromium version. + +```js +var chromeVersion = e2c.electronToChromium('1.4.11'); +// chromeVersion is "53.0.2785.143" +``` + +If a query does not match a Chromium version, it will return `undefined`. + +```js +var chromeVersion = e2c.electronToChromium('9000'); +// chromeVersion is undefined +``` + +#### `chromiumToElectron(query)` +Arguments: +* Query: string or number, required. A major or full Chromium version. + +Returns a string with the corresponding Electron version for a given Chromium query. + +If you provide it with a major Chromium version, it will return a major Electron version: + +```js +var electronVersion = e2c.chromiumToElectron('54'); +// electronVersion is "1.4" +``` + +If you provide it with a full Chrome version, it will return an array of full Electron versions. + +```js +var electronVersions = e2c.chromiumToElectron('56.0.2924.87'); +// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"] +``` + +If a query does not match an Electron version, it will return `undefined`. + +```js +var electronVersion = e2c.chromiumToElectron('10'); +// electronVersion is undefined +``` + +#### `electronToBrowserList(query)` **DEPRECATED** +Arguments: +* Query: string or number, required. A major Electron version. + +_**Deprecated**: Browserlist already includes electron-to-chromium._ + +A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string. + +If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities: + +```js +var query = e2c.electronToBrowserList('1.4'); +// query is "Chrome >= 53" +``` + +If a query does not match a Chromium version, it will return `undefined`. + +```js +var query = e2c.electronToBrowserList('9000'); +// query is undefined +``` + +### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions +All lists can be imported on their own, if file size is a concern. + +#### `versions` + +```js +var versions = require('electron-to-chromium/versions'); +``` + +#### `fullVersions` + +```js +var fullVersions = require('electron-to-chromium/full-versions'); +``` + +#### `chromiumVersions` + +```js +var chromiumVersions = require('electron-to-chromium/chromium-versions'); +``` + +#### `fullChromiumVersions` + +```js +var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions'); +``` + +## Updating +This package will be updated with each new Electron release. + +To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions. + +To verify correct behaviour, run `npm test`. + + +## License +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large) diff --git a/e-commerce/node_modules/electron-to-chromium/chromium-versions.js b/e-commerce/node_modules/electron-to-chromium/chromium-versions.js new file mode 100644 index 0000000000000000000000000000000000000000..596bdc2af06f053dff992a3675f59deff5c69e78 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/chromium-versions.js @@ -0,0 +1,94 @@ +module.exports = { + "39": "0.20", + "40": "0.21", + "41": "0.21", + "42": "0.25", + "43": "0.27", + "44": "0.30", + "45": "0.31", + "47": "0.36", + "49": "0.37", + "50": "1.1", + "51": "1.2", + "52": "1.3", + "53": "1.4", + "54": "1.4", + "56": "1.6", + "58": "1.7", + "59": "1.8", + "61": "2.0", + "66": "3.0", + "69": "4.0", + "72": "5.0", + "73": "5.0", + "76": "6.0", + "78": "7.0", + "79": "8.0", + "80": "8.0", + "82": "9.0", + "83": "9.0", + "84": "10.0", + "85": "10.0", + "86": "11.0", + "87": "11.0", + "89": "12.0", + "90": "13.0", + "91": "13.0", + "92": "14.0", + "93": "14.0", + "94": "15.0", + "95": "16.0", + "96": "16.0", + "98": "17.0", + "99": "18.0", + "100": "18.0", + "102": "19.0", + "103": "20.0", + "104": "20.0", + "105": "21.0", + "106": "21.0", + "107": "22.0", + "108": "22.0", + "110": "23.0", + "111": "24.0", + "112": "24.0", + "114": "25.0", + "116": "26.0", + "118": "27.0", + "119": "28.0", + "120": "28.0", + "121": "29.0", + "122": "29.0", + "123": "30.0", + "124": "30.0", + "125": "31.0", + "126": "31.0", + "127": "32.0", + "128": "32.0", + "129": "33.0", + "130": "33.0", + "131": "34.0", + "132": "34.0", + "133": "35.0", + "134": "35.0", + "135": "36.0", + "136": "36.0", + "137": "37.0", + "138": "37.0", + "139": "38.0", + "140": "38.0", + "141": "39.0", + "142": "39.0", + "143": "40.0", + "144": "40.0", + "146": "41.0", + "147": "42.0", + "148": "42.0", + "149": "43.0", + "150": "43.0", + "151": "44.0", + "152": "44.0", + "154": "45.0", + "155": "45.0", + "156": "45.0" +}; \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/chromium-versions.json b/e-commerce/node_modules/electron-to-chromium/chromium-versions.json new file mode 100644 index 0000000000000000000000000000000000000000..d6ad9dee32369febf91a9849daf2271be05c4687 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/chromium-versions.json @@ -0,0 +1 @@ +{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0","123":"30.0","124":"30.0","125":"31.0","126":"31.0","127":"32.0","128":"32.0","129":"33.0","130":"33.0","131":"34.0","132":"34.0","133":"35.0","134":"35.0","135":"36.0","136":"36.0","137":"37.0","138":"37.0","139":"38.0","140":"38.0","141":"39.0","142":"39.0","143":"40.0","144":"40.0","146":"41.0","147":"42.0","148":"42.0","149":"43.0","150":"43.0","151":"44.0","152":"44.0","154":"45.0","155":"45.0","156":"45.0"} \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.js b/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.js new file mode 100644 index 0000000000000000000000000000000000000000..d0be7cb5df9bf07ac79c799b7639f01f59f3f449 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.js @@ -0,0 +1,3019 @@ +module.exports = { + "39.0.2171.65": [ + "0.20.0", + "0.20.1", + "0.20.2", + "0.20.3", + "0.20.4", + "0.20.5", + "0.20.6", + "0.20.7", + "0.20.8" + ], + "40.0.2214.91": [ + "0.21.0", + "0.21.1", + "0.21.2" + ], + "41.0.2272.76": [ + "0.21.3", + "0.22.1", + "0.22.2", + "0.22.3", + "0.23.0", + "0.24.0" + ], + "42.0.2311.107": [ + "0.25.0", + "0.25.1", + "0.25.2", + "0.25.3", + "0.26.0", + "0.26.1", + "0.27.0", + "0.27.1" + ], + "43.0.2357.65": [ + "0.27.2", + "0.27.3", + "0.28.0", + "0.28.1", + "0.28.2", + "0.28.3", + "0.29.1", + "0.29.2" + ], + "44.0.2403.125": [ + "0.30.4", + "0.31.0" + ], + "45.0.2454.85": [ + "0.31.2", + "0.32.2", + "0.32.3", + "0.33.0", + "0.33.1", + "0.33.2", + "0.33.3", + "0.33.4", + "0.33.6", + "0.33.7", + "0.33.8", + "0.33.9", + "0.34.0", + "0.34.1", + "0.34.2", + "0.34.3", + "0.34.4", + "0.35.1", + "0.35.2", + "0.35.3", + "0.35.4", + "0.35.5" + ], + "47.0.2526.73": [ + "0.36.0", + "0.36.2", + "0.36.3", + "0.36.4" + ], + "47.0.2526.110": [ + "0.36.5", + "0.36.6", + "0.36.7", + "0.36.8", + "0.36.9", + "0.36.10", + "0.36.11", + "0.36.12" + ], + "49.0.2623.75": [ + "0.37.0", + "0.37.1", + "0.37.3", + "0.37.4", + "0.37.5", + "0.37.6", + "0.37.7", + "0.37.8", + "1.0.0", + "1.0.1", + "1.0.2" + ], + "50.0.2661.102": [ + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], + "51.0.2704.63": [ + "1.2.0", + "1.2.1" + ], + "51.0.2704.84": [ + "1.2.2", + "1.2.3" + ], + "51.0.2704.103": [ + "1.2.4", + "1.2.5" + ], + "51.0.2704.106": [ + "1.2.6", + "1.2.7", + "1.2.8" + ], + "52.0.2743.82": [ + "1.3.0", + "1.3.1", + "1.3.2", + "1.3.3", + "1.3.4", + "1.3.5", + "1.3.6", + "1.3.7", + "1.3.9", + "1.3.10", + "1.3.13", + "1.3.14", + "1.3.15" + ], + "53.0.2785.113": [ + "1.4.0", + "1.4.1", + "1.4.2", + "1.4.3", + "1.4.4", + "1.4.5" + ], + "53.0.2785.143": [ + "1.4.6", + "1.4.7", + "1.4.8", + "1.4.10", + "1.4.11", + "1.4.13", + "1.4.14", + "1.4.15", + "1.4.16" + ], + "54.0.2840.51": [ + "1.4.12" + ], + "54.0.2840.101": [ + "1.5.0", + "1.5.1" + ], + "56.0.2924.87": [ + "1.6.0", + "1.6.1", + "1.6.2", + "1.6.3", + "1.6.4", + "1.6.5", + "1.6.6", + "1.6.7", + "1.6.8", + "1.6.9", + "1.6.10", + "1.6.11", + "1.6.12", + "1.6.13", + "1.6.14", + "1.6.15", + "1.6.16", + "1.6.17", + "1.6.18" + ], + "58.0.3029.110": [ + "1.7.0", + "1.7.1", + "1.7.2", + "1.7.3", + "1.7.4", + "1.7.5", + "1.7.6", + "1.7.7", + "1.7.8", + "1.7.9", + "1.7.10", + "1.7.11", + "1.7.12", + "1.7.13", + "1.7.14", + "1.7.15", + "1.7.16" + ], + "59.0.3071.115": [ + "1.8.0", + "1.8.1", + "1.8.2-beta.1", + "1.8.2-beta.2", + "1.8.2-beta.3", + "1.8.2-beta.4", + "1.8.2-beta.5", + "1.8.2", + "1.8.3", + "1.8.4", + "1.8.5", + "1.8.6", + "1.8.7", + "1.8.8" + ], + "61.0.3163.100": [ + "2.0.0-beta.1", + "2.0.0-beta.2", + "2.0.0-beta.3", + "2.0.0-beta.4", + "2.0.0-beta.5", + "2.0.0-beta.6", + "2.0.0-beta.7", + "2.0.0-beta.8", + "2.0.0", + "2.0.1", + "2.0.2", + "2.0.3", + "2.0.4", + "2.0.5", + "2.0.6", + "2.0.7", + "2.0.8", + "2.0.9", + "2.0.10", + "2.0.11", + "2.0.12", + "2.0.13", + "2.0.14", + "2.0.15", + "2.0.16", + "2.0.17", + "2.0.18", + "2.1.0-unsupported.20180809" + ], + "66.0.3359.181": [ + "3.0.0-beta.1", + "3.0.0-beta.2", + "3.0.0-beta.3", + "3.0.0-beta.4", + "3.0.0-beta.5", + "3.0.0-beta.6", + "3.0.0-beta.7", + "3.0.0-beta.8", + "3.0.0-beta.9", + "3.0.0-beta.10", + "3.0.0-beta.11", + "3.0.0-beta.12", + "3.0.0-beta.13", + "3.0.0", + "3.0.1", + "3.0.2", + "3.0.3", + "3.0.4", + "3.0.5", + "3.0.6", + "3.0.7", + "3.0.8", + "3.0.9", + "3.0.10", + "3.0.11", + "3.0.12", + "3.0.13", + "3.0.14", + "3.0.15", + "3.0.16", + "3.1.0-beta.1", + "3.1.0-beta.2", + "3.1.0-beta.3", + "3.1.0-beta.4", + "3.1.0-beta.5", + "3.1.0", + "3.1.1", + "3.1.2", + "3.1.3", + "3.1.4", + "3.1.5", + "3.1.6", + "3.1.7", + "3.1.8", + "3.1.9", + "3.1.10", + "3.1.11", + "3.1.12", + "3.1.13" + ], + "69.0.3497.106": [ + "4.0.0-beta.1", + "4.0.0-beta.2", + "4.0.0-beta.3", + "4.0.0-beta.4", + "4.0.0-beta.5", + "4.0.0-beta.6", + "4.0.0-beta.7", + "4.0.0-beta.8", + "4.0.0-beta.9", + "4.0.0-beta.10", + "4.0.0-beta.11", + "4.0.0", + "4.0.1", + "4.0.2", + "4.0.3", + "4.0.4", + "4.0.5", + "4.0.6" + ], + "69.0.3497.128": [ + "4.0.7", + "4.0.8", + "4.1.0", + "4.1.1", + "4.1.2", + "4.1.3", + "4.1.4", + "4.1.5", + "4.2.0", + "4.2.1", + "4.2.2", + "4.2.3", + "4.2.4", + "4.2.5", + "4.2.6", + "4.2.7", + "4.2.8", + "4.2.9", + "4.2.10", + "4.2.11", + "4.2.12" + ], + "72.0.3626.52": [ + "5.0.0-beta.1", + "5.0.0-beta.2" + ], + "73.0.3683.27": [ + "5.0.0-beta.3" + ], + "73.0.3683.54": [ + "5.0.0-beta.4" + ], + "73.0.3683.61": [ + "5.0.0-beta.5" + ], + "73.0.3683.84": [ + "5.0.0-beta.6" + ], + "73.0.3683.94": [ + "5.0.0-beta.7" + ], + "73.0.3683.104": [ + "5.0.0-beta.8" + ], + "73.0.3683.117": [ + "5.0.0-beta.9" + ], + "73.0.3683.119": [ + "5.0.0" + ], + "73.0.3683.121": [ + "5.0.1", + "5.0.2", + "5.0.3", + "5.0.4", + "5.0.5", + "5.0.6", + "5.0.7", + "5.0.8", + "5.0.9", + "5.0.10", + "5.0.11", + "5.0.12", + "5.0.13" + ], + "76.0.3774.1": [ + "6.0.0-beta.1" + ], + "76.0.3783.1": [ + "6.0.0-beta.2", + "6.0.0-beta.3", + "6.0.0-beta.4" + ], + "76.0.3805.4": [ + "6.0.0-beta.5" + ], + "76.0.3809.3": [ + "6.0.0-beta.6" + ], + "76.0.3809.22": [ + "6.0.0-beta.7" + ], + "76.0.3809.26": [ + "6.0.0-beta.8", + "6.0.0-beta.9" + ], + "76.0.3809.37": [ + "6.0.0-beta.10" + ], + "76.0.3809.42": [ + "6.0.0-beta.11" + ], + "76.0.3809.54": [ + "6.0.0-beta.12" + ], + "76.0.3809.60": [ + "6.0.0-beta.13" + ], + "76.0.3809.68": [ + "6.0.0-beta.14" + ], + "76.0.3809.74": [ + "6.0.0-beta.15" + ], + "76.0.3809.88": [ + "6.0.0" + ], + "76.0.3809.102": [ + "6.0.1" + ], + "76.0.3809.110": [ + "6.0.2" + ], + "76.0.3809.126": [ + "6.0.3" + ], + "76.0.3809.131": [ + "6.0.4" + ], + "76.0.3809.136": [ + "6.0.5" + ], + "76.0.3809.138": [ + "6.0.6" + ], + "76.0.3809.139": [ + "6.0.7" + ], + "76.0.3809.146": [ + "6.0.8", + "6.0.9", + "6.0.10", + "6.0.11", + "6.0.12", + "6.1.0", + "6.1.1", + "6.1.2", + "6.1.3", + "6.1.4", + "6.1.5", + "6.1.6", + "6.1.7", + "6.1.8", + "6.1.9", + "6.1.10", + "6.1.11", + "6.1.12" + ], + "78.0.3866.0": [ + "7.0.0-beta.1", + "7.0.0-beta.2", + "7.0.0-beta.3" + ], + "78.0.3896.6": [ + "7.0.0-beta.4" + ], + "78.0.3905.1": [ + "7.0.0-beta.5", + "7.0.0-beta.6", + "7.0.0-beta.7", + "7.0.0" + ], + "78.0.3904.92": [ + "7.0.1" + ], + "78.0.3904.94": [ + "7.1.0" + ], + "78.0.3904.99": [ + "7.1.1" + ], + "78.0.3904.113": [ + "7.1.2" + ], + "78.0.3904.126": [ + "7.1.3" + ], + "78.0.3904.130": [ + "7.1.4", + "7.1.5", + "7.1.6", + "7.1.7", + "7.1.8", + "7.1.9", + "7.1.10", + "7.1.11", + "7.1.12", + "7.1.13", + "7.1.14", + "7.2.0", + "7.2.1", + "7.2.2", + "7.2.3", + "7.2.4", + "7.3.0", + "7.3.1", + "7.3.2", + "7.3.3" + ], + "79.0.3931.0": [ + "8.0.0-beta.1", + "8.0.0-beta.2" + ], + "80.0.3955.0": [ + "8.0.0-beta.3", + "8.0.0-beta.4" + ], + "80.0.3987.14": [ + "8.0.0-beta.5" + ], + "80.0.3987.51": [ + "8.0.0-beta.6" + ], + "80.0.3987.59": [ + "8.0.0-beta.7" + ], + "80.0.3987.75": [ + "8.0.0-beta.8", + "8.0.0-beta.9" + ], + "80.0.3987.86": [ + "8.0.0", + "8.0.1", + "8.0.2" + ], + "80.0.3987.134": [ + "8.0.3" + ], + "80.0.3987.137": [ + "8.1.0" + ], + "80.0.3987.141": [ + "8.1.1" + ], + "80.0.3987.158": [ + "8.2.0" + ], + "80.0.3987.163": [ + "8.2.1", + "8.2.2", + "8.2.3", + "8.5.3", + "8.5.4", + "8.5.5" + ], + "80.0.3987.165": [ + "8.2.4", + "8.2.5", + "8.3.0", + "8.3.1", + "8.3.2", + "8.3.3", + "8.3.4", + "8.4.0", + "8.4.1", + "8.5.0", + "8.5.1", + "8.5.2" + ], + "82.0.4048.0": [ + "9.0.0-beta.1", + "9.0.0-beta.2", + "9.0.0-beta.3", + "9.0.0-beta.4", + "9.0.0-beta.5" + ], + "82.0.4058.2": [ + "9.0.0-beta.6", + "9.0.0-beta.7", + "9.0.0-beta.9" + ], + "82.0.4085.10": [ + "9.0.0-beta.10" + ], + "82.0.4085.14": [ + "9.0.0-beta.11", + "9.0.0-beta.12", + "9.0.0-beta.13" + ], + "82.0.4085.27": [ + "9.0.0-beta.14" + ], + "83.0.4102.3": [ + "9.0.0-beta.15", + "9.0.0-beta.16" + ], + "83.0.4103.14": [ + "9.0.0-beta.17" + ], + "83.0.4103.16": [ + "9.0.0-beta.18" + ], + "83.0.4103.24": [ + "9.0.0-beta.19" + ], + "83.0.4103.26": [ + "9.0.0-beta.20", + "9.0.0-beta.21" + ], + "83.0.4103.34": [ + "9.0.0-beta.22" + ], + "83.0.4103.44": [ + "9.0.0-beta.23" + ], + "83.0.4103.45": [ + "9.0.0-beta.24" + ], + "83.0.4103.64": [ + "9.0.0" + ], + "83.0.4103.94": [ + "9.0.1", + "9.0.2" + ], + "83.0.4103.100": [ + "9.0.3" + ], + "83.0.4103.104": [ + "9.0.4" + ], + "83.0.4103.119": [ + "9.0.5" + ], + "83.0.4103.122": [ + "9.1.0", + "9.1.1", + "9.1.2", + "9.2.0", + "9.2.1", + "9.3.0", + "9.3.1", + "9.3.2", + "9.3.3", + "9.3.4", + "9.3.5", + "9.4.0", + "9.4.1", + "9.4.2", + "9.4.3", + "9.4.4" + ], + "84.0.4129.0": [ + "10.0.0-beta.1", + "10.0.0-beta.2" + ], + "85.0.4161.2": [ + "10.0.0-beta.3", + "10.0.0-beta.4" + ], + "85.0.4181.1": [ + "10.0.0-beta.8", + "10.0.0-beta.9" + ], + "85.0.4183.19": [ + "10.0.0-beta.10" + ], + "85.0.4183.20": [ + "10.0.0-beta.11" + ], + "85.0.4183.26": [ + "10.0.0-beta.12" + ], + "85.0.4183.39": [ + "10.0.0-beta.13", + "10.0.0-beta.14", + "10.0.0-beta.15", + "10.0.0-beta.17", + "10.0.0-beta.19", + "10.0.0-beta.20", + "10.0.0-beta.21" + ], + "85.0.4183.70": [ + "10.0.0-beta.23" + ], + "85.0.4183.78": [ + "10.0.0-beta.24" + ], + "85.0.4183.80": [ + "10.0.0-beta.25" + ], + "85.0.4183.84": [ + "10.0.0" + ], + "85.0.4183.86": [ + "10.0.1" + ], + "85.0.4183.87": [ + "10.1.0" + ], + "85.0.4183.93": [ + "10.1.1" + ], + "85.0.4183.98": [ + "10.1.2" + ], + "85.0.4183.121": [ + "10.1.3", + "10.1.4", + "10.1.5", + "10.1.6", + "10.1.7", + "10.2.0", + "10.3.0", + "10.3.1", + "10.3.2", + "10.4.0", + "10.4.1", + "10.4.2", + "10.4.3", + "10.4.4", + "10.4.5", + "10.4.6", + "10.4.7" + ], + "86.0.4234.0": [ + "11.0.0-beta.1", + "11.0.0-beta.3", + "11.0.0-beta.4", + "11.0.0-beta.5", + "11.0.0-beta.6", + "11.0.0-beta.7" + ], + "87.0.4251.1": [ + "11.0.0-beta.8", + "11.0.0-beta.9", + "11.0.0-beta.11" + ], + "87.0.4280.11": [ + "11.0.0-beta.12", + "11.0.0-beta.13" + ], + "87.0.4280.27": [ + "11.0.0-beta.16", + "11.0.0-beta.17", + "11.0.0-beta.18", + "11.0.0-beta.19" + ], + "87.0.4280.40": [ + "11.0.0-beta.20" + ], + "87.0.4280.47": [ + "11.0.0-beta.22", + "11.0.0-beta.23" + ], + "87.0.4280.60": [ + "11.0.0", + "11.0.1" + ], + "87.0.4280.67": [ + "11.0.2", + "11.0.3", + "11.0.4" + ], + "87.0.4280.88": [ + "11.0.5", + "11.1.0", + "11.1.1" + ], + "87.0.4280.141": [ + "11.2.0", + "11.2.1", + "11.2.2", + "11.2.3", + "11.3.0", + "11.4.0", + "11.4.1", + "11.4.2", + "11.4.3", + "11.4.4", + "11.4.5", + "11.4.6", + "11.4.7", + "11.4.8", + "11.4.9", + "11.4.10", + "11.4.11", + "11.4.12", + "11.5.0" + ], + "89.0.4328.0": [ + "12.0.0-beta.1", + "12.0.0-beta.3", + "12.0.0-beta.4", + "12.0.0-beta.5", + "12.0.0-beta.6", + "12.0.0-beta.7", + "12.0.0-beta.8", + "12.0.0-beta.9", + "12.0.0-beta.10", + "12.0.0-beta.11", + "12.0.0-beta.12", + "12.0.0-beta.14" + ], + "89.0.4348.1": [ + "12.0.0-beta.16", + "12.0.0-beta.18", + "12.0.0-beta.19", + "12.0.0-beta.20" + ], + "89.0.4388.2": [ + "12.0.0-beta.21", + "12.0.0-beta.22", + "12.0.0-beta.23", + "12.0.0-beta.24", + "12.0.0-beta.25", + "12.0.0-beta.26" + ], + "89.0.4389.23": [ + "12.0.0-beta.27", + "12.0.0-beta.28", + "12.0.0-beta.29" + ], + "89.0.4389.58": [ + "12.0.0-beta.30", + "12.0.0-beta.31" + ], + "89.0.4389.69": [ + "12.0.0" + ], + "89.0.4389.82": [ + "12.0.1" + ], + "89.0.4389.90": [ + "12.0.2" + ], + "89.0.4389.114": [ + "12.0.3", + "12.0.4" + ], + "89.0.4389.128": [ + "12.0.5", + "12.0.6", + "12.0.7", + "12.0.8", + "12.0.9", + "12.0.10", + "12.0.11", + "12.0.12", + "12.0.13", + "12.0.14", + "12.0.15", + "12.0.16", + "12.0.17", + "12.0.18", + "12.1.0", + "12.1.1", + "12.1.2", + "12.2.0", + "12.2.1", + "12.2.2", + "12.2.3" + ], + "90.0.4402.0": [ + "13.0.0-beta.2", + "13.0.0-beta.3" + ], + "90.0.4415.0": [ + "13.0.0-beta.4", + "13.0.0-beta.5", + "13.0.0-beta.6", + "13.0.0-beta.7", + "13.0.0-beta.8", + "13.0.0-beta.9", + "13.0.0-beta.10", + "13.0.0-beta.11", + "13.0.0-beta.12", + "13.0.0-beta.13" + ], + "91.0.4448.0": [ + "13.0.0-beta.14", + "13.0.0-beta.16", + "13.0.0-beta.17", + "13.0.0-beta.18", + "13.0.0-beta.20" + ], + "91.0.4472.33": [ + "13.0.0-beta.21", + "13.0.0-beta.22", + "13.0.0-beta.23" + ], + "91.0.4472.38": [ + "13.0.0-beta.24", + "13.0.0-beta.25", + "13.0.0-beta.26", + "13.0.0-beta.27", + "13.0.0-beta.28" + ], + "91.0.4472.69": [ + "13.0.0", + "13.0.1" + ], + "91.0.4472.77": [ + "13.1.0", + "13.1.1", + "13.1.2" + ], + "91.0.4472.106": [ + "13.1.3", + "13.1.4" + ], + "91.0.4472.124": [ + "13.1.5", + "13.1.6", + "13.1.7" + ], + "91.0.4472.164": [ + "13.1.8", + "13.1.9", + "13.2.0", + "13.2.1", + "13.2.2", + "13.2.3", + "13.3.0", + "13.4.0", + "13.5.0", + "13.5.1", + "13.5.2", + "13.6.0", + "13.6.1", + "13.6.2", + "13.6.3", + "13.6.6", + "13.6.7", + "13.6.8", + "13.6.9" + ], + "92.0.4511.0": [ + "14.0.0-beta.1", + "14.0.0-beta.2", + "14.0.0-beta.3" + ], + "93.0.4536.0": [ + "14.0.0-beta.5", + "14.0.0-beta.6", + "14.0.0-beta.7", + "14.0.0-beta.8" + ], + "93.0.4539.0": [ + "14.0.0-beta.9", + "14.0.0-beta.10" + ], + "93.0.4557.4": [ + "14.0.0-beta.11", + "14.0.0-beta.12" + ], + "93.0.4566.0": [ + "14.0.0-beta.13", + "14.0.0-beta.14", + "14.0.0-beta.15", + "14.0.0-beta.16", + "14.0.0-beta.17", + "15.0.0-alpha.1", + "15.0.0-alpha.2" + ], + "93.0.4577.15": [ + "14.0.0-beta.18", + "14.0.0-beta.19", + "14.0.0-beta.20", + "14.0.0-beta.21" + ], + "93.0.4577.25": [ + "14.0.0-beta.22", + "14.0.0-beta.23" + ], + "93.0.4577.51": [ + "14.0.0-beta.24", + "14.0.0-beta.25" + ], + "93.0.4577.58": [ + "14.0.0" + ], + "93.0.4577.63": [ + "14.0.1" + ], + "93.0.4577.82": [ + "14.0.2", + "14.1.0", + "14.1.1", + "14.2.0", + "14.2.1", + "14.2.2", + "14.2.3", + "14.2.4", + "14.2.5", + "14.2.6", + "14.2.7", + "14.2.8", + "14.2.9" + ], + "94.0.4584.0": [ + "15.0.0-alpha.3", + "15.0.0-alpha.4", + "15.0.0-alpha.5", + "15.0.0-alpha.6" + ], + "94.0.4590.2": [ + "15.0.0-alpha.7", + "15.0.0-alpha.8", + "15.0.0-alpha.9" + ], + "94.0.4606.12": [ + "15.0.0-alpha.10" + ], + "94.0.4606.20": [ + "15.0.0-beta.1", + "15.0.0-beta.2" + ], + "94.0.4606.31": [ + "15.0.0-beta.3", + "15.0.0-beta.4", + "15.0.0-beta.5", + "15.0.0-beta.6", + "15.0.0-beta.7" + ], + "94.0.4606.51": [ + "15.0.0" + ], + "94.0.4606.61": [ + "15.1.0", + "15.1.1" + ], + "94.0.4606.71": [ + "15.1.2" + ], + "94.0.4606.81": [ + "15.2.0", + "15.3.0", + "15.3.1", + "15.3.2", + "15.3.3", + "15.3.4", + "15.3.5", + "15.3.6", + "15.3.7", + "15.4.0", + "15.4.1", + "15.4.2", + "15.5.0", + "15.5.1", + "15.5.2", + "15.5.3", + "15.5.4", + "15.5.5", + "15.5.6", + "15.5.7" + ], + "95.0.4629.0": [ + "16.0.0-alpha.1", + "16.0.0-alpha.2", + "16.0.0-alpha.3", + "16.0.0-alpha.4", + "16.0.0-alpha.5", + "16.0.0-alpha.6", + "16.0.0-alpha.7" + ], + "96.0.4647.0": [ + "16.0.0-alpha.8", + "16.0.0-alpha.9", + "16.0.0-beta.1", + "16.0.0-beta.2", + "16.0.0-beta.3" + ], + "96.0.4664.18": [ + "16.0.0-beta.4", + "16.0.0-beta.5" + ], + "96.0.4664.27": [ + "16.0.0-beta.6", + "16.0.0-beta.7" + ], + "96.0.4664.35": [ + "16.0.0-beta.8", + "16.0.0-beta.9" + ], + "96.0.4664.45": [ + "16.0.0", + "16.0.1" + ], + "96.0.4664.55": [ + "16.0.2", + "16.0.3", + "16.0.4", + "16.0.5" + ], + "96.0.4664.110": [ + "16.0.6", + "16.0.7", + "16.0.8" + ], + "96.0.4664.174": [ + "16.0.9", + "16.0.10", + "16.1.0", + "16.1.1", + "16.2.0", + "16.2.1", + "16.2.2", + "16.2.3", + "16.2.4", + "16.2.5", + "16.2.6", + "16.2.7", + "16.2.8" + ], + "96.0.4664.4": [ + "17.0.0-alpha.1", + "17.0.0-alpha.2", + "17.0.0-alpha.3" + ], + "98.0.4706.0": [ + "17.0.0-alpha.4", + "17.0.0-alpha.5", + "17.0.0-alpha.6", + "17.0.0-beta.1", + "17.0.0-beta.2" + ], + "98.0.4758.9": [ + "17.0.0-beta.3" + ], + "98.0.4758.11": [ + "17.0.0-beta.4", + "17.0.0-beta.5", + "17.0.0-beta.6", + "17.0.0-beta.7", + "17.0.0-beta.8", + "17.0.0-beta.9" + ], + "98.0.4758.74": [ + "17.0.0" + ], + "98.0.4758.82": [ + "17.0.1" + ], + "98.0.4758.102": [ + "17.1.0" + ], + "98.0.4758.109": [ + "17.1.1", + "17.1.2", + "17.2.0" + ], + "98.0.4758.141": [ + "17.3.0", + "17.3.1", + "17.4.0", + "17.4.1", + "17.4.2", + "17.4.3", + "17.4.4", + "17.4.5", + "17.4.6", + "17.4.7", + "17.4.8", + "17.4.9", + "17.4.10", + "17.4.11" + ], + "99.0.4767.0": [ + "18.0.0-alpha.1", + "18.0.0-alpha.2", + "18.0.0-alpha.3", + "18.0.0-alpha.4", + "18.0.0-alpha.5" + ], + "100.0.4894.0": [ + "18.0.0-beta.1", + "18.0.0-beta.2", + "18.0.0-beta.3", + "18.0.0-beta.4", + "18.0.0-beta.5", + "18.0.0-beta.6" + ], + "100.0.4896.56": [ + "18.0.0" + ], + "100.0.4896.60": [ + "18.0.1", + "18.0.2" + ], + "100.0.4896.75": [ + "18.0.3", + "18.0.4" + ], + "100.0.4896.127": [ + "18.1.0" + ], + "100.0.4896.143": [ + "18.2.0", + "18.2.1", + "18.2.2", + "18.2.3" + ], + "100.0.4896.160": [ + "18.2.4", + "18.3.0", + "18.3.1", + "18.3.2", + "18.3.3", + "18.3.4", + "18.3.5", + "18.3.6", + "18.3.7", + "18.3.8", + "18.3.9", + "18.3.11", + "18.3.12", + "18.3.13", + "18.3.14", + "18.3.15" + ], + "102.0.4962.3": [ + "19.0.0-alpha.1" + ], + "102.0.4971.0": [ + "19.0.0-alpha.2", + "19.0.0-alpha.3" + ], + "102.0.4989.0": [ + "19.0.0-alpha.4", + "19.0.0-alpha.5" + ], + "102.0.4999.0": [ + "19.0.0-beta.1", + "19.0.0-beta.2", + "19.0.0-beta.3" + ], + "102.0.5005.27": [ + "19.0.0-beta.4" + ], + "102.0.5005.40": [ + "19.0.0-beta.5", + "19.0.0-beta.6", + "19.0.0-beta.7" + ], + "102.0.5005.49": [ + "19.0.0-beta.8" + ], + "102.0.5005.61": [ + "19.0.0", + "19.0.1" + ], + "102.0.5005.63": [ + "19.0.2", + "19.0.3", + "19.0.4" + ], + "102.0.5005.115": [ + "19.0.5", + "19.0.6" + ], + "102.0.5005.134": [ + "19.0.7" + ], + "102.0.5005.148": [ + "19.0.8" + ], + "102.0.5005.167": [ + "19.0.9", + "19.0.10", + "19.0.11", + "19.0.12", + "19.0.13", + "19.0.14", + "19.0.15", + "19.0.16", + "19.0.17", + "19.1.0", + "19.1.1", + "19.1.2", + "19.1.3", + "19.1.4", + "19.1.5", + "19.1.6", + "19.1.7", + "19.1.8", + "19.1.9" + ], + "103.0.5044.0": [ + "20.0.0-alpha.1" + ], + "104.0.5073.0": [ + "20.0.0-alpha.2", + "20.0.0-alpha.3", + "20.0.0-alpha.4", + "20.0.0-alpha.5", + "20.0.0-alpha.6", + "20.0.0-alpha.7", + "20.0.0-beta.1", + "20.0.0-beta.2", + "20.0.0-beta.3", + "20.0.0-beta.4", + "20.0.0-beta.5", + "20.0.0-beta.6", + "20.0.0-beta.7", + "20.0.0-beta.8" + ], + "104.0.5112.39": [ + "20.0.0-beta.9" + ], + "104.0.5112.48": [ + "20.0.0-beta.10", + "20.0.0-beta.11", + "20.0.0-beta.12" + ], + "104.0.5112.57": [ + "20.0.0-beta.13" + ], + "104.0.5112.65": [ + "20.0.0" + ], + "104.0.5112.81": [ + "20.0.1", + "20.0.2", + "20.0.3" + ], + "104.0.5112.102": [ + "20.1.0", + "20.1.1" + ], + "104.0.5112.114": [ + "20.1.2", + "20.1.3", + "20.1.4" + ], + "104.0.5112.124": [ + "20.2.0", + "20.3.0", + "20.3.1", + "20.3.2", + "20.3.3", + "20.3.4", + "20.3.5", + "20.3.6", + "20.3.7", + "20.3.8", + "20.3.9", + "20.3.10", + "20.3.11", + "20.3.12" + ], + "105.0.5187.0": [ + "21.0.0-alpha.1", + "21.0.0-alpha.2", + "21.0.0-alpha.3", + "21.0.0-alpha.4", + "21.0.0-alpha.5" + ], + "106.0.5216.0": [ + "21.0.0-alpha.6", + "21.0.0-beta.1", + "21.0.0-beta.2", + "21.0.0-beta.3", + "21.0.0-beta.4", + "21.0.0-beta.5" + ], + "106.0.5249.40": [ + "21.0.0-beta.6", + "21.0.0-beta.7", + "21.0.0-beta.8" + ], + "106.0.5249.51": [ + "21.0.0" + ], + "106.0.5249.61": [ + "21.0.1" + ], + "106.0.5249.91": [ + "21.1.0" + ], + "106.0.5249.103": [ + "21.1.1" + ], + "106.0.5249.119": [ + "21.2.0" + ], + "106.0.5249.165": [ + "21.2.1" + ], + "106.0.5249.168": [ + "21.2.2", + "21.2.3" + ], + "106.0.5249.181": [ + "21.3.0", + "21.3.1" + ], + "106.0.5249.199": [ + "21.3.3", + "21.3.4", + "21.3.5", + "21.4.0", + "21.4.1", + "21.4.2", + "21.4.3", + "21.4.4" + ], + "107.0.5286.0": [ + "22.0.0-alpha.1" + ], + "108.0.5329.0": [ + "22.0.0-alpha.3", + "22.0.0-alpha.4", + "22.0.0-alpha.5", + "22.0.0-alpha.6" + ], + "108.0.5355.0": [ + "22.0.0-alpha.7" + ], + "108.0.5359.10": [ + "22.0.0-alpha.8", + "22.0.0-beta.1", + "22.0.0-beta.2", + "22.0.0-beta.3" + ], + "108.0.5359.29": [ + "22.0.0-beta.4" + ], + "108.0.5359.40": [ + "22.0.0-beta.5", + "22.0.0-beta.6" + ], + "108.0.5359.48": [ + "22.0.0-beta.7", + "22.0.0-beta.8" + ], + "108.0.5359.62": [ + "22.0.0" + ], + "108.0.5359.125": [ + "22.0.1" + ], + "108.0.5359.179": [ + "22.0.2", + "22.0.3", + "22.1.0" + ], + "108.0.5359.215": [ + "22.2.0", + "22.2.1", + "22.3.0", + "22.3.1", + "22.3.2", + "22.3.3", + "22.3.4", + "22.3.5", + "22.3.6", + "22.3.7", + "22.3.8", + "22.3.9", + "22.3.10", + "22.3.11", + "22.3.12", + "22.3.13", + "22.3.14", + "22.3.15", + "22.3.16", + "22.3.17", + "22.3.18", + "22.3.20", + "22.3.21", + "22.3.22", + "22.3.23", + "22.3.24", + "22.3.25", + "22.3.26", + "22.3.27" + ], + "110.0.5415.0": [ + "23.0.0-alpha.1" + ], + "110.0.5451.0": [ + "23.0.0-alpha.2", + "23.0.0-alpha.3" + ], + "110.0.5478.5": [ + "23.0.0-beta.1", + "23.0.0-beta.2", + "23.0.0-beta.3" + ], + "110.0.5481.30": [ + "23.0.0-beta.4" + ], + "110.0.5481.38": [ + "23.0.0-beta.5" + ], + "110.0.5481.52": [ + "23.0.0-beta.6", + "23.0.0-beta.8" + ], + "110.0.5481.77": [ + "23.0.0" + ], + "110.0.5481.100": [ + "23.1.0" + ], + "110.0.5481.104": [ + "23.1.1" + ], + "110.0.5481.177": [ + "23.1.2" + ], + "110.0.5481.179": [ + "23.1.3" + ], + "110.0.5481.192": [ + "23.1.4", + "23.2.0" + ], + "110.0.5481.208": [ + "23.2.1", + "23.2.2", + "23.2.3", + "23.2.4", + "23.3.0", + "23.3.1", + "23.3.2", + "23.3.3", + "23.3.4", + "23.3.5", + "23.3.6", + "23.3.7", + "23.3.8", + "23.3.9", + "23.3.10", + "23.3.11", + "23.3.12", + "23.3.13" + ], + "111.0.5560.0": [ + "24.0.0-alpha.1", + "24.0.0-alpha.2", + "24.0.0-alpha.3", + "24.0.0-alpha.4", + "24.0.0-alpha.5", + "24.0.0-alpha.6", + "24.0.0-alpha.7" + ], + "111.0.5563.50": [ + "24.0.0-beta.1", + "24.0.0-beta.2" + ], + "112.0.5615.20": [ + "24.0.0-beta.3", + "24.0.0-beta.4" + ], + "112.0.5615.29": [ + "24.0.0-beta.5" + ], + "112.0.5615.39": [ + "24.0.0-beta.6", + "24.0.0-beta.7" + ], + "112.0.5615.49": [ + "24.0.0" + ], + "112.0.5615.50": [ + "24.1.0", + "24.1.1" + ], + "112.0.5615.87": [ + "24.1.2" + ], + "112.0.5615.165": [ + "24.1.3", + "24.2.0", + "24.3.0" + ], + "112.0.5615.183": [ + "24.3.1" + ], + "112.0.5615.204": [ + "24.4.0", + "24.4.1", + "24.5.0", + "24.5.1", + "24.6.0", + "24.6.1", + "24.6.2", + "24.6.3", + "24.6.4", + "24.6.5", + "24.7.0", + "24.7.1", + "24.8.0", + "24.8.1", + "24.8.2", + "24.8.3", + "24.8.4", + "24.8.5", + "24.8.6", + "24.8.7", + "24.8.8" + ], + "114.0.5694.0": [ + "25.0.0-alpha.1", + "25.0.0-alpha.2" + ], + "114.0.5710.0": [ + "25.0.0-alpha.3", + "25.0.0-alpha.4" + ], + "114.0.5719.0": [ + "25.0.0-alpha.5", + "25.0.0-alpha.6", + "25.0.0-beta.1", + "25.0.0-beta.2", + "25.0.0-beta.3" + ], + "114.0.5735.16": [ + "25.0.0-beta.4", + "25.0.0-beta.5", + "25.0.0-beta.6", + "25.0.0-beta.7" + ], + "114.0.5735.35": [ + "25.0.0-beta.8" + ], + "114.0.5735.45": [ + "25.0.0-beta.9", + "25.0.0", + "25.0.1" + ], + "114.0.5735.106": [ + "25.1.0", + "25.1.1" + ], + "114.0.5735.134": [ + "25.2.0" + ], + "114.0.5735.199": [ + "25.3.0" + ], + "114.0.5735.243": [ + "25.3.1" + ], + "114.0.5735.248": [ + "25.3.2", + "25.4.0" + ], + "114.0.5735.289": [ + "25.5.0", + "25.6.0", + "25.7.0", + "25.8.0", + "25.8.1", + "25.8.2", + "25.8.3", + "25.8.4", + "25.9.0", + "25.9.1", + "25.9.2", + "25.9.3", + "25.9.4", + "25.9.5", + "25.9.6", + "25.9.7", + "25.9.8" + ], + "116.0.5791.0": [ + "26.0.0-alpha.1", + "26.0.0-alpha.2", + "26.0.0-alpha.3", + "26.0.0-alpha.4", + "26.0.0-alpha.5" + ], + "116.0.5815.0": [ + "26.0.0-alpha.6" + ], + "116.0.5831.0": [ + "26.0.0-alpha.7" + ], + "116.0.5845.0": [ + "26.0.0-alpha.8", + "26.0.0-beta.1" + ], + "116.0.5845.14": [ + "26.0.0-beta.2", + "26.0.0-beta.3", + "26.0.0-beta.4", + "26.0.0-beta.5", + "26.0.0-beta.6", + "26.0.0-beta.7" + ], + "116.0.5845.42": [ + "26.0.0-beta.8", + "26.0.0-beta.9" + ], + "116.0.5845.49": [ + "26.0.0-beta.10", + "26.0.0-beta.11" + ], + "116.0.5845.62": [ + "26.0.0-beta.12" + ], + "116.0.5845.82": [ + "26.0.0" + ], + "116.0.5845.97": [ + "26.1.0" + ], + "116.0.5845.179": [ + "26.2.0" + ], + "116.0.5845.188": [ + "26.2.1" + ], + "116.0.5845.190": [ + "26.2.2", + "26.2.3", + "26.2.4" + ], + "116.0.5845.228": [ + "26.3.0", + "26.4.0", + "26.4.1", + "26.4.2", + "26.4.3", + "26.5.0", + "26.6.0", + "26.6.1", + "26.6.2", + "26.6.3", + "26.6.4", + "26.6.5", + "26.6.6", + "26.6.7", + "26.6.8", + "26.6.9", + "26.6.10" + ], + "118.0.5949.0": [ + "27.0.0-alpha.1", + "27.0.0-alpha.2", + "27.0.0-alpha.3", + "27.0.0-alpha.4", + "27.0.0-alpha.5", + "27.0.0-alpha.6" + ], + "118.0.5993.5": [ + "27.0.0-beta.1", + "27.0.0-beta.2", + "27.0.0-beta.3" + ], + "118.0.5993.11": [ + "27.0.0-beta.4" + ], + "118.0.5993.18": [ + "27.0.0-beta.5", + "27.0.0-beta.6", + "27.0.0-beta.7", + "27.0.0-beta.8", + "27.0.0-beta.9" + ], + "118.0.5993.54": [ + "27.0.0" + ], + "118.0.5993.89": [ + "27.0.1", + "27.0.2" + ], + "118.0.5993.120": [ + "27.0.3" + ], + "118.0.5993.129": [ + "27.0.4" + ], + "118.0.5993.144": [ + "27.1.0", + "27.1.2" + ], + "118.0.5993.159": [ + "27.1.3", + "27.2.0", + "27.2.1", + "27.2.2", + "27.2.3", + "27.2.4", + "27.3.0", + "27.3.1", + "27.3.2", + "27.3.3", + "27.3.4", + "27.3.5", + "27.3.6", + "27.3.7", + "27.3.8", + "27.3.9", + "27.3.10", + "27.3.11" + ], + "119.0.6045.0": [ + "28.0.0-alpha.1", + "28.0.0-alpha.2" + ], + "119.0.6045.21": [ + "28.0.0-alpha.3", + "28.0.0-alpha.4" + ], + "119.0.6045.33": [ + "28.0.0-alpha.5", + "28.0.0-alpha.6", + "28.0.0-alpha.7", + "28.0.0-beta.1" + ], + "120.0.6099.0": [ + "28.0.0-beta.2" + ], + "120.0.6099.5": [ + "28.0.0-beta.3", + "28.0.0-beta.4" + ], + "120.0.6099.18": [ + "28.0.0-beta.5", + "28.0.0-beta.6", + "28.0.0-beta.7", + "28.0.0-beta.8", + "28.0.0-beta.9", + "28.0.0-beta.10" + ], + "120.0.6099.35": [ + "28.0.0-beta.11" + ], + "120.0.6099.56": [ + "28.0.0" + ], + "120.0.6099.109": [ + "28.1.0", + "28.1.1" + ], + "120.0.6099.199": [ + "28.1.2", + "28.1.3" + ], + "120.0.6099.216": [ + "28.1.4" + ], + "120.0.6099.227": [ + "28.2.0" + ], + "120.0.6099.268": [ + "28.2.1" + ], + "120.0.6099.276": [ + "28.2.2" + ], + "120.0.6099.283": [ + "28.2.3" + ], + "120.0.6099.291": [ + "28.2.4", + "28.2.5", + "28.2.6", + "28.2.7", + "28.2.8", + "28.2.9", + "28.2.10", + "28.3.0", + "28.3.1", + "28.3.2", + "28.3.3" + ], + "121.0.6147.0": [ + "29.0.0-alpha.1", + "29.0.0-alpha.2", + "29.0.0-alpha.3" + ], + "121.0.6159.0": [ + "29.0.0-alpha.4", + "29.0.0-alpha.5", + "29.0.0-alpha.6", + "29.0.0-alpha.7" + ], + "122.0.6194.0": [ + "29.0.0-alpha.8" + ], + "122.0.6236.2": [ + "29.0.0-alpha.9", + "29.0.0-alpha.10", + "29.0.0-alpha.11", + "29.0.0-beta.1", + "29.0.0-beta.2" + ], + "122.0.6261.6": [ + "29.0.0-beta.3", + "29.0.0-beta.4" + ], + "122.0.6261.18": [ + "29.0.0-beta.5", + "29.0.0-beta.6", + "29.0.0-beta.7", + "29.0.0-beta.8", + "29.0.0-beta.9", + "29.0.0-beta.10", + "29.0.0-beta.11" + ], + "122.0.6261.29": [ + "29.0.0-beta.12" + ], + "122.0.6261.39": [ + "29.0.0" + ], + "122.0.6261.57": [ + "29.0.1" + ], + "122.0.6261.70": [ + "29.1.0" + ], + "122.0.6261.111": [ + "29.1.1" + ], + "122.0.6261.112": [ + "29.1.2", + "29.1.3" + ], + "122.0.6261.129": [ + "29.1.4" + ], + "122.0.6261.130": [ + "29.1.5" + ], + "122.0.6261.139": [ + "29.1.6" + ], + "122.0.6261.156": [ + "29.2.0", + "29.3.0", + "29.3.1", + "29.3.2", + "29.3.3", + "29.4.0", + "29.4.1", + "29.4.2", + "29.4.3", + "29.4.4", + "29.4.5", + "29.4.6" + ], + "123.0.6296.0": [ + "30.0.0-alpha.1" + ], + "123.0.6312.5": [ + "30.0.0-alpha.2" + ], + "124.0.6323.0": [ + "30.0.0-alpha.3", + "30.0.0-alpha.4" + ], + "124.0.6331.0": [ + "30.0.0-alpha.5", + "30.0.0-alpha.6" + ], + "124.0.6353.0": [ + "30.0.0-alpha.7" + ], + "124.0.6359.0": [ + "30.0.0-beta.1", + "30.0.0-beta.2" + ], + "124.0.6367.9": [ + "30.0.0-beta.3", + "30.0.0-beta.4", + "30.0.0-beta.5" + ], + "124.0.6367.18": [ + "30.0.0-beta.6" + ], + "124.0.6367.29": [ + "30.0.0-beta.7", + "30.0.0-beta.8" + ], + "124.0.6367.49": [ + "30.0.0" + ], + "124.0.6367.60": [ + "30.0.1" + ], + "124.0.6367.91": [ + "30.0.2" + ], + "124.0.6367.119": [ + "30.0.3" + ], + "124.0.6367.201": [ + "30.0.4" + ], + "124.0.6367.207": [ + "30.0.5", + "30.0.6" + ], + "124.0.6367.221": [ + "30.0.7" + ], + "124.0.6367.230": [ + "30.0.8" + ], + "124.0.6367.233": [ + "30.0.9" + ], + "124.0.6367.243": [ + "30.1.0", + "30.1.1", + "30.1.2", + "30.2.0", + "30.3.0", + "30.3.1", + "30.4.0", + "30.5.0", + "30.5.1" + ], + "125.0.6412.0": [ + "31.0.0-alpha.1", + "31.0.0-alpha.2", + "31.0.0-alpha.3", + "31.0.0-alpha.4", + "31.0.0-alpha.5" + ], + "126.0.6445.0": [ + "31.0.0-beta.1", + "31.0.0-beta.2", + "31.0.0-beta.3", + "31.0.0-beta.4", + "31.0.0-beta.5", + "31.0.0-beta.6", + "31.0.0-beta.7", + "31.0.0-beta.8", + "31.0.0-beta.9" + ], + "126.0.6478.36": [ + "31.0.0-beta.10", + "31.0.0", + "31.0.1" + ], + "126.0.6478.61": [ + "31.0.2" + ], + "126.0.6478.114": [ + "31.1.0" + ], + "126.0.6478.127": [ + "31.2.0", + "31.2.1" + ], + "126.0.6478.183": [ + "31.3.0" + ], + "126.0.6478.185": [ + "31.3.1" + ], + "126.0.6478.234": [ + "31.4.0", + "31.5.0", + "31.6.0", + "31.7.0", + "31.7.1", + "31.7.2", + "31.7.3", + "31.7.4", + "31.7.5", + "31.7.6", + "31.7.7" + ], + "127.0.6521.0": [ + "32.0.0-alpha.1", + "32.0.0-alpha.2", + "32.0.0-alpha.3", + "32.0.0-alpha.4", + "32.0.0-alpha.5" + ], + "128.0.6571.0": [ + "32.0.0-alpha.6", + "32.0.0-alpha.7" + ], + "128.0.6573.0": [ + "32.0.0-alpha.8", + "32.0.0-alpha.9", + "32.0.0-alpha.10", + "32.0.0-beta.1" + ], + "128.0.6611.0": [ + "32.0.0-beta.2" + ], + "128.0.6613.7": [ + "32.0.0-beta.3" + ], + "128.0.6613.18": [ + "32.0.0-beta.4" + ], + "128.0.6613.27": [ + "32.0.0-beta.5", + "32.0.0-beta.6", + "32.0.0-beta.7" + ], + "128.0.6613.36": [ + "32.0.0", + "32.0.1" + ], + "128.0.6613.84": [ + "32.0.2" + ], + "128.0.6613.120": [ + "32.1.0" + ], + "128.0.6613.137": [ + "32.1.1" + ], + "128.0.6613.162": [ + "32.1.2" + ], + "128.0.6613.178": [ + "32.2.0" + ], + "128.0.6613.186": [ + "32.2.1", + "32.2.2", + "32.2.3", + "32.2.4", + "32.2.5", + "32.2.6", + "32.2.7", + "32.2.8", + "32.3.0", + "32.3.1", + "32.3.2", + "32.3.3" + ], + "129.0.6668.0": [ + "33.0.0-alpha.1" + ], + "130.0.6672.0": [ + "33.0.0-alpha.2", + "33.0.0-alpha.3", + "33.0.0-alpha.4", + "33.0.0-alpha.5", + "33.0.0-alpha.6", + "33.0.0-beta.1", + "33.0.0-beta.2", + "33.0.0-beta.3", + "33.0.0-beta.4" + ], + "130.0.6723.19": [ + "33.0.0-beta.5", + "33.0.0-beta.6", + "33.0.0-beta.7" + ], + "130.0.6723.31": [ + "33.0.0-beta.8", + "33.0.0-beta.9", + "33.0.0-beta.10" + ], + "130.0.6723.44": [ + "33.0.0-beta.11", + "33.0.0" + ], + "130.0.6723.59": [ + "33.0.1", + "33.0.2" + ], + "130.0.6723.91": [ + "33.1.0" + ], + "130.0.6723.118": [ + "33.2.0" + ], + "130.0.6723.137": [ + "33.2.1" + ], + "130.0.6723.152": [ + "33.3.0" + ], + "130.0.6723.170": [ + "33.3.1" + ], + "130.0.6723.191": [ + "33.3.2", + "33.4.0", + "33.4.1", + "33.4.2", + "33.4.3", + "33.4.4", + "33.4.5", + "33.4.6", + "33.4.7", + "33.4.8", + "33.4.9", + "33.4.10", + "33.4.11" + ], + "131.0.6776.0": [ + "34.0.0-alpha.1" + ], + "132.0.6779.0": [ + "34.0.0-alpha.2" + ], + "132.0.6789.1": [ + "34.0.0-alpha.3", + "34.0.0-alpha.4", + "34.0.0-alpha.5", + "34.0.0-alpha.6", + "34.0.0-alpha.7" + ], + "132.0.6820.0": [ + "34.0.0-alpha.8" + ], + "132.0.6824.0": [ + "34.0.0-alpha.9", + "34.0.0-beta.1", + "34.0.0-beta.2", + "34.0.0-beta.3" + ], + "132.0.6834.6": [ + "34.0.0-beta.4", + "34.0.0-beta.5" + ], + "132.0.6834.15": [ + "34.0.0-beta.6", + "34.0.0-beta.7", + "34.0.0-beta.8" + ], + "132.0.6834.32": [ + "34.0.0-beta.9", + "34.0.0-beta.10", + "34.0.0-beta.11" + ], + "132.0.6834.46": [ + "34.0.0-beta.12", + "34.0.0-beta.13" + ], + "132.0.6834.57": [ + "34.0.0-beta.14", + "34.0.0-beta.15", + "34.0.0-beta.16" + ], + "132.0.6834.83": [ + "34.0.0", + "34.0.1" + ], + "132.0.6834.159": [ + "34.0.2" + ], + "132.0.6834.194": [ + "34.1.0", + "34.1.1" + ], + "132.0.6834.196": [ + "34.2.0" + ], + "132.0.6834.210": [ + "34.3.0", + "34.3.1", + "34.3.2", + "34.3.3", + "34.3.4", + "34.4.0", + "34.4.1", + "34.5.0", + "34.5.1", + "34.5.2", + "34.5.3", + "34.5.4", + "34.5.5", + "34.5.6", + "34.5.7", + "34.5.8" + ], + "133.0.6920.0": [ + "35.0.0-alpha.1", + "35.0.0-alpha.2", + "35.0.0-alpha.3", + "35.0.0-alpha.4", + "35.0.0-alpha.5", + "35.0.0-beta.1" + ], + "134.0.6968.0": [ + "35.0.0-beta.2", + "35.0.0-beta.3", + "35.0.0-beta.4" + ], + "134.0.6989.0": [ + "35.0.0-beta.5" + ], + "134.0.6990.0": [ + "35.0.0-beta.6", + "35.0.0-beta.7" + ], + "134.0.6998.10": [ + "35.0.0-beta.8", + "35.0.0-beta.9" + ], + "134.0.6998.23": [ + "35.0.0-beta.10", + "35.0.0-beta.11", + "35.0.0-beta.12" + ], + "134.0.6998.44": [ + "35.0.0-beta.13", + "35.0.0", + "35.0.1" + ], + "134.0.6998.88": [ + "35.0.2", + "35.0.3" + ], + "134.0.6998.165": [ + "35.1.0", + "35.1.1" + ], + "134.0.6998.178": [ + "35.1.2" + ], + "134.0.6998.179": [ + "35.1.3", + "35.1.4", + "35.1.5" + ], + "134.0.6998.205": [ + "35.2.0", + "35.2.1", + "35.2.2", + "35.3.0", + "35.4.0", + "35.5.0", + "35.5.1", + "35.6.0", + "35.7.0", + "35.7.1", + "35.7.2", + "35.7.4", + "35.7.5" + ], + "135.0.7049.5": [ + "36.0.0-alpha.1" + ], + "136.0.7062.0": [ + "36.0.0-alpha.2", + "36.0.0-alpha.3", + "36.0.0-alpha.4" + ], + "136.0.7067.0": [ + "36.0.0-alpha.5", + "36.0.0-alpha.6", + "36.0.0-beta.1", + "36.0.0-beta.2", + "36.0.0-beta.3", + "36.0.0-beta.4" + ], + "136.0.7103.17": [ + "36.0.0-beta.5" + ], + "136.0.7103.25": [ + "36.0.0-beta.6", + "36.0.0-beta.7" + ], + "136.0.7103.33": [ + "36.0.0-beta.8", + "36.0.0-beta.9" + ], + "136.0.7103.48": [ + "36.0.0", + "36.0.1" + ], + "136.0.7103.49": [ + "36.1.0", + "36.2.0" + ], + "136.0.7103.93": [ + "36.2.1" + ], + "136.0.7103.113": [ + "36.3.0", + "36.3.1" + ], + "136.0.7103.115": [ + "36.3.2" + ], + "136.0.7103.149": [ + "36.4.0" + ], + "136.0.7103.168": [ + "36.5.0" + ], + "136.0.7103.177": [ + "36.6.0", + "36.7.0", + "36.7.1", + "36.7.3", + "36.7.4", + "36.8.0", + "36.8.1", + "36.9.0", + "36.9.1", + "36.9.2", + "36.9.3", + "36.9.4", + "36.9.5" + ], + "137.0.7151.0": [ + "37.0.0-alpha.1", + "37.0.0-alpha.2" + ], + "138.0.7156.0": [ + "37.0.0-alpha.3" + ], + "138.0.7165.0": [ + "37.0.0-alpha.4" + ], + "138.0.7177.0": [ + "37.0.0-alpha.5" + ], + "138.0.7178.0": [ + "37.0.0-alpha.6", + "37.0.0-alpha.7", + "37.0.0-beta.1", + "37.0.0-beta.2" + ], + "138.0.7190.0": [ + "37.0.0-beta.3" + ], + "138.0.7204.15": [ + "37.0.0-beta.4", + "37.0.0-beta.5", + "37.0.0-beta.6", + "37.0.0-beta.7" + ], + "138.0.7204.23": [ + "37.0.0-beta.8" + ], + "138.0.7204.35": [ + "37.0.0-beta.9", + "37.0.0", + "37.1.0" + ], + "138.0.7204.97": [ + "37.2.0", + "37.2.1" + ], + "138.0.7204.100": [ + "37.2.2", + "37.2.3" + ], + "138.0.7204.157": [ + "37.2.4" + ], + "138.0.7204.168": [ + "37.2.5" + ], + "138.0.7204.185": [ + "37.2.6" + ], + "138.0.7204.224": [ + "37.3.0" + ], + "138.0.7204.235": [ + "37.3.1" + ], + "138.0.7204.243": [ + "37.4.0" + ], + "138.0.7204.251": [ + "37.5.0", + "37.5.1", + "37.6.0", + "37.6.1", + "37.7.0", + "37.7.1", + "37.8.0", + "37.9.0", + "37.10.0", + "37.10.1", + "37.10.2", + "37.10.3" + ], + "139.0.7219.0": [ + "38.0.0-alpha.1", + "38.0.0-alpha.2", + "38.0.0-alpha.3" + ], + "140.0.7261.0": [ + "38.0.0-alpha.4", + "38.0.0-alpha.5", + "38.0.0-alpha.6" + ], + "140.0.7281.0": [ + "38.0.0-alpha.7", + "38.0.0-alpha.8" + ], + "140.0.7301.0": [ + "38.0.0-alpha.9" + ], + "140.0.7309.0": [ + "38.0.0-alpha.10" + ], + "140.0.7312.0": [ + "38.0.0-alpha.11" + ], + "140.0.7314.0": [ + "38.0.0-alpha.12", + "38.0.0-alpha.13", + "38.0.0-beta.1" + ], + "140.0.7327.0": [ + "38.0.0-beta.2", + "38.0.0-beta.3" + ], + "140.0.7339.2": [ + "38.0.0-beta.4", + "38.0.0-beta.5", + "38.0.0-beta.6" + ], + "140.0.7339.16": [ + "38.0.0-beta.7" + ], + "140.0.7339.24": [ + "38.0.0-beta.8", + "38.0.0-beta.9" + ], + "140.0.7339.41": [ + "38.0.0-beta.11", + "38.0.0" + ], + "140.0.7339.80": [ + "38.1.0" + ], + "140.0.7339.133": [ + "38.1.1", + "38.1.2", + "38.2.0", + "38.2.1", + "38.2.2" + ], + "140.0.7339.240": [ + "38.3.0", + "38.4.0" + ], + "140.0.7339.249": [ + "38.5.0", + "38.6.0", + "38.7.0", + "38.7.1", + "38.7.2", + "38.8.0", + "38.8.1", + "38.8.2", + "38.8.4", + "38.8.6" + ], + "141.0.7361.0": [ + "39.0.0-alpha.1", + "39.0.0-alpha.2" + ], + "141.0.7390.7": [ + "39.0.0-alpha.3", + "39.0.0-alpha.4", + "39.0.0-alpha.5" + ], + "142.0.7417.0": [ + "39.0.0-alpha.6", + "39.0.0-alpha.7", + "39.0.0-alpha.8", + "39.0.0-alpha.9", + "39.0.0-beta.1", + "39.0.0-beta.2", + "39.0.0-beta.3" + ], + "142.0.7444.34": [ + "39.0.0-beta.4", + "39.0.0-beta.5" + ], + "142.0.7444.52": [ + "39.0.0" + ], + "142.0.7444.59": [ + "39.1.0", + "39.1.1" + ], + "142.0.7444.134": [ + "39.1.2" + ], + "142.0.7444.162": [ + "39.2.0", + "39.2.1", + "39.2.2" + ], + "142.0.7444.175": [ + "39.2.3" + ], + "142.0.7444.177": [ + "39.2.4", + "39.2.5" + ], + "142.0.7444.226": [ + "39.2.6" + ], + "142.0.7444.235": [ + "39.2.7" + ], + "142.0.7444.265": [ + "39.3.0", + "39.4.0", + "39.5.0", + "39.5.1", + "39.5.2", + "39.6.0", + "39.6.1", + "39.7.0", + "39.8.0", + "39.8.1", + "39.8.2", + "39.8.3", + "39.8.4", + "39.8.5", + "39.8.6", + "39.8.7", + "39.8.8", + "39.8.9", + "39.8.10" + ], + "143.0.7499.0": [ + "40.0.0-alpha.2" + ], + "144.0.7506.0": [ + "40.0.0-alpha.4" + ], + "144.0.7526.0": [ + "40.0.0-alpha.5", + "40.0.0-alpha.6", + "40.0.0-alpha.7", + "40.0.0-alpha.8" + ], + "144.0.7527.0": [ + "40.0.0-beta.1", + "40.0.0-beta.2" + ], + "144.0.7547.0": [ + "40.0.0-beta.3", + "40.0.0-beta.4", + "40.0.0-beta.5" + ], + "144.0.7559.31": [ + "40.0.0-beta.6", + "40.0.0-beta.7", + "40.0.0-beta.8" + ], + "144.0.7559.60": [ + "40.0.0-beta.9", + "40.0.0" + ], + "144.0.7559.96": [ + "40.1.0" + ], + "144.0.7559.111": [ + "40.2.0", + "40.2.1" + ], + "144.0.7559.134": [ + "40.3.0", + "40.4.0" + ], + "144.0.7559.173": [ + "40.4.1" + ], + "144.0.7559.177": [ + "40.5.0", + "40.6.0" + ], + "144.0.7559.220": [ + "40.6.1" + ], + "144.0.7559.225": [ + "40.7.0" + ], + "144.0.7559.236": [ + "40.8.0", + "40.8.1", + "40.8.2", + "40.8.3", + "40.8.4", + "40.8.5", + "40.9.0", + "40.9.1", + "40.9.2", + "40.9.3", + "40.10.0", + "40.10.1", + "40.10.2", + "40.10.3", + "40.10.4", + "40.10.5", + "40.10.6" + ], + "146.0.7635.0": [ + "41.0.0-alpha.1", + "41.0.0-alpha.2" + ], + "146.0.7645.0": [ + "41.0.0-alpha.3" + ], + "146.0.7650.0": [ + "41.0.0-alpha.4", + "41.0.0-alpha.5", + "41.0.0-alpha.6", + "41.0.0-beta.1", + "41.0.0-beta.2", + "41.0.0-beta.3" + ], + "146.0.7666.0": [ + "41.0.0-beta.4" + ], + "146.0.7680.16": [ + "41.0.0-beta.5", + "41.0.0-beta.6" + ], + "146.0.7680.31": [ + "41.0.0-beta.7", + "41.0.0-beta.8" + ], + "146.0.7680.65": [ + "41.0.0" + ], + "146.0.7680.72": [ + "41.0.1", + "41.0.2" + ], + "146.0.7680.80": [ + "41.0.3" + ], + "146.0.7680.153": [ + "41.0.4" + ], + "146.0.7680.166": [ + "41.1.0", + "41.1.1" + ], + "146.0.7680.179": [ + "41.2.0" + ], + "146.0.7680.188": [ + "41.2.1", + "41.2.2", + "41.3.0" + ], + "146.0.7680.216": [ + "41.4.0", + "41.5.0", + "41.5.1", + "41.5.2", + "41.6.0", + "41.6.1", + "41.7.0", + "41.7.1", + "41.7.2", + "41.8.0", + "41.9.0", + "41.9.1", + "41.9.2", + "41.10.0", + "41.10.1", + "41.10.2", + "41.10.3", + "41.10.4", + "41.10.5", + "41.10.6", + "41.10.7" + ], + "147.0.7727.0": [ + "42.0.0-alpha.1" + ], + "148.0.7733.0": [ + "42.0.0-alpha.2" + ], + "148.0.7738.0": [ + "42.0.0-alpha.4" + ], + "148.0.7741.0": [ + "42.0.0-alpha.5" + ], + "148.0.7751.0": [ + "42.0.0-alpha.6", + "42.0.0-beta.1" + ], + "148.0.7778.0": [ + "42.0.0-beta.2" + ], + "148.0.7778.5": [ + "42.0.0-beta.3", + "42.0.0-beta.4", + "42.0.0-beta.5", + "42.0.0-beta.6" + ], + "148.0.7778.56": [ + "42.0.0-beta.7", + "42.0.0-beta.8" + ], + "148.0.7778.96": [ + "42.0.0" + ], + "148.0.7778.97": [ + "42.0.1", + "42.1.0", + "42.2.0" + ], + "148.0.7778.180": [ + "42.3.0" + ], + "148.0.7778.218": [ + "42.3.1", + "42.3.2", + "42.3.3" + ], + "148.0.7778.254": [ + "42.4.0" + ], + "148.0.7778.265": [ + "42.4.1" + ], + "148.0.7778.271": [ + "42.5.0", + "42.5.1", + "42.5.2" + ], + "148.0.7778.280": [ + "42.6.0", + "42.6.1", + "42.6.2", + "42.7.0", + "42.7.1", + "42.8.0", + "42.8.1", + "42.9.0", + "42.9.1", + "42.9.2", + "42.9.3", + "42.10.0", + "42.10.1", + "42.11.0", + "42.11.1", + "42.11.2", + "42.11.3", + "42.11.4", + "42.11.5", + "42.11.6", + "42.11.7", + "42.11.8", + "42.11.9", + "42.11.10", + "42.11.11", + "42.11.12" + ], + "149.0.7827.0": [ + "43.0.0-alpha.1" + ], + "150.0.7832.0": [ + "43.0.0-alpha.2" + ], + "150.0.7834.0": [ + "43.0.0-alpha.3", + "43.0.0-alpha.4", + "43.0.0-alpha.5", + "43.0.0-alpha.6" + ], + "150.0.7849.0": [ + "43.0.0-alpha.7" + ], + "150.0.7863.0": [ + "43.0.0-beta.1", + "43.0.0-beta.2", + "43.0.0-beta.3" + ], + "150.0.7871.13": [ + "43.0.0-beta.4", + "43.0.0-beta.5" + ], + "150.0.7871.24": [ + "43.0.0-beta.6", + "43.0.0-beta.7", + "43.0.0-beta.8" + ], + "150.0.7871.46": [ + "43.0.0" + ], + "150.0.7871.47": [ + "43.1.0" + ], + "150.0.7871.114": [ + "43.1.1" + ], + "150.0.7871.129": [ + "43.2.0" + ], + "150.0.7871.212": [ + "43.3.0" + ], + "150.0.7871.224": [ + "43.4.0", + "43.4.1" + ], + "150.0.7871.250": [ + "43.5.0", + "43.5.1", + "43.6.0", + "43.7.0", + "43.7.1", + "43.7.2", + "43.7.3", + "43.7.4", + "43.7.5", + "43.7.6", + "43.7.7", + "43.7.8", + "43.7.9" + ], + "151.0.7900.0": [ + "44.0.0-alpha.1", + "44.0.0-alpha.2", + "44.0.0-alpha.3" + ], + "152.0.7938.0": [ + "44.0.0-alpha.4", + "44.0.0-alpha.5" + ], + "152.0.7954.0": [ + "44.0.0-alpha.6" + ], + "152.0.7969.0": [ + "44.0.0-alpha.7" + ], + "152.0.7977.0": [ + "44.0.0-alpha.8" + ], + "152.0.7977.8": [ + "44.0.0-alpha.9", + "44.0.0-beta.1" + ], + "152.0.7977.30": [ + "44.0.0-beta.2", + "44.0.0-beta.3", + "44.0.0-beta.4", + "44.0.0-beta.5", + "44.0.0-beta.6" + ], + "152.0.7977.54": [ + "44.0.0" + ], + "152.0.7977.65": [ + "44.1.0", + "44.1.1" + ], + "152.0.7977.76": [ + "44.2.0" + ], + "152.0.7977.78": [ + "44.3.0", + "44.4.0", + "44.4.1" + ], + "152.0.7977.130": [ + "44.4.2", + "44.4.3", + "44.4.4", + "44.4.5", + "44.5.0", + "44.5.1", + "44.6.0", + "44.7.0" + ], + "154.0.8025.0": [ + "45.0.0-alpha.1" + ], + "154.0.8029.0": [ + "45.0.0-alpha.2", + "45.0.0-alpha.3" + ], + "155.0.8038.2": [ + "45.0.0-alpha.4", + "45.0.0-alpha.5", + "45.0.0-alpha.6", + "45.0.0-alpha.7" + ], + "155.0.8046.0": [ + "45.0.0-alpha.8", + "45.0.0-alpha.9", + "45.0.0-alpha.10", + "45.0.0-alpha.11", + "45.0.0-alpha.12", + "45.0.0-alpha.13" + ], + "156.0.8077.0": [ + "45.0.0-alpha.14", + "45.0.0-alpha.15", + "45.0.0-alpha.16" + ], + "156.0.8078.12": [ + "45.0.0-beta.1" + ] +}; \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.json b/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.json new file mode 100644 index 0000000000000000000000000000000000000000..188e6d5def5ed1b90c898b3f0849826581e7af79 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/full-chromium-versions.json @@ -0,0 +1 @@ +{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.11","9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.10","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.25","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3","13.6.6","13.6.7","13.6.8","13.6.9"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2","14.2.3","14.2.4","14.2.5","14.2.6","14.2.7","14.2.8","14.2.9"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3","15.3.4","15.3.5","15.3.6","15.3.7","15.4.0","15.4.1","15.4.2","15.5.0","15.5.1","15.5.2","15.5.3","15.5.4","15.5.5","15.5.6","15.5.7"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3","16.0.4","16.0.5"],"96.0.4664.110":["16.0.6","16.0.7","16.0.8"],"96.0.4664.174":["16.0.9","16.0.10","16.1.0","16.1.1","16.2.0","16.2.1","16.2.2","16.2.3","16.2.4","16.2.5","16.2.6","16.2.7","16.2.8"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3"],"98.0.4706.0":["17.0.0-alpha.4","17.0.0-alpha.5","17.0.0-alpha.6","17.0.0-beta.1","17.0.0-beta.2"],"98.0.4758.9":["17.0.0-beta.3"],"98.0.4758.11":["17.0.0-beta.4","17.0.0-beta.5","17.0.0-beta.6","17.0.0-beta.7","17.0.0-beta.8","17.0.0-beta.9"],"98.0.4758.74":["17.0.0"],"98.0.4758.82":["17.0.1"],"98.0.4758.102":["17.1.0"],"98.0.4758.109":["17.1.1","17.1.2","17.2.0"],"98.0.4758.141":["17.3.0","17.3.1","17.4.0","17.4.1","17.4.2","17.4.3","17.4.4","17.4.5","17.4.6","17.4.7","17.4.8","17.4.9","17.4.10","17.4.11"],"99.0.4767.0":["18.0.0-alpha.1","18.0.0-alpha.2","18.0.0-alpha.3","18.0.0-alpha.4","18.0.0-alpha.5"],"100.0.4894.0":["18.0.0-beta.1","18.0.0-beta.2","18.0.0-beta.3","18.0.0-beta.4","18.0.0-beta.5","18.0.0-beta.6"],"100.0.4896.56":["18.0.0"],"100.0.4896.60":["18.0.1","18.0.2"],"100.0.4896.75":["18.0.3","18.0.4"],"100.0.4896.127":["18.1.0"],"100.0.4896.143":["18.2.0","18.2.1","18.2.2","18.2.3"],"100.0.4896.160":["18.2.4","18.3.0","18.3.1","18.3.2","18.3.3","18.3.4","18.3.5","18.3.6","18.3.7","18.3.8","18.3.9","18.3.11","18.3.12","18.3.13","18.3.14","18.3.15"],"102.0.4962.3":["19.0.0-alpha.1"],"102.0.4971.0":["19.0.0-alpha.2","19.0.0-alpha.3"],"102.0.4989.0":["19.0.0-alpha.4","19.0.0-alpha.5"],"102.0.4999.0":["19.0.0-beta.1","19.0.0-beta.2","19.0.0-beta.3"],"102.0.5005.27":["19.0.0-beta.4"],"102.0.5005.40":["19.0.0-beta.5","19.0.0-beta.6","19.0.0-beta.7"],"102.0.5005.49":["19.0.0-beta.8"],"102.0.5005.61":["19.0.0","19.0.1"],"102.0.5005.63":["19.0.2","19.0.3","19.0.4"],"102.0.5005.115":["19.0.5","19.0.6"],"102.0.5005.134":["19.0.7"],"102.0.5005.148":["19.0.8"],"102.0.5005.167":["19.0.9","19.0.10","19.0.11","19.0.12","19.0.13","19.0.14","19.0.15","19.0.16","19.0.17","19.1.0","19.1.1","19.1.2","19.1.3","19.1.4","19.1.5","19.1.6","19.1.7","19.1.8","19.1.9"],"103.0.5044.0":["20.0.0-alpha.1"],"104.0.5073.0":["20.0.0-alpha.2","20.0.0-alpha.3","20.0.0-alpha.4","20.0.0-alpha.5","20.0.0-alpha.6","20.0.0-alpha.7","20.0.0-beta.1","20.0.0-beta.2","20.0.0-beta.3","20.0.0-beta.4","20.0.0-beta.5","20.0.0-beta.6","20.0.0-beta.7","20.0.0-beta.8"],"104.0.5112.39":["20.0.0-beta.9"],"104.0.5112.48":["20.0.0-beta.10","20.0.0-beta.11","20.0.0-beta.12"],"104.0.5112.57":["20.0.0-beta.13"],"104.0.5112.65":["20.0.0"],"104.0.5112.81":["20.0.1","20.0.2","20.0.3"],"104.0.5112.102":["20.1.0","20.1.1"],"104.0.5112.114":["20.1.2","20.1.3","20.1.4"],"104.0.5112.124":["20.2.0","20.3.0","20.3.1","20.3.2","20.3.3","20.3.4","20.3.5","20.3.6","20.3.7","20.3.8","20.3.9","20.3.10","20.3.11","20.3.12"],"105.0.5187.0":["21.0.0-alpha.1","21.0.0-alpha.2","21.0.0-alpha.3","21.0.0-alpha.4","21.0.0-alpha.5"],"106.0.5216.0":["21.0.0-alpha.6","21.0.0-beta.1","21.0.0-beta.2","21.0.0-beta.3","21.0.0-beta.4","21.0.0-beta.5"],"106.0.5249.40":["21.0.0-beta.6","21.0.0-beta.7","21.0.0-beta.8"],"106.0.5249.51":["21.0.0"],"106.0.5249.61":["21.0.1"],"106.0.5249.91":["21.1.0"],"106.0.5249.103":["21.1.1"],"106.0.5249.119":["21.2.0"],"106.0.5249.165":["21.2.1"],"106.0.5249.168":["21.2.2","21.2.3"],"106.0.5249.181":["21.3.0","21.3.1"],"106.0.5249.199":["21.3.3","21.3.4","21.3.5","21.4.0","21.4.1","21.4.2","21.4.3","21.4.4"],"107.0.5286.0":["22.0.0-alpha.1"],"108.0.5329.0":["22.0.0-alpha.3","22.0.0-alpha.4","22.0.0-alpha.5","22.0.0-alpha.6"],"108.0.5355.0":["22.0.0-alpha.7"],"108.0.5359.10":["22.0.0-alpha.8","22.0.0-beta.1","22.0.0-beta.2","22.0.0-beta.3"],"108.0.5359.29":["22.0.0-beta.4"],"108.0.5359.40":["22.0.0-beta.5","22.0.0-beta.6"],"108.0.5359.48":["22.0.0-beta.7","22.0.0-beta.8"],"108.0.5359.62":["22.0.0"],"108.0.5359.125":["22.0.1"],"108.0.5359.179":["22.0.2","22.0.3","22.1.0"],"108.0.5359.215":["22.2.0","22.2.1","22.3.0","22.3.1","22.3.2","22.3.3","22.3.4","22.3.5","22.3.6","22.3.7","22.3.8","22.3.9","22.3.10","22.3.11","22.3.12","22.3.13","22.3.14","22.3.15","22.3.16","22.3.17","22.3.18","22.3.20","22.3.21","22.3.22","22.3.23","22.3.24","22.3.25","22.3.26","22.3.27"],"110.0.5415.0":["23.0.0-alpha.1"],"110.0.5451.0":["23.0.0-alpha.2","23.0.0-alpha.3"],"110.0.5478.5":["23.0.0-beta.1","23.0.0-beta.2","23.0.0-beta.3"],"110.0.5481.30":["23.0.0-beta.4"],"110.0.5481.38":["23.0.0-beta.5"],"110.0.5481.52":["23.0.0-beta.6","23.0.0-beta.8"],"110.0.5481.77":["23.0.0"],"110.0.5481.100":["23.1.0"],"110.0.5481.104":["23.1.1"],"110.0.5481.177":["23.1.2"],"110.0.5481.179":["23.1.3"],"110.0.5481.192":["23.1.4","23.2.0"],"110.0.5481.208":["23.2.1","23.2.2","23.2.3","23.2.4","23.3.0","23.3.1","23.3.2","23.3.3","23.3.4","23.3.5","23.3.6","23.3.7","23.3.8","23.3.9","23.3.10","23.3.11","23.3.12","23.3.13"],"111.0.5560.0":["24.0.0-alpha.1","24.0.0-alpha.2","24.0.0-alpha.3","24.0.0-alpha.4","24.0.0-alpha.5","24.0.0-alpha.6","24.0.0-alpha.7"],"111.0.5563.50":["24.0.0-beta.1","24.0.0-beta.2"],"112.0.5615.20":["24.0.0-beta.3","24.0.0-beta.4"],"112.0.5615.29":["24.0.0-beta.5"],"112.0.5615.39":["24.0.0-beta.6","24.0.0-beta.7"],"112.0.5615.49":["24.0.0"],"112.0.5615.50":["24.1.0","24.1.1"],"112.0.5615.87":["24.1.2"],"112.0.5615.165":["24.1.3","24.2.0","24.3.0"],"112.0.5615.183":["24.3.1"],"112.0.5615.204":["24.4.0","24.4.1","24.5.0","24.5.1","24.6.0","24.6.1","24.6.2","24.6.3","24.6.4","24.6.5","24.7.0","24.7.1","24.8.0","24.8.1","24.8.2","24.8.3","24.8.4","24.8.5","24.8.6","24.8.7","24.8.8"],"114.0.5694.0":["25.0.0-alpha.1","25.0.0-alpha.2"],"114.0.5710.0":["25.0.0-alpha.3","25.0.0-alpha.4"],"114.0.5719.0":["25.0.0-alpha.5","25.0.0-alpha.6","25.0.0-beta.1","25.0.0-beta.2","25.0.0-beta.3"],"114.0.5735.16":["25.0.0-beta.4","25.0.0-beta.5","25.0.0-beta.6","25.0.0-beta.7"],"114.0.5735.35":["25.0.0-beta.8"],"114.0.5735.45":["25.0.0-beta.9","25.0.0","25.0.1"],"114.0.5735.106":["25.1.0","25.1.1"],"114.0.5735.134":["25.2.0"],"114.0.5735.199":["25.3.0"],"114.0.5735.243":["25.3.1"],"114.0.5735.248":["25.3.2","25.4.0"],"114.0.5735.289":["25.5.0","25.6.0","25.7.0","25.8.0","25.8.1","25.8.2","25.8.3","25.8.4","25.9.0","25.9.1","25.9.2","25.9.3","25.9.4","25.9.5","25.9.6","25.9.7","25.9.8"],"116.0.5791.0":["26.0.0-alpha.1","26.0.0-alpha.2","26.0.0-alpha.3","26.0.0-alpha.4","26.0.0-alpha.5"],"116.0.5815.0":["26.0.0-alpha.6"],"116.0.5831.0":["26.0.0-alpha.7"],"116.0.5845.0":["26.0.0-alpha.8","26.0.0-beta.1"],"116.0.5845.14":["26.0.0-beta.2","26.0.0-beta.3","26.0.0-beta.4","26.0.0-beta.5","26.0.0-beta.6","26.0.0-beta.7"],"116.0.5845.42":["26.0.0-beta.8","26.0.0-beta.9"],"116.0.5845.49":["26.0.0-beta.10","26.0.0-beta.11"],"116.0.5845.62":["26.0.0-beta.12"],"116.0.5845.82":["26.0.0"],"116.0.5845.97":["26.1.0"],"116.0.5845.179":["26.2.0"],"116.0.5845.188":["26.2.1"],"116.0.5845.190":["26.2.2","26.2.3","26.2.4"],"116.0.5845.228":["26.3.0","26.4.0","26.4.1","26.4.2","26.4.3","26.5.0","26.6.0","26.6.1","26.6.2","26.6.3","26.6.4","26.6.5","26.6.6","26.6.7","26.6.8","26.6.9","26.6.10"],"118.0.5949.0":["27.0.0-alpha.1","27.0.0-alpha.2","27.0.0-alpha.3","27.0.0-alpha.4","27.0.0-alpha.5","27.0.0-alpha.6"],"118.0.5993.5":["27.0.0-beta.1","27.0.0-beta.2","27.0.0-beta.3"],"118.0.5993.11":["27.0.0-beta.4"],"118.0.5993.18":["27.0.0-beta.5","27.0.0-beta.6","27.0.0-beta.7","27.0.0-beta.8","27.0.0-beta.9"],"118.0.5993.54":["27.0.0"],"118.0.5993.89":["27.0.1","27.0.2"],"118.0.5993.120":["27.0.3"],"118.0.5993.129":["27.0.4"],"118.0.5993.144":["27.1.0","27.1.2"],"118.0.5993.159":["27.1.3","27.2.0","27.2.1","27.2.2","27.2.3","27.2.4","27.3.0","27.3.1","27.3.2","27.3.3","27.3.4","27.3.5","27.3.6","27.3.7","27.3.8","27.3.9","27.3.10","27.3.11"],"119.0.6045.0":["28.0.0-alpha.1","28.0.0-alpha.2"],"119.0.6045.21":["28.0.0-alpha.3","28.0.0-alpha.4"],"119.0.6045.33":["28.0.0-alpha.5","28.0.0-alpha.6","28.0.0-alpha.7","28.0.0-beta.1"],"120.0.6099.0":["28.0.0-beta.2"],"120.0.6099.5":["28.0.0-beta.3","28.0.0-beta.4"],"120.0.6099.18":["28.0.0-beta.5","28.0.0-beta.6","28.0.0-beta.7","28.0.0-beta.8","28.0.0-beta.9","28.0.0-beta.10"],"120.0.6099.35":["28.0.0-beta.11"],"120.0.6099.56":["28.0.0"],"120.0.6099.109":["28.1.0","28.1.1"],"120.0.6099.199":["28.1.2","28.1.3"],"120.0.6099.216":["28.1.4"],"120.0.6099.227":["28.2.0"],"120.0.6099.268":["28.2.1"],"120.0.6099.276":["28.2.2"],"120.0.6099.283":["28.2.3"],"120.0.6099.291":["28.2.4","28.2.5","28.2.6","28.2.7","28.2.8","28.2.9","28.2.10","28.3.0","28.3.1","28.3.2","28.3.3"],"121.0.6147.0":["29.0.0-alpha.1","29.0.0-alpha.2","29.0.0-alpha.3"],"121.0.6159.0":["29.0.0-alpha.4","29.0.0-alpha.5","29.0.0-alpha.6","29.0.0-alpha.7"],"122.0.6194.0":["29.0.0-alpha.8"],"122.0.6236.2":["29.0.0-alpha.9","29.0.0-alpha.10","29.0.0-alpha.11","29.0.0-beta.1","29.0.0-beta.2"],"122.0.6261.6":["29.0.0-beta.3","29.0.0-beta.4"],"122.0.6261.18":["29.0.0-beta.5","29.0.0-beta.6","29.0.0-beta.7","29.0.0-beta.8","29.0.0-beta.9","29.0.0-beta.10","29.0.0-beta.11"],"122.0.6261.29":["29.0.0-beta.12"],"122.0.6261.39":["29.0.0"],"122.0.6261.57":["29.0.1"],"122.0.6261.70":["29.1.0"],"122.0.6261.111":["29.1.1"],"122.0.6261.112":["29.1.2","29.1.3"],"122.0.6261.129":["29.1.4"],"122.0.6261.130":["29.1.5"],"122.0.6261.139":["29.1.6"],"122.0.6261.156":["29.2.0","29.3.0","29.3.1","29.3.2","29.3.3","29.4.0","29.4.1","29.4.2","29.4.3","29.4.4","29.4.5","29.4.6"],"123.0.6296.0":["30.0.0-alpha.1"],"123.0.6312.5":["30.0.0-alpha.2"],"124.0.6323.0":["30.0.0-alpha.3","30.0.0-alpha.4"],"124.0.6331.0":["30.0.0-alpha.5","30.0.0-alpha.6"],"124.0.6353.0":["30.0.0-alpha.7"],"124.0.6359.0":["30.0.0-beta.1","30.0.0-beta.2"],"124.0.6367.9":["30.0.0-beta.3","30.0.0-beta.4","30.0.0-beta.5"],"124.0.6367.18":["30.0.0-beta.6"],"124.0.6367.29":["30.0.0-beta.7","30.0.0-beta.8"],"124.0.6367.49":["30.0.0"],"124.0.6367.60":["30.0.1"],"124.0.6367.91":["30.0.2"],"124.0.6367.119":["30.0.3"],"124.0.6367.201":["30.0.4"],"124.0.6367.207":["30.0.5","30.0.6"],"124.0.6367.221":["30.0.7"],"124.0.6367.230":["30.0.8"],"124.0.6367.233":["30.0.9"],"124.0.6367.243":["30.1.0","30.1.1","30.1.2","30.2.0","30.3.0","30.3.1","30.4.0","30.5.0","30.5.1"],"125.0.6412.0":["31.0.0-alpha.1","31.0.0-alpha.2","31.0.0-alpha.3","31.0.0-alpha.4","31.0.0-alpha.5"],"126.0.6445.0":["31.0.0-beta.1","31.0.0-beta.2","31.0.0-beta.3","31.0.0-beta.4","31.0.0-beta.5","31.0.0-beta.6","31.0.0-beta.7","31.0.0-beta.8","31.0.0-beta.9"],"126.0.6478.36":["31.0.0-beta.10","31.0.0","31.0.1"],"126.0.6478.61":["31.0.2"],"126.0.6478.114":["31.1.0"],"126.0.6478.127":["31.2.0","31.2.1"],"126.0.6478.183":["31.3.0"],"126.0.6478.185":["31.3.1"],"126.0.6478.234":["31.4.0","31.5.0","31.6.0","31.7.0","31.7.1","31.7.2","31.7.3","31.7.4","31.7.5","31.7.6","31.7.7"],"127.0.6521.0":["32.0.0-alpha.1","32.0.0-alpha.2","32.0.0-alpha.3","32.0.0-alpha.4","32.0.0-alpha.5"],"128.0.6571.0":["32.0.0-alpha.6","32.0.0-alpha.7"],"128.0.6573.0":["32.0.0-alpha.8","32.0.0-alpha.9","32.0.0-alpha.10","32.0.0-beta.1"],"128.0.6611.0":["32.0.0-beta.2"],"128.0.6613.7":["32.0.0-beta.3"],"128.0.6613.18":["32.0.0-beta.4"],"128.0.6613.27":["32.0.0-beta.5","32.0.0-beta.6","32.0.0-beta.7"],"128.0.6613.36":["32.0.0","32.0.1"],"128.0.6613.84":["32.0.2"],"128.0.6613.120":["32.1.0"],"128.0.6613.137":["32.1.1"],"128.0.6613.162":["32.1.2"],"128.0.6613.178":["32.2.0"],"128.0.6613.186":["32.2.1","32.2.2","32.2.3","32.2.4","32.2.5","32.2.6","32.2.7","32.2.8","32.3.0","32.3.1","32.3.2","32.3.3"],"129.0.6668.0":["33.0.0-alpha.1"],"130.0.6672.0":["33.0.0-alpha.2","33.0.0-alpha.3","33.0.0-alpha.4","33.0.0-alpha.5","33.0.0-alpha.6","33.0.0-beta.1","33.0.0-beta.2","33.0.0-beta.3","33.0.0-beta.4"],"130.0.6723.19":["33.0.0-beta.5","33.0.0-beta.6","33.0.0-beta.7"],"130.0.6723.31":["33.0.0-beta.8","33.0.0-beta.9","33.0.0-beta.10"],"130.0.6723.44":["33.0.0-beta.11","33.0.0"],"130.0.6723.59":["33.0.1","33.0.2"],"130.0.6723.91":["33.1.0"],"130.0.6723.118":["33.2.0"],"130.0.6723.137":["33.2.1"],"130.0.6723.152":["33.3.0"],"130.0.6723.170":["33.3.1"],"130.0.6723.191":["33.3.2","33.4.0","33.4.1","33.4.2","33.4.3","33.4.4","33.4.5","33.4.6","33.4.7","33.4.8","33.4.9","33.4.10","33.4.11"],"131.0.6776.0":["34.0.0-alpha.1"],"132.0.6779.0":["34.0.0-alpha.2"],"132.0.6789.1":["34.0.0-alpha.3","34.0.0-alpha.4","34.0.0-alpha.5","34.0.0-alpha.6","34.0.0-alpha.7"],"132.0.6820.0":["34.0.0-alpha.8"],"132.0.6824.0":["34.0.0-alpha.9","34.0.0-beta.1","34.0.0-beta.2","34.0.0-beta.3"],"132.0.6834.6":["34.0.0-beta.4","34.0.0-beta.5"],"132.0.6834.15":["34.0.0-beta.6","34.0.0-beta.7","34.0.0-beta.8"],"132.0.6834.32":["34.0.0-beta.9","34.0.0-beta.10","34.0.0-beta.11"],"132.0.6834.46":["34.0.0-beta.12","34.0.0-beta.13"],"132.0.6834.57":["34.0.0-beta.14","34.0.0-beta.15","34.0.0-beta.16"],"132.0.6834.83":["34.0.0","34.0.1"],"132.0.6834.159":["34.0.2"],"132.0.6834.194":["34.1.0","34.1.1"],"132.0.6834.196":["34.2.0"],"132.0.6834.210":["34.3.0","34.3.1","34.3.2","34.3.3","34.3.4","34.4.0","34.4.1","34.5.0","34.5.1","34.5.2","34.5.3","34.5.4","34.5.5","34.5.6","34.5.7","34.5.8"],"133.0.6920.0":["35.0.0-alpha.1","35.0.0-alpha.2","35.0.0-alpha.3","35.0.0-alpha.4","35.0.0-alpha.5","35.0.0-beta.1"],"134.0.6968.0":["35.0.0-beta.2","35.0.0-beta.3","35.0.0-beta.4"],"134.0.6989.0":["35.0.0-beta.5"],"134.0.6990.0":["35.0.0-beta.6","35.0.0-beta.7"],"134.0.6998.10":["35.0.0-beta.8","35.0.0-beta.9"],"134.0.6998.23":["35.0.0-beta.10","35.0.0-beta.11","35.0.0-beta.12"],"134.0.6998.44":["35.0.0-beta.13","35.0.0","35.0.1"],"134.0.6998.88":["35.0.2","35.0.3"],"134.0.6998.165":["35.1.0","35.1.1"],"134.0.6998.178":["35.1.2"],"134.0.6998.179":["35.1.3","35.1.4","35.1.5"],"134.0.6998.205":["35.2.0","35.2.1","35.2.2","35.3.0","35.4.0","35.5.0","35.5.1","35.6.0","35.7.0","35.7.1","35.7.2","35.7.4","35.7.5"],"135.0.7049.5":["36.0.0-alpha.1"],"136.0.7062.0":["36.0.0-alpha.2","36.0.0-alpha.3","36.0.0-alpha.4"],"136.0.7067.0":["36.0.0-alpha.5","36.0.0-alpha.6","36.0.0-beta.1","36.0.0-beta.2","36.0.0-beta.3","36.0.0-beta.4"],"136.0.7103.17":["36.0.0-beta.5"],"136.0.7103.25":["36.0.0-beta.6","36.0.0-beta.7"],"136.0.7103.33":["36.0.0-beta.8","36.0.0-beta.9"],"136.0.7103.48":["36.0.0","36.0.1"],"136.0.7103.49":["36.1.0","36.2.0"],"136.0.7103.93":["36.2.1"],"136.0.7103.113":["36.3.0","36.3.1"],"136.0.7103.115":["36.3.2"],"136.0.7103.149":["36.4.0"],"136.0.7103.168":["36.5.0"],"136.0.7103.177":["36.6.0","36.7.0","36.7.1","36.7.3","36.7.4","36.8.0","36.8.1","36.9.0","36.9.1","36.9.2","36.9.3","36.9.4","36.9.5"],"137.0.7151.0":["37.0.0-alpha.1","37.0.0-alpha.2"],"138.0.7156.0":["37.0.0-alpha.3"],"138.0.7165.0":["37.0.0-alpha.4"],"138.0.7177.0":["37.0.0-alpha.5"],"138.0.7178.0":["37.0.0-alpha.6","37.0.0-alpha.7","37.0.0-beta.1","37.0.0-beta.2"],"138.0.7190.0":["37.0.0-beta.3"],"138.0.7204.15":["37.0.0-beta.4","37.0.0-beta.5","37.0.0-beta.6","37.0.0-beta.7"],"138.0.7204.23":["37.0.0-beta.8"],"138.0.7204.35":["37.0.0-beta.9","37.0.0","37.1.0"],"138.0.7204.97":["37.2.0","37.2.1"],"138.0.7204.100":["37.2.2","37.2.3"],"138.0.7204.157":["37.2.4"],"138.0.7204.168":["37.2.5"],"138.0.7204.185":["37.2.6"],"138.0.7204.224":["37.3.0"],"138.0.7204.235":["37.3.1"],"138.0.7204.243":["37.4.0"],"138.0.7204.251":["37.5.0","37.5.1","37.6.0","37.6.1","37.7.0","37.7.1","37.8.0","37.9.0","37.10.0","37.10.1","37.10.2","37.10.3"],"139.0.7219.0":["38.0.0-alpha.1","38.0.0-alpha.2","38.0.0-alpha.3"],"140.0.7261.0":["38.0.0-alpha.4","38.0.0-alpha.5","38.0.0-alpha.6"],"140.0.7281.0":["38.0.0-alpha.7","38.0.0-alpha.8"],"140.0.7301.0":["38.0.0-alpha.9"],"140.0.7309.0":["38.0.0-alpha.10"],"140.0.7312.0":["38.0.0-alpha.11"],"140.0.7314.0":["38.0.0-alpha.12","38.0.0-alpha.13","38.0.0-beta.1"],"140.0.7327.0":["38.0.0-beta.2","38.0.0-beta.3"],"140.0.7339.2":["38.0.0-beta.4","38.0.0-beta.5","38.0.0-beta.6"],"140.0.7339.16":["38.0.0-beta.7"],"140.0.7339.24":["38.0.0-beta.8","38.0.0-beta.9"],"140.0.7339.41":["38.0.0-beta.11","38.0.0"],"140.0.7339.80":["38.1.0"],"140.0.7339.133":["38.1.1","38.1.2","38.2.0","38.2.1","38.2.2"],"140.0.7339.240":["38.3.0","38.4.0"],"140.0.7339.249":["38.5.0","38.6.0","38.7.0","38.7.1","38.7.2","38.8.0","38.8.1","38.8.2","38.8.4","38.8.6"],"141.0.7361.0":["39.0.0-alpha.1","39.0.0-alpha.2"],"141.0.7390.7":["39.0.0-alpha.3","39.0.0-alpha.4","39.0.0-alpha.5"],"142.0.7417.0":["39.0.0-alpha.6","39.0.0-alpha.7","39.0.0-alpha.8","39.0.0-alpha.9","39.0.0-beta.1","39.0.0-beta.2","39.0.0-beta.3"],"142.0.7444.34":["39.0.0-beta.4","39.0.0-beta.5"],"142.0.7444.52":["39.0.0"],"142.0.7444.59":["39.1.0","39.1.1"],"142.0.7444.134":["39.1.2"],"142.0.7444.162":["39.2.0","39.2.1","39.2.2"],"142.0.7444.175":["39.2.3"],"142.0.7444.177":["39.2.4","39.2.5"],"142.0.7444.226":["39.2.6"],"142.0.7444.235":["39.2.7"],"142.0.7444.265":["39.3.0","39.4.0","39.5.0","39.5.1","39.5.2","39.6.0","39.6.1","39.7.0","39.8.0","39.8.1","39.8.2","39.8.3","39.8.4","39.8.5","39.8.6","39.8.7","39.8.8","39.8.9","39.8.10"],"143.0.7499.0":["40.0.0-alpha.2"],"144.0.7506.0":["40.0.0-alpha.4"],"144.0.7526.0":["40.0.0-alpha.5","40.0.0-alpha.6","40.0.0-alpha.7","40.0.0-alpha.8"],"144.0.7527.0":["40.0.0-beta.1","40.0.0-beta.2"],"144.0.7547.0":["40.0.0-beta.3","40.0.0-beta.4","40.0.0-beta.5"],"144.0.7559.31":["40.0.0-beta.6","40.0.0-beta.7","40.0.0-beta.8"],"144.0.7559.60":["40.0.0-beta.9","40.0.0"],"144.0.7559.96":["40.1.0"],"144.0.7559.111":["40.2.0","40.2.1"],"144.0.7559.134":["40.3.0","40.4.0"],"144.0.7559.173":["40.4.1"],"144.0.7559.177":["40.5.0","40.6.0"],"144.0.7559.220":["40.6.1"],"144.0.7559.225":["40.7.0"],"144.0.7559.236":["40.8.0","40.8.1","40.8.2","40.8.3","40.8.4","40.8.5","40.9.0","40.9.1","40.9.2","40.9.3","40.10.0","40.10.1","40.10.2","40.10.3","40.10.4","40.10.5","40.10.6"],"146.0.7635.0":["41.0.0-alpha.1","41.0.0-alpha.2"],"146.0.7645.0":["41.0.0-alpha.3"],"146.0.7650.0":["41.0.0-alpha.4","41.0.0-alpha.5","41.0.0-alpha.6","41.0.0-beta.1","41.0.0-beta.2","41.0.0-beta.3"],"146.0.7666.0":["41.0.0-beta.4"],"146.0.7680.16":["41.0.0-beta.5","41.0.0-beta.6"],"146.0.7680.31":["41.0.0-beta.7","41.0.0-beta.8"],"146.0.7680.65":["41.0.0"],"146.0.7680.72":["41.0.1","41.0.2"],"146.0.7680.80":["41.0.3"],"146.0.7680.153":["41.0.4"],"146.0.7680.166":["41.1.0","41.1.1"],"146.0.7680.179":["41.2.0"],"146.0.7680.188":["41.2.1","41.2.2","41.3.0"],"146.0.7680.216":["41.4.0","41.5.0","41.5.1","41.5.2","41.6.0","41.6.1","41.7.0","41.7.1","41.7.2","41.8.0","41.9.0","41.9.1","41.9.2","41.10.0","41.10.1","41.10.2","41.10.3","41.10.4","41.10.5","41.10.6","41.10.7"],"147.0.7727.0":["42.0.0-alpha.1"],"148.0.7733.0":["42.0.0-alpha.2"],"148.0.7738.0":["42.0.0-alpha.4"],"148.0.7741.0":["42.0.0-alpha.5"],"148.0.7751.0":["42.0.0-alpha.6","42.0.0-beta.1"],"148.0.7778.0":["42.0.0-beta.2"],"148.0.7778.5":["42.0.0-beta.3","42.0.0-beta.4","42.0.0-beta.5","42.0.0-beta.6"],"148.0.7778.56":["42.0.0-beta.7","42.0.0-beta.8"],"148.0.7778.96":["42.0.0"],"148.0.7778.97":["42.0.1","42.1.0","42.2.0"],"148.0.7778.180":["42.3.0"],"148.0.7778.218":["42.3.1","42.3.2","42.3.3"],"148.0.7778.254":["42.4.0"],"148.0.7778.265":["42.4.1"],"148.0.7778.271":["42.5.0","42.5.1","42.5.2"],"148.0.7778.280":["42.6.0","42.6.1","42.6.2","42.7.0","42.7.1","42.8.0","42.8.1","42.9.0","42.9.1","42.9.2","42.9.3","42.10.0","42.10.1","42.11.0","42.11.1","42.11.2","42.11.3","42.11.4","42.11.5","42.11.6","42.11.7","42.11.8","42.11.9","42.11.10","42.11.11","42.11.12"],"149.0.7827.0":["43.0.0-alpha.1"],"150.0.7832.0":["43.0.0-alpha.2"],"150.0.7834.0":["43.0.0-alpha.3","43.0.0-alpha.4","43.0.0-alpha.5","43.0.0-alpha.6"],"150.0.7849.0":["43.0.0-alpha.7"],"150.0.7863.0":["43.0.0-beta.1","43.0.0-beta.2","43.0.0-beta.3"],"150.0.7871.13":["43.0.0-beta.4","43.0.0-beta.5"],"150.0.7871.24":["43.0.0-beta.6","43.0.0-beta.7","43.0.0-beta.8"],"150.0.7871.46":["43.0.0"],"150.0.7871.47":["43.1.0"],"150.0.7871.114":["43.1.1"],"150.0.7871.129":["43.2.0"],"150.0.7871.212":["43.3.0"],"150.0.7871.224":["43.4.0","43.4.1"],"150.0.7871.250":["43.5.0","43.5.1","43.6.0","43.7.0","43.7.1","43.7.2","43.7.3","43.7.4","43.7.5","43.7.6","43.7.7","43.7.8","43.7.9"],"151.0.7900.0":["44.0.0-alpha.1","44.0.0-alpha.2","44.0.0-alpha.3"],"152.0.7938.0":["44.0.0-alpha.4","44.0.0-alpha.5"],"152.0.7954.0":["44.0.0-alpha.6"],"152.0.7969.0":["44.0.0-alpha.7"],"152.0.7977.0":["44.0.0-alpha.8"],"152.0.7977.8":["44.0.0-alpha.9","44.0.0-beta.1"],"152.0.7977.30":["44.0.0-beta.2","44.0.0-beta.3","44.0.0-beta.4","44.0.0-beta.5","44.0.0-beta.6"],"152.0.7977.54":["44.0.0"],"152.0.7977.65":["44.1.0","44.1.1"],"152.0.7977.76":["44.2.0"],"152.0.7977.78":["44.3.0","44.4.0","44.4.1"],"152.0.7977.130":["44.4.2","44.4.3","44.4.4","44.4.5","44.5.0","44.5.1","44.6.0","44.7.0"],"154.0.8025.0":["45.0.0-alpha.1"],"154.0.8029.0":["45.0.0-alpha.2","45.0.0-alpha.3"],"155.0.8038.2":["45.0.0-alpha.4","45.0.0-alpha.5","45.0.0-alpha.6","45.0.0-alpha.7"],"155.0.8046.0":["45.0.0-alpha.8","45.0.0-alpha.9","45.0.0-alpha.10","45.0.0-alpha.11","45.0.0-alpha.12","45.0.0-alpha.13"],"156.0.8077.0":["45.0.0-alpha.14","45.0.0-alpha.15","45.0.0-alpha.16"],"156.0.8078.12":["45.0.0-beta.1"]} \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/full-versions.js b/e-commerce/node_modules/electron-to-chromium/full-versions.js new file mode 100644 index 0000000000000000000000000000000000000000..dfe93ef974197baa0720d01bcf855fb7f32f6849 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/full-versions.js @@ -0,0 +1,1923 @@ +module.exports = { + "0.20.0": "39.0.2171.65", + "0.20.1": "39.0.2171.65", + "0.20.2": "39.0.2171.65", + "0.20.3": "39.0.2171.65", + "0.20.4": "39.0.2171.65", + "0.20.5": "39.0.2171.65", + "0.20.6": "39.0.2171.65", + "0.20.7": "39.0.2171.65", + "0.20.8": "39.0.2171.65", + "0.21.0": "40.0.2214.91", + "0.21.1": "40.0.2214.91", + "0.21.2": "40.0.2214.91", + "0.21.3": "41.0.2272.76", + "0.22.1": "41.0.2272.76", + "0.22.2": "41.0.2272.76", + "0.22.3": "41.0.2272.76", + "0.23.0": "41.0.2272.76", + "0.24.0": "41.0.2272.76", + "0.25.0": "42.0.2311.107", + "0.25.1": "42.0.2311.107", + "0.25.2": "42.0.2311.107", + "0.25.3": "42.0.2311.107", + "0.26.0": "42.0.2311.107", + "0.26.1": "42.0.2311.107", + "0.27.0": "42.0.2311.107", + "0.27.1": "42.0.2311.107", + "0.27.2": "43.0.2357.65", + "0.27.3": "43.0.2357.65", + "0.28.0": "43.0.2357.65", + "0.28.1": "43.0.2357.65", + "0.28.2": "43.0.2357.65", + "0.28.3": "43.0.2357.65", + "0.29.1": "43.0.2357.65", + "0.29.2": "43.0.2357.65", + "0.30.4": "44.0.2403.125", + "0.31.0": "44.0.2403.125", + "0.31.2": "45.0.2454.85", + "0.32.2": "45.0.2454.85", + "0.32.3": "45.0.2454.85", + "0.33.0": "45.0.2454.85", + "0.33.1": "45.0.2454.85", + "0.33.2": "45.0.2454.85", + "0.33.3": "45.0.2454.85", + "0.33.4": "45.0.2454.85", + "0.33.6": "45.0.2454.85", + "0.33.7": "45.0.2454.85", + "0.33.8": "45.0.2454.85", + "0.33.9": "45.0.2454.85", + "0.34.0": "45.0.2454.85", + "0.34.1": "45.0.2454.85", + "0.34.2": "45.0.2454.85", + "0.34.3": "45.0.2454.85", + "0.34.4": "45.0.2454.85", + "0.35.1": "45.0.2454.85", + "0.35.2": "45.0.2454.85", + "0.35.3": "45.0.2454.85", + "0.35.4": "45.0.2454.85", + "0.35.5": "45.0.2454.85", + "0.36.0": "47.0.2526.73", + "0.36.2": "47.0.2526.73", + "0.36.3": "47.0.2526.73", + "0.36.4": "47.0.2526.73", + "0.36.5": "47.0.2526.110", + "0.36.6": "47.0.2526.110", + "0.36.7": "47.0.2526.110", + "0.36.8": "47.0.2526.110", + "0.36.9": "47.0.2526.110", + "0.36.10": "47.0.2526.110", + "0.36.11": "47.0.2526.110", + "0.36.12": "47.0.2526.110", + "0.37.0": "49.0.2623.75", + "0.37.1": "49.0.2623.75", + "0.37.3": "49.0.2623.75", + "0.37.4": "49.0.2623.75", + "0.37.5": "49.0.2623.75", + "0.37.6": "49.0.2623.75", + "0.37.7": "49.0.2623.75", + "0.37.8": "49.0.2623.75", + "1.0.0": "49.0.2623.75", + "1.0.1": "49.0.2623.75", + "1.0.2": "49.0.2623.75", + "1.1.0": "50.0.2661.102", + "1.1.1": "50.0.2661.102", + "1.1.2": "50.0.2661.102", + "1.1.3": "50.0.2661.102", + "1.2.0": "51.0.2704.63", + "1.2.1": "51.0.2704.63", + "1.2.2": "51.0.2704.84", + "1.2.3": "51.0.2704.84", + "1.2.4": "51.0.2704.103", + "1.2.5": "51.0.2704.103", + "1.2.6": "51.0.2704.106", + "1.2.7": "51.0.2704.106", + "1.2.8": "51.0.2704.106", + "1.3.0": "52.0.2743.82", + "1.3.1": "52.0.2743.82", + "1.3.2": "52.0.2743.82", + "1.3.3": "52.0.2743.82", + "1.3.4": "52.0.2743.82", + "1.3.5": "52.0.2743.82", + "1.3.6": "52.0.2743.82", + "1.3.7": "52.0.2743.82", + "1.3.9": "52.0.2743.82", + "1.3.10": "52.0.2743.82", + "1.3.13": "52.0.2743.82", + "1.3.14": "52.0.2743.82", + "1.3.15": "52.0.2743.82", + "1.4.0": "53.0.2785.113", + "1.4.1": "53.0.2785.113", + "1.4.2": "53.0.2785.113", + "1.4.3": "53.0.2785.113", + "1.4.4": "53.0.2785.113", + "1.4.5": "53.0.2785.113", + "1.4.6": "53.0.2785.143", + "1.4.7": "53.0.2785.143", + "1.4.8": "53.0.2785.143", + "1.4.10": "53.0.2785.143", + "1.4.11": "53.0.2785.143", + "1.4.12": "54.0.2840.51", + "1.4.13": "53.0.2785.143", + "1.4.14": "53.0.2785.143", + "1.4.15": "53.0.2785.143", + "1.4.16": "53.0.2785.143", + "1.5.0": "54.0.2840.101", + "1.5.1": "54.0.2840.101", + "1.6.0": "56.0.2924.87", + "1.6.1": "56.0.2924.87", + "1.6.2": "56.0.2924.87", + "1.6.3": "56.0.2924.87", + "1.6.4": "56.0.2924.87", + "1.6.5": "56.0.2924.87", + "1.6.6": "56.0.2924.87", + "1.6.7": "56.0.2924.87", + "1.6.8": "56.0.2924.87", + "1.6.9": "56.0.2924.87", + "1.6.10": "56.0.2924.87", + "1.6.11": "56.0.2924.87", + "1.6.12": "56.0.2924.87", + "1.6.13": "56.0.2924.87", + "1.6.14": "56.0.2924.87", + "1.6.15": "56.0.2924.87", + "1.6.16": "56.0.2924.87", + "1.6.17": "56.0.2924.87", + "1.6.18": "56.0.2924.87", + "1.7.0": "58.0.3029.110", + "1.7.1": "58.0.3029.110", + "1.7.2": "58.0.3029.110", + "1.7.3": "58.0.3029.110", + "1.7.4": "58.0.3029.110", + "1.7.5": "58.0.3029.110", + "1.7.6": "58.0.3029.110", + "1.7.7": "58.0.3029.110", + "1.7.8": "58.0.3029.110", + "1.7.9": "58.0.3029.110", + "1.7.10": "58.0.3029.110", + "1.7.11": "58.0.3029.110", + "1.7.12": "58.0.3029.110", + "1.7.13": "58.0.3029.110", + "1.7.14": "58.0.3029.110", + "1.7.15": "58.0.3029.110", + "1.7.16": "58.0.3029.110", + "1.8.0": "59.0.3071.115", + "1.8.1": "59.0.3071.115", + "1.8.2-beta.1": "59.0.3071.115", + "1.8.2-beta.2": "59.0.3071.115", + "1.8.2-beta.3": "59.0.3071.115", + "1.8.2-beta.4": "59.0.3071.115", + "1.8.2-beta.5": "59.0.3071.115", + "1.8.2": "59.0.3071.115", + "1.8.3": "59.0.3071.115", + "1.8.4": "59.0.3071.115", + "1.8.5": "59.0.3071.115", + "1.8.6": "59.0.3071.115", + "1.8.7": "59.0.3071.115", + "1.8.8": "59.0.3071.115", + "2.0.0-beta.1": "61.0.3163.100", + "2.0.0-beta.2": "61.0.3163.100", + "2.0.0-beta.3": "61.0.3163.100", + "2.0.0-beta.4": "61.0.3163.100", + "2.0.0-beta.5": "61.0.3163.100", + "2.0.0-beta.6": "61.0.3163.100", + "2.0.0-beta.7": "61.0.3163.100", + "2.0.0-beta.8": "61.0.3163.100", + "2.0.0": "61.0.3163.100", + "2.0.1": "61.0.3163.100", + "2.0.2": "61.0.3163.100", + "2.0.3": "61.0.3163.100", + "2.0.4": "61.0.3163.100", + "2.0.5": "61.0.3163.100", + "2.0.6": "61.0.3163.100", + "2.0.7": "61.0.3163.100", + "2.0.8": "61.0.3163.100", + "2.0.9": "61.0.3163.100", + "2.0.10": "61.0.3163.100", + "2.0.11": "61.0.3163.100", + "2.0.12": "61.0.3163.100", + "2.0.13": "61.0.3163.100", + "2.0.14": "61.0.3163.100", + "2.0.15": "61.0.3163.100", + "2.0.16": "61.0.3163.100", + "2.0.17": "61.0.3163.100", + "2.0.18": "61.0.3163.100", + "2.1.0-unsupported.20180809": "61.0.3163.100", + "3.0.0-beta.1": "66.0.3359.181", + "3.0.0-beta.2": "66.0.3359.181", + "3.0.0-beta.3": "66.0.3359.181", + "3.0.0-beta.4": "66.0.3359.181", + "3.0.0-beta.5": "66.0.3359.181", + "3.0.0-beta.6": "66.0.3359.181", + "3.0.0-beta.7": "66.0.3359.181", + "3.0.0-beta.8": "66.0.3359.181", + "3.0.0-beta.9": "66.0.3359.181", + "3.0.0-beta.10": "66.0.3359.181", + "3.0.0-beta.11": "66.0.3359.181", + "3.0.0-beta.12": "66.0.3359.181", + "3.0.0-beta.13": "66.0.3359.181", + "3.0.0": "66.0.3359.181", + "3.0.1": "66.0.3359.181", + "3.0.2": "66.0.3359.181", + "3.0.3": "66.0.3359.181", + "3.0.4": "66.0.3359.181", + "3.0.5": "66.0.3359.181", + "3.0.6": "66.0.3359.181", + "3.0.7": "66.0.3359.181", + "3.0.8": "66.0.3359.181", + "3.0.9": "66.0.3359.181", + "3.0.10": "66.0.3359.181", + "3.0.11": "66.0.3359.181", + "3.0.12": "66.0.3359.181", + "3.0.13": "66.0.3359.181", + "3.0.14": "66.0.3359.181", + "3.0.15": "66.0.3359.181", + "3.0.16": "66.0.3359.181", + "3.1.0-beta.1": "66.0.3359.181", + "3.1.0-beta.2": "66.0.3359.181", + "3.1.0-beta.3": "66.0.3359.181", + "3.1.0-beta.4": "66.0.3359.181", + "3.1.0-beta.5": "66.0.3359.181", + "3.1.0": "66.0.3359.181", + "3.1.1": "66.0.3359.181", + "3.1.2": "66.0.3359.181", + "3.1.3": "66.0.3359.181", + "3.1.4": "66.0.3359.181", + "3.1.5": "66.0.3359.181", + "3.1.6": "66.0.3359.181", + "3.1.7": "66.0.3359.181", + "3.1.8": "66.0.3359.181", + "3.1.9": "66.0.3359.181", + "3.1.10": "66.0.3359.181", + "3.1.11": "66.0.3359.181", + "3.1.12": "66.0.3359.181", + "3.1.13": "66.0.3359.181", + "4.0.0-beta.1": "69.0.3497.106", + "4.0.0-beta.2": "69.0.3497.106", + "4.0.0-beta.3": "69.0.3497.106", + "4.0.0-beta.4": "69.0.3497.106", + "4.0.0-beta.5": "69.0.3497.106", + "4.0.0-beta.6": "69.0.3497.106", + "4.0.0-beta.7": "69.0.3497.106", + "4.0.0-beta.8": "69.0.3497.106", + "4.0.0-beta.9": "69.0.3497.106", + "4.0.0-beta.10": "69.0.3497.106", + "4.0.0-beta.11": "69.0.3497.106", + "4.0.0": "69.0.3497.106", + "4.0.1": "69.0.3497.106", + "4.0.2": "69.0.3497.106", + "4.0.3": "69.0.3497.106", + "4.0.4": "69.0.3497.106", + "4.0.5": "69.0.3497.106", + "4.0.6": "69.0.3497.106", + "4.0.7": "69.0.3497.128", + "4.0.8": "69.0.3497.128", + "4.1.0": "69.0.3497.128", + "4.1.1": "69.0.3497.128", + "4.1.2": "69.0.3497.128", + "4.1.3": "69.0.3497.128", + "4.1.4": "69.0.3497.128", + "4.1.5": "69.0.3497.128", + "4.2.0": "69.0.3497.128", + "4.2.1": "69.0.3497.128", + "4.2.2": "69.0.3497.128", + "4.2.3": "69.0.3497.128", + "4.2.4": "69.0.3497.128", + "4.2.5": "69.0.3497.128", + "4.2.6": "69.0.3497.128", + "4.2.7": "69.0.3497.128", + "4.2.8": "69.0.3497.128", + "4.2.9": "69.0.3497.128", + "4.2.10": "69.0.3497.128", + "4.2.11": "69.0.3497.128", + "4.2.12": "69.0.3497.128", + "5.0.0-beta.1": "72.0.3626.52", + "5.0.0-beta.2": "72.0.3626.52", + "5.0.0-beta.3": "73.0.3683.27", + "5.0.0-beta.4": "73.0.3683.54", + "5.0.0-beta.5": "73.0.3683.61", + "5.0.0-beta.6": "73.0.3683.84", + "5.0.0-beta.7": "73.0.3683.94", + "5.0.0-beta.8": "73.0.3683.104", + "5.0.0-beta.9": "73.0.3683.117", + "5.0.0": "73.0.3683.119", + "5.0.1": "73.0.3683.121", + "5.0.2": "73.0.3683.121", + "5.0.3": "73.0.3683.121", + "5.0.4": "73.0.3683.121", + "5.0.5": "73.0.3683.121", + "5.0.6": "73.0.3683.121", + "5.0.7": "73.0.3683.121", + "5.0.8": "73.0.3683.121", + "5.0.9": "73.0.3683.121", + "5.0.10": "73.0.3683.121", + "5.0.11": "73.0.3683.121", + "5.0.12": "73.0.3683.121", + "5.0.13": "73.0.3683.121", + "6.0.0-beta.1": "76.0.3774.1", + "6.0.0-beta.2": "76.0.3783.1", + "6.0.0-beta.3": "76.0.3783.1", + "6.0.0-beta.4": "76.0.3783.1", + "6.0.0-beta.5": "76.0.3805.4", + "6.0.0-beta.6": "76.0.3809.3", + "6.0.0-beta.7": "76.0.3809.22", + "6.0.0-beta.8": "76.0.3809.26", + "6.0.0-beta.9": "76.0.3809.26", + "6.0.0-beta.10": "76.0.3809.37", + "6.0.0-beta.11": "76.0.3809.42", + "6.0.0-beta.12": "76.0.3809.54", + "6.0.0-beta.13": "76.0.3809.60", + "6.0.0-beta.14": "76.0.3809.68", + "6.0.0-beta.15": "76.0.3809.74", + "6.0.0": "76.0.3809.88", + "6.0.1": "76.0.3809.102", + "6.0.2": "76.0.3809.110", + "6.0.3": "76.0.3809.126", + "6.0.4": "76.0.3809.131", + "6.0.5": "76.0.3809.136", + "6.0.6": "76.0.3809.138", + "6.0.7": "76.0.3809.139", + "6.0.8": "76.0.3809.146", + "6.0.9": "76.0.3809.146", + "6.0.10": "76.0.3809.146", + "6.0.11": "76.0.3809.146", + "6.0.12": "76.0.3809.146", + "6.1.0": "76.0.3809.146", + "6.1.1": "76.0.3809.146", + "6.1.2": "76.0.3809.146", + "6.1.3": "76.0.3809.146", + "6.1.4": "76.0.3809.146", + "6.1.5": "76.0.3809.146", + "6.1.6": "76.0.3809.146", + "6.1.7": "76.0.3809.146", + "6.1.8": "76.0.3809.146", + "6.1.9": "76.0.3809.146", + "6.1.10": "76.0.3809.146", + "6.1.11": "76.0.3809.146", + "6.1.12": "76.0.3809.146", + "7.0.0-beta.1": "78.0.3866.0", + "7.0.0-beta.2": "78.0.3866.0", + "7.0.0-beta.3": "78.0.3866.0", + "7.0.0-beta.4": "78.0.3896.6", + "7.0.0-beta.5": "78.0.3905.1", + "7.0.0-beta.6": "78.0.3905.1", + "7.0.0-beta.7": "78.0.3905.1", + "7.0.0": "78.0.3905.1", + "7.0.1": "78.0.3904.92", + "7.1.0": "78.0.3904.94", + "7.1.1": "78.0.3904.99", + "7.1.2": "78.0.3904.113", + "7.1.3": "78.0.3904.126", + "7.1.4": "78.0.3904.130", + "7.1.5": "78.0.3904.130", + "7.1.6": "78.0.3904.130", + "7.1.7": "78.0.3904.130", + "7.1.8": "78.0.3904.130", + "7.1.9": "78.0.3904.130", + "7.1.10": "78.0.3904.130", + "7.1.11": "78.0.3904.130", + "7.1.12": "78.0.3904.130", + "7.1.13": "78.0.3904.130", + "7.1.14": "78.0.3904.130", + "7.2.0": "78.0.3904.130", + "7.2.1": "78.0.3904.130", + "7.2.2": "78.0.3904.130", + "7.2.3": "78.0.3904.130", + "7.2.4": "78.0.3904.130", + "7.3.0": "78.0.3904.130", + "7.3.1": "78.0.3904.130", + "7.3.2": "78.0.3904.130", + "7.3.3": "78.0.3904.130", + "8.0.0-beta.1": "79.0.3931.0", + "8.0.0-beta.2": "79.0.3931.0", + "8.0.0-beta.3": "80.0.3955.0", + "8.0.0-beta.4": "80.0.3955.0", + "8.0.0-beta.5": "80.0.3987.14", + "8.0.0-beta.6": "80.0.3987.51", + "8.0.0-beta.7": "80.0.3987.59", + "8.0.0-beta.8": "80.0.3987.75", + "8.0.0-beta.9": "80.0.3987.75", + "8.0.0": "80.0.3987.86", + "8.0.1": "80.0.3987.86", + "8.0.2": "80.0.3987.86", + "8.0.3": "80.0.3987.134", + "8.1.0": "80.0.3987.137", + "8.1.1": "80.0.3987.141", + "8.2.0": "80.0.3987.158", + "8.2.1": "80.0.3987.163", + "8.2.2": "80.0.3987.163", + "8.2.3": "80.0.3987.163", + "8.2.4": "80.0.3987.165", + "8.2.5": "80.0.3987.165", + "8.3.0": "80.0.3987.165", + "8.3.1": "80.0.3987.165", + "8.3.2": "80.0.3987.165", + "8.3.3": "80.0.3987.165", + "8.3.4": "80.0.3987.165", + "8.4.0": "80.0.3987.165", + "8.4.1": "80.0.3987.165", + "8.5.0": "80.0.3987.165", + "8.5.1": "80.0.3987.165", + "8.5.2": "80.0.3987.165", + "8.5.3": "80.0.3987.163", + "8.5.4": "80.0.3987.163", + "8.5.5": "80.0.3987.163", + "9.0.0-beta.1": "82.0.4048.0", + "9.0.0-beta.2": "82.0.4048.0", + "9.0.0-beta.3": "82.0.4048.0", + "9.0.0-beta.4": "82.0.4048.0", + "9.0.0-beta.5": "82.0.4048.0", + "9.0.0-beta.6": "82.0.4058.2", + "9.0.0-beta.7": "82.0.4058.2", + "9.0.0-beta.9": "82.0.4058.2", + "9.0.0-beta.10": "82.0.4085.10", + "9.0.0-beta.11": "82.0.4085.14", + "9.0.0-beta.12": "82.0.4085.14", + "9.0.0-beta.13": "82.0.4085.14", + "9.0.0-beta.14": "82.0.4085.27", + "9.0.0-beta.15": "83.0.4102.3", + "9.0.0-beta.16": "83.0.4102.3", + "9.0.0-beta.17": "83.0.4103.14", + "9.0.0-beta.18": "83.0.4103.16", + "9.0.0-beta.19": "83.0.4103.24", + "9.0.0-beta.20": "83.0.4103.26", + "9.0.0-beta.21": "83.0.4103.26", + "9.0.0-beta.22": "83.0.4103.34", + "9.0.0-beta.23": "83.0.4103.44", + "9.0.0-beta.24": "83.0.4103.45", + "9.0.0": "83.0.4103.64", + "9.0.1": "83.0.4103.94", + "9.0.2": "83.0.4103.94", + "9.0.3": "83.0.4103.100", + "9.0.4": "83.0.4103.104", + "9.0.5": "83.0.4103.119", + "9.1.0": "83.0.4103.122", + "9.1.1": "83.0.4103.122", + "9.1.2": "83.0.4103.122", + "9.2.0": "83.0.4103.122", + "9.2.1": "83.0.4103.122", + "9.3.0": "83.0.4103.122", + "9.3.1": "83.0.4103.122", + "9.3.2": "83.0.4103.122", + "9.3.3": "83.0.4103.122", + "9.3.4": "83.0.4103.122", + "9.3.5": "83.0.4103.122", + "9.4.0": "83.0.4103.122", + "9.4.1": "83.0.4103.122", + "9.4.2": "83.0.4103.122", + "9.4.3": "83.0.4103.122", + "9.4.4": "83.0.4103.122", + "10.0.0-beta.1": "84.0.4129.0", + "10.0.0-beta.2": "84.0.4129.0", + "10.0.0-beta.3": "85.0.4161.2", + "10.0.0-beta.4": "85.0.4161.2", + "10.0.0-beta.8": "85.0.4181.1", + "10.0.0-beta.9": "85.0.4181.1", + "10.0.0-beta.10": "85.0.4183.19", + "10.0.0-beta.11": "85.0.4183.20", + "10.0.0-beta.12": "85.0.4183.26", + "10.0.0-beta.13": "85.0.4183.39", + "10.0.0-beta.14": "85.0.4183.39", + "10.0.0-beta.15": "85.0.4183.39", + "10.0.0-beta.17": "85.0.4183.39", + "10.0.0-beta.19": "85.0.4183.39", + "10.0.0-beta.20": "85.0.4183.39", + "10.0.0-beta.21": "85.0.4183.39", + "10.0.0-beta.23": "85.0.4183.70", + "10.0.0-beta.24": "85.0.4183.78", + "10.0.0-beta.25": "85.0.4183.80", + "10.0.0": "85.0.4183.84", + "10.0.1": "85.0.4183.86", + "10.1.0": "85.0.4183.87", + "10.1.1": "85.0.4183.93", + "10.1.2": "85.0.4183.98", + "10.1.3": "85.0.4183.121", + "10.1.4": "85.0.4183.121", + "10.1.5": "85.0.4183.121", + "10.1.6": "85.0.4183.121", + "10.1.7": "85.0.4183.121", + "10.2.0": "85.0.4183.121", + "10.3.0": "85.0.4183.121", + "10.3.1": "85.0.4183.121", + "10.3.2": "85.0.4183.121", + "10.4.0": "85.0.4183.121", + "10.4.1": "85.0.4183.121", + "10.4.2": "85.0.4183.121", + "10.4.3": "85.0.4183.121", + "10.4.4": "85.0.4183.121", + "10.4.5": "85.0.4183.121", + "10.4.6": "85.0.4183.121", + "10.4.7": "85.0.4183.121", + "11.0.0-beta.1": "86.0.4234.0", + "11.0.0-beta.3": "86.0.4234.0", + "11.0.0-beta.4": "86.0.4234.0", + "11.0.0-beta.5": "86.0.4234.0", + "11.0.0-beta.6": "86.0.4234.0", + "11.0.0-beta.7": "86.0.4234.0", + "11.0.0-beta.8": "87.0.4251.1", + "11.0.0-beta.9": "87.0.4251.1", + "11.0.0-beta.11": "87.0.4251.1", + "11.0.0-beta.12": "87.0.4280.11", + "11.0.0-beta.13": "87.0.4280.11", + "11.0.0-beta.16": "87.0.4280.27", + "11.0.0-beta.17": "87.0.4280.27", + "11.0.0-beta.18": "87.0.4280.27", + "11.0.0-beta.19": "87.0.4280.27", + "11.0.0-beta.20": "87.0.4280.40", + "11.0.0-beta.22": "87.0.4280.47", + "11.0.0-beta.23": "87.0.4280.47", + "11.0.0": "87.0.4280.60", + "11.0.1": "87.0.4280.60", + "11.0.2": "87.0.4280.67", + "11.0.3": "87.0.4280.67", + "11.0.4": "87.0.4280.67", + "11.0.5": "87.0.4280.88", + "11.1.0": "87.0.4280.88", + "11.1.1": "87.0.4280.88", + "11.2.0": "87.0.4280.141", + "11.2.1": "87.0.4280.141", + "11.2.2": "87.0.4280.141", + "11.2.3": "87.0.4280.141", + "11.3.0": "87.0.4280.141", + "11.4.0": "87.0.4280.141", + "11.4.1": "87.0.4280.141", + "11.4.2": "87.0.4280.141", + "11.4.3": "87.0.4280.141", + "11.4.4": "87.0.4280.141", + "11.4.5": "87.0.4280.141", + "11.4.6": "87.0.4280.141", + "11.4.7": "87.0.4280.141", + "11.4.8": "87.0.4280.141", + "11.4.9": "87.0.4280.141", + "11.4.10": "87.0.4280.141", + "11.4.11": "87.0.4280.141", + "11.4.12": "87.0.4280.141", + "11.5.0": "87.0.4280.141", + "12.0.0-beta.1": "89.0.4328.0", + "12.0.0-beta.3": "89.0.4328.0", + "12.0.0-beta.4": "89.0.4328.0", + "12.0.0-beta.5": "89.0.4328.0", + "12.0.0-beta.6": "89.0.4328.0", + "12.0.0-beta.7": "89.0.4328.0", + "12.0.0-beta.8": "89.0.4328.0", + "12.0.0-beta.9": "89.0.4328.0", + "12.0.0-beta.10": "89.0.4328.0", + "12.0.0-beta.11": "89.0.4328.0", + "12.0.0-beta.12": "89.0.4328.0", + "12.0.0-beta.14": "89.0.4328.0", + "12.0.0-beta.16": "89.0.4348.1", + "12.0.0-beta.18": "89.0.4348.1", + "12.0.0-beta.19": "89.0.4348.1", + "12.0.0-beta.20": "89.0.4348.1", + "12.0.0-beta.21": "89.0.4388.2", + "12.0.0-beta.22": "89.0.4388.2", + "12.0.0-beta.23": "89.0.4388.2", + "12.0.0-beta.24": "89.0.4388.2", + "12.0.0-beta.25": "89.0.4388.2", + "12.0.0-beta.26": "89.0.4388.2", + "12.0.0-beta.27": "89.0.4389.23", + "12.0.0-beta.28": "89.0.4389.23", + "12.0.0-beta.29": "89.0.4389.23", + "12.0.0-beta.30": "89.0.4389.58", + "12.0.0-beta.31": "89.0.4389.58", + "12.0.0": "89.0.4389.69", + "12.0.1": "89.0.4389.82", + "12.0.2": "89.0.4389.90", + "12.0.3": "89.0.4389.114", + "12.0.4": "89.0.4389.114", + "12.0.5": "89.0.4389.128", + "12.0.6": "89.0.4389.128", + "12.0.7": "89.0.4389.128", + "12.0.8": "89.0.4389.128", + "12.0.9": "89.0.4389.128", + "12.0.10": "89.0.4389.128", + "12.0.11": "89.0.4389.128", + "12.0.12": "89.0.4389.128", + "12.0.13": "89.0.4389.128", + "12.0.14": "89.0.4389.128", + "12.0.15": "89.0.4389.128", + "12.0.16": "89.0.4389.128", + "12.0.17": "89.0.4389.128", + "12.0.18": "89.0.4389.128", + "12.1.0": "89.0.4389.128", + "12.1.1": "89.0.4389.128", + "12.1.2": "89.0.4389.128", + "12.2.0": "89.0.4389.128", + "12.2.1": "89.0.4389.128", + "12.2.2": "89.0.4389.128", + "12.2.3": "89.0.4389.128", + "13.0.0-beta.2": "90.0.4402.0", + "13.0.0-beta.3": "90.0.4402.0", + "13.0.0-beta.4": "90.0.4415.0", + "13.0.0-beta.5": "90.0.4415.0", + "13.0.0-beta.6": "90.0.4415.0", + "13.0.0-beta.7": "90.0.4415.0", + "13.0.0-beta.8": "90.0.4415.0", + "13.0.0-beta.9": "90.0.4415.0", + "13.0.0-beta.10": "90.0.4415.0", + "13.0.0-beta.11": "90.0.4415.0", + "13.0.0-beta.12": "90.0.4415.0", + "13.0.0-beta.13": "90.0.4415.0", + "13.0.0-beta.14": "91.0.4448.0", + "13.0.0-beta.16": "91.0.4448.0", + "13.0.0-beta.17": "91.0.4448.0", + "13.0.0-beta.18": "91.0.4448.0", + "13.0.0-beta.20": "91.0.4448.0", + "13.0.0-beta.21": "91.0.4472.33", + "13.0.0-beta.22": "91.0.4472.33", + "13.0.0-beta.23": "91.0.4472.33", + "13.0.0-beta.24": "91.0.4472.38", + "13.0.0-beta.25": "91.0.4472.38", + "13.0.0-beta.26": "91.0.4472.38", + "13.0.0-beta.27": "91.0.4472.38", + "13.0.0-beta.28": "91.0.4472.38", + "13.0.0": "91.0.4472.69", + "13.0.1": "91.0.4472.69", + "13.1.0": "91.0.4472.77", + "13.1.1": "91.0.4472.77", + "13.1.2": "91.0.4472.77", + "13.1.3": "91.0.4472.106", + "13.1.4": "91.0.4472.106", + "13.1.5": "91.0.4472.124", + "13.1.6": "91.0.4472.124", + "13.1.7": "91.0.4472.124", + "13.1.8": "91.0.4472.164", + "13.1.9": "91.0.4472.164", + "13.2.0": "91.0.4472.164", + "13.2.1": "91.0.4472.164", + "13.2.2": "91.0.4472.164", + "13.2.3": "91.0.4472.164", + "13.3.0": "91.0.4472.164", + "13.4.0": "91.0.4472.164", + "13.5.0": "91.0.4472.164", + "13.5.1": "91.0.4472.164", + "13.5.2": "91.0.4472.164", + "13.6.0": "91.0.4472.164", + "13.6.1": "91.0.4472.164", + "13.6.2": "91.0.4472.164", + "13.6.3": "91.0.4472.164", + "13.6.6": "91.0.4472.164", + "13.6.7": "91.0.4472.164", + "13.6.8": "91.0.4472.164", + "13.6.9": "91.0.4472.164", + "14.0.0-beta.1": "92.0.4511.0", + "14.0.0-beta.2": "92.0.4511.0", + "14.0.0-beta.3": "92.0.4511.0", + "14.0.0-beta.5": "93.0.4536.0", + "14.0.0-beta.6": "93.0.4536.0", + "14.0.0-beta.7": "93.0.4536.0", + "14.0.0-beta.8": "93.0.4536.0", + "14.0.0-beta.9": "93.0.4539.0", + "14.0.0-beta.10": "93.0.4539.0", + "14.0.0-beta.11": "93.0.4557.4", + "14.0.0-beta.12": "93.0.4557.4", + "14.0.0-beta.13": "93.0.4566.0", + "14.0.0-beta.14": "93.0.4566.0", + "14.0.0-beta.15": "93.0.4566.0", + "14.0.0-beta.16": "93.0.4566.0", + "14.0.0-beta.17": "93.0.4566.0", + "14.0.0-beta.18": "93.0.4577.15", + "14.0.0-beta.19": "93.0.4577.15", + "14.0.0-beta.20": "93.0.4577.15", + "14.0.0-beta.21": "93.0.4577.15", + "14.0.0-beta.22": "93.0.4577.25", + "14.0.0-beta.23": "93.0.4577.25", + "14.0.0-beta.24": "93.0.4577.51", + "14.0.0-beta.25": "93.0.4577.51", + "14.0.0": "93.0.4577.58", + "14.0.1": "93.0.4577.63", + "14.0.2": "93.0.4577.82", + "14.1.0": "93.0.4577.82", + "14.1.1": "93.0.4577.82", + "14.2.0": "93.0.4577.82", + "14.2.1": "93.0.4577.82", + "14.2.2": "93.0.4577.82", + "14.2.3": "93.0.4577.82", + "14.2.4": "93.0.4577.82", + "14.2.5": "93.0.4577.82", + "14.2.6": "93.0.4577.82", + "14.2.7": "93.0.4577.82", + "14.2.8": "93.0.4577.82", + "14.2.9": "93.0.4577.82", + "15.0.0-alpha.1": "93.0.4566.0", + "15.0.0-alpha.2": "93.0.4566.0", + "15.0.0-alpha.3": "94.0.4584.0", + "15.0.0-alpha.4": "94.0.4584.0", + "15.0.0-alpha.5": "94.0.4584.0", + "15.0.0-alpha.6": "94.0.4584.0", + "15.0.0-alpha.7": "94.0.4590.2", + "15.0.0-alpha.8": "94.0.4590.2", + "15.0.0-alpha.9": "94.0.4590.2", + "15.0.0-alpha.10": "94.0.4606.12", + "15.0.0-beta.1": "94.0.4606.20", + "15.0.0-beta.2": "94.0.4606.20", + "15.0.0-beta.3": "94.0.4606.31", + "15.0.0-beta.4": "94.0.4606.31", + "15.0.0-beta.5": "94.0.4606.31", + "15.0.0-beta.6": "94.0.4606.31", + "15.0.0-beta.7": "94.0.4606.31", + "15.0.0": "94.0.4606.51", + "15.1.0": "94.0.4606.61", + "15.1.1": "94.0.4606.61", + "15.1.2": "94.0.4606.71", + "15.2.0": "94.0.4606.81", + "15.3.0": "94.0.4606.81", + "15.3.1": "94.0.4606.81", + "15.3.2": "94.0.4606.81", + "15.3.3": "94.0.4606.81", + "15.3.4": "94.0.4606.81", + "15.3.5": "94.0.4606.81", + "15.3.6": "94.0.4606.81", + "15.3.7": "94.0.4606.81", + "15.4.0": "94.0.4606.81", + "15.4.1": "94.0.4606.81", + "15.4.2": "94.0.4606.81", + "15.5.0": "94.0.4606.81", + "15.5.1": "94.0.4606.81", + "15.5.2": "94.0.4606.81", + "15.5.3": "94.0.4606.81", + "15.5.4": "94.0.4606.81", + "15.5.5": "94.0.4606.81", + "15.5.6": "94.0.4606.81", + "15.5.7": "94.0.4606.81", + "16.0.0-alpha.1": "95.0.4629.0", + "16.0.0-alpha.2": "95.0.4629.0", + "16.0.0-alpha.3": "95.0.4629.0", + "16.0.0-alpha.4": "95.0.4629.0", + "16.0.0-alpha.5": "95.0.4629.0", + "16.0.0-alpha.6": "95.0.4629.0", + "16.0.0-alpha.7": "95.0.4629.0", + "16.0.0-alpha.8": "96.0.4647.0", + "16.0.0-alpha.9": "96.0.4647.0", + "16.0.0-beta.1": "96.0.4647.0", + "16.0.0-beta.2": "96.0.4647.0", + "16.0.0-beta.3": "96.0.4647.0", + "16.0.0-beta.4": "96.0.4664.18", + "16.0.0-beta.5": "96.0.4664.18", + "16.0.0-beta.6": "96.0.4664.27", + "16.0.0-beta.7": "96.0.4664.27", + "16.0.0-beta.8": "96.0.4664.35", + "16.0.0-beta.9": "96.0.4664.35", + "16.0.0": "96.0.4664.45", + "16.0.1": "96.0.4664.45", + "16.0.2": "96.0.4664.55", + "16.0.3": "96.0.4664.55", + "16.0.4": "96.0.4664.55", + "16.0.5": "96.0.4664.55", + "16.0.6": "96.0.4664.110", + "16.0.7": "96.0.4664.110", + "16.0.8": "96.0.4664.110", + "16.0.9": "96.0.4664.174", + "16.0.10": "96.0.4664.174", + "16.1.0": "96.0.4664.174", + "16.1.1": "96.0.4664.174", + "16.2.0": "96.0.4664.174", + "16.2.1": "96.0.4664.174", + "16.2.2": "96.0.4664.174", + "16.2.3": "96.0.4664.174", + "16.2.4": "96.0.4664.174", + "16.2.5": "96.0.4664.174", + "16.2.6": "96.0.4664.174", + "16.2.7": "96.0.4664.174", + "16.2.8": "96.0.4664.174", + "17.0.0-alpha.1": "96.0.4664.4", + "17.0.0-alpha.2": "96.0.4664.4", + "17.0.0-alpha.3": "96.0.4664.4", + "17.0.0-alpha.4": "98.0.4706.0", + "17.0.0-alpha.5": "98.0.4706.0", + "17.0.0-alpha.6": "98.0.4706.0", + "17.0.0-beta.1": "98.0.4706.0", + "17.0.0-beta.2": "98.0.4706.0", + "17.0.0-beta.3": "98.0.4758.9", + "17.0.0-beta.4": "98.0.4758.11", + "17.0.0-beta.5": "98.0.4758.11", + "17.0.0-beta.6": "98.0.4758.11", + "17.0.0-beta.7": "98.0.4758.11", + "17.0.0-beta.8": "98.0.4758.11", + "17.0.0-beta.9": "98.0.4758.11", + "17.0.0": "98.0.4758.74", + "17.0.1": "98.0.4758.82", + "17.1.0": "98.0.4758.102", + "17.1.1": "98.0.4758.109", + "17.1.2": "98.0.4758.109", + "17.2.0": "98.0.4758.109", + "17.3.0": "98.0.4758.141", + "17.3.1": "98.0.4758.141", + "17.4.0": "98.0.4758.141", + "17.4.1": "98.0.4758.141", + "17.4.2": "98.0.4758.141", + "17.4.3": "98.0.4758.141", + "17.4.4": "98.0.4758.141", + "17.4.5": "98.0.4758.141", + "17.4.6": "98.0.4758.141", + "17.4.7": "98.0.4758.141", + "17.4.8": "98.0.4758.141", + "17.4.9": "98.0.4758.141", + "17.4.10": "98.0.4758.141", + "17.4.11": "98.0.4758.141", + "18.0.0-alpha.1": "99.0.4767.0", + "18.0.0-alpha.2": "99.0.4767.0", + "18.0.0-alpha.3": "99.0.4767.0", + "18.0.0-alpha.4": "99.0.4767.0", + "18.0.0-alpha.5": "99.0.4767.0", + "18.0.0-beta.1": "100.0.4894.0", + "18.0.0-beta.2": "100.0.4894.0", + "18.0.0-beta.3": "100.0.4894.0", + "18.0.0-beta.4": "100.0.4894.0", + "18.0.0-beta.5": "100.0.4894.0", + "18.0.0-beta.6": "100.0.4894.0", + "18.0.0": "100.0.4896.56", + "18.0.1": "100.0.4896.60", + "18.0.2": "100.0.4896.60", + "18.0.3": "100.0.4896.75", + "18.0.4": "100.0.4896.75", + "18.1.0": "100.0.4896.127", + "18.2.0": "100.0.4896.143", + "18.2.1": "100.0.4896.143", + "18.2.2": "100.0.4896.143", + "18.2.3": "100.0.4896.143", + "18.2.4": "100.0.4896.160", + "18.3.0": "100.0.4896.160", + "18.3.1": "100.0.4896.160", + "18.3.2": "100.0.4896.160", + "18.3.3": "100.0.4896.160", + "18.3.4": "100.0.4896.160", + "18.3.5": "100.0.4896.160", + "18.3.6": "100.0.4896.160", + "18.3.7": "100.0.4896.160", + "18.3.8": "100.0.4896.160", + "18.3.9": "100.0.4896.160", + "18.3.11": "100.0.4896.160", + "18.3.12": "100.0.4896.160", + "18.3.13": "100.0.4896.160", + "18.3.14": "100.0.4896.160", + "18.3.15": "100.0.4896.160", + "19.0.0-alpha.1": "102.0.4962.3", + "19.0.0-alpha.2": "102.0.4971.0", + "19.0.0-alpha.3": "102.0.4971.0", + "19.0.0-alpha.4": "102.0.4989.0", + "19.0.0-alpha.5": "102.0.4989.0", + "19.0.0-beta.1": "102.0.4999.0", + "19.0.0-beta.2": "102.0.4999.0", + "19.0.0-beta.3": "102.0.4999.0", + "19.0.0-beta.4": "102.0.5005.27", + "19.0.0-beta.5": "102.0.5005.40", + "19.0.0-beta.6": "102.0.5005.40", + "19.0.0-beta.7": "102.0.5005.40", + "19.0.0-beta.8": "102.0.5005.49", + "19.0.0": "102.0.5005.61", + "19.0.1": "102.0.5005.61", + "19.0.2": "102.0.5005.63", + "19.0.3": "102.0.5005.63", + "19.0.4": "102.0.5005.63", + "19.0.5": "102.0.5005.115", + "19.0.6": "102.0.5005.115", + "19.0.7": "102.0.5005.134", + "19.0.8": "102.0.5005.148", + "19.0.9": "102.0.5005.167", + "19.0.10": "102.0.5005.167", + "19.0.11": "102.0.5005.167", + "19.0.12": "102.0.5005.167", + "19.0.13": "102.0.5005.167", + "19.0.14": "102.0.5005.167", + "19.0.15": "102.0.5005.167", + "19.0.16": "102.0.5005.167", + "19.0.17": "102.0.5005.167", + "19.1.0": "102.0.5005.167", + "19.1.1": "102.0.5005.167", + "19.1.2": "102.0.5005.167", + "19.1.3": "102.0.5005.167", + "19.1.4": "102.0.5005.167", + "19.1.5": "102.0.5005.167", + "19.1.6": "102.0.5005.167", + "19.1.7": "102.0.5005.167", + "19.1.8": "102.0.5005.167", + "19.1.9": "102.0.5005.167", + "20.0.0-alpha.1": "103.0.5044.0", + "20.0.0-alpha.2": "104.0.5073.0", + "20.0.0-alpha.3": "104.0.5073.0", + "20.0.0-alpha.4": "104.0.5073.0", + "20.0.0-alpha.5": "104.0.5073.0", + "20.0.0-alpha.6": "104.0.5073.0", + "20.0.0-alpha.7": "104.0.5073.0", + "20.0.0-beta.1": "104.0.5073.0", + "20.0.0-beta.2": "104.0.5073.0", + "20.0.0-beta.3": "104.0.5073.0", + "20.0.0-beta.4": "104.0.5073.0", + "20.0.0-beta.5": "104.0.5073.0", + "20.0.0-beta.6": "104.0.5073.0", + "20.0.0-beta.7": "104.0.5073.0", + "20.0.0-beta.8": "104.0.5073.0", + "20.0.0-beta.9": "104.0.5112.39", + "20.0.0-beta.10": "104.0.5112.48", + "20.0.0-beta.11": "104.0.5112.48", + "20.0.0-beta.12": "104.0.5112.48", + "20.0.0-beta.13": "104.0.5112.57", + "20.0.0": "104.0.5112.65", + "20.0.1": "104.0.5112.81", + "20.0.2": "104.0.5112.81", + "20.0.3": "104.0.5112.81", + "20.1.0": "104.0.5112.102", + "20.1.1": "104.0.5112.102", + "20.1.2": "104.0.5112.114", + "20.1.3": "104.0.5112.114", + "20.1.4": "104.0.5112.114", + "20.2.0": "104.0.5112.124", + "20.3.0": "104.0.5112.124", + "20.3.1": "104.0.5112.124", + "20.3.2": "104.0.5112.124", + "20.3.3": "104.0.5112.124", + "20.3.4": "104.0.5112.124", + "20.3.5": "104.0.5112.124", + "20.3.6": "104.0.5112.124", + "20.3.7": "104.0.5112.124", + "20.3.8": "104.0.5112.124", + "20.3.9": "104.0.5112.124", + "20.3.10": "104.0.5112.124", + "20.3.11": "104.0.5112.124", + "20.3.12": "104.0.5112.124", + "21.0.0-alpha.1": "105.0.5187.0", + "21.0.0-alpha.2": "105.0.5187.0", + "21.0.0-alpha.3": "105.0.5187.0", + "21.0.0-alpha.4": "105.0.5187.0", + "21.0.0-alpha.5": "105.0.5187.0", + "21.0.0-alpha.6": "106.0.5216.0", + "21.0.0-beta.1": "106.0.5216.0", + "21.0.0-beta.2": "106.0.5216.0", + "21.0.0-beta.3": "106.0.5216.0", + "21.0.0-beta.4": "106.0.5216.0", + "21.0.0-beta.5": "106.0.5216.0", + "21.0.0-beta.6": "106.0.5249.40", + "21.0.0-beta.7": "106.0.5249.40", + "21.0.0-beta.8": "106.0.5249.40", + "21.0.0": "106.0.5249.51", + "21.0.1": "106.0.5249.61", + "21.1.0": "106.0.5249.91", + "21.1.1": "106.0.5249.103", + "21.2.0": "106.0.5249.119", + "21.2.1": "106.0.5249.165", + "21.2.2": "106.0.5249.168", + "21.2.3": "106.0.5249.168", + "21.3.0": "106.0.5249.181", + "21.3.1": "106.0.5249.181", + "21.3.3": "106.0.5249.199", + "21.3.4": "106.0.5249.199", + "21.3.5": "106.0.5249.199", + "21.4.0": "106.0.5249.199", + "21.4.1": "106.0.5249.199", + "21.4.2": "106.0.5249.199", + "21.4.3": "106.0.5249.199", + "21.4.4": "106.0.5249.199", + "22.0.0-alpha.1": "107.0.5286.0", + "22.0.0-alpha.3": "108.0.5329.0", + "22.0.0-alpha.4": "108.0.5329.0", + "22.0.0-alpha.5": "108.0.5329.0", + "22.0.0-alpha.6": "108.0.5329.0", + "22.0.0-alpha.7": "108.0.5355.0", + "22.0.0-alpha.8": "108.0.5359.10", + "22.0.0-beta.1": "108.0.5359.10", + "22.0.0-beta.2": "108.0.5359.10", + "22.0.0-beta.3": "108.0.5359.10", + "22.0.0-beta.4": "108.0.5359.29", + "22.0.0-beta.5": "108.0.5359.40", + "22.0.0-beta.6": "108.0.5359.40", + "22.0.0-beta.7": "108.0.5359.48", + "22.0.0-beta.8": "108.0.5359.48", + "22.0.0": "108.0.5359.62", + "22.0.1": "108.0.5359.125", + "22.0.2": "108.0.5359.179", + "22.0.3": "108.0.5359.179", + "22.1.0": "108.0.5359.179", + "22.2.0": "108.0.5359.215", + "22.2.1": "108.0.5359.215", + "22.3.0": "108.0.5359.215", + "22.3.1": "108.0.5359.215", + "22.3.2": "108.0.5359.215", + "22.3.3": "108.0.5359.215", + "22.3.4": "108.0.5359.215", + "22.3.5": "108.0.5359.215", + "22.3.6": "108.0.5359.215", + "22.3.7": "108.0.5359.215", + "22.3.8": "108.0.5359.215", + "22.3.9": "108.0.5359.215", + "22.3.10": "108.0.5359.215", + "22.3.11": "108.0.5359.215", + "22.3.12": "108.0.5359.215", + "22.3.13": "108.0.5359.215", + "22.3.14": "108.0.5359.215", + "22.3.15": "108.0.5359.215", + "22.3.16": "108.0.5359.215", + "22.3.17": "108.0.5359.215", + "22.3.18": "108.0.5359.215", + "22.3.20": "108.0.5359.215", + "22.3.21": "108.0.5359.215", + "22.3.22": "108.0.5359.215", + "22.3.23": "108.0.5359.215", + "22.3.24": "108.0.5359.215", + "22.3.25": "108.0.5359.215", + "22.3.26": "108.0.5359.215", + "22.3.27": "108.0.5359.215", + "23.0.0-alpha.1": "110.0.5415.0", + "23.0.0-alpha.2": "110.0.5451.0", + "23.0.0-alpha.3": "110.0.5451.0", + "23.0.0-beta.1": "110.0.5478.5", + "23.0.0-beta.2": "110.0.5478.5", + "23.0.0-beta.3": "110.0.5478.5", + "23.0.0-beta.4": "110.0.5481.30", + "23.0.0-beta.5": "110.0.5481.38", + "23.0.0-beta.6": "110.0.5481.52", + "23.0.0-beta.8": "110.0.5481.52", + "23.0.0": "110.0.5481.77", + "23.1.0": "110.0.5481.100", + "23.1.1": "110.0.5481.104", + "23.1.2": "110.0.5481.177", + "23.1.3": "110.0.5481.179", + "23.1.4": "110.0.5481.192", + "23.2.0": "110.0.5481.192", + "23.2.1": "110.0.5481.208", + "23.2.2": "110.0.5481.208", + "23.2.3": "110.0.5481.208", + "23.2.4": "110.0.5481.208", + "23.3.0": "110.0.5481.208", + "23.3.1": "110.0.5481.208", + "23.3.2": "110.0.5481.208", + "23.3.3": "110.0.5481.208", + "23.3.4": "110.0.5481.208", + "23.3.5": "110.0.5481.208", + "23.3.6": "110.0.5481.208", + "23.3.7": "110.0.5481.208", + "23.3.8": "110.0.5481.208", + "23.3.9": "110.0.5481.208", + "23.3.10": "110.0.5481.208", + "23.3.11": "110.0.5481.208", + "23.3.12": "110.0.5481.208", + "23.3.13": "110.0.5481.208", + "24.0.0-alpha.1": "111.0.5560.0", + "24.0.0-alpha.2": "111.0.5560.0", + "24.0.0-alpha.3": "111.0.5560.0", + "24.0.0-alpha.4": "111.0.5560.0", + "24.0.0-alpha.5": "111.0.5560.0", + "24.0.0-alpha.6": "111.0.5560.0", + "24.0.0-alpha.7": "111.0.5560.0", + "24.0.0-beta.1": "111.0.5563.50", + "24.0.0-beta.2": "111.0.5563.50", + "24.0.0-beta.3": "112.0.5615.20", + "24.0.0-beta.4": "112.0.5615.20", + "24.0.0-beta.5": "112.0.5615.29", + "24.0.0-beta.6": "112.0.5615.39", + "24.0.0-beta.7": "112.0.5615.39", + "24.0.0": "112.0.5615.49", + "24.1.0": "112.0.5615.50", + "24.1.1": "112.0.5615.50", + "24.1.2": "112.0.5615.87", + "24.1.3": "112.0.5615.165", + "24.2.0": "112.0.5615.165", + "24.3.0": "112.0.5615.165", + "24.3.1": "112.0.5615.183", + "24.4.0": "112.0.5615.204", + "24.4.1": "112.0.5615.204", + "24.5.0": "112.0.5615.204", + "24.5.1": "112.0.5615.204", + "24.6.0": "112.0.5615.204", + "24.6.1": "112.0.5615.204", + "24.6.2": "112.0.5615.204", + "24.6.3": "112.0.5615.204", + "24.6.4": "112.0.5615.204", + "24.6.5": "112.0.5615.204", + "24.7.0": "112.0.5615.204", + "24.7.1": "112.0.5615.204", + "24.8.0": "112.0.5615.204", + "24.8.1": "112.0.5615.204", + "24.8.2": "112.0.5615.204", + "24.8.3": "112.0.5615.204", + "24.8.4": "112.0.5615.204", + "24.8.5": "112.0.5615.204", + "24.8.6": "112.0.5615.204", + "24.8.7": "112.0.5615.204", + "24.8.8": "112.0.5615.204", + "25.0.0-alpha.1": "114.0.5694.0", + "25.0.0-alpha.2": "114.0.5694.0", + "25.0.0-alpha.3": "114.0.5710.0", + "25.0.0-alpha.4": "114.0.5710.0", + "25.0.0-alpha.5": "114.0.5719.0", + "25.0.0-alpha.6": "114.0.5719.0", + "25.0.0-beta.1": "114.0.5719.0", + "25.0.0-beta.2": "114.0.5719.0", + "25.0.0-beta.3": "114.0.5719.0", + "25.0.0-beta.4": "114.0.5735.16", + "25.0.0-beta.5": "114.0.5735.16", + "25.0.0-beta.6": "114.0.5735.16", + "25.0.0-beta.7": "114.0.5735.16", + "25.0.0-beta.8": "114.0.5735.35", + "25.0.0-beta.9": "114.0.5735.45", + "25.0.0": "114.0.5735.45", + "25.0.1": "114.0.5735.45", + "25.1.0": "114.0.5735.106", + "25.1.1": "114.0.5735.106", + "25.2.0": "114.0.5735.134", + "25.3.0": "114.0.5735.199", + "25.3.1": "114.0.5735.243", + "25.3.2": "114.0.5735.248", + "25.4.0": "114.0.5735.248", + "25.5.0": "114.0.5735.289", + "25.6.0": "114.0.5735.289", + "25.7.0": "114.0.5735.289", + "25.8.0": "114.0.5735.289", + "25.8.1": "114.0.5735.289", + "25.8.2": "114.0.5735.289", + "25.8.3": "114.0.5735.289", + "25.8.4": "114.0.5735.289", + "25.9.0": "114.0.5735.289", + "25.9.1": "114.0.5735.289", + "25.9.2": "114.0.5735.289", + "25.9.3": "114.0.5735.289", + "25.9.4": "114.0.5735.289", + "25.9.5": "114.0.5735.289", + "25.9.6": "114.0.5735.289", + "25.9.7": "114.0.5735.289", + "25.9.8": "114.0.5735.289", + "26.0.0-alpha.1": "116.0.5791.0", + "26.0.0-alpha.2": "116.0.5791.0", + "26.0.0-alpha.3": "116.0.5791.0", + "26.0.0-alpha.4": "116.0.5791.0", + "26.0.0-alpha.5": "116.0.5791.0", + "26.0.0-alpha.6": "116.0.5815.0", + "26.0.0-alpha.7": "116.0.5831.0", + "26.0.0-alpha.8": "116.0.5845.0", + "26.0.0-beta.1": "116.0.5845.0", + "26.0.0-beta.2": "116.0.5845.14", + "26.0.0-beta.3": "116.0.5845.14", + "26.0.0-beta.4": "116.0.5845.14", + "26.0.0-beta.5": "116.0.5845.14", + "26.0.0-beta.6": "116.0.5845.14", + "26.0.0-beta.7": "116.0.5845.14", + "26.0.0-beta.8": "116.0.5845.42", + "26.0.0-beta.9": "116.0.5845.42", + "26.0.0-beta.10": "116.0.5845.49", + "26.0.0-beta.11": "116.0.5845.49", + "26.0.0-beta.12": "116.0.5845.62", + "26.0.0": "116.0.5845.82", + "26.1.0": "116.0.5845.97", + "26.2.0": "116.0.5845.179", + "26.2.1": "116.0.5845.188", + "26.2.2": "116.0.5845.190", + "26.2.3": "116.0.5845.190", + "26.2.4": "116.0.5845.190", + "26.3.0": "116.0.5845.228", + "26.4.0": "116.0.5845.228", + "26.4.1": "116.0.5845.228", + "26.4.2": "116.0.5845.228", + "26.4.3": "116.0.5845.228", + "26.5.0": "116.0.5845.228", + "26.6.0": "116.0.5845.228", + "26.6.1": "116.0.5845.228", + "26.6.2": "116.0.5845.228", + "26.6.3": "116.0.5845.228", + "26.6.4": "116.0.5845.228", + "26.6.5": "116.0.5845.228", + "26.6.6": "116.0.5845.228", + "26.6.7": "116.0.5845.228", + "26.6.8": "116.0.5845.228", + "26.6.9": "116.0.5845.228", + "26.6.10": "116.0.5845.228", + "27.0.0-alpha.1": "118.0.5949.0", + "27.0.0-alpha.2": "118.0.5949.0", + "27.0.0-alpha.3": "118.0.5949.0", + "27.0.0-alpha.4": "118.0.5949.0", + "27.0.0-alpha.5": "118.0.5949.0", + "27.0.0-alpha.6": "118.0.5949.0", + "27.0.0-beta.1": "118.0.5993.5", + "27.0.0-beta.2": "118.0.5993.5", + "27.0.0-beta.3": "118.0.5993.5", + "27.0.0-beta.4": "118.0.5993.11", + "27.0.0-beta.5": "118.0.5993.18", + "27.0.0-beta.6": "118.0.5993.18", + "27.0.0-beta.7": "118.0.5993.18", + "27.0.0-beta.8": "118.0.5993.18", + "27.0.0-beta.9": "118.0.5993.18", + "27.0.0": "118.0.5993.54", + "27.0.1": "118.0.5993.89", + "27.0.2": "118.0.5993.89", + "27.0.3": "118.0.5993.120", + "27.0.4": "118.0.5993.129", + "27.1.0": "118.0.5993.144", + "27.1.2": "118.0.5993.144", + "27.1.3": "118.0.5993.159", + "27.2.0": "118.0.5993.159", + "27.2.1": "118.0.5993.159", + "27.2.2": "118.0.5993.159", + "27.2.3": "118.0.5993.159", + "27.2.4": "118.0.5993.159", + "27.3.0": "118.0.5993.159", + "27.3.1": "118.0.5993.159", + "27.3.2": "118.0.5993.159", + "27.3.3": "118.0.5993.159", + "27.3.4": "118.0.5993.159", + "27.3.5": "118.0.5993.159", + "27.3.6": "118.0.5993.159", + "27.3.7": "118.0.5993.159", + "27.3.8": "118.0.5993.159", + "27.3.9": "118.0.5993.159", + "27.3.10": "118.0.5993.159", + "27.3.11": "118.0.5993.159", + "28.0.0-alpha.1": "119.0.6045.0", + "28.0.0-alpha.2": "119.0.6045.0", + "28.0.0-alpha.3": "119.0.6045.21", + "28.0.0-alpha.4": "119.0.6045.21", + "28.0.0-alpha.5": "119.0.6045.33", + "28.0.0-alpha.6": "119.0.6045.33", + "28.0.0-alpha.7": "119.0.6045.33", + "28.0.0-beta.1": "119.0.6045.33", + "28.0.0-beta.2": "120.0.6099.0", + "28.0.0-beta.3": "120.0.6099.5", + "28.0.0-beta.4": "120.0.6099.5", + "28.0.0-beta.5": "120.0.6099.18", + "28.0.0-beta.6": "120.0.6099.18", + "28.0.0-beta.7": "120.0.6099.18", + "28.0.0-beta.8": "120.0.6099.18", + "28.0.0-beta.9": "120.0.6099.18", + "28.0.0-beta.10": "120.0.6099.18", + "28.0.0-beta.11": "120.0.6099.35", + "28.0.0": "120.0.6099.56", + "28.1.0": "120.0.6099.109", + "28.1.1": "120.0.6099.109", + "28.1.2": "120.0.6099.199", + "28.1.3": "120.0.6099.199", + "28.1.4": "120.0.6099.216", + "28.2.0": "120.0.6099.227", + "28.2.1": "120.0.6099.268", + "28.2.2": "120.0.6099.276", + "28.2.3": "120.0.6099.283", + "28.2.4": "120.0.6099.291", + "28.2.5": "120.0.6099.291", + "28.2.6": "120.0.6099.291", + "28.2.7": "120.0.6099.291", + "28.2.8": "120.0.6099.291", + "28.2.9": "120.0.6099.291", + "28.2.10": "120.0.6099.291", + "28.3.0": "120.0.6099.291", + "28.3.1": "120.0.6099.291", + "28.3.2": "120.0.6099.291", + "28.3.3": "120.0.6099.291", + "29.0.0-alpha.1": "121.0.6147.0", + "29.0.0-alpha.2": "121.0.6147.0", + "29.0.0-alpha.3": "121.0.6147.0", + "29.0.0-alpha.4": "121.0.6159.0", + "29.0.0-alpha.5": "121.0.6159.0", + "29.0.0-alpha.6": "121.0.6159.0", + "29.0.0-alpha.7": "121.0.6159.0", + "29.0.0-alpha.8": "122.0.6194.0", + "29.0.0-alpha.9": "122.0.6236.2", + "29.0.0-alpha.10": "122.0.6236.2", + "29.0.0-alpha.11": "122.0.6236.2", + "29.0.0-beta.1": "122.0.6236.2", + "29.0.0-beta.2": "122.0.6236.2", + "29.0.0-beta.3": "122.0.6261.6", + "29.0.0-beta.4": "122.0.6261.6", + "29.0.0-beta.5": "122.0.6261.18", + "29.0.0-beta.6": "122.0.6261.18", + "29.0.0-beta.7": "122.0.6261.18", + "29.0.0-beta.8": "122.0.6261.18", + "29.0.0-beta.9": "122.0.6261.18", + "29.0.0-beta.10": "122.0.6261.18", + "29.0.0-beta.11": "122.0.6261.18", + "29.0.0-beta.12": "122.0.6261.29", + "29.0.0": "122.0.6261.39", + "29.0.1": "122.0.6261.57", + "29.1.0": "122.0.6261.70", + "29.1.1": "122.0.6261.111", + "29.1.2": "122.0.6261.112", + "29.1.3": "122.0.6261.112", + "29.1.4": "122.0.6261.129", + "29.1.5": "122.0.6261.130", + "29.1.6": "122.0.6261.139", + "29.2.0": "122.0.6261.156", + "29.3.0": "122.0.6261.156", + "29.3.1": "122.0.6261.156", + "29.3.2": "122.0.6261.156", + "29.3.3": "122.0.6261.156", + "29.4.0": "122.0.6261.156", + "29.4.1": "122.0.6261.156", + "29.4.2": "122.0.6261.156", + "29.4.3": "122.0.6261.156", + "29.4.4": "122.0.6261.156", + "29.4.5": "122.0.6261.156", + "29.4.6": "122.0.6261.156", + "30.0.0-alpha.1": "123.0.6296.0", + "30.0.0-alpha.2": "123.0.6312.5", + "30.0.0-alpha.3": "124.0.6323.0", + "30.0.0-alpha.4": "124.0.6323.0", + "30.0.0-alpha.5": "124.0.6331.0", + "30.0.0-alpha.6": "124.0.6331.0", + "30.0.0-alpha.7": "124.0.6353.0", + "30.0.0-beta.1": "124.0.6359.0", + "30.0.0-beta.2": "124.0.6359.0", + "30.0.0-beta.3": "124.0.6367.9", + "30.0.0-beta.4": "124.0.6367.9", + "30.0.0-beta.5": "124.0.6367.9", + "30.0.0-beta.6": "124.0.6367.18", + "30.0.0-beta.7": "124.0.6367.29", + "30.0.0-beta.8": "124.0.6367.29", + "30.0.0": "124.0.6367.49", + "30.0.1": "124.0.6367.60", + "30.0.2": "124.0.6367.91", + "30.0.3": "124.0.6367.119", + "30.0.4": "124.0.6367.201", + "30.0.5": "124.0.6367.207", + "30.0.6": "124.0.6367.207", + "30.0.7": "124.0.6367.221", + "30.0.8": "124.0.6367.230", + "30.0.9": "124.0.6367.233", + "30.1.0": "124.0.6367.243", + "30.1.1": "124.0.6367.243", + "30.1.2": "124.0.6367.243", + "30.2.0": "124.0.6367.243", + "30.3.0": "124.0.6367.243", + "30.3.1": "124.0.6367.243", + "30.4.0": "124.0.6367.243", + "30.5.0": "124.0.6367.243", + "30.5.1": "124.0.6367.243", + "31.0.0-alpha.1": "125.0.6412.0", + "31.0.0-alpha.2": "125.0.6412.0", + "31.0.0-alpha.3": "125.0.6412.0", + "31.0.0-alpha.4": "125.0.6412.0", + "31.0.0-alpha.5": "125.0.6412.0", + "31.0.0-beta.1": "126.0.6445.0", + "31.0.0-beta.2": "126.0.6445.0", + "31.0.0-beta.3": "126.0.6445.0", + "31.0.0-beta.4": "126.0.6445.0", + "31.0.0-beta.5": "126.0.6445.0", + "31.0.0-beta.6": "126.0.6445.0", + "31.0.0-beta.7": "126.0.6445.0", + "31.0.0-beta.8": "126.0.6445.0", + "31.0.0-beta.9": "126.0.6445.0", + "31.0.0-beta.10": "126.0.6478.36", + "31.0.0": "126.0.6478.36", + "31.0.1": "126.0.6478.36", + "31.0.2": "126.0.6478.61", + "31.1.0": "126.0.6478.114", + "31.2.0": "126.0.6478.127", + "31.2.1": "126.0.6478.127", + "31.3.0": "126.0.6478.183", + "31.3.1": "126.0.6478.185", + "31.4.0": "126.0.6478.234", + "31.5.0": "126.0.6478.234", + "31.6.0": "126.0.6478.234", + "31.7.0": "126.0.6478.234", + "31.7.1": "126.0.6478.234", + "31.7.2": "126.0.6478.234", + "31.7.3": "126.0.6478.234", + "31.7.4": "126.0.6478.234", + "31.7.5": "126.0.6478.234", + "31.7.6": "126.0.6478.234", + "31.7.7": "126.0.6478.234", + "32.0.0-alpha.1": "127.0.6521.0", + "32.0.0-alpha.2": "127.0.6521.0", + "32.0.0-alpha.3": "127.0.6521.0", + "32.0.0-alpha.4": "127.0.6521.0", + "32.0.0-alpha.5": "127.0.6521.0", + "32.0.0-alpha.6": "128.0.6571.0", + "32.0.0-alpha.7": "128.0.6571.0", + "32.0.0-alpha.8": "128.0.6573.0", + "32.0.0-alpha.9": "128.0.6573.0", + "32.0.0-alpha.10": "128.0.6573.0", + "32.0.0-beta.1": "128.0.6573.0", + "32.0.0-beta.2": "128.0.6611.0", + "32.0.0-beta.3": "128.0.6613.7", + "32.0.0-beta.4": "128.0.6613.18", + "32.0.0-beta.5": "128.0.6613.27", + "32.0.0-beta.6": "128.0.6613.27", + "32.0.0-beta.7": "128.0.6613.27", + "32.0.0": "128.0.6613.36", + "32.0.1": "128.0.6613.36", + "32.0.2": "128.0.6613.84", + "32.1.0": "128.0.6613.120", + "32.1.1": "128.0.6613.137", + "32.1.2": "128.0.6613.162", + "32.2.0": "128.0.6613.178", + "32.2.1": "128.0.6613.186", + "32.2.2": "128.0.6613.186", + "32.2.3": "128.0.6613.186", + "32.2.4": "128.0.6613.186", + "32.2.5": "128.0.6613.186", + "32.2.6": "128.0.6613.186", + "32.2.7": "128.0.6613.186", + "32.2.8": "128.0.6613.186", + "32.3.0": "128.0.6613.186", + "32.3.1": "128.0.6613.186", + "32.3.2": "128.0.6613.186", + "32.3.3": "128.0.6613.186", + "33.0.0-alpha.1": "129.0.6668.0", + "33.0.0-alpha.2": "130.0.6672.0", + "33.0.0-alpha.3": "130.0.6672.0", + "33.0.0-alpha.4": "130.0.6672.0", + "33.0.0-alpha.5": "130.0.6672.0", + "33.0.0-alpha.6": "130.0.6672.0", + "33.0.0-beta.1": "130.0.6672.0", + "33.0.0-beta.2": "130.0.6672.0", + "33.0.0-beta.3": "130.0.6672.0", + "33.0.0-beta.4": "130.0.6672.0", + "33.0.0-beta.5": "130.0.6723.19", + "33.0.0-beta.6": "130.0.6723.19", + "33.0.0-beta.7": "130.0.6723.19", + "33.0.0-beta.8": "130.0.6723.31", + "33.0.0-beta.9": "130.0.6723.31", + "33.0.0-beta.10": "130.0.6723.31", + "33.0.0-beta.11": "130.0.6723.44", + "33.0.0": "130.0.6723.44", + "33.0.1": "130.0.6723.59", + "33.0.2": "130.0.6723.59", + "33.1.0": "130.0.6723.91", + "33.2.0": "130.0.6723.118", + "33.2.1": "130.0.6723.137", + "33.3.0": "130.0.6723.152", + "33.3.1": "130.0.6723.170", + "33.3.2": "130.0.6723.191", + "33.4.0": "130.0.6723.191", + "33.4.1": "130.0.6723.191", + "33.4.2": "130.0.6723.191", + "33.4.3": "130.0.6723.191", + "33.4.4": "130.0.6723.191", + "33.4.5": "130.0.6723.191", + "33.4.6": "130.0.6723.191", + "33.4.7": "130.0.6723.191", + "33.4.8": "130.0.6723.191", + "33.4.9": "130.0.6723.191", + "33.4.10": "130.0.6723.191", + "33.4.11": "130.0.6723.191", + "34.0.0-alpha.1": "131.0.6776.0", + "34.0.0-alpha.2": "132.0.6779.0", + "34.0.0-alpha.3": "132.0.6789.1", + "34.0.0-alpha.4": "132.0.6789.1", + "34.0.0-alpha.5": "132.0.6789.1", + "34.0.0-alpha.6": "132.0.6789.1", + "34.0.0-alpha.7": "132.0.6789.1", + "34.0.0-alpha.8": "132.0.6820.0", + "34.0.0-alpha.9": "132.0.6824.0", + "34.0.0-beta.1": "132.0.6824.0", + "34.0.0-beta.2": "132.0.6824.0", + "34.0.0-beta.3": "132.0.6824.0", + "34.0.0-beta.4": "132.0.6834.6", + "34.0.0-beta.5": "132.0.6834.6", + "34.0.0-beta.6": "132.0.6834.15", + "34.0.0-beta.7": "132.0.6834.15", + "34.0.0-beta.8": "132.0.6834.15", + "34.0.0-beta.9": "132.0.6834.32", + "34.0.0-beta.10": "132.0.6834.32", + "34.0.0-beta.11": "132.0.6834.32", + "34.0.0-beta.12": "132.0.6834.46", + "34.0.0-beta.13": "132.0.6834.46", + "34.0.0-beta.14": "132.0.6834.57", + "34.0.0-beta.15": "132.0.6834.57", + "34.0.0-beta.16": "132.0.6834.57", + "34.0.0": "132.0.6834.83", + "34.0.1": "132.0.6834.83", + "34.0.2": "132.0.6834.159", + "34.1.0": "132.0.6834.194", + "34.1.1": "132.0.6834.194", + "34.2.0": "132.0.6834.196", + "34.3.0": "132.0.6834.210", + "34.3.1": "132.0.6834.210", + "34.3.2": "132.0.6834.210", + "34.3.3": "132.0.6834.210", + "34.3.4": "132.0.6834.210", + "34.4.0": "132.0.6834.210", + "34.4.1": "132.0.6834.210", + "34.5.0": "132.0.6834.210", + "34.5.1": "132.0.6834.210", + "34.5.2": "132.0.6834.210", + "34.5.3": "132.0.6834.210", + "34.5.4": "132.0.6834.210", + "34.5.5": "132.0.6834.210", + "34.5.6": "132.0.6834.210", + "34.5.7": "132.0.6834.210", + "34.5.8": "132.0.6834.210", + "35.0.0-alpha.1": "133.0.6920.0", + "35.0.0-alpha.2": "133.0.6920.0", + "35.0.0-alpha.3": "133.0.6920.0", + "35.0.0-alpha.4": "133.0.6920.0", + "35.0.0-alpha.5": "133.0.6920.0", + "35.0.0-beta.1": "133.0.6920.0", + "35.0.0-beta.2": "134.0.6968.0", + "35.0.0-beta.3": "134.0.6968.0", + "35.0.0-beta.4": "134.0.6968.0", + "35.0.0-beta.5": "134.0.6989.0", + "35.0.0-beta.6": "134.0.6990.0", + "35.0.0-beta.7": "134.0.6990.0", + "35.0.0-beta.8": "134.0.6998.10", + "35.0.0-beta.9": "134.0.6998.10", + "35.0.0-beta.10": "134.0.6998.23", + "35.0.0-beta.11": "134.0.6998.23", + "35.0.0-beta.12": "134.0.6998.23", + "35.0.0-beta.13": "134.0.6998.44", + "35.0.0": "134.0.6998.44", + "35.0.1": "134.0.6998.44", + "35.0.2": "134.0.6998.88", + "35.0.3": "134.0.6998.88", + "35.1.0": "134.0.6998.165", + "35.1.1": "134.0.6998.165", + "35.1.2": "134.0.6998.178", + "35.1.3": "134.0.6998.179", + "35.1.4": "134.0.6998.179", + "35.1.5": "134.0.6998.179", + "35.2.0": "134.0.6998.205", + "35.2.1": "134.0.6998.205", + "35.2.2": "134.0.6998.205", + "35.3.0": "134.0.6998.205", + "35.4.0": "134.0.6998.205", + "35.5.0": "134.0.6998.205", + "35.5.1": "134.0.6998.205", + "35.6.0": "134.0.6998.205", + "35.7.0": "134.0.6998.205", + "35.7.1": "134.0.6998.205", + "35.7.2": "134.0.6998.205", + "35.7.4": "134.0.6998.205", + "35.7.5": "134.0.6998.205", + "36.0.0-alpha.1": "135.0.7049.5", + "36.0.0-alpha.2": "136.0.7062.0", + "36.0.0-alpha.3": "136.0.7062.0", + "36.0.0-alpha.4": "136.0.7062.0", + "36.0.0-alpha.5": "136.0.7067.0", + "36.0.0-alpha.6": "136.0.7067.0", + "36.0.0-beta.1": "136.0.7067.0", + "36.0.0-beta.2": "136.0.7067.0", + "36.0.0-beta.3": "136.0.7067.0", + "36.0.0-beta.4": "136.0.7067.0", + "36.0.0-beta.5": "136.0.7103.17", + "36.0.0-beta.6": "136.0.7103.25", + "36.0.0-beta.7": "136.0.7103.25", + "36.0.0-beta.8": "136.0.7103.33", + "36.0.0-beta.9": "136.0.7103.33", + "36.0.0": "136.0.7103.48", + "36.0.1": "136.0.7103.48", + "36.1.0": "136.0.7103.49", + "36.2.0": "136.0.7103.49", + "36.2.1": "136.0.7103.93", + "36.3.0": "136.0.7103.113", + "36.3.1": "136.0.7103.113", + "36.3.2": "136.0.7103.115", + "36.4.0": "136.0.7103.149", + "36.5.0": "136.0.7103.168", + "36.6.0": "136.0.7103.177", + "36.7.0": "136.0.7103.177", + "36.7.1": "136.0.7103.177", + "36.7.3": "136.0.7103.177", + "36.7.4": "136.0.7103.177", + "36.8.0": "136.0.7103.177", + "36.8.1": "136.0.7103.177", + "36.9.0": "136.0.7103.177", + "36.9.1": "136.0.7103.177", + "36.9.2": "136.0.7103.177", + "36.9.3": "136.0.7103.177", + "36.9.4": "136.0.7103.177", + "36.9.5": "136.0.7103.177", + "37.0.0-alpha.1": "137.0.7151.0", + "37.0.0-alpha.2": "137.0.7151.0", + "37.0.0-alpha.3": "138.0.7156.0", + "37.0.0-alpha.4": "138.0.7165.0", + "37.0.0-alpha.5": "138.0.7177.0", + "37.0.0-alpha.6": "138.0.7178.0", + "37.0.0-alpha.7": "138.0.7178.0", + "37.0.0-beta.1": "138.0.7178.0", + "37.0.0-beta.2": "138.0.7178.0", + "37.0.0-beta.3": "138.0.7190.0", + "37.0.0-beta.4": "138.0.7204.15", + "37.0.0-beta.5": "138.0.7204.15", + "37.0.0-beta.6": "138.0.7204.15", + "37.0.0-beta.7": "138.0.7204.15", + "37.0.0-beta.8": "138.0.7204.23", + "37.0.0-beta.9": "138.0.7204.35", + "37.0.0": "138.0.7204.35", + "37.1.0": "138.0.7204.35", + "37.2.0": "138.0.7204.97", + "37.2.1": "138.0.7204.97", + "37.2.2": "138.0.7204.100", + "37.2.3": "138.0.7204.100", + "37.2.4": "138.0.7204.157", + "37.2.5": "138.0.7204.168", + "37.2.6": "138.0.7204.185", + "37.3.0": "138.0.7204.224", + "37.3.1": "138.0.7204.235", + "37.4.0": "138.0.7204.243", + "37.5.0": "138.0.7204.251", + "37.5.1": "138.0.7204.251", + "37.6.0": "138.0.7204.251", + "37.6.1": "138.0.7204.251", + "37.7.0": "138.0.7204.251", + "37.7.1": "138.0.7204.251", + "37.8.0": "138.0.7204.251", + "37.9.0": "138.0.7204.251", + "37.10.0": "138.0.7204.251", + "37.10.1": "138.0.7204.251", + "37.10.2": "138.0.7204.251", + "37.10.3": "138.0.7204.251", + "38.0.0-alpha.1": "139.0.7219.0", + "38.0.0-alpha.2": "139.0.7219.0", + "38.0.0-alpha.3": "139.0.7219.0", + "38.0.0-alpha.4": "140.0.7261.0", + "38.0.0-alpha.5": "140.0.7261.0", + "38.0.0-alpha.6": "140.0.7261.0", + "38.0.0-alpha.7": "140.0.7281.0", + "38.0.0-alpha.8": "140.0.7281.0", + "38.0.0-alpha.9": "140.0.7301.0", + "38.0.0-alpha.10": "140.0.7309.0", + "38.0.0-alpha.11": "140.0.7312.0", + "38.0.0-alpha.12": "140.0.7314.0", + "38.0.0-alpha.13": "140.0.7314.0", + "38.0.0-beta.1": "140.0.7314.0", + "38.0.0-beta.2": "140.0.7327.0", + "38.0.0-beta.3": "140.0.7327.0", + "38.0.0-beta.4": "140.0.7339.2", + "38.0.0-beta.5": "140.0.7339.2", + "38.0.0-beta.6": "140.0.7339.2", + "38.0.0-beta.7": "140.0.7339.16", + "38.0.0-beta.8": "140.0.7339.24", + "38.0.0-beta.9": "140.0.7339.24", + "38.0.0-beta.11": "140.0.7339.41", + "38.0.0": "140.0.7339.41", + "38.1.0": "140.0.7339.80", + "38.1.1": "140.0.7339.133", + "38.1.2": "140.0.7339.133", + "38.2.0": "140.0.7339.133", + "38.2.1": "140.0.7339.133", + "38.2.2": "140.0.7339.133", + "38.3.0": "140.0.7339.240", + "38.4.0": "140.0.7339.240", + "38.5.0": "140.0.7339.249", + "38.6.0": "140.0.7339.249", + "38.7.0": "140.0.7339.249", + "38.7.1": "140.0.7339.249", + "38.7.2": "140.0.7339.249", + "38.8.0": "140.0.7339.249", + "38.8.1": "140.0.7339.249", + "38.8.2": "140.0.7339.249", + "38.8.4": "140.0.7339.249", + "38.8.6": "140.0.7339.249", + "39.0.0-alpha.1": "141.0.7361.0", + "39.0.0-alpha.2": "141.0.7361.0", + "39.0.0-alpha.3": "141.0.7390.7", + "39.0.0-alpha.4": "141.0.7390.7", + "39.0.0-alpha.5": "141.0.7390.7", + "39.0.0-alpha.6": "142.0.7417.0", + "39.0.0-alpha.7": "142.0.7417.0", + "39.0.0-alpha.8": "142.0.7417.0", + "39.0.0-alpha.9": "142.0.7417.0", + "39.0.0-beta.1": "142.0.7417.0", + "39.0.0-beta.2": "142.0.7417.0", + "39.0.0-beta.3": "142.0.7417.0", + "39.0.0-beta.4": "142.0.7444.34", + "39.0.0-beta.5": "142.0.7444.34", + "39.0.0": "142.0.7444.52", + "39.1.0": "142.0.7444.59", + "39.1.1": "142.0.7444.59", + "39.1.2": "142.0.7444.134", + "39.2.0": "142.0.7444.162", + "39.2.1": "142.0.7444.162", + "39.2.2": "142.0.7444.162", + "39.2.3": "142.0.7444.175", + "39.2.4": "142.0.7444.177", + "39.2.5": "142.0.7444.177", + "39.2.6": "142.0.7444.226", + "39.2.7": "142.0.7444.235", + "39.3.0": "142.0.7444.265", + "39.4.0": "142.0.7444.265", + "39.5.0": "142.0.7444.265", + "39.5.1": "142.0.7444.265", + "39.5.2": "142.0.7444.265", + "39.6.0": "142.0.7444.265", + "39.6.1": "142.0.7444.265", + "39.7.0": "142.0.7444.265", + "39.8.0": "142.0.7444.265", + "39.8.1": "142.0.7444.265", + "39.8.2": "142.0.7444.265", + "39.8.3": "142.0.7444.265", + "39.8.4": "142.0.7444.265", + "39.8.5": "142.0.7444.265", + "39.8.6": "142.0.7444.265", + "39.8.7": "142.0.7444.265", + "39.8.8": "142.0.7444.265", + "39.8.9": "142.0.7444.265", + "39.8.10": "142.0.7444.265", + "40.0.0-alpha.2": "143.0.7499.0", + "40.0.0-alpha.4": "144.0.7506.0", + "40.0.0-alpha.5": "144.0.7526.0", + "40.0.0-alpha.6": "144.0.7526.0", + "40.0.0-alpha.7": "144.0.7526.0", + "40.0.0-alpha.8": "144.0.7526.0", + "40.0.0-beta.1": "144.0.7527.0", + "40.0.0-beta.2": "144.0.7527.0", + "40.0.0-beta.3": "144.0.7547.0", + "40.0.0-beta.4": "144.0.7547.0", + "40.0.0-beta.5": "144.0.7547.0", + "40.0.0-beta.6": "144.0.7559.31", + "40.0.0-beta.7": "144.0.7559.31", + "40.0.0-beta.8": "144.0.7559.31", + "40.0.0-beta.9": "144.0.7559.60", + "40.0.0": "144.0.7559.60", + "40.1.0": "144.0.7559.96", + "40.2.0": "144.0.7559.111", + "40.2.1": "144.0.7559.111", + "40.3.0": "144.0.7559.134", + "40.4.0": "144.0.7559.134", + "40.4.1": "144.0.7559.173", + "40.5.0": "144.0.7559.177", + "40.6.0": "144.0.7559.177", + "40.6.1": "144.0.7559.220", + "40.7.0": "144.0.7559.225", + "40.8.0": "144.0.7559.236", + "40.8.1": "144.0.7559.236", + "40.8.2": "144.0.7559.236", + "40.8.3": "144.0.7559.236", + "40.8.4": "144.0.7559.236", + "40.8.5": "144.0.7559.236", + "40.9.0": "144.0.7559.236", + "40.9.1": "144.0.7559.236", + "40.9.2": "144.0.7559.236", + "40.9.3": "144.0.7559.236", + "40.10.0": "144.0.7559.236", + "40.10.1": "144.0.7559.236", + "40.10.2": "144.0.7559.236", + "40.10.3": "144.0.7559.236", + "40.10.4": "144.0.7559.236", + "40.10.5": "144.0.7559.236", + "40.10.6": "144.0.7559.236", + "41.0.0-alpha.1": "146.0.7635.0", + "41.0.0-alpha.2": "146.0.7635.0", + "41.0.0-alpha.3": "146.0.7645.0", + "41.0.0-alpha.4": "146.0.7650.0", + "41.0.0-alpha.5": "146.0.7650.0", + "41.0.0-alpha.6": "146.0.7650.0", + "41.0.0-beta.1": "146.0.7650.0", + "41.0.0-beta.2": "146.0.7650.0", + "41.0.0-beta.3": "146.0.7650.0", + "41.0.0-beta.4": "146.0.7666.0", + "41.0.0-beta.5": "146.0.7680.16", + "41.0.0-beta.6": "146.0.7680.16", + "41.0.0-beta.7": "146.0.7680.31", + "41.0.0-beta.8": "146.0.7680.31", + "41.0.0": "146.0.7680.65", + "41.0.1": "146.0.7680.72", + "41.0.2": "146.0.7680.72", + "41.0.3": "146.0.7680.80", + "41.0.4": "146.0.7680.153", + "41.1.0": "146.0.7680.166", + "41.1.1": "146.0.7680.166", + "41.2.0": "146.0.7680.179", + "41.2.1": "146.0.7680.188", + "41.2.2": "146.0.7680.188", + "41.3.0": "146.0.7680.188", + "41.4.0": "146.0.7680.216", + "41.5.0": "146.0.7680.216", + "41.5.1": "146.0.7680.216", + "41.5.2": "146.0.7680.216", + "41.6.0": "146.0.7680.216", + "41.6.1": "146.0.7680.216", + "41.7.0": "146.0.7680.216", + "41.7.1": "146.0.7680.216", + "41.7.2": "146.0.7680.216", + "41.8.0": "146.0.7680.216", + "41.9.0": "146.0.7680.216", + "41.9.1": "146.0.7680.216", + "41.9.2": "146.0.7680.216", + "41.10.0": "146.0.7680.216", + "41.10.1": "146.0.7680.216", + "41.10.2": "146.0.7680.216", + "41.10.3": "146.0.7680.216", + "41.10.4": "146.0.7680.216", + "41.10.5": "146.0.7680.216", + "41.10.6": "146.0.7680.216", + "41.10.7": "146.0.7680.216", + "42.0.0-alpha.1": "147.0.7727.0", + "42.0.0-alpha.2": "148.0.7733.0", + "42.0.0-alpha.4": "148.0.7738.0", + "42.0.0-alpha.5": "148.0.7741.0", + "42.0.0-alpha.6": "148.0.7751.0", + "42.0.0-beta.1": "148.0.7751.0", + "42.0.0-beta.2": "148.0.7778.0", + "42.0.0-beta.3": "148.0.7778.5", + "42.0.0-beta.4": "148.0.7778.5", + "42.0.0-beta.5": "148.0.7778.5", + "42.0.0-beta.6": "148.0.7778.5", + "42.0.0-beta.7": "148.0.7778.56", + "42.0.0-beta.8": "148.0.7778.56", + "42.0.0": "148.0.7778.96", + "42.0.1": "148.0.7778.97", + "42.1.0": "148.0.7778.97", + "42.2.0": "148.0.7778.97", + "42.3.0": "148.0.7778.180", + "42.3.1": "148.0.7778.218", + "42.3.2": "148.0.7778.218", + "42.3.3": "148.0.7778.218", + "42.4.0": "148.0.7778.254", + "42.4.1": "148.0.7778.265", + "42.5.0": "148.0.7778.271", + "42.5.1": "148.0.7778.271", + "42.5.2": "148.0.7778.271", + "42.6.0": "148.0.7778.280", + "42.6.1": "148.0.7778.280", + "42.6.2": "148.0.7778.280", + "42.7.0": "148.0.7778.280", + "42.7.1": "148.0.7778.280", + "42.8.0": "148.0.7778.280", + "42.8.1": "148.0.7778.280", + "42.9.0": "148.0.7778.280", + "42.9.1": "148.0.7778.280", + "42.9.2": "148.0.7778.280", + "42.9.3": "148.0.7778.280", + "42.10.0": "148.0.7778.280", + "42.10.1": "148.0.7778.280", + "42.11.0": "148.0.7778.280", + "42.11.1": "148.0.7778.280", + "42.11.2": "148.0.7778.280", + "42.11.3": "148.0.7778.280", + "42.11.4": "148.0.7778.280", + "42.11.5": "148.0.7778.280", + "42.11.6": "148.0.7778.280", + "42.11.7": "148.0.7778.280", + "42.11.8": "148.0.7778.280", + "42.11.9": "148.0.7778.280", + "42.11.10": "148.0.7778.280", + "42.11.11": "148.0.7778.280", + "42.11.12": "148.0.7778.280", + "43.0.0-alpha.1": "149.0.7827.0", + "43.0.0-alpha.2": "150.0.7832.0", + "43.0.0-alpha.3": "150.0.7834.0", + "43.0.0-alpha.4": "150.0.7834.0", + "43.0.0-alpha.5": "150.0.7834.0", + "43.0.0-alpha.6": "150.0.7834.0", + "43.0.0-alpha.7": "150.0.7849.0", + "43.0.0-beta.1": "150.0.7863.0", + "43.0.0-beta.2": "150.0.7863.0", + "43.0.0-beta.3": "150.0.7863.0", + "43.0.0-beta.4": "150.0.7871.13", + "43.0.0-beta.5": "150.0.7871.13", + "43.0.0-beta.6": "150.0.7871.24", + "43.0.0-beta.7": "150.0.7871.24", + "43.0.0-beta.8": "150.0.7871.24", + "43.0.0": "150.0.7871.46", + "43.1.0": "150.0.7871.47", + "43.1.1": "150.0.7871.114", + "43.2.0": "150.0.7871.129", + "43.3.0": "150.0.7871.212", + "43.4.0": "150.0.7871.224", + "43.4.1": "150.0.7871.224", + "43.5.0": "150.0.7871.250", + "43.5.1": "150.0.7871.250", + "43.6.0": "150.0.7871.250", + "43.7.0": "150.0.7871.250", + "43.7.1": "150.0.7871.250", + "43.7.2": "150.0.7871.250", + "43.7.3": "150.0.7871.250", + "43.7.4": "150.0.7871.250", + "43.7.5": "150.0.7871.250", + "43.7.6": "150.0.7871.250", + "43.7.7": "150.0.7871.250", + "43.7.8": "150.0.7871.250", + "43.7.9": "150.0.7871.250", + "44.0.0-alpha.1": "151.0.7900.0", + "44.0.0-alpha.2": "151.0.7900.0", + "44.0.0-alpha.3": "151.0.7900.0", + "44.0.0-alpha.4": "152.0.7938.0", + "44.0.0-alpha.5": "152.0.7938.0", + "44.0.0-alpha.6": "152.0.7954.0", + "44.0.0-alpha.7": "152.0.7969.0", + "44.0.0-alpha.8": "152.0.7977.0", + "44.0.0-alpha.9": "152.0.7977.8", + "44.0.0-beta.1": "152.0.7977.8", + "44.0.0-beta.2": "152.0.7977.30", + "44.0.0-beta.3": "152.0.7977.30", + "44.0.0-beta.4": "152.0.7977.30", + "44.0.0-beta.5": "152.0.7977.30", + "44.0.0-beta.6": "152.0.7977.30", + "44.0.0": "152.0.7977.54", + "44.1.0": "152.0.7977.65", + "44.1.1": "152.0.7977.65", + "44.2.0": "152.0.7977.76", + "44.3.0": "152.0.7977.78", + "44.4.0": "152.0.7977.78", + "44.4.1": "152.0.7977.78", + "44.4.2": "152.0.7977.130", + "44.4.3": "152.0.7977.130", + "44.4.4": "152.0.7977.130", + "44.4.5": "152.0.7977.130", + "44.5.0": "152.0.7977.130", + "44.5.1": "152.0.7977.130", + "44.6.0": "152.0.7977.130", + "44.7.0": "152.0.7977.130", + "45.0.0-alpha.1": "154.0.8025.0", + "45.0.0-alpha.2": "154.0.8029.0", + "45.0.0-alpha.3": "154.0.8029.0", + "45.0.0-alpha.4": "155.0.8038.2", + "45.0.0-alpha.5": "155.0.8038.2", + "45.0.0-alpha.6": "155.0.8038.2", + "45.0.0-alpha.7": "155.0.8038.2", + "45.0.0-alpha.8": "155.0.8046.0", + "45.0.0-alpha.9": "155.0.8046.0", + "45.0.0-alpha.10": "155.0.8046.0", + "45.0.0-alpha.11": "155.0.8046.0", + "45.0.0-alpha.12": "155.0.8046.0", + "45.0.0-alpha.13": "155.0.8046.0", + "45.0.0-alpha.14": "156.0.8077.0", + "45.0.0-alpha.15": "156.0.8077.0", + "45.0.0-alpha.16": "156.0.8077.0", + "45.0.0-beta.1": "156.0.8078.12" +}; \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/full-versions.json b/e-commerce/node_modules/electron-to-chromium/full-versions.json new file mode 100644 index 0000000000000000000000000000000000000000..70b4016ef579e7441accd9b16fee9e9725486efa --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/full-versions.json @@ -0,0 +1 @@ +{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.11":"82.0.4085.14","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.10":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.25":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","13.6.6":"91.0.4472.164","13.6.7":"91.0.4472.164","13.6.8":"91.0.4472.164","13.6.9":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","14.2.3":"93.0.4577.82","14.2.4":"93.0.4577.82","14.2.5":"93.0.4577.82","14.2.6":"93.0.4577.82","14.2.7":"93.0.4577.82","14.2.8":"93.0.4577.82","14.2.9":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","15.3.4":"94.0.4606.81","15.3.5":"94.0.4606.81","15.3.6":"94.0.4606.81","15.3.7":"94.0.4606.81","15.4.0":"94.0.4606.81","15.4.1":"94.0.4606.81","15.4.2":"94.0.4606.81","15.5.0":"94.0.4606.81","15.5.1":"94.0.4606.81","15.5.2":"94.0.4606.81","15.5.3":"94.0.4606.81","15.5.4":"94.0.4606.81","15.5.5":"94.0.4606.81","15.5.6":"94.0.4606.81","15.5.7":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","16.0.4":"96.0.4664.55","16.0.5":"96.0.4664.55","16.0.6":"96.0.4664.110","16.0.7":"96.0.4664.110","16.0.8":"96.0.4664.110","16.0.9":"96.0.4664.174","16.0.10":"96.0.4664.174","16.1.0":"96.0.4664.174","16.1.1":"96.0.4664.174","16.2.0":"96.0.4664.174","16.2.1":"96.0.4664.174","16.2.2":"96.0.4664.174","16.2.3":"96.0.4664.174","16.2.4":"96.0.4664.174","16.2.5":"96.0.4664.174","16.2.6":"96.0.4664.174","16.2.7":"96.0.4664.174","16.2.8":"96.0.4664.174","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-alpha.5":"98.0.4706.0","17.0.0-alpha.6":"98.0.4706.0","17.0.0-beta.1":"98.0.4706.0","17.0.0-beta.2":"98.0.4706.0","17.0.0-beta.3":"98.0.4758.9","17.0.0-beta.4":"98.0.4758.11","17.0.0-beta.5":"98.0.4758.11","17.0.0-beta.6":"98.0.4758.11","17.0.0-beta.7":"98.0.4758.11","17.0.0-beta.8":"98.0.4758.11","17.0.0-beta.9":"98.0.4758.11","17.0.0":"98.0.4758.74","17.0.1":"98.0.4758.82","17.1.0":"98.0.4758.102","17.1.1":"98.0.4758.109","17.1.2":"98.0.4758.109","17.2.0":"98.0.4758.109","17.3.0":"98.0.4758.141","17.3.1":"98.0.4758.141","17.4.0":"98.0.4758.141","17.4.1":"98.0.4758.141","17.4.2":"98.0.4758.141","17.4.3":"98.0.4758.141","17.4.4":"98.0.4758.141","17.4.5":"98.0.4758.141","17.4.6":"98.0.4758.141","17.4.7":"98.0.4758.141","17.4.8":"98.0.4758.141","17.4.9":"98.0.4758.141","17.4.10":"98.0.4758.141","17.4.11":"98.0.4758.141","18.0.0-alpha.1":"99.0.4767.0","18.0.0-alpha.2":"99.0.4767.0","18.0.0-alpha.3":"99.0.4767.0","18.0.0-alpha.4":"99.0.4767.0","18.0.0-alpha.5":"99.0.4767.0","18.0.0-beta.1":"100.0.4894.0","18.0.0-beta.2":"100.0.4894.0","18.0.0-beta.3":"100.0.4894.0","18.0.0-beta.4":"100.0.4894.0","18.0.0-beta.5":"100.0.4894.0","18.0.0-beta.6":"100.0.4894.0","18.0.0":"100.0.4896.56","18.0.1":"100.0.4896.60","18.0.2":"100.0.4896.60","18.0.3":"100.0.4896.75","18.0.4":"100.0.4896.75","18.1.0":"100.0.4896.127","18.2.0":"100.0.4896.143","18.2.1":"100.0.4896.143","18.2.2":"100.0.4896.143","18.2.3":"100.0.4896.143","18.2.4":"100.0.4896.160","18.3.0":"100.0.4896.160","18.3.1":"100.0.4896.160","18.3.2":"100.0.4896.160","18.3.3":"100.0.4896.160","18.3.4":"100.0.4896.160","18.3.5":"100.0.4896.160","18.3.6":"100.0.4896.160","18.3.7":"100.0.4896.160","18.3.8":"100.0.4896.160","18.3.9":"100.0.4896.160","18.3.11":"100.0.4896.160","18.3.12":"100.0.4896.160","18.3.13":"100.0.4896.160","18.3.14":"100.0.4896.160","18.3.15":"100.0.4896.160","19.0.0-alpha.1":"102.0.4962.3","19.0.0-alpha.2":"102.0.4971.0","19.0.0-alpha.3":"102.0.4971.0","19.0.0-alpha.4":"102.0.4989.0","19.0.0-alpha.5":"102.0.4989.0","19.0.0-beta.1":"102.0.4999.0","19.0.0-beta.2":"102.0.4999.0","19.0.0-beta.3":"102.0.4999.0","19.0.0-beta.4":"102.0.5005.27","19.0.0-beta.5":"102.0.5005.40","19.0.0-beta.6":"102.0.5005.40","19.0.0-beta.7":"102.0.5005.40","19.0.0-beta.8":"102.0.5005.49","19.0.0":"102.0.5005.61","19.0.1":"102.0.5005.61","19.0.2":"102.0.5005.63","19.0.3":"102.0.5005.63","19.0.4":"102.0.5005.63","19.0.5":"102.0.5005.115","19.0.6":"102.0.5005.115","19.0.7":"102.0.5005.134","19.0.8":"102.0.5005.148","19.0.9":"102.0.5005.167","19.0.10":"102.0.5005.167","19.0.11":"102.0.5005.167","19.0.12":"102.0.5005.167","19.0.13":"102.0.5005.167","19.0.14":"102.0.5005.167","19.0.15":"102.0.5005.167","19.0.16":"102.0.5005.167","19.0.17":"102.0.5005.167","19.1.0":"102.0.5005.167","19.1.1":"102.0.5005.167","19.1.2":"102.0.5005.167","19.1.3":"102.0.5005.167","19.1.4":"102.0.5005.167","19.1.5":"102.0.5005.167","19.1.6":"102.0.5005.167","19.1.7":"102.0.5005.167","19.1.8":"102.0.5005.167","19.1.9":"102.0.5005.167","20.0.0-alpha.1":"103.0.5044.0","20.0.0-alpha.2":"104.0.5073.0","20.0.0-alpha.3":"104.0.5073.0","20.0.0-alpha.4":"104.0.5073.0","20.0.0-alpha.5":"104.0.5073.0","20.0.0-alpha.6":"104.0.5073.0","20.0.0-alpha.7":"104.0.5073.0","20.0.0-beta.1":"104.0.5073.0","20.0.0-beta.2":"104.0.5073.0","20.0.0-beta.3":"104.0.5073.0","20.0.0-beta.4":"104.0.5073.0","20.0.0-beta.5":"104.0.5073.0","20.0.0-beta.6":"104.0.5073.0","20.0.0-beta.7":"104.0.5073.0","20.0.0-beta.8":"104.0.5073.0","20.0.0-beta.9":"104.0.5112.39","20.0.0-beta.10":"104.0.5112.48","20.0.0-beta.11":"104.0.5112.48","20.0.0-beta.12":"104.0.5112.48","20.0.0-beta.13":"104.0.5112.57","20.0.0":"104.0.5112.65","20.0.1":"104.0.5112.81","20.0.2":"104.0.5112.81","20.0.3":"104.0.5112.81","20.1.0":"104.0.5112.102","20.1.1":"104.0.5112.102","20.1.2":"104.0.5112.114","20.1.3":"104.0.5112.114","20.1.4":"104.0.5112.114","20.2.0":"104.0.5112.124","20.3.0":"104.0.5112.124","20.3.1":"104.0.5112.124","20.3.2":"104.0.5112.124","20.3.3":"104.0.5112.124","20.3.4":"104.0.5112.124","20.3.5":"104.0.5112.124","20.3.6":"104.0.5112.124","20.3.7":"104.0.5112.124","20.3.8":"104.0.5112.124","20.3.9":"104.0.5112.124","20.3.10":"104.0.5112.124","20.3.11":"104.0.5112.124","20.3.12":"104.0.5112.124","21.0.0-alpha.1":"105.0.5187.0","21.0.0-alpha.2":"105.0.5187.0","21.0.0-alpha.3":"105.0.5187.0","21.0.0-alpha.4":"105.0.5187.0","21.0.0-alpha.5":"105.0.5187.0","21.0.0-alpha.6":"106.0.5216.0","21.0.0-beta.1":"106.0.5216.0","21.0.0-beta.2":"106.0.5216.0","21.0.0-beta.3":"106.0.5216.0","21.0.0-beta.4":"106.0.5216.0","21.0.0-beta.5":"106.0.5216.0","21.0.0-beta.6":"106.0.5249.40","21.0.0-beta.7":"106.0.5249.40","21.0.0-beta.8":"106.0.5249.40","21.0.0":"106.0.5249.51","21.0.1":"106.0.5249.61","21.1.0":"106.0.5249.91","21.1.1":"106.0.5249.103","21.2.0":"106.0.5249.119","21.2.1":"106.0.5249.165","21.2.2":"106.0.5249.168","21.2.3":"106.0.5249.168","21.3.0":"106.0.5249.181","21.3.1":"106.0.5249.181","21.3.3":"106.0.5249.199","21.3.4":"106.0.5249.199","21.3.5":"106.0.5249.199","21.4.0":"106.0.5249.199","21.4.1":"106.0.5249.199","21.4.2":"106.0.5249.199","21.4.3":"106.0.5249.199","21.4.4":"106.0.5249.199","22.0.0-alpha.1":"107.0.5286.0","22.0.0-alpha.3":"108.0.5329.0","22.0.0-alpha.4":"108.0.5329.0","22.0.0-alpha.5":"108.0.5329.0","22.0.0-alpha.6":"108.0.5329.0","22.0.0-alpha.7":"108.0.5355.0","22.0.0-alpha.8":"108.0.5359.10","22.0.0-beta.1":"108.0.5359.10","22.0.0-beta.2":"108.0.5359.10","22.0.0-beta.3":"108.0.5359.10","22.0.0-beta.4":"108.0.5359.29","22.0.0-beta.5":"108.0.5359.40","22.0.0-beta.6":"108.0.5359.40","22.0.0-beta.7":"108.0.5359.48","22.0.0-beta.8":"108.0.5359.48","22.0.0":"108.0.5359.62","22.0.1":"108.0.5359.125","22.0.2":"108.0.5359.179","22.0.3":"108.0.5359.179","22.1.0":"108.0.5359.179","22.2.0":"108.0.5359.215","22.2.1":"108.0.5359.215","22.3.0":"108.0.5359.215","22.3.1":"108.0.5359.215","22.3.2":"108.0.5359.215","22.3.3":"108.0.5359.215","22.3.4":"108.0.5359.215","22.3.5":"108.0.5359.215","22.3.6":"108.0.5359.215","22.3.7":"108.0.5359.215","22.3.8":"108.0.5359.215","22.3.9":"108.0.5359.215","22.3.10":"108.0.5359.215","22.3.11":"108.0.5359.215","22.3.12":"108.0.5359.215","22.3.13":"108.0.5359.215","22.3.14":"108.0.5359.215","22.3.15":"108.0.5359.215","22.3.16":"108.0.5359.215","22.3.17":"108.0.5359.215","22.3.18":"108.0.5359.215","22.3.20":"108.0.5359.215","22.3.21":"108.0.5359.215","22.3.22":"108.0.5359.215","22.3.23":"108.0.5359.215","22.3.24":"108.0.5359.215","22.3.25":"108.0.5359.215","22.3.26":"108.0.5359.215","22.3.27":"108.0.5359.215","23.0.0-alpha.1":"110.0.5415.0","23.0.0-alpha.2":"110.0.5451.0","23.0.0-alpha.3":"110.0.5451.0","23.0.0-beta.1":"110.0.5478.5","23.0.0-beta.2":"110.0.5478.5","23.0.0-beta.3":"110.0.5478.5","23.0.0-beta.4":"110.0.5481.30","23.0.0-beta.5":"110.0.5481.38","23.0.0-beta.6":"110.0.5481.52","23.0.0-beta.8":"110.0.5481.52","23.0.0":"110.0.5481.77","23.1.0":"110.0.5481.100","23.1.1":"110.0.5481.104","23.1.2":"110.0.5481.177","23.1.3":"110.0.5481.179","23.1.4":"110.0.5481.192","23.2.0":"110.0.5481.192","23.2.1":"110.0.5481.208","23.2.2":"110.0.5481.208","23.2.3":"110.0.5481.208","23.2.4":"110.0.5481.208","23.3.0":"110.0.5481.208","23.3.1":"110.0.5481.208","23.3.2":"110.0.5481.208","23.3.3":"110.0.5481.208","23.3.4":"110.0.5481.208","23.3.5":"110.0.5481.208","23.3.6":"110.0.5481.208","23.3.7":"110.0.5481.208","23.3.8":"110.0.5481.208","23.3.9":"110.0.5481.208","23.3.10":"110.0.5481.208","23.3.11":"110.0.5481.208","23.3.12":"110.0.5481.208","23.3.13":"110.0.5481.208","24.0.0-alpha.1":"111.0.5560.0","24.0.0-alpha.2":"111.0.5560.0","24.0.0-alpha.3":"111.0.5560.0","24.0.0-alpha.4":"111.0.5560.0","24.0.0-alpha.5":"111.0.5560.0","24.0.0-alpha.6":"111.0.5560.0","24.0.0-alpha.7":"111.0.5560.0","24.0.0-beta.1":"111.0.5563.50","24.0.0-beta.2":"111.0.5563.50","24.0.0-beta.3":"112.0.5615.20","24.0.0-beta.4":"112.0.5615.20","24.0.0-beta.5":"112.0.5615.29","24.0.0-beta.6":"112.0.5615.39","24.0.0-beta.7":"112.0.5615.39","24.0.0":"112.0.5615.49","24.1.0":"112.0.5615.50","24.1.1":"112.0.5615.50","24.1.2":"112.0.5615.87","24.1.3":"112.0.5615.165","24.2.0":"112.0.5615.165","24.3.0":"112.0.5615.165","24.3.1":"112.0.5615.183","24.4.0":"112.0.5615.204","24.4.1":"112.0.5615.204","24.5.0":"112.0.5615.204","24.5.1":"112.0.5615.204","24.6.0":"112.0.5615.204","24.6.1":"112.0.5615.204","24.6.2":"112.0.5615.204","24.6.3":"112.0.5615.204","24.6.4":"112.0.5615.204","24.6.5":"112.0.5615.204","24.7.0":"112.0.5615.204","24.7.1":"112.0.5615.204","24.8.0":"112.0.5615.204","24.8.1":"112.0.5615.204","24.8.2":"112.0.5615.204","24.8.3":"112.0.5615.204","24.8.4":"112.0.5615.204","24.8.5":"112.0.5615.204","24.8.6":"112.0.5615.204","24.8.7":"112.0.5615.204","24.8.8":"112.0.5615.204","25.0.0-alpha.1":"114.0.5694.0","25.0.0-alpha.2":"114.0.5694.0","25.0.0-alpha.3":"114.0.5710.0","25.0.0-alpha.4":"114.0.5710.0","25.0.0-alpha.5":"114.0.5719.0","25.0.0-alpha.6":"114.0.5719.0","25.0.0-beta.1":"114.0.5719.0","25.0.0-beta.2":"114.0.5719.0","25.0.0-beta.3":"114.0.5719.0","25.0.0-beta.4":"114.0.5735.16","25.0.0-beta.5":"114.0.5735.16","25.0.0-beta.6":"114.0.5735.16","25.0.0-beta.7":"114.0.5735.16","25.0.0-beta.8":"114.0.5735.35","25.0.0-beta.9":"114.0.5735.45","25.0.0":"114.0.5735.45","25.0.1":"114.0.5735.45","25.1.0":"114.0.5735.106","25.1.1":"114.0.5735.106","25.2.0":"114.0.5735.134","25.3.0":"114.0.5735.199","25.3.1":"114.0.5735.243","25.3.2":"114.0.5735.248","25.4.0":"114.0.5735.248","25.5.0":"114.0.5735.289","25.6.0":"114.0.5735.289","25.7.0":"114.0.5735.289","25.8.0":"114.0.5735.289","25.8.1":"114.0.5735.289","25.8.2":"114.0.5735.289","25.8.3":"114.0.5735.289","25.8.4":"114.0.5735.289","25.9.0":"114.0.5735.289","25.9.1":"114.0.5735.289","25.9.2":"114.0.5735.289","25.9.3":"114.0.5735.289","25.9.4":"114.0.5735.289","25.9.5":"114.0.5735.289","25.9.6":"114.0.5735.289","25.9.7":"114.0.5735.289","25.9.8":"114.0.5735.289","26.0.0-alpha.1":"116.0.5791.0","26.0.0-alpha.2":"116.0.5791.0","26.0.0-alpha.3":"116.0.5791.0","26.0.0-alpha.4":"116.0.5791.0","26.0.0-alpha.5":"116.0.5791.0","26.0.0-alpha.6":"116.0.5815.0","26.0.0-alpha.7":"116.0.5831.0","26.0.0-alpha.8":"116.0.5845.0","26.0.0-beta.1":"116.0.5845.0","26.0.0-beta.2":"116.0.5845.14","26.0.0-beta.3":"116.0.5845.14","26.0.0-beta.4":"116.0.5845.14","26.0.0-beta.5":"116.0.5845.14","26.0.0-beta.6":"116.0.5845.14","26.0.0-beta.7":"116.0.5845.14","26.0.0-beta.8":"116.0.5845.42","26.0.0-beta.9":"116.0.5845.42","26.0.0-beta.10":"116.0.5845.49","26.0.0-beta.11":"116.0.5845.49","26.0.0-beta.12":"116.0.5845.62","26.0.0":"116.0.5845.82","26.1.0":"116.0.5845.97","26.2.0":"116.0.5845.179","26.2.1":"116.0.5845.188","26.2.2":"116.0.5845.190","26.2.3":"116.0.5845.190","26.2.4":"116.0.5845.190","26.3.0":"116.0.5845.228","26.4.0":"116.0.5845.228","26.4.1":"116.0.5845.228","26.4.2":"116.0.5845.228","26.4.3":"116.0.5845.228","26.5.0":"116.0.5845.228","26.6.0":"116.0.5845.228","26.6.1":"116.0.5845.228","26.6.2":"116.0.5845.228","26.6.3":"116.0.5845.228","26.6.4":"116.0.5845.228","26.6.5":"116.0.5845.228","26.6.6":"116.0.5845.228","26.6.7":"116.0.5845.228","26.6.8":"116.0.5845.228","26.6.9":"116.0.5845.228","26.6.10":"116.0.5845.228","27.0.0-alpha.1":"118.0.5949.0","27.0.0-alpha.2":"118.0.5949.0","27.0.0-alpha.3":"118.0.5949.0","27.0.0-alpha.4":"118.0.5949.0","27.0.0-alpha.5":"118.0.5949.0","27.0.0-alpha.6":"118.0.5949.0","27.0.0-beta.1":"118.0.5993.5","27.0.0-beta.2":"118.0.5993.5","27.0.0-beta.3":"118.0.5993.5","27.0.0-beta.4":"118.0.5993.11","27.0.0-beta.5":"118.0.5993.18","27.0.0-beta.6":"118.0.5993.18","27.0.0-beta.7":"118.0.5993.18","27.0.0-beta.8":"118.0.5993.18","27.0.0-beta.9":"118.0.5993.18","27.0.0":"118.0.5993.54","27.0.1":"118.0.5993.89","27.0.2":"118.0.5993.89","27.0.3":"118.0.5993.120","27.0.4":"118.0.5993.129","27.1.0":"118.0.5993.144","27.1.2":"118.0.5993.144","27.1.3":"118.0.5993.159","27.2.0":"118.0.5993.159","27.2.1":"118.0.5993.159","27.2.2":"118.0.5993.159","27.2.3":"118.0.5993.159","27.2.4":"118.0.5993.159","27.3.0":"118.0.5993.159","27.3.1":"118.0.5993.159","27.3.2":"118.0.5993.159","27.3.3":"118.0.5993.159","27.3.4":"118.0.5993.159","27.3.5":"118.0.5993.159","27.3.6":"118.0.5993.159","27.3.7":"118.0.5993.159","27.3.8":"118.0.5993.159","27.3.9":"118.0.5993.159","27.3.10":"118.0.5993.159","27.3.11":"118.0.5993.159","28.0.0-alpha.1":"119.0.6045.0","28.0.0-alpha.2":"119.0.6045.0","28.0.0-alpha.3":"119.0.6045.21","28.0.0-alpha.4":"119.0.6045.21","28.0.0-alpha.5":"119.0.6045.33","28.0.0-alpha.6":"119.0.6045.33","28.0.0-alpha.7":"119.0.6045.33","28.0.0-beta.1":"119.0.6045.33","28.0.0-beta.2":"120.0.6099.0","28.0.0-beta.3":"120.0.6099.5","28.0.0-beta.4":"120.0.6099.5","28.0.0-beta.5":"120.0.6099.18","28.0.0-beta.6":"120.0.6099.18","28.0.0-beta.7":"120.0.6099.18","28.0.0-beta.8":"120.0.6099.18","28.0.0-beta.9":"120.0.6099.18","28.0.0-beta.10":"120.0.6099.18","28.0.0-beta.11":"120.0.6099.35","28.0.0":"120.0.6099.56","28.1.0":"120.0.6099.109","28.1.1":"120.0.6099.109","28.1.2":"120.0.6099.199","28.1.3":"120.0.6099.199","28.1.4":"120.0.6099.216","28.2.0":"120.0.6099.227","28.2.1":"120.0.6099.268","28.2.2":"120.0.6099.276","28.2.3":"120.0.6099.283","28.2.4":"120.0.6099.291","28.2.5":"120.0.6099.291","28.2.6":"120.0.6099.291","28.2.7":"120.0.6099.291","28.2.8":"120.0.6099.291","28.2.9":"120.0.6099.291","28.2.10":"120.0.6099.291","28.3.0":"120.0.6099.291","28.3.1":"120.0.6099.291","28.3.2":"120.0.6099.291","28.3.3":"120.0.6099.291","29.0.0-alpha.1":"121.0.6147.0","29.0.0-alpha.2":"121.0.6147.0","29.0.0-alpha.3":"121.0.6147.0","29.0.0-alpha.4":"121.0.6159.0","29.0.0-alpha.5":"121.0.6159.0","29.0.0-alpha.6":"121.0.6159.0","29.0.0-alpha.7":"121.0.6159.0","29.0.0-alpha.8":"122.0.6194.0","29.0.0-alpha.9":"122.0.6236.2","29.0.0-alpha.10":"122.0.6236.2","29.0.0-alpha.11":"122.0.6236.2","29.0.0-beta.1":"122.0.6236.2","29.0.0-beta.2":"122.0.6236.2","29.0.0-beta.3":"122.0.6261.6","29.0.0-beta.4":"122.0.6261.6","29.0.0-beta.5":"122.0.6261.18","29.0.0-beta.6":"122.0.6261.18","29.0.0-beta.7":"122.0.6261.18","29.0.0-beta.8":"122.0.6261.18","29.0.0-beta.9":"122.0.6261.18","29.0.0-beta.10":"122.0.6261.18","29.0.0-beta.11":"122.0.6261.18","29.0.0-beta.12":"122.0.6261.29","29.0.0":"122.0.6261.39","29.0.1":"122.0.6261.57","29.1.0":"122.0.6261.70","29.1.1":"122.0.6261.111","29.1.2":"122.0.6261.112","29.1.3":"122.0.6261.112","29.1.4":"122.0.6261.129","29.1.5":"122.0.6261.130","29.1.6":"122.0.6261.139","29.2.0":"122.0.6261.156","29.3.0":"122.0.6261.156","29.3.1":"122.0.6261.156","29.3.2":"122.0.6261.156","29.3.3":"122.0.6261.156","29.4.0":"122.0.6261.156","29.4.1":"122.0.6261.156","29.4.2":"122.0.6261.156","29.4.3":"122.0.6261.156","29.4.4":"122.0.6261.156","29.4.5":"122.0.6261.156","29.4.6":"122.0.6261.156","30.0.0-alpha.1":"123.0.6296.0","30.0.0-alpha.2":"123.0.6312.5","30.0.0-alpha.3":"124.0.6323.0","30.0.0-alpha.4":"124.0.6323.0","30.0.0-alpha.5":"124.0.6331.0","30.0.0-alpha.6":"124.0.6331.0","30.0.0-alpha.7":"124.0.6353.0","30.0.0-beta.1":"124.0.6359.0","30.0.0-beta.2":"124.0.6359.0","30.0.0-beta.3":"124.0.6367.9","30.0.0-beta.4":"124.0.6367.9","30.0.0-beta.5":"124.0.6367.9","30.0.0-beta.6":"124.0.6367.18","30.0.0-beta.7":"124.0.6367.29","30.0.0-beta.8":"124.0.6367.29","30.0.0":"124.0.6367.49","30.0.1":"124.0.6367.60","30.0.2":"124.0.6367.91","30.0.3":"124.0.6367.119","30.0.4":"124.0.6367.201","30.0.5":"124.0.6367.207","30.0.6":"124.0.6367.207","30.0.7":"124.0.6367.221","30.0.8":"124.0.6367.230","30.0.9":"124.0.6367.233","30.1.0":"124.0.6367.243","30.1.1":"124.0.6367.243","30.1.2":"124.0.6367.243","30.2.0":"124.0.6367.243","30.3.0":"124.0.6367.243","30.3.1":"124.0.6367.243","30.4.0":"124.0.6367.243","30.5.0":"124.0.6367.243","30.5.1":"124.0.6367.243","31.0.0-alpha.1":"125.0.6412.0","31.0.0-alpha.2":"125.0.6412.0","31.0.0-alpha.3":"125.0.6412.0","31.0.0-alpha.4":"125.0.6412.0","31.0.0-alpha.5":"125.0.6412.0","31.0.0-beta.1":"126.0.6445.0","31.0.0-beta.2":"126.0.6445.0","31.0.0-beta.3":"126.0.6445.0","31.0.0-beta.4":"126.0.6445.0","31.0.0-beta.5":"126.0.6445.0","31.0.0-beta.6":"126.0.6445.0","31.0.0-beta.7":"126.0.6445.0","31.0.0-beta.8":"126.0.6445.0","31.0.0-beta.9":"126.0.6445.0","31.0.0-beta.10":"126.0.6478.36","31.0.0":"126.0.6478.36","31.0.1":"126.0.6478.36","31.0.2":"126.0.6478.61","31.1.0":"126.0.6478.114","31.2.0":"126.0.6478.127","31.2.1":"126.0.6478.127","31.3.0":"126.0.6478.183","31.3.1":"126.0.6478.185","31.4.0":"126.0.6478.234","31.5.0":"126.0.6478.234","31.6.0":"126.0.6478.234","31.7.0":"126.0.6478.234","31.7.1":"126.0.6478.234","31.7.2":"126.0.6478.234","31.7.3":"126.0.6478.234","31.7.4":"126.0.6478.234","31.7.5":"126.0.6478.234","31.7.6":"126.0.6478.234","31.7.7":"126.0.6478.234","32.0.0-alpha.1":"127.0.6521.0","32.0.0-alpha.2":"127.0.6521.0","32.0.0-alpha.3":"127.0.6521.0","32.0.0-alpha.4":"127.0.6521.0","32.0.0-alpha.5":"127.0.6521.0","32.0.0-alpha.6":"128.0.6571.0","32.0.0-alpha.7":"128.0.6571.0","32.0.0-alpha.8":"128.0.6573.0","32.0.0-alpha.9":"128.0.6573.0","32.0.0-alpha.10":"128.0.6573.0","32.0.0-beta.1":"128.0.6573.0","32.0.0-beta.2":"128.0.6611.0","32.0.0-beta.3":"128.0.6613.7","32.0.0-beta.4":"128.0.6613.18","32.0.0-beta.5":"128.0.6613.27","32.0.0-beta.6":"128.0.6613.27","32.0.0-beta.7":"128.0.6613.27","32.0.0":"128.0.6613.36","32.0.1":"128.0.6613.36","32.0.2":"128.0.6613.84","32.1.0":"128.0.6613.120","32.1.1":"128.0.6613.137","32.1.2":"128.0.6613.162","32.2.0":"128.0.6613.178","32.2.1":"128.0.6613.186","32.2.2":"128.0.6613.186","32.2.3":"128.0.6613.186","32.2.4":"128.0.6613.186","32.2.5":"128.0.6613.186","32.2.6":"128.0.6613.186","32.2.7":"128.0.6613.186","32.2.8":"128.0.6613.186","32.3.0":"128.0.6613.186","32.3.1":"128.0.6613.186","32.3.2":"128.0.6613.186","32.3.3":"128.0.6613.186","33.0.0-alpha.1":"129.0.6668.0","33.0.0-alpha.2":"130.0.6672.0","33.0.0-alpha.3":"130.0.6672.0","33.0.0-alpha.4":"130.0.6672.0","33.0.0-alpha.5":"130.0.6672.0","33.0.0-alpha.6":"130.0.6672.0","33.0.0-beta.1":"130.0.6672.0","33.0.0-beta.2":"130.0.6672.0","33.0.0-beta.3":"130.0.6672.0","33.0.0-beta.4":"130.0.6672.0","33.0.0-beta.5":"130.0.6723.19","33.0.0-beta.6":"130.0.6723.19","33.0.0-beta.7":"130.0.6723.19","33.0.0-beta.8":"130.0.6723.31","33.0.0-beta.9":"130.0.6723.31","33.0.0-beta.10":"130.0.6723.31","33.0.0-beta.11":"130.0.6723.44","33.0.0":"130.0.6723.44","33.0.1":"130.0.6723.59","33.0.2":"130.0.6723.59","33.1.0":"130.0.6723.91","33.2.0":"130.0.6723.118","33.2.1":"130.0.6723.137","33.3.0":"130.0.6723.152","33.3.1":"130.0.6723.170","33.3.2":"130.0.6723.191","33.4.0":"130.0.6723.191","33.4.1":"130.0.6723.191","33.4.2":"130.0.6723.191","33.4.3":"130.0.6723.191","33.4.4":"130.0.6723.191","33.4.5":"130.0.6723.191","33.4.6":"130.0.6723.191","33.4.7":"130.0.6723.191","33.4.8":"130.0.6723.191","33.4.9":"130.0.6723.191","33.4.10":"130.0.6723.191","33.4.11":"130.0.6723.191","34.0.0-alpha.1":"131.0.6776.0","34.0.0-alpha.2":"132.0.6779.0","34.0.0-alpha.3":"132.0.6789.1","34.0.0-alpha.4":"132.0.6789.1","34.0.0-alpha.5":"132.0.6789.1","34.0.0-alpha.6":"132.0.6789.1","34.0.0-alpha.7":"132.0.6789.1","34.0.0-alpha.8":"132.0.6820.0","34.0.0-alpha.9":"132.0.6824.0","34.0.0-beta.1":"132.0.6824.0","34.0.0-beta.2":"132.0.6824.0","34.0.0-beta.3":"132.0.6824.0","34.0.0-beta.4":"132.0.6834.6","34.0.0-beta.5":"132.0.6834.6","34.0.0-beta.6":"132.0.6834.15","34.0.0-beta.7":"132.0.6834.15","34.0.0-beta.8":"132.0.6834.15","34.0.0-beta.9":"132.0.6834.32","34.0.0-beta.10":"132.0.6834.32","34.0.0-beta.11":"132.0.6834.32","34.0.0-beta.12":"132.0.6834.46","34.0.0-beta.13":"132.0.6834.46","34.0.0-beta.14":"132.0.6834.57","34.0.0-beta.15":"132.0.6834.57","34.0.0-beta.16":"132.0.6834.57","34.0.0":"132.0.6834.83","34.0.1":"132.0.6834.83","34.0.2":"132.0.6834.159","34.1.0":"132.0.6834.194","34.1.1":"132.0.6834.194","34.2.0":"132.0.6834.196","34.3.0":"132.0.6834.210","34.3.1":"132.0.6834.210","34.3.2":"132.0.6834.210","34.3.3":"132.0.6834.210","34.3.4":"132.0.6834.210","34.4.0":"132.0.6834.210","34.4.1":"132.0.6834.210","34.5.0":"132.0.6834.210","34.5.1":"132.0.6834.210","34.5.2":"132.0.6834.210","34.5.3":"132.0.6834.210","34.5.4":"132.0.6834.210","34.5.5":"132.0.6834.210","34.5.6":"132.0.6834.210","34.5.7":"132.0.6834.210","34.5.8":"132.0.6834.210","35.0.0-alpha.1":"133.0.6920.0","35.0.0-alpha.2":"133.0.6920.0","35.0.0-alpha.3":"133.0.6920.0","35.0.0-alpha.4":"133.0.6920.0","35.0.0-alpha.5":"133.0.6920.0","35.0.0-beta.1":"133.0.6920.0","35.0.0-beta.2":"134.0.6968.0","35.0.0-beta.3":"134.0.6968.0","35.0.0-beta.4":"134.0.6968.0","35.0.0-beta.5":"134.0.6989.0","35.0.0-beta.6":"134.0.6990.0","35.0.0-beta.7":"134.0.6990.0","35.0.0-beta.8":"134.0.6998.10","35.0.0-beta.9":"134.0.6998.10","35.0.0-beta.10":"134.0.6998.23","35.0.0-beta.11":"134.0.6998.23","35.0.0-beta.12":"134.0.6998.23","35.0.0-beta.13":"134.0.6998.44","35.0.0":"134.0.6998.44","35.0.1":"134.0.6998.44","35.0.2":"134.0.6998.88","35.0.3":"134.0.6998.88","35.1.0":"134.0.6998.165","35.1.1":"134.0.6998.165","35.1.2":"134.0.6998.178","35.1.3":"134.0.6998.179","35.1.4":"134.0.6998.179","35.1.5":"134.0.6998.179","35.2.0":"134.0.6998.205","35.2.1":"134.0.6998.205","35.2.2":"134.0.6998.205","35.3.0":"134.0.6998.205","35.4.0":"134.0.6998.205","35.5.0":"134.0.6998.205","35.5.1":"134.0.6998.205","35.6.0":"134.0.6998.205","35.7.0":"134.0.6998.205","35.7.1":"134.0.6998.205","35.7.2":"134.0.6998.205","35.7.4":"134.0.6998.205","35.7.5":"134.0.6998.205","36.0.0-alpha.1":"135.0.7049.5","36.0.0-alpha.2":"136.0.7062.0","36.0.0-alpha.3":"136.0.7062.0","36.0.0-alpha.4":"136.0.7062.0","36.0.0-alpha.5":"136.0.7067.0","36.0.0-alpha.6":"136.0.7067.0","36.0.0-beta.1":"136.0.7067.0","36.0.0-beta.2":"136.0.7067.0","36.0.0-beta.3":"136.0.7067.0","36.0.0-beta.4":"136.0.7067.0","36.0.0-beta.5":"136.0.7103.17","36.0.0-beta.6":"136.0.7103.25","36.0.0-beta.7":"136.0.7103.25","36.0.0-beta.8":"136.0.7103.33","36.0.0-beta.9":"136.0.7103.33","36.0.0":"136.0.7103.48","36.0.1":"136.0.7103.48","36.1.0":"136.0.7103.49","36.2.0":"136.0.7103.49","36.2.1":"136.0.7103.93","36.3.0":"136.0.7103.113","36.3.1":"136.0.7103.113","36.3.2":"136.0.7103.115","36.4.0":"136.0.7103.149","36.5.0":"136.0.7103.168","36.6.0":"136.0.7103.177","36.7.0":"136.0.7103.177","36.7.1":"136.0.7103.177","36.7.3":"136.0.7103.177","36.7.4":"136.0.7103.177","36.8.0":"136.0.7103.177","36.8.1":"136.0.7103.177","36.9.0":"136.0.7103.177","36.9.1":"136.0.7103.177","36.9.2":"136.0.7103.177","36.9.3":"136.0.7103.177","36.9.4":"136.0.7103.177","36.9.5":"136.0.7103.177","37.0.0-alpha.1":"137.0.7151.0","37.0.0-alpha.2":"137.0.7151.0","37.0.0-alpha.3":"138.0.7156.0","37.0.0-alpha.4":"138.0.7165.0","37.0.0-alpha.5":"138.0.7177.0","37.0.0-alpha.6":"138.0.7178.0","37.0.0-alpha.7":"138.0.7178.0","37.0.0-beta.1":"138.0.7178.0","37.0.0-beta.2":"138.0.7178.0","37.0.0-beta.3":"138.0.7190.0","37.0.0-beta.4":"138.0.7204.15","37.0.0-beta.5":"138.0.7204.15","37.0.0-beta.6":"138.0.7204.15","37.0.0-beta.7":"138.0.7204.15","37.0.0-beta.8":"138.0.7204.23","37.0.0-beta.9":"138.0.7204.35","37.0.0":"138.0.7204.35","37.1.0":"138.0.7204.35","37.2.0":"138.0.7204.97","37.2.1":"138.0.7204.97","37.2.2":"138.0.7204.100","37.2.3":"138.0.7204.100","37.2.4":"138.0.7204.157","37.2.5":"138.0.7204.168","37.2.6":"138.0.7204.185","37.3.0":"138.0.7204.224","37.3.1":"138.0.7204.235","37.4.0":"138.0.7204.243","37.5.0":"138.0.7204.251","37.5.1":"138.0.7204.251","37.6.0":"138.0.7204.251","37.6.1":"138.0.7204.251","37.7.0":"138.0.7204.251","37.7.1":"138.0.7204.251","37.8.0":"138.0.7204.251","37.9.0":"138.0.7204.251","37.10.0":"138.0.7204.251","37.10.1":"138.0.7204.251","37.10.2":"138.0.7204.251","37.10.3":"138.0.7204.251","38.0.0-alpha.1":"139.0.7219.0","38.0.0-alpha.2":"139.0.7219.0","38.0.0-alpha.3":"139.0.7219.0","38.0.0-alpha.4":"140.0.7261.0","38.0.0-alpha.5":"140.0.7261.0","38.0.0-alpha.6":"140.0.7261.0","38.0.0-alpha.7":"140.0.7281.0","38.0.0-alpha.8":"140.0.7281.0","38.0.0-alpha.9":"140.0.7301.0","38.0.0-alpha.10":"140.0.7309.0","38.0.0-alpha.11":"140.0.7312.0","38.0.0-alpha.12":"140.0.7314.0","38.0.0-alpha.13":"140.0.7314.0","38.0.0-beta.1":"140.0.7314.0","38.0.0-beta.2":"140.0.7327.0","38.0.0-beta.3":"140.0.7327.0","38.0.0-beta.4":"140.0.7339.2","38.0.0-beta.5":"140.0.7339.2","38.0.0-beta.6":"140.0.7339.2","38.0.0-beta.7":"140.0.7339.16","38.0.0-beta.8":"140.0.7339.24","38.0.0-beta.9":"140.0.7339.24","38.0.0-beta.11":"140.0.7339.41","38.0.0":"140.0.7339.41","38.1.0":"140.0.7339.80","38.1.1":"140.0.7339.133","38.1.2":"140.0.7339.133","38.2.0":"140.0.7339.133","38.2.1":"140.0.7339.133","38.2.2":"140.0.7339.133","38.3.0":"140.0.7339.240","38.4.0":"140.0.7339.240","38.5.0":"140.0.7339.249","38.6.0":"140.0.7339.249","38.7.0":"140.0.7339.249","38.7.1":"140.0.7339.249","38.7.2":"140.0.7339.249","38.8.0":"140.0.7339.249","38.8.1":"140.0.7339.249","38.8.2":"140.0.7339.249","38.8.4":"140.0.7339.249","38.8.6":"140.0.7339.249","39.0.0-alpha.1":"141.0.7361.0","39.0.0-alpha.2":"141.0.7361.0","39.0.0-alpha.3":"141.0.7390.7","39.0.0-alpha.4":"141.0.7390.7","39.0.0-alpha.5":"141.0.7390.7","39.0.0-alpha.6":"142.0.7417.0","39.0.0-alpha.7":"142.0.7417.0","39.0.0-alpha.8":"142.0.7417.0","39.0.0-alpha.9":"142.0.7417.0","39.0.0-beta.1":"142.0.7417.0","39.0.0-beta.2":"142.0.7417.0","39.0.0-beta.3":"142.0.7417.0","39.0.0-beta.4":"142.0.7444.34","39.0.0-beta.5":"142.0.7444.34","39.0.0":"142.0.7444.52","39.1.0":"142.0.7444.59","39.1.1":"142.0.7444.59","39.1.2":"142.0.7444.134","39.2.0":"142.0.7444.162","39.2.1":"142.0.7444.162","39.2.2":"142.0.7444.162","39.2.3":"142.0.7444.175","39.2.4":"142.0.7444.177","39.2.5":"142.0.7444.177","39.2.6":"142.0.7444.226","39.2.7":"142.0.7444.235","39.3.0":"142.0.7444.265","39.4.0":"142.0.7444.265","39.5.0":"142.0.7444.265","39.5.1":"142.0.7444.265","39.5.2":"142.0.7444.265","39.6.0":"142.0.7444.265","39.6.1":"142.0.7444.265","39.7.0":"142.0.7444.265","39.8.0":"142.0.7444.265","39.8.1":"142.0.7444.265","39.8.2":"142.0.7444.265","39.8.3":"142.0.7444.265","39.8.4":"142.0.7444.265","39.8.5":"142.0.7444.265","39.8.6":"142.0.7444.265","39.8.7":"142.0.7444.265","39.8.8":"142.0.7444.265","39.8.9":"142.0.7444.265","39.8.10":"142.0.7444.265","40.0.0-alpha.2":"143.0.7499.0","40.0.0-alpha.4":"144.0.7506.0","40.0.0-alpha.5":"144.0.7526.0","40.0.0-alpha.6":"144.0.7526.0","40.0.0-alpha.7":"144.0.7526.0","40.0.0-alpha.8":"144.0.7526.0","40.0.0-beta.1":"144.0.7527.0","40.0.0-beta.2":"144.0.7527.0","40.0.0-beta.3":"144.0.7547.0","40.0.0-beta.4":"144.0.7547.0","40.0.0-beta.5":"144.0.7547.0","40.0.0-beta.6":"144.0.7559.31","40.0.0-beta.7":"144.0.7559.31","40.0.0-beta.8":"144.0.7559.31","40.0.0-beta.9":"144.0.7559.60","40.0.0":"144.0.7559.60","40.1.0":"144.0.7559.96","40.2.0":"144.0.7559.111","40.2.1":"144.0.7559.111","40.3.0":"144.0.7559.134","40.4.0":"144.0.7559.134","40.4.1":"144.0.7559.173","40.5.0":"144.0.7559.177","40.6.0":"144.0.7559.177","40.6.1":"144.0.7559.220","40.7.0":"144.0.7559.225","40.8.0":"144.0.7559.236","40.8.1":"144.0.7559.236","40.8.2":"144.0.7559.236","40.8.3":"144.0.7559.236","40.8.4":"144.0.7559.236","40.8.5":"144.0.7559.236","40.9.0":"144.0.7559.236","40.9.1":"144.0.7559.236","40.9.2":"144.0.7559.236","40.9.3":"144.0.7559.236","40.10.0":"144.0.7559.236","40.10.1":"144.0.7559.236","40.10.2":"144.0.7559.236","40.10.3":"144.0.7559.236","40.10.4":"144.0.7559.236","40.10.5":"144.0.7559.236","40.10.6":"144.0.7559.236","41.0.0-alpha.1":"146.0.7635.0","41.0.0-alpha.2":"146.0.7635.0","41.0.0-alpha.3":"146.0.7645.0","41.0.0-alpha.4":"146.0.7650.0","41.0.0-alpha.5":"146.0.7650.0","41.0.0-alpha.6":"146.0.7650.0","41.0.0-beta.1":"146.0.7650.0","41.0.0-beta.2":"146.0.7650.0","41.0.0-beta.3":"146.0.7650.0","41.0.0-beta.4":"146.0.7666.0","41.0.0-beta.5":"146.0.7680.16","41.0.0-beta.6":"146.0.7680.16","41.0.0-beta.7":"146.0.7680.31","41.0.0-beta.8":"146.0.7680.31","41.0.0":"146.0.7680.65","41.0.1":"146.0.7680.72","41.0.2":"146.0.7680.72","41.0.3":"146.0.7680.80","41.0.4":"146.0.7680.153","41.1.0":"146.0.7680.166","41.1.1":"146.0.7680.166","41.2.0":"146.0.7680.179","41.2.1":"146.0.7680.188","41.2.2":"146.0.7680.188","41.3.0":"146.0.7680.188","41.4.0":"146.0.7680.216","41.5.0":"146.0.7680.216","41.5.1":"146.0.7680.216","41.5.2":"146.0.7680.216","41.6.0":"146.0.7680.216","41.6.1":"146.0.7680.216","41.7.0":"146.0.7680.216","41.7.1":"146.0.7680.216","41.7.2":"146.0.7680.216","41.8.0":"146.0.7680.216","41.9.0":"146.0.7680.216","41.9.1":"146.0.7680.216","41.9.2":"146.0.7680.216","41.10.0":"146.0.7680.216","41.10.1":"146.0.7680.216","41.10.2":"146.0.7680.216","41.10.3":"146.0.7680.216","41.10.4":"146.0.7680.216","41.10.5":"146.0.7680.216","41.10.6":"146.0.7680.216","41.10.7":"146.0.7680.216","42.0.0-alpha.1":"147.0.7727.0","42.0.0-alpha.2":"148.0.7733.0","42.0.0-alpha.4":"148.0.7738.0","42.0.0-alpha.5":"148.0.7741.0","42.0.0-alpha.6":"148.0.7751.0","42.0.0-beta.1":"148.0.7751.0","42.0.0-beta.2":"148.0.7778.0","42.0.0-beta.3":"148.0.7778.5","42.0.0-beta.4":"148.0.7778.5","42.0.0-beta.5":"148.0.7778.5","42.0.0-beta.6":"148.0.7778.5","42.0.0-beta.7":"148.0.7778.56","42.0.0-beta.8":"148.0.7778.56","42.0.0":"148.0.7778.96","42.0.1":"148.0.7778.97","42.1.0":"148.0.7778.97","42.2.0":"148.0.7778.97","42.3.0":"148.0.7778.180","42.3.1":"148.0.7778.218","42.3.2":"148.0.7778.218","42.3.3":"148.0.7778.218","42.4.0":"148.0.7778.254","42.4.1":"148.0.7778.265","42.5.0":"148.0.7778.271","42.5.1":"148.0.7778.271","42.5.2":"148.0.7778.271","42.6.0":"148.0.7778.280","42.6.1":"148.0.7778.280","42.6.2":"148.0.7778.280","42.7.0":"148.0.7778.280","42.7.1":"148.0.7778.280","42.8.0":"148.0.7778.280","42.8.1":"148.0.7778.280","42.9.0":"148.0.7778.280","42.9.1":"148.0.7778.280","42.9.2":"148.0.7778.280","42.9.3":"148.0.7778.280","42.10.0":"148.0.7778.280","42.10.1":"148.0.7778.280","42.11.0":"148.0.7778.280","42.11.1":"148.0.7778.280","42.11.2":"148.0.7778.280","42.11.3":"148.0.7778.280","42.11.4":"148.0.7778.280","42.11.5":"148.0.7778.280","42.11.6":"148.0.7778.280","42.11.7":"148.0.7778.280","42.11.8":"148.0.7778.280","42.11.9":"148.0.7778.280","42.11.10":"148.0.7778.280","42.11.11":"148.0.7778.280","42.11.12":"148.0.7778.280","43.0.0-alpha.1":"149.0.7827.0","43.0.0-alpha.2":"150.0.7832.0","43.0.0-alpha.3":"150.0.7834.0","43.0.0-alpha.4":"150.0.7834.0","43.0.0-alpha.5":"150.0.7834.0","43.0.0-alpha.6":"150.0.7834.0","43.0.0-alpha.7":"150.0.7849.0","43.0.0-beta.1":"150.0.7863.0","43.0.0-beta.2":"150.0.7863.0","43.0.0-beta.3":"150.0.7863.0","43.0.0-beta.4":"150.0.7871.13","43.0.0-beta.5":"150.0.7871.13","43.0.0-beta.6":"150.0.7871.24","43.0.0-beta.7":"150.0.7871.24","43.0.0-beta.8":"150.0.7871.24","43.0.0":"150.0.7871.46","43.1.0":"150.0.7871.47","43.1.1":"150.0.7871.114","43.2.0":"150.0.7871.129","43.3.0":"150.0.7871.212","43.4.0":"150.0.7871.224","43.4.1":"150.0.7871.224","43.5.0":"150.0.7871.250","43.5.1":"150.0.7871.250","43.6.0":"150.0.7871.250","43.7.0":"150.0.7871.250","43.7.1":"150.0.7871.250","43.7.2":"150.0.7871.250","43.7.3":"150.0.7871.250","43.7.4":"150.0.7871.250","43.7.5":"150.0.7871.250","43.7.6":"150.0.7871.250","43.7.7":"150.0.7871.250","43.7.8":"150.0.7871.250","43.7.9":"150.0.7871.250","44.0.0-alpha.1":"151.0.7900.0","44.0.0-alpha.2":"151.0.7900.0","44.0.0-alpha.3":"151.0.7900.0","44.0.0-alpha.4":"152.0.7938.0","44.0.0-alpha.5":"152.0.7938.0","44.0.0-alpha.6":"152.0.7954.0","44.0.0-alpha.7":"152.0.7969.0","44.0.0-alpha.8":"152.0.7977.0","44.0.0-alpha.9":"152.0.7977.8","44.0.0-beta.1":"152.0.7977.8","44.0.0-beta.2":"152.0.7977.30","44.0.0-beta.3":"152.0.7977.30","44.0.0-beta.4":"152.0.7977.30","44.0.0-beta.5":"152.0.7977.30","44.0.0-beta.6":"152.0.7977.30","44.0.0":"152.0.7977.54","44.1.0":"152.0.7977.65","44.1.1":"152.0.7977.65","44.2.0":"152.0.7977.76","44.3.0":"152.0.7977.78","44.4.0":"152.0.7977.78","44.4.1":"152.0.7977.78","44.4.2":"152.0.7977.130","44.4.3":"152.0.7977.130","44.4.4":"152.0.7977.130","44.4.5":"152.0.7977.130","44.5.0":"152.0.7977.130","44.5.1":"152.0.7977.130","44.6.0":"152.0.7977.130","44.7.0":"152.0.7977.130","45.0.0-alpha.1":"154.0.8025.0","45.0.0-alpha.2":"154.0.8029.0","45.0.0-alpha.3":"154.0.8029.0","45.0.0-alpha.4":"155.0.8038.2","45.0.0-alpha.5":"155.0.8038.2","45.0.0-alpha.6":"155.0.8038.2","45.0.0-alpha.7":"155.0.8038.2","45.0.0-alpha.8":"155.0.8046.0","45.0.0-alpha.9":"155.0.8046.0","45.0.0-alpha.10":"155.0.8046.0","45.0.0-alpha.11":"155.0.8046.0","45.0.0-alpha.12":"155.0.8046.0","45.0.0-alpha.13":"155.0.8046.0","45.0.0-alpha.14":"156.0.8077.0","45.0.0-alpha.15":"156.0.8077.0","45.0.0-alpha.16":"156.0.8077.0","45.0.0-beta.1":"156.0.8078.12"} \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/index.js b/e-commerce/node_modules/electron-to-chromium/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1818281fab50434ab48c203906894558b4a66eab --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/index.js @@ -0,0 +1,36 @@ +var versions = require('./versions'); +var fullVersions = require('./full-versions'); +var chromiumVersions = require('./chromium-versions'); +var fullChromiumVersions = require('./full-chromium-versions'); + +var electronToChromium = function (query) { + var number = getQueryString(query); + return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined; +}; + +var chromiumToElectron = function (query) { + var number = getQueryString(query); + return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined; +}; + +var electronToBrowserList = function (query) { + var number = getQueryString(query); + return versions[number] ? "Chrome >= " + versions[number] : undefined; +}; + +var getQueryString = function (query) { + var number = query; + if (query === 1) { number = "1.0" } + if (typeof query === 'number') { number += ''; } + return number; +}; + +module.exports = { + versions: versions, + fullVersions: fullVersions, + chromiumVersions: chromiumVersions, + fullChromiumVersions: fullChromiumVersions, + electronToChromium: electronToChromium, + electronToBrowserList: electronToBrowserList, + chromiumToElectron: chromiumToElectron +}; diff --git a/e-commerce/node_modules/electron-to-chromium/package.json b/e-commerce/node_modules/electron-to-chromium/package.json new file mode 100644 index 0000000000000000000000000000000000000000..66d2767af9debaebd56a01ce189f2ae9503ca3ee --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/package.json @@ -0,0 +1,43 @@ +{ + "name": "electron-to-chromium", + "version": "1.5.452", + "description": "Provides a list of electron-to-chromium version mappings", + "main": "index.js", + "files": [ + "versions.js", + "full-versions.js", + "chromium-versions.js", + "full-chromium-versions.js", + "versions.json", + "full-versions.json", + "chromium-versions.json", + "full-chromium-versions.json", + "LICENSE" + ], + "scripts": { + "build": "node build.mjs", + "update": "node automated-update.js", + "test": "nyc ava --verbose", + "report": "nyc report --reporter=text-lcov > coverage.lcov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Kilian/electron-to-chromium.git" + }, + "keywords": [ + "electron", + "chrome", + "chromium", + "browserslist", + "browserlist" + ], + "author": "Kilian Valkhof", + "license": "ISC", + "devDependencies": { + "ava": "^7.0.0", + "compare-versions": "^6.1.1", + "node-fetch": "^3.3.2", + "nyc": "^18.0.0", + "shelljs": "^0.10.0" + } +} diff --git a/e-commerce/node_modules/electron-to-chromium/versions.js b/e-commerce/node_modules/electron-to-chromium/versions.js new file mode 100644 index 0000000000000000000000000000000000000000..2eb5492fafd51a22cb6706ead7ae4ec33d66b2c9 --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/versions.js @@ -0,0 +1,281 @@ +module.exports = { + "0.20": "39", + "0.21": "41", + "0.22": "41", + "0.23": "41", + "0.24": "41", + "0.25": "42", + "0.26": "42", + "0.27": "43", + "0.28": "43", + "0.29": "43", + "0.30": "44", + "0.31": "45", + "0.32": "45", + "0.33": "45", + "0.34": "45", + "0.35": "45", + "0.36": "47", + "0.37": "49", + "1.0": "49", + "1.1": "50", + "1.2": "51", + "1.3": "52", + "1.4": "53", + "1.5": "54", + "1.6": "56", + "1.7": "58", + "1.8": "59", + "2.0": "61", + "2.1": "61", + "3.0": "66", + "3.1": "66", + "4.0": "69", + "4.1": "69", + "4.2": "69", + "5.0": "73", + "6.0": "76", + "6.1": "76", + "7.0": "78", + "7.1": "78", + "7.2": "78", + "7.3": "78", + "8.0": "80", + "8.1": "80", + "8.2": "80", + "8.3": "80", + "8.4": "80", + "8.5": "80", + "9.0": "83", + "9.1": "83", + "9.2": "83", + "9.3": "83", + "9.4": "83", + "10.0": "85", + "10.1": "85", + "10.2": "85", + "10.3": "85", + "10.4": "85", + "11.0": "87", + "11.1": "87", + "11.2": "87", + "11.3": "87", + "11.4": "87", + "11.5": "87", + "12.0": "89", + "12.1": "89", + "12.2": "89", + "13.0": "91", + "13.1": "91", + "13.2": "91", + "13.3": "91", + "13.4": "91", + "13.5": "91", + "13.6": "91", + "14.0": "93", + "14.1": "93", + "14.2": "93", + "15.0": "94", + "15.1": "94", + "15.2": "94", + "15.3": "94", + "15.4": "94", + "15.5": "94", + "16.0": "96", + "16.1": "96", + "16.2": "96", + "17.0": "98", + "17.1": "98", + "17.2": "98", + "17.3": "98", + "17.4": "98", + "18.0": "100", + "18.1": "100", + "18.2": "100", + "18.3": "100", + "19.0": "102", + "19.1": "102", + "20.0": "104", + "20.1": "104", + "20.2": "104", + "20.3": "104", + "21.0": "106", + "21.1": "106", + "21.2": "106", + "21.3": "106", + "21.4": "106", + "22.0": "108", + "22.1": "108", + "22.2": "108", + "22.3": "108", + "23.0": "110", + "23.1": "110", + "23.2": "110", + "23.3": "110", + "24.0": "112", + "24.1": "112", + "24.2": "112", + "24.3": "112", + "24.4": "112", + "24.5": "112", + "24.6": "112", + "24.7": "112", + "24.8": "112", + "25.0": "114", + "25.1": "114", + "25.2": "114", + "25.3": "114", + "25.4": "114", + "25.5": "114", + "25.6": "114", + "25.7": "114", + "25.8": "114", + "25.9": "114", + "26.0": "116", + "26.1": "116", + "26.2": "116", + "26.3": "116", + "26.4": "116", + "26.5": "116", + "26.6": "116", + "27.0": "118", + "27.1": "118", + "27.2": "118", + "27.3": "118", + "28.0": "120", + "28.1": "120", + "28.2": "120", + "28.3": "120", + "29.0": "122", + "29.1": "122", + "29.2": "122", + "29.3": "122", + "29.4": "122", + "30.0": "124", + "30.1": "124", + "30.2": "124", + "30.3": "124", + "30.4": "124", + "30.5": "124", + "31.0": "126", + "31.1": "126", + "31.2": "126", + "31.3": "126", + "31.4": "126", + "31.5": "126", + "31.6": "126", + "31.7": "126", + "32.0": "128", + "32.1": "128", + "32.2": "128", + "32.3": "128", + "33.0": "130", + "33.1": "130", + "33.2": "130", + "33.3": "130", + "33.4": "130", + "34.0": "132", + "34.1": "132", + "34.2": "132", + "34.3": "132", + "34.4": "132", + "34.5": "132", + "35.0": "134", + "35.1": "134", + "35.2": "134", + "35.3": "134", + "35.4": "134", + "35.5": "134", + "35.6": "134", + "35.7": "134", + "36.0": "136", + "36.1": "136", + "36.2": "136", + "36.3": "136", + "36.4": "136", + "36.5": "136", + "36.6": "136", + "36.7": "136", + "36.8": "136", + "36.9": "136", + "37.0": "138", + "37.1": "138", + "37.2": "138", + "37.3": "138", + "37.4": "138", + "37.5": "138", + "37.6": "138", + "37.7": "138", + "37.8": "138", + "37.9": "138", + "37.10": "138", + "38.0": "140", + "38.1": "140", + "38.2": "140", + "38.3": "140", + "38.4": "140", + "38.5": "140", + "38.6": "140", + "38.7": "140", + "38.8": "140", + "39.0": "142", + "39.1": "142", + "39.2": "142", + "39.3": "142", + "39.4": "142", + "39.5": "142", + "39.6": "142", + "39.7": "142", + "39.8": "142", + "40.0": "144", + "40.1": "144", + "40.2": "144", + "40.3": "144", + "40.4": "144", + "40.5": "144", + "40.6": "144", + "40.7": "144", + "40.8": "144", + "40.9": "144", + "40.10": "144", + "41.0": "146", + "41.1": "146", + "41.2": "146", + "41.3": "146", + "41.4": "146", + "41.5": "146", + "41.6": "146", + "41.7": "146", + "41.8": "146", + "41.9": "146", + "41.10": "146", + "42.0": "148", + "42.1": "148", + "42.2": "148", + "42.3": "148", + "42.4": "148", + "42.5": "148", + "42.6": "148", + "42.7": "148", + "42.8": "148", + "42.9": "148", + "42.10": "148", + "42.11": "148", + "43.0": "150", + "43.1": "150", + "43.2": "150", + "43.3": "150", + "43.4": "150", + "43.5": "150", + "43.6": "150", + "43.7": "150", + "44.0": "152", + "44.1": "152", + "44.2": "152", + "44.3": "152", + "44.4": "152", + "44.5": "152", + "44.6": "152", + "44.7": "152", + "45.0": "156" +}; \ No newline at end of file diff --git a/e-commerce/node_modules/electron-to-chromium/versions.json b/e-commerce/node_modules/electron-to-chromium/versions.json new file mode 100644 index 0000000000000000000000000000000000000000..71bf9f88319dd0244692fdf41eddc3861fc7217f --- /dev/null +++ b/e-commerce/node_modules/electron-to-chromium/versions.json @@ -0,0 +1 @@ +{"0.20":"39","0.21":"41","0.22":"41","0.23":"41","0.24":"41","0.25":"42","0.26":"42","0.27":"43","0.28":"43","0.29":"43","0.30":"44","0.31":"45","0.32":"45","0.33":"45","0.34":"45","0.35":"45","0.36":"47","0.37":"49","1.0":"49","1.1":"50","1.2":"51","1.3":"52","1.4":"53","1.5":"54","1.6":"56","1.7":"58","1.8":"59","2.0":"61","2.1":"61","3.0":"66","3.1":"66","4.0":"69","4.1":"69","4.2":"69","5.0":"73","6.0":"76","6.1":"76","7.0":"78","7.1":"78","7.2":"78","7.3":"78","8.0":"80","8.1":"80","8.2":"80","8.3":"80","8.4":"80","8.5":"80","9.0":"83","9.1":"83","9.2":"83","9.3":"83","9.4":"83","10.0":"85","10.1":"85","10.2":"85","10.3":"85","10.4":"85","11.0":"87","11.1":"87","11.2":"87","11.3":"87","11.4":"87","11.5":"87","12.0":"89","12.1":"89","12.2":"89","13.0":"91","13.1":"91","13.2":"91","13.3":"91","13.4":"91","13.5":"91","13.6":"91","14.0":"93","14.1":"93","14.2":"93","15.0":"94","15.1":"94","15.2":"94","15.3":"94","15.4":"94","15.5":"94","16.0":"96","16.1":"96","16.2":"96","17.0":"98","17.1":"98","17.2":"98","17.3":"98","17.4":"98","18.0":"100","18.1":"100","18.2":"100","18.3":"100","19.0":"102","19.1":"102","20.0":"104","20.1":"104","20.2":"104","20.3":"104","21.0":"106","21.1":"106","21.2":"106","21.3":"106","21.4":"106","22.0":"108","22.1":"108","22.2":"108","22.3":"108","23.0":"110","23.1":"110","23.2":"110","23.3":"110","24.0":"112","24.1":"112","24.2":"112","24.3":"112","24.4":"112","24.5":"112","24.6":"112","24.7":"112","24.8":"112","25.0":"114","25.1":"114","25.2":"114","25.3":"114","25.4":"114","25.5":"114","25.6":"114","25.7":"114","25.8":"114","25.9":"114","26.0":"116","26.1":"116","26.2":"116","26.3":"116","26.4":"116","26.5":"116","26.6":"116","27.0":"118","27.1":"118","27.2":"118","27.3":"118","28.0":"120","28.1":"120","28.2":"120","28.3":"120","29.0":"122","29.1":"122","29.2":"122","29.3":"122","29.4":"122","30.0":"124","30.1":"124","30.2":"124","30.3":"124","30.4":"124","30.5":"124","31.0":"126","31.1":"126","31.2":"126","31.3":"126","31.4":"126","31.5":"126","31.6":"126","31.7":"126","32.0":"128","32.1":"128","32.2":"128","32.3":"128","33.0":"130","33.1":"130","33.2":"130","33.3":"130","33.4":"130","34.0":"132","34.1":"132","34.2":"132","34.3":"132","34.4":"132","34.5":"132","35.0":"134","35.1":"134","35.2":"134","35.3":"134","35.4":"134","35.5":"134","35.6":"134","35.7":"134","36.0":"136","36.1":"136","36.2":"136","36.3":"136","36.4":"136","36.5":"136","36.6":"136","36.7":"136","36.8":"136","36.9":"136","37.0":"138","37.1":"138","37.2":"138","37.3":"138","37.4":"138","37.5":"138","37.6":"138","37.7":"138","37.8":"138","37.9":"138","37.10":"138","38.0":"140","38.1":"140","38.2":"140","38.3":"140","38.4":"140","38.5":"140","38.6":"140","38.7":"140","38.8":"140","39.0":"142","39.1":"142","39.2":"142","39.3":"142","39.4":"142","39.5":"142","39.6":"142","39.7":"142","39.8":"142","40.0":"144","40.1":"144","40.2":"144","40.3":"144","40.4":"144","40.5":"144","40.6":"144","40.7":"144","40.8":"144","40.9":"144","40.10":"144","41.0":"146","41.1":"146","41.2":"146","41.3":"146","41.4":"146","41.5":"146","41.6":"146","41.7":"146","41.8":"146","41.9":"146","41.10":"146","42.0":"148","42.1":"148","42.2":"148","42.3":"148","42.4":"148","42.5":"148","42.6":"148","42.7":"148","42.8":"148","42.9":"148","42.10":"148","42.11":"148","43.0":"150","43.1":"150","43.2":"150","43.3":"150","43.4":"150","43.5":"150","43.6":"150","43.7":"150","44.0":"152","44.1":"152","44.2":"152","44.3":"152","44.4":"152","44.5":"152","44.6":"152","44.7":"152","45.0":"156"} \ No newline at end of file diff --git a/e-commerce/node_modules/enhanced-resolve/LICENSE b/e-commerce/node_modules/enhanced-resolve/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8c11fc7289b75463fe07534fcc8224e333feb7ff --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/e-commerce/node_modules/enhanced-resolve/README.md b/e-commerce/node_modules/enhanced-resolve/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a1ac5c522d01c17e8248e483b145ff6766542b0b --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/README.md @@ -0,0 +1,907 @@ +# enhanced-resolve + +[![npm][npm]][npm-url] +[![Build Status][build-status]][build-status-url] +[![codecov][codecov-badge]][codecov-url] +[![Install Size][size]][size-url] +[![GitHub Discussions][discussion]][discussion-url] + +Offers an async require.resolve function. It's highly configurable. + +## Features + +- plugin system +- provide a custom filesystem +- sync and async node.js filesystems included + +## Getting Started + +### Install + +```sh +# npm +npm install enhanced-resolve +# or Yarn +yarn add enhanced-resolve +# or pnpm +pnpm add enhanced-resolve +``` + +### Resolve + +There is a Node.js API which allows to resolve requests according to the Node.js resolving rules. +Sync, async (callback) and promise APIs are offered. A `create` method allows to create a custom resolve function. + +```js +const resolve = require("enhanced-resolve"); + +resolve("/some/path/to/folder", "module/dir", (err, result) => { + result; // === "/some/path/node_modules/module/dir/index.js" +}); + +resolve.sync("/some/path/to/folder", "../../dir"); +// === "/some/path/dir/index.js" + +const result = await resolve.promise("/some/path/to/folder", "../../dir"); +// === "/some/path/dir/index.js" + +const myResolve = resolve.create({ + // or resolve.create.sync / resolve.create.promise + extensions: [".ts", ".js"], + // see more options below +}); + +myResolve("/some/path/to/folder", "ts-module", (err, result) => { + result; // === "/some/node_modules/ts-module/index.ts" +}); +``` + +### Public API + +All of the following are exposed from `require("enhanced-resolve")`. + +#### `resolve(context?, parent, specifier, resolveContext?, callback)` + +Async Node-style resolver using the built-in defaults (`conditionNames: ["node"]`, `extensions: [".js", ".json", ".node"]`). Both `context` and `resolveContext` are optional, so the function accepts four shapes: + +```js +resolve(context, parent, specifier, resolveContext, callback); +resolve(context, parent, specifier, callback); +resolve(parent, specifier, resolveContext, callback); +resolve(parent, specifier, callback); // most common +``` + +The `parent` / `specifier` naming mirrors the ECMAScript resolution terms (as in `import.meta.resolve(specifier, parent)`): `parent` is the location you resolve **from**, and `specifier` is the string being resolved. + +##### Arguments — what each one is and when to pass it + +| Argument | Required | What it is | When to pass it | +| ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `context` | no | Extra info about _who_ is requesting, e.g. `{ environments: ["node+es3+es5+process+native"] }`. Plugins can read arbitrary keys off it. When omitted, a built-in Node context is used. | Pass it only when a plugin you use reads from it. Most callers omit it. | +| `parent` | yes | The absolute directory to resolve **from** — the location the `specifier` is relative to (the ECMAScript "parent", historically called the "lookup start path"). | Always. | +| `specifier` | yes | The string to resolve — a relative specifier (`./utils`), a bare module (`lodash/merge`), an alias, etc. (the ECMAScript "specifier", historically called the "request"). | Always. | +| `resolveContext` | no | A collector object the resolver writes into / reads from: `fileDependencies`, `contextDependencies`, `missingDependencies` (`Set`s it fills in), `log` (a function it calls for trace output). | Pass it when you need to know which files/dirs were touched (e.g. to set up a watcher) or want a log of the resolution steps. | +| `callback` | yes | `(err, result, resolveRequest) => void`. `result` is the resolved absolute path (or `false` if the request resolves to an ignored module). `resolveRequest` is the full request object with `path`, `query`, `fragment`, `descriptionFilePath`, etc. | Always. | + +##### Minimal form — just `parent`, `specifier`, `callback` + +```js +const resolve = require("enhanced-resolve"); + +resolve(__dirname, "./utils", (err, result) => { + if (err) throw err; + result; // === "/abs/path/to/utils.js" +}); +``` + +##### Inspecting the full result via the third callback argument + +```js +resolve(__dirname, "./utils?query#frag", (err, result, resolveRequest) => { + result; // === "/abs/path/to/utils.js?query#frag" — path with query/fragment appended + resolveRequest.path; // === "/abs/path/to/utils.js" (the bare path, no query/fragment) + resolveRequest.query; // === "?query" (empty string if the request has none) + resolveRequest.fragment; // === "#frag" (empty string if the request has none) + resolveRequest.descriptionFilePath; // path to the nearest package.json, if any +}); +``` + +##### With `resolveContext` — collect dependencies and a log + +Pass a `resolveContext` when you need the resolver to report back _what it looked at_. The `Set`s you provide are filled in during resolution, and `log` is called with each step: + +```js +const fileDependencies = new Set(); +const missingDependencies = new Set(); +const contextDependencies = new Set(); +const logs = []; + +resolve( + __dirname, + "./utils", + { + fileDependencies, // files that were read/checked + missingDependencies, // paths that were probed but didn't exist + contextDependencies, // directories that were read + log: (msg) => logs.push(msg), // trace of each resolution step + }, + (err, result) => { + result; // === "/abs/path/to/utils.js" + fileDependencies; // Set { ".../utils.js", ".../package.json", ... } + missingDependencies; // Set { ".../utils", ".../utils.json", ... } (candidates tried) + // `fileDependencies` / `missingDependencies` are exactly what you'd feed + // a file watcher so a rebuild re-runs when any of them changes. + }, +); +``` + +##### With a custom `context` + +Pass a `context` when a plugin reads from it. The default resolver only uses `environments`, but custom plugins may key off anything you put here: + +```js +resolve( + { environments: ["node+es3+es5+process+native"] }, // context + __dirname, + "./utils", + (err, result) => { + result; // === "/abs/path/to/utils.js" + }, +); +``` + +#### `resolve.sync(context?, parent, specifier, resolveContext?) => string | false` + +Synchronous variant. Throws on failure, returns `false` when the resolve yields no result. + +```js +const file = resolve.sync(__dirname, "./utils"); +``` + +#### `resolve.promise(context?, parent, specifier, resolveContext?) => Promise` + +Promise variant of `resolve`. + +```js +const file = await resolve.promise(__dirname, "./utils"); +``` + +#### `resolve.create(options) => ResolveFunctionAsync` + +Builds a customized async resolve function. Options are the same as for [`ResolverFactory.createResolver`](#resolver-options); `fileSystem` defaults to the built-in Node.js filesystem. + +```js +const resolveTs = resolve.create({ extensions: [".ts", ".tsx", ".js"] }); + +resolveTs(__dirname, "./component", (err, result) => { + // result === "/abs/path/to/component.tsx" +}); +``` + +#### `resolve.create.sync(options) => ResolveFunction` + +Sync variant of `resolve.create`. + +```js +const resolveTsSync = resolve.create.sync({ extensions: [".ts", ".js"] }); +const file = resolveTsSync(__dirname, "./component"); +``` + +#### `resolve.create.promise(options) => ResolveFunctionPromise` + +Promise variant of `resolve.create`. + +```js +const resolveTsPromise = resolve.create.promise({ extensions: [".ts", ".js"] }); +const file = await resolveTsPromise(__dirname, "./component"); +``` + +#### `ResolverFactory.createResolver(options) => Resolver` + +Lower-level factory. Returns a `Resolver` whose `resolve`, `resolveSync`, and `resolvePromise` methods accept `(context, parent, specifier, resolveContext, [callback])`. Use this when you need a reusable resolver instance or access to its `hooks` (see the [Plugins](#plugins) section). `fileSystem` is required here — the high-level `resolve.create` defaults it for you. + +```js +const fs = require("fs"); +const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); + +const resolver = ResolverFactory.createResolver({ + fileSystem: new CachedInputFileSystem(fs, 4000), + extensions: [".js", ".json"], +}); + +// callback +resolver.resolve({}, __dirname, "./utils", {}, (err, file) => { + // ... +}); + +// sync (requires a sync fileSystem) +const fileSync = resolver.resolveSync({}, __dirname, "./utils"); + +// promise +const filePromise = await resolver.resolvePromise({}, __dirname, "./utils", {}); +``` + +#### `CachedInputFileSystem(fileSystem, duration)` + +Wraps any Node-compatible `fs` to add an in-memory cache for `stat`, `readdir`, `readFile`, `readJson`, and `readlink`. `duration` is the cache TTL in milliseconds (typically `4000`). Call `.purge()` to invalidate, or `.purge(path)` / `.purge([path, ...])` to invalidate specific entries — do this whenever you know files changed (e.g. from a watcher). + +```js +const fs = require("fs"); +const { CachedInputFileSystem } = require("enhanced-resolve"); + +const cachedFs = new CachedInputFileSystem(fs, 4000); +// later, when files change: +cachedFs.purge("/abs/path/to/changed-file.js"); +``` + +#### Exported plugins & helpers + +For use with the `plugins` option or as standalone utilities: + +- `ResolverFactory` — see above. +- `CachedInputFileSystem` — see above. +- `CloneBasenamePlugin(source, target)` — joins the directory's basename onto the path. See [Built-in Plugins](#built-in-plugins). +- `LogInfoPlugin(source)` — logs pipeline state at a hook; enable by passing a `log` function on the `resolveContext`. +- `TsconfigPathsPlugin(options)` — applies `tsconfig.json` `paths` / `baseUrl` mappings; typically configured via the `tsconfig` resolver option instead. +- `forEachBail(array, iterator, callback)` — bail-style async iterator used internally; useful when authoring plugins that try several candidates in order. + +```js +const { LogInfoPlugin } = require("enhanced-resolve"); + +const resolver = ResolverFactory.createResolver({ + fileSystem: cachedFs, + extensions: [".js"], + plugins: [new LogInfoPlugin("described-resolve")], +}); + +resolver.resolve( + {}, + __dirname, + "./utils", + { log: (msg) => console.log(msg) }, + () => {}, +); +``` + +### Creating a Resolver + +The easiest way to create a resolver is to use the `createResolver` function on `ResolveFactory`, along with one of the supplied File System implementations. + +```js +const fs = require("fs"); +const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); + +// create a resolver +const myResolver = ResolverFactory.createResolver({ + // Typical usage will consume the `fs` + `CachedInputFileSystem`, which wraps Node.js `fs` to add caching. + fileSystem: new CachedInputFileSystem(fs, 4000), + extensions: [".js", ".json"], + /* any other resolver options here. Options/defaults can be seen below */ +}); + +// resolve a file with the new resolver +const context = {}; +const parent = "/Users/webpack/some/root/dir"; // directory to resolve from +const specifier = "./path/to-look-up.js"; // string to resolve +const resolveContext = {}; + +// callback +myResolver.resolve( + context, + parent, + specifier, + resolveContext, + (err /* Error */, filepath /* string */) => { + // Do something with the path + }, +); + +// promise +try { + const filepath = await myResolver.resolvePromise( + context, + parent, + specifier, + resolveContext, + ); + // Do something with the path +} catch (err) { + // handle resolve failure +} + +// sync (requires a sync fileSystem, e.g. the default Node.js one) +const filepath = myResolver.resolveSync(context, parent, specifier); +``` + +#### Resolver Options + +| Field | Default | Description | +| ------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| alias | [] | A list of module alias configurations or an object which maps key to value | +| aliasFields | [] | A list of alias fields in description files | +| extensionAlias | {} | An object which maps extension to extension aliases | +| extensionAliasForExports | false | Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned) | +| cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. | +| cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key | +| conditionNames | [] | A list of exports field condition names | +| descriptionFiles | ["package.json"] | A list of description files to read from | +| enforceExtension | false | Enforce that a extension from extensions must be used | +| exportsFields | ["exports"] | A list of exports fields in description files | +| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files | +| fallback | [] | Same as `alias`, but only used if default resolving fails | +| fileSystem | | The file system which should be used | +| fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) | +| mainFields | ["main"] | A list of main fields in description files | +| mainFiles | ["index"] | A list of main files in directories | +| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | +| packageMap | undefined | **Experimental.** A [Node.js package map](https://nodejs.org/api/packages.html#package-maps): a path (or `file:` URL) to the configuration file, or an object with `configFile` and already-parsed `packages`. Bare specifiers then resolve through the map instead of `node_modules`. | +| plugins | [] | A list of additional resolve plugins which should be applied | +| resolver | undefined | A prepared Resolver to which the plugins are attached | +| resolveToContext | false | Resolve to a context instead of a file | +| preferRelative | false | Prefer to resolve module requests as relative request and fallback to resolving as module | +| preferAbsolute | false | Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots | +| restrictions | [] | A list of resolve restrictions | +| roots | [] | A list of root paths | +| symlinks | true | Whether to resolve symlinks to their symlinked location | +| tsconfig | false | TypeScript config for paths mapping. Can be `false` (disabled), `true` (use default `tsconfig.json`), a string path to `tsconfig.json`, or an object with `configFile`, `references`, and `baseUrl` options. Supports JSONC format (comments and trailing commas) like TypeScript compiler. | +| tsconfig.configFile | tsconfig.json | Path to the tsconfig.json file | +| tsconfig.references | [] | Project references. `'auto'` to load from tsconfig, or an array of paths to referenced projects | +| tsconfig.baseUrl | undefined | Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file | +| unsafeCache | false | Use this cache object to unsafely cache the successful requests | + +#### Option Examples + +Small snippets for the non-obvious options. All options are passed to `resolve.create({ ... })` or `ResolverFactory.createResolver({ ... })`. + +**`alias`** — rewrite matching requests to a target path, module, or to `false` to ignore them. Accepts an object or an array of entries (array form lets you specify ordering / `onlyModule`). + +```js +const options = { + alias: { + "@": path.resolve(__dirname, "src"), // @/utils → src/utils + lodash$: "lodash-es", // exact "lodash", not "lodash/foo" + "ignored-module": false, // short-circuit to an empty module + }, +}; +``` + +**`aliasFields`** — read alias maps from fields in `package.json`. The `browser` field is the common case: + +```js +const options = { aliasFields: ["browser"] }; +``` + +**`extensionAlias`** — maps one request extension to a list of candidate extensions. Useful for TypeScript ESM where imports are written with `.js` but the source is `.ts`. Applies both to direct requests (e.g. `./foo.js`) and to paths produced by the package.json `imports` field (e.g. `#foo` → `./foo.js` → `./foo.ts`). By default it does **not** apply to paths produced by the `exports` field (to stay aligned with Node.js, which does not substitute extensions on package-exported paths) — see `extensionAliasForExports` below to opt in: + +```js +const options = { + extensionAlias: { + ".js": [".ts", ".js"], + ".mjs": [".mts", ".mjs"], + }, +}; +``` + +**`extensionAliasForExports`** — when `true`, also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default to match Node.js. Turn it on if you want full alignment with TypeScript's resolver for packages that ship `.ts` sources alongside the compiled `.js` files they list in `exports` (e.g. monorepo source packages, or the `eslint-import-resolver-typescript` use case): + +```js +const options = { + extensionAlias: { ".js": [".ts", ".js"] }, + extensionAliasForExports: true, +}; +``` + +**`conditionNames` + `exportsFields`** — pick which conditions to match in the `exports` field of `package.json`: + +```js +const options = { + conditionNames: ["import", "node", "default"], + exportsFields: ["exports"], +}; +``` + +**`extensions`** — extensions to try for extensionless requests, in order: + +```js +const options = { extensions: [".ts", ".tsx", ".js", ".json"] }; +``` + +**`fallback`** — same shape as `alias`, but only consulted when the primary resolve fails. Handy for polyfills: + +```js +const options = { + fallback: { + crypto: require.resolve("crypto-browserify"), + stream: false, + }, +}; +``` + +**`modules`** — where to look for bare-module requests. Entries can be folder names (searched hierarchically up the tree) or absolute paths (searched directly): + +```js +const options = { modules: [path.resolve(__dirname, "src"), "node_modules"] }; +``` + +**`mainFields` / `mainFiles`** — fields in `package.json` to try for a package entry point, and filenames to try inside a directory: + +```js +const options = { + mainFields: ["browser", "module", "main"], + mainFiles: ["index"], +}; +``` + +**`roots` + `preferAbsolute`** — resolve server-relative URLs (starting with `/`) against one or more root directories. With `preferAbsolute: true`, absolute-path resolution is tried before the roots are consulted. + +```js +const options = { + roots: [path.resolve(__dirname, "public")], + preferAbsolute: false, +}; +``` + +**`restrictions`** — reject results that don't satisfy at least one restriction. Accepts strings (path prefixes) or `RegExp`s: + +```js +const options = { + restrictions: [path.resolve(__dirname, "src"), /\.(js|ts)$/], +}; +``` + +**`tsconfig`** — apply TypeScript `paths` / `baseUrl` mappings. Either pass `true` to load `./tsconfig.json`, a path string, or a configuration object: + +```js +const options = { + tsconfig: { + configFile: path.resolve(__dirname, "tsconfig.json"), + references: "auto", // honor project references declared in tsconfig + }, +}; +``` + +**`symlinks`** — resolve to the real path by following symlinks. Set to `false` to keep the symlinked path (common for monorepo / pnpm layouts where you want module identity tied to the workspace location): + +```js +const options = { symlinks: false }; +``` + +**`fullySpecified`** — require fully-specified requests (no extension inference, no `index` lookup) for non-internal requests. Matches Node.js ESM semantics: + +```js +const options = { fullySpecified: true }; +``` + +**`unsafeCache`** — pass an object to use as an in-memory cache of successful resolves. Set to `true` to let the resolver allocate its own: + +```js +const options = { + unsafeCache: {}, // or true + cacheWithContext: false, // skip context in the cache key — faster, but only safe if context doesn't change the result +}; +``` + +To observe whether a request was served from the cache, wrap the cache object in a `Proxy`. `UnsafeCachePlugin` reads entries with `cache[id]` (cache lookup) and writes them with `cache[id] = result` (cache store), so trapping `get` and `set` is enough to distinguish hits from misses: + +```js +const cache = {}; +const observedCache = new Proxy(cache, { + get(target, name, receiver) { + const hit = name in target; + console.log(hit ? `[cache hit] ${name}` : `[cache miss] ${name}`); + return Reflect.get(target, name, receiver); + }, + set(target, name, value, receiver) { + console.log(`[cache set] ${name}`); + return Reflect.set(target, name, value, receiver); + }, +}); + +const resolver = ResolverFactory.createResolver({ + fileSystem: new CachedInputFileSystem(fs, 4000), + extensions: [".js", ".json"], + unsafeCache: observedCache, +}); +``` + +The `name` argument is the cache id — a `JSON.stringify`'d object containing `type`, `context`, `path`, `query`, `fragment`, and `request` — so you can parse it to report on specific resolves. Only successful resolves go through the cache; failures never touch it. + +**`fileSystem`** — any `fs`-compatible implementation. Usually `new CachedInputFileSystem(fs, 4000)`; can be a virtual filesystem (e.g. `memfs`) for testing: + +```js +const options = { fileSystem: new CachedInputFileSystem(require("fs"), 4000) }; +``` + +**`packageMap`** (**experimental**) — resolve bare specifiers through a [Node.js package map](https://nodejs.org/api/packages.html#package-maps) instead of walking `node_modules`. Each package entry declares where it lives and which package id every bare specifier of its own maps to: + +```json +{ + "packages": { + "app": { + "url": "./packages/app", + "dependencies": { "@acme/utils": "utils" } + }, + "utils": { "url": "./packages/utils" } + } +} +``` + +```js +const options = { packageMap: path.resolve("./package-map.json") }; +// or, with the map already in memory: +const options2 = { + packageMap: { + // relative `url` values are resolved against this path + configFile: path.resolve("./package-map.json"), + packages: {/* ... */}, + }, +}; +``` + +The map is authoritative: when it is set, a bare specifier that the importing package does not declare is reported as unresolved rather than looked up in `node_modules`. Relative and absolute requests, and `node:` builtins, are unaffected. + +Because a package map may point several package ids at the same `url` (the same sources used with different dependency tables), the importing package cannot always be derived from the file path alone. Pass the package id along to remove the ambiguity — it is available on every result as `packageId`: + +```js +resolver({}, parent, specifier, {}, (err, result, request) => { + // `request.packageId` is the package the request resolved into; pass it + // back in as `context.packageId` for resolutions made from `result`. + resolver({ packageId: request.packageId }, result, next, {}, callback); +}); +``` + +Resolution fails with an error (rather than silently picking one) when the importing file lies outside every mapped package (`ERR_PACKAGE_MAP_EXTERNAL_FILE`) or when several package ids share its location and no package id was given (`ERR_PACKAGE_MAP_AMBIGUOUS_PACKAGE`). + +> Package maps are stability 1 (experimental) in Node.js, where they are only reachable behind `--experimental-package-map`. This option tracks that specification and may change with it, including in a patch release. + +**`plugins`** — additional plugin instances appended to the pipeline. See [Plugins](#plugins): + +```js +const options = { + plugins: [new TsconfigPathsPlugin({ configFile: "./tsconfig.json" })], +}; +``` + +## Plugins + +Similar to `webpack`, the core of `enhanced-resolve` functionality is implemented as individual plugins that are executed using [`tapable`](https://github.com/webpack/tapable). +These plugins can extend the functionality of the library, adding other ways for files/contexts to be resolved. + +A plugin should be a `class` (or its ES5 equivalent) with an `apply` method. The `apply` method will receive a `resolver` instance, that can be used to hook in to the event system. + +Plugins are executed in a pipeline, and register which event they should be executed before/after. `source` is the name of the event that starts the pipeline, and `target` is what event this plugin should fire, which is what continues the execution of the pipeline. For a full view of how these plugin events form a chain, see `lib/ResolverFactory.js`, in the `//// pipeline ////` section. + +### Built-in Plugins + +`enhanced-resolve` ships with the following plugins. Most of them are wired up automatically by `ResolverFactory` based on the [resolver options](#resolver-options); the ones exported from the package entry (`TsconfigPathsPlugin`, `CloneBasenamePlugin`, `LogInfoPlugin`) are the ones you're most likely to use explicitly. + +| Plugin | Purpose | +| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `AliasPlugin` | Replaces a matching request with one or more alternative targets. Powers the `alias` and `fallback` options. | +| `AliasFieldPlugin` | Applies aliasing based on a field in the description file (e.g. the `browser` field). Powers `aliasFields`. | +| `AppendPlugin` | Appends a string (typically an extension) to the current path. Used for `extensions`. | +| `CloneBasenamePlugin` | Joins the current directory basename onto the path (e.g. `/foo/bar` → `/foo/bar/bar`). Useful for directory-named main-file schemes. | +| `ConditionalPlugin` | Forwards the request only when it matches a given partial request shape. | +| `DescriptionFilePlugin` | Finds and loads the nearest description file (e.g. `package.json`) so other plugins can read its fields. Powers `descriptionFiles`. | +| `DirectoryExistsPlugin` | Only continues the pipeline if the current path is an existing directory. | +| `ExportsFieldPlugin` | Resolves requests through the `exports` field of a package's description file. Powers `exportsFields` and `conditionNames`. | +| `ExtensionAliasPlugin` | Maps one extension to a list of alternative extensions (e.g. `.js` → `.ts`, `.js`). Powers `extensionAlias`. | +| `FileExistsPlugin` | Only continues the pipeline if the current path is an existing file, and records the file as a dependency. | +| `ImportsFieldPlugin` | Resolves `#name` requests through the `imports` field of the enclosing package. | +| `JoinRequestPlugin` | Joins the current path with the current request into a new path. | +| `JoinRequestPartPlugin` | Splits a module request into module name + inner request, joining the inner request onto the path. | +| `LogInfoPlugin` | Emits verbose log output at a given pipeline step. Handy for debugging resolves via `resolveContext.log`. | +| `MainFieldPlugin` | Uses a field in the description file (e.g. `main`) to point to the entry file of a package. Powers `mainFields`. | +| `ModulesInHierarchicalDirectoriesPlugin` | Searches for a module by walking up parent directories (the standard `node_modules` lookup). Powers `modules`. | +| `ModulesInRootPlugin` | Searches for a module in a single absolute directory. Powers absolute-path entries in `modules`. | +| `NextPlugin` | Forwards the request from one hook to another without modification — glue between pipeline steps. | +| `PackageMapPlugin` | Resolves bare specifiers through a Node.js package map instead of `node_modules`. Powers `packageMap`. **Experimental.** | +| `ParsePlugin` | Parses a raw request string into its components (path, query, fragment, module flag, etc.). | +| `PnpPlugin` | Resolves module requests through a Yarn PnP API when one is available. | +| `RestrictionsPlugin` | Rejects results that don't match a list of path restrictions (strings or regular expressions). Powers `restrictions`. | +| `ResultPlugin` | Terminal plugin that fires the `result` hook — signals a successful resolve. | +| `RootsPlugin` | Resolves server-relative URL requests (starting with `/`) against one or more root directories. Powers `roots`. | +| `SelfReferencePlugin` | Resolves a package self-reference (e.g. `my-pkg/foo` from within `my-pkg`). | +| `SymlinkPlugin` | Real paths the resolved file by following symlinks. Can be disabled via the `symlinks` option. | +| `TryNextPlugin` | Forwards the request to the next hook with a log message. Useful for trying alternative resolutions. | +| `TsconfigPathsPlugin` | Rewrites requests using the `paths` and `baseUrl` from a `tsconfig.json`. Powers the `tsconfig` option. | +| `UnsafeCachePlugin` | Caches successful resolves in an in-memory map to speed up repeated requests. Powers `unsafeCache`. | +| `UseFilePlugin` | Joins a fixed filename onto the current path (e.g. `index`). Powers `mainFiles`. | + +#### Plugin wiring and goals + +One-line goal and default wiring (`source → target`) for each plugin. `*` means the plugin is tapped on several hooks — the common ones are listed. Plugins without a fixed wiring are user-tapped. + +- **`AliasPlugin`** — Goal: redirect requests matching a configured key to an alternative target. `raw-resolve` → `internal-resolve` for `alias`; `file` → `internal-resolve` as a last-chance remap; `described-resolve` → `internal-resolve` for `fallback`. +- **`AliasFieldPlugin`** — Goal: apply aliases declared in a description-file field like `browser`, so environment-specific substitutions happen without user config. `raw-resolve` / `file` → `internal-resolve`. +- **`AppendPlugin`** — Goal: try appending a fixed string (usually an extension) to the current path. `raw-file` → `file`, one instance per entry in `extensions`. +- **`CloneBasenamePlugin`** — Goal: join the directory's basename onto the path (e.g. `/foo/bar` → `/foo/bar/bar`) for directory-named-main layouts. User-wired via `plugins`. +- **`ConditionalPlugin`** — Goal: gate a forward on a partial match of the request shape (e.g. `{ module: true }`), used to fan-out at branching hooks. Tapped on `after-normal-resolve`, `resolve-as-module`, `described-relative`, and `raw-file`. +- **`DescriptionFilePlugin`** — Goal: locate and attach the nearest description file (usually `package.json`) so downstream plugins can read its fields. `parsed-resolve` → `described-resolve`, `relative` → `described-relative`, `undescribed-resolve-in-package` → `resolve-in-package`, `undescribed-existing-directory` → `existing-directory`, `undescribed-raw-file` → `raw-file`. +- **`DirectoryExistsPlugin`** — Goal: only continue the pipeline if the current path exists as a directory. `resolve-as-module` → `undescribed-resolve-in-package`, `directory` → `undescribed-existing-directory`. +- **`ExportsFieldPlugin`** — Goal: map a request through the `exports` field of a package's description file (with `conditionNames`). `resolve-in-package` → `relative`. +- **`ExtensionAliasPlugin`** — Goal: rewrite a request's extension to a list of candidate extensions (e.g. `.js` → `.ts`, `.js`) for TypeScript ESM and similar. `raw-resolve` → `normal-resolve` for direct requests; also `imports-field-relative` → `relative` so extension substitution applies to `imports`-field targets. +- **`FileExistsPlugin`** — Goal: confirm a candidate path exists as a file and record it as a file dependency. `final-file` → `existing-file`. +- **`ImportsFieldPlugin`** — Goal: resolve `#name` requests through the `imports` field of the enclosing package. `internal` → `imports-field-relative` (relative target) or `imports-resolve` (bare target). +- **`JoinRequestPlugin`** — Goal: join the current path with the current request into a single concrete path. `after-normal-resolve` → `relative` (three stage-offset copies for `preferRelative`, `preferAbsolute`, and default), `resolve-in-existing-directory` → `relative`. +- **`JoinRequestPartPlugin`** — Goal: split a module request into module name + inner request, joining the inner part onto the path. `module` → `resolve-as-module`. +- **`LogInfoPlugin`** — Goal: emit verbose log output at a chosen hook; enable by passing a `log` function on `resolveContext`. User-wired via `plugins`. +- **`MainFieldPlugin`** — Goal: follow a description-file field (e.g. `main`, `module`, `browser`) to the entry file of a package. `existing-directory` → `resolve-in-existing-directory`, one instance per entry in `mainFields`. +- **`ModulesInHierarchicalDirectoriesPlugin`** — Goal: search for a module by walking up parent directories (the standard `node_modules` lookup). `raw-module` → `module`; when PnP is enabled, `alternate-raw-module` → `module` too. +- **`ModulesInRootPlugin`** — Goal: search for a module in a single absolute directory (powers absolute-path entries in `modules`). `raw-module` → `module`. +- **`NextPlugin`** — Goal: glue — forward the current request unchanged from one hook to another. Used across the pipeline wherever two hooks should run sequentially. +- **`PackageMapPlugin`** — Goal: resolve bare specifiers through a [Node.js package map](https://nodejs.org/api/packages.html#package-maps) rather than `node_modules` (powers `packageMap`, experimental). `raw-module` → `undescribed-resolve-in-package`. +- **`ParsePlugin`** — Goal: split the raw request string into path / query / fragment / `module` / `directory` / `internal` flags. `resolve` → `parsed-resolve`; also wired on `internal-resolve` and `imports-resolve`. +- **`PnpPlugin`** — Goal: resolve bare-module requests through Yarn's PnP API when available. `raw-module` → `undescribed-resolve-in-package` on hit, `alternate-raw-module` on miss. +- **`RestrictionsPlugin`** — Goal: reject resolved paths that don't satisfy at least one string prefix or RegExp. Tapped on `resolved`. +- **`ResultPlugin`** — Goal: terminal plugin — fires the `result` lifecycle hook and signals a successful resolve. Tapped on `resolved`. +- **`RootsPlugin`** — Goal: resolve server-relative URL requests (starting with `/`) against one or more root directories. `after-normal-resolve` → `relative`. +- **`SelfReferencePlugin`** — Goal: resolve a package self-reference (`my-pkg/foo` from inside `my-pkg`) via its own `exports`. `raw-module` → `resolve-as-module`. +- **`SymlinkPlugin`** — Goal: real-path the resolved file by following symlinks; can be disabled via `symlinks: false`. `existing-file` → `existing-file` (runs via a stage offset on the same hook). +- **`TryNextPlugin`** — Goal: forward the request to another hook with a log message, useful for trying an alternative candidate. `raw-file` → `file` (as the "no extension" attempt) and user-wired. +- **`TsconfigPathsPlugin`** — Goal: rewrite requests using the `paths` and `baseUrl` from a `tsconfig.json` (including project references). Taps `described-resolve` internally and forwards to `internal-resolve`; exported for direct use as well. +- **`UnsafeCachePlugin`** — Goal: cache successful resolves in an in-memory map for repeated requests. `described-resolve` → `raw-resolve` (only when `unsafeCache` is enabled). +- **`UseFilePlugin`** — Goal: join a fixed filename (e.g. `index`) onto the current path to try as an entry file. `existing-directory` / `undescribed-existing-directory` → `undescribed-raw-file`, one instance per entry in `mainFiles`. + +### Hooks + +A resolver exposes two kinds of [`tapable`](https://github.com/webpack/tapable) hooks: + +- **Lifecycle hooks** on `resolver.hooks` — fired by the resolver itself around each `resolve` call. Use these to observe, not to transform the request. +- **Pipeline hooks** — the named steps that plugins tap as `source` and forward to as `target`. Every pipeline hook is an `AsyncSeriesBailHook<[request, resolveContext], request | null>`: return `callback()` to pass on, `callback(err)` to fail, or `callback(null, request)` to short-circuit with a result. Obtain them with `resolver.ensureHook(name)` (creates if missing) or `resolver.getHook(name)` (throws if missing); names are kebab-case or camelCase and are interchangeable. + +#### Lifecycle hooks + +| Hook | Type | Fires when | +| ------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `resolveStep` | `SyncHook` | Every time the resolver hands a request to a pipeline hook. Arguments: `(hook, request)`. Ideal for tracing. | +| `noResolve` | `SyncHook` | When a top-level `resolve()` call can't produce a result. Arguments: `(request, error)`. | +| `resolve` | `AsyncSeriesBailHook` | Entry point of the pipeline (also listed below). Tap this to intercept requests before parsing. | +| `result` | `AsyncSeriesHook` | After a successful resolve, with the final request. Fired by `ResultPlugin`. Tap to observe/record results without short-circuiting. | + +#### Pipeline hooks + +Listed roughly in the order the default pipeline visits them. Full wiring lives in `lib/ResolverFactory.js` under `//// pipeline ////`. + +| Hook | Role | +| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `resolve` | Entry point. `ParsePlugin` parses the raw request (path, query, fragment, module flag) and forwards to `parsed-resolve`. | +| `internal-resolve` | Re-entry point used by internal rewrites (e.g. after an `alias` fires). Same role as `resolve`, but `fullySpecified` is forced off. | +| `imports-resolve` | Re-entry point for the target of an `imports` field match; prevents recursive `#` resolution per the Node.js ESM spec. | +| `parsed-resolve` | Request has been parsed. `DescriptionFilePlugin` attaches the nearest `package.json`, then forwards to `described-resolve`. | +| `described-resolve` | Description file is attached. Where `unsafeCache`, `fallback`, and most user plugins (including `MyLibSrcPlugin` below) hook in. | +| `raw-resolve` | After description. Where `alias`, `aliasFields`, `tsconfig` paths, and `extensionAlias` rewrites fire before default resolution. | +| `normal-resolve` | Default resolution starts. Branches into `relative` (for `./`, `../`, absolute), `raw-module` (bare modules), or `internal` (`#imports`). | +| `internal` | `#name` imports-field entry. `ImportsFieldPlugin` maps the specifier and forwards to `imports-field-relative` or `imports-resolve`. | +| `imports-field-relative` | Concrete path from an `imports`-field match, before the normal `relative` flow. `ExtensionAliasPlugin` taps here so `.js` → `.ts` also fires for `#name` targets. Forwards to `relative`. | +| `raw-module` | Bare-module lookup. `SelfReferencePlugin`, `ModulesInHierarchicalDirectoriesPlugin`, `ModulesInRootPlugin`, `PackageMapPlugin`, and `PnpPlugin` all tap here. | +| `alternate-raw-module` | Fallback module lookup used by `PnpPlugin` when PnP can't resolve and `node_modules` should be tried. | +| `module` | A candidate module directory was built. `JoinRequestPartPlugin` splits off the inner request and forwards to `resolve-as-module`. | +| `resolve-as-module` | Treat candidate as a package. `DirectoryExistsPlugin` gates on existence; short single-file modules may re-enter via `undescribed-raw-file`. | +| `undescribed-resolve-in-package` | Inside a located package directory, before its `package.json` has been read. Loads the description, forwards to `resolve-in-package`. | +| `resolve-in-package` | Inside a package with its description loaded. `ExportsFieldPlugin` matches `exports`, otherwise forwards to `resolve-in-existing-directory`. | +| `resolve-in-existing-directory` | Package directory confirmed; join the remaining request onto it and continue at `relative`. | +| `relative` | A concrete path on disk. `DescriptionFilePlugin` loads the nearest `package.json` and forwards to `described-relative`. | +| `described-relative` | Branches to `raw-file` (treat as file) and `directory` (treat as directory). `resolveToContext` skips the file branch. | +| `directory` | Candidate directory. `DirectoryExistsPlugin` gates on existence and forwards to `undescribed-existing-directory`. | +| `undescribed-existing-directory` | Existing directory, before its `package.json` has been read. `UseFilePlugin` tries `mainFiles` via `undescribed-raw-file`. | +| `existing-directory` | Existing directory with description loaded. `MainFieldPlugin` tries `mainFields`; `UseFilePlugin` falls back to `mainFiles`. | +| `undescribed-raw-file` | Candidate file path, before description is read. Loads description, then forwards to `raw-file`. | +| `raw-file` | Apply extension handling: `ConditionalPlugin` short-circuits when `fullySpecified`, `TryNextPlugin` + `AppendPlugin` try each extension. | +| `file` | A specific file path. Last place `alias` and `aliasFields` can redirect; forwards to `final-file`. | +| `final-file` | `FileExistsPlugin` checks the file is real and records it as a file dependency, then forwards to `existing-file`. | +| `existing-file` | Real file on disk. `SymlinkPlugin` real-paths symlinks (unless `symlinks: false`), then forwards to `resolved`. | +| `resolved` | Terminal hook. `RestrictionsPlugin` enforces `restrictions`; `ResultPlugin` fires the `result` lifecycle hook. | + +#### `before-` and `after-` prefixes + +`ensureHook("before-foo")` and `getHook("before-foo")` return the `foo` hook with `stage: -10`; `after-foo` returns it with `stage: 10`. Use this to tap earlier or later than the default stage without creating a separate hook. You'll see `after-parsed-resolve`, `after-normal-resolve`, `after-relative`, and `after-undescribed-resolve-in-package` used this way inside `ResolverFactory`. + +#### Request flow by request type + +The same 26 pipeline hooks serve every request, but different request shapes take different paths through them. Each `➝` below is one `doResolve` / `NextPlugin` / plugin forward; `resolveStep` fires on every arrow, so tapping it (see [Hook examples](#hook-examples)) prints these chains live. + +Relative path (`./utils` from `/src/index.js`) — the default "resolve on disk" path: + +```text +resolve (ParsePlugin) + ➝ parsed-resolve (DescriptionFilePlugin attaches nearest package.json) + ➝ described-resolve (NextPlugin; or UnsafeCachePlugin short-circuit) + ➝ raw-resolve (NextPlugin; alias/tsconfig would branch here) + ➝ normal-resolve (JoinRequestPlugin: path=/src/utils, request="") + ➝ relative (DescriptionFilePlugin loads /src/package.json) + ➝ described-relative (branches to file and directory candidates) + ├─ ➝ raw-file (ConditionalPlugin / TryNextPlugin) + │ ➝ file (AppendPlugin tried each extension, e.g. .js) + │ ➝ final-file (FileExistsPlugin confirms the file) + │ ➝ existing-file (SymlinkPlugin real-paths it) + │ ➝ resolved (RestrictionsPlugin → ResultPlugin) + └─ ➝ directory (DirectoryExistsPlugin; used when path is a dir) + ➝ undescribed-existing-directory + ➝ existing-directory (MainFieldPlugin tries "main", UseFilePlugin tries "index") + ➝ undescribed-raw-file ➝ raw-file ➝ … +``` + +Bare module (`lodash/merge`) — walks up `node_modules`, then treats the hit as a package: + +```text +resolve ➝ parsed-resolve ➝ described-resolve ➝ raw-resolve ➝ normal-resolve + ➝ raw-module (ConditionalPlugin {module:true}) + ➝ module (ModulesInHierarchicalDirectoriesPlugin walks + /src/node_modules, /node_modules, …) + ➝ resolve-as-module (JoinRequestPartPlugin splits "lodash" / "./merge") + ➝ undescribed-resolve-in-package (DirectoryExistsPlugin gates on lodash/ existing) + ➝ resolve-in-package (DescriptionFilePlugin loads lodash/package.json) + ├─ ➝ relative (ExportsFieldPlugin, if "exports" matches) + └─ ➝ resolve-in-existing-directory (otherwise; JoinRequestPlugin joins "./merge") + ➝ relative ➝ … (same tail as the relative flow above) +``` + +Internal import (`#util` from inside a package) — re-enters the pipeline after mapping: + +```text +resolve ➝ parsed-resolve ➝ described-resolve ➝ raw-resolve ➝ normal-resolve + ➝ internal (ConditionalPlugin {internal:true}) + ➝ imports-resolve (ImportsFieldPlugin mapped "#util" to a bare target) + ➝ parsed-resolve ➝ … (fresh pipeline run, internal:false so # isn't remapped) +``` + +When the `imports` field maps to a relative target, the branch instead goes: + +```text + ➝ internal + ➝ imports-field-relative (ImportsFieldPlugin mapped "#util" to "./util.js"; + ExtensionAliasPlugin can swap .js → .ts here) + ➝ relative ➝ … (same tail as the relative flow above) +``` + +Alias hit (`@/button` with `alias: { "@": "/src" }`) — rewrites then restarts: + +```text +resolve ➝ parsed-resolve ➝ described-resolve + ➝ raw-resolve + ➝ internal-resolve (AliasPlugin rewrote request → "/src/button") + ➝ parsed-resolve ➝ … (fullySpecified forced off; AliasPlugin won't re-fire for the rewritten form) +``` + +`exports`-field hit inside a package (`pkg/feature` matching `"./feature"` in `exports`): + +```text +… ➝ raw-module ➝ module ➝ resolve-as-module ➝ undescribed-resolve-in-package + ➝ resolve-in-package + ➝ relative (ExportsFieldPlugin jumped to the exports target; + main-field / main-file logic is skipped) + ➝ described-relative ➝ raw-file ➝ file ➝ final-file ➝ existing-file ➝ resolved +``` + +Failure — every candidate opts out (`callback()`) and no handler ever short-circuits with a result. `noResolve` fires once, for the top-level request: + +```text +… ➝ final-file + ✗ FileExistsPlugin: ENOENT (opts out; no extension candidates left) + ⇠ bail hooks unwind, each tapped handler has already tried its alternatives + ⇒ top-level resolve() returns no result + ⇒ resolver.hooks.noResolve(request, error) (ResultPlugin never fires) +``` + +#### Hook examples + +Trace every pipeline step and observe failures via the lifecycle hooks: + +```js +resolver.hooks.resolveStep.tap("Trace", (hook, request) => { + console.log(`[step] ${hook.name}: ${request.request} @ ${request.path}`); +}); +resolver.hooks.noResolve.tap("Trace", (request, error) => { + console.log(`[fail] ${request.request}: ${error.message}`); +}); +resolver.hooks.result.tapAsync("Trace", (request, _ctx, callback) => { + console.log(`[done] ${request.path}`); + callback(); +}); +``` + +Short-circuit at `file` to redirect any `.css` request to a stub without continuing the pipeline: + +```js +class StubCssPlugin { + apply(resolver) { + resolver + .getHook("file") + .tapAsync("StubCssPlugin", (request, _ctx, callback) => { + if (!request.path || !request.path.endsWith(".css")) return callback(); + callback(null, { ...request, path: require.resolve("./empty.css") }); + }); + } +} +``` + +Forward to a different hook with `doResolve` to restart resolution with a rewritten request — see `MyLibSrcPlugin` in [Writing a Custom Plugin](#writing-a-custom-plugin) for the canonical pattern (`getHook("described-resolve")` → `doResolve(ensureHook("resolve"), …)`). + +### Writing a Custom Plugin + +The example below adds a plugin that rewrites any request starting with `my-lib/` to `my-lib/src/`. It taps the `described-resolve` hook (after the description file has been located) and forwards the rewritten request to `resolve`, so the pipeline restarts with the new request. + +```js +const fs = require("fs"); +const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); + +class MyLibSrcPlugin { + apply(resolver) { + const target = resolver.ensureHook("resolve"); + resolver + .getHook("described-resolve") + .tapAsync("MyLibSrcPlugin", (request, resolveContext, callback) => { + if (!request.request || !request.request.startsWith("my-lib/")) { + return callback(); + } + const newRequest = { + ...request, + request: request.request.replace(/^my-lib\//, "my-lib/src/"), + }; + resolver.doResolve( + target, + newRequest, + "rewrote my-lib → my-lib/src", + resolveContext, + callback, + ); + }); + } +} + +const myResolver = ResolverFactory.createResolver({ + fileSystem: new CachedInputFileSystem(fs, 4000), + extensions: [".js", ".json"], + plugins: [new MyLibSrcPlugin()], +}); +``` + +Tips for writing your own plugin: + +- Call `callback()` with no arguments to pass the request on to the next tapped handler at the same `source` hook. This is how you "opt out" when a request doesn't apply. +- Call `resolver.doResolve(target, newRequest, message, resolveContext, callback)` to continue the pipeline at a different hook with a (possibly modified) request. +- Return early with `callback(null, result)` to short-circuit with a specific result, or `callback(err)` to fail the resolve. +- See [Hooks](#hooks) for the full list of pipeline hooks, their order, and the `before-` / `after-` stage modifiers. `lib/ResolverFactory.js` has the exact wiring under `//// pipeline ////`. + +## Escaping + +It's allowed to escape `#` as `\0#` to avoid parsing it as fragment. + +enhanced-resolve will try to resolve requests containing `#` as path and as fragment, so it will automatically figure out if `./some#thing` means `.../some.js#thing` or `.../some#thing.js`. When a `#` is resolved as path it will be escaped in the result. Here: `.../some\0#thing.js`. + +## Tests + +```sh +npm run test +``` + +## Passing options from webpack + +If you are using `webpack`, and you want to pass custom options to `enhanced-resolve`, the options are passed from the `resolve` key of your webpack configuration e.g.: + +``` +resolve: { + extensions: ['.js', '.jsx'], + modules: [path.resolve(__dirname, 'src'), 'node_modules'], + plugins: [new DirectoryNamedWebpackPlugin()] + ... +}, +``` + +## License + +Copyright (c) 2012-2019 JS Foundation and other contributors + +MIT (http://www.opensource.org/licenses/mit-license.php) + +[npm]: https://img.shields.io/npm/v/enhanced-resolve.svg +[npm-url]: https://www.npmjs.com/package/enhanced-resolve +[build-status]: https://github.com/webpack/enhanced-resolve/actions/workflows/test.yml/badge.svg +[build-status-url]: https://github.com/webpack/enhanced-resolve/actions +[codecov-badge]: https://codecov.io/gh/webpack/enhanced-resolve/branch/main/graph/badge.svg?token=6B6NxtsZc3 +[codecov-url]: https://codecov.io/gh/webpack/enhanced-resolve +[size]: https://packagephobia.com/badge?p=enhanced-resolve +[size-url]: https://packagephobia.com/result?p=enhanced-resolve +[discussion]: https://img.shields.io/github/discussions/webpack/webpack +[discussion-url]: https://github.com/webpack/webpack/discussions diff --git a/e-commerce/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..0e803472dde4abfb8f5c87e67094128367b17a1b --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js @@ -0,0 +1,123 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const getInnerRequest = require("./getInnerRequest"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +// Sentinel stored in `_fieldDataCache` when a description file does not +// contain a usable alias field object. Lets us distinguish "not cached yet" +// from "no valid field" without calling back into `getField`. +const NO_FIELD_OBJECT = Symbol("NoFieldObject"); + +module.exports = class AliasFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} field field + * @param {string | ResolveStepHook} target target + */ + constructor(source, field, target) { + this.source = source; + this.field = field; + this.target = target; + // `this.field` is fixed for the plugin's lifetime, so caching + // per description-file content is safe. The cached value is either + // the resolved alias-map object or the `NO_FIELD_OBJECT` sentinel + // meaning "description file has no usable alias field". + /** @type {WeakMap} */ + this._fieldDataCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { + if (!request.descriptionFileData) return callback(); + const innerRequest = getInnerRequest(resolver, request); + if (!innerRequest) return callback(); + const { descriptionFileData } = request; + let fieldData = this._fieldDataCache.get(descriptionFileData); + if (fieldData === undefined) { + const raw = DescriptionFileUtils.getField( + descriptionFileData, + this.field, + ); + fieldData = + raw === null || typeof raw !== "object" + ? NO_FIELD_OBJECT + : /** @type {{ [k: string]: JsonPrimitive }} */ (raw); + this._fieldDataCache.set(descriptionFileData, fieldData); + } + if (fieldData === NO_FIELD_OBJECT) { + if (resolveContext.log) { + resolveContext.log( + `Field '${this.field}' doesn't contain a valid alias configuration`, + ); + } + return callback(); + } + /** @type {JsonPrimitive | undefined} */ + const data = Object.prototype.hasOwnProperty.call( + fieldData, + innerRequest, + ) + ? /** @type {{ [Key in string]: JsonPrimitive }} */ (fieldData)[ + innerRequest + ] + : innerRequest.startsWith("./") + ? /** @type {{ [Key in string]: JsonPrimitive }} */ (fieldData)[ + innerRequest.slice(2) + ] + : undefined; + if (data === innerRequest) return callback(); + if (data === undefined) return callback(); + if (data === false) { + /** @type {ResolveRequest} */ + const ignoreObj = { + ...request, + path: false, + }; + if (typeof resolveContext.yield === "function") { + resolveContext.yield(ignoreObj); + return callback(null, null); + } + return callback(null, ignoreObj); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: /** @type {string} */ (request.descriptionFileRoot), + request: /** @type {string} */ (data), + fullySpecified: false, + }; + resolver.doResolve( + target, + obj, + `aliased from description file ${ + request.descriptionFilePath + } with mapping '${innerRequest}' to '${/** @type {string} */ data}'`, + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other aliasing or raw request + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/AliasPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/AliasPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..608d27077b744a9446db6a898ade87a6fcbd285f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/AliasPlugin.js @@ -0,0 +1,63 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {string | string[] | false} Alias */ +/** @typedef {{ alias: Alias, name: string, onlyModule?: boolean }} AliasOption */ + +const { aliasResolveHandler, compileAliasOptions } = require("./AliasUtils"); + +/** + * When `alias` is given as an array, the targets are tried in priority + * order and the first matching one wins. Tried-and-failed higher-priority + * targets are recorded on `resolveContext.missingDependencies` (via the + * downstream `FileExistsPlugin`) so that a consumer's watcher can + * invalidate the resolve once one of them appears. The winning target is + * recorded on `resolveContext.fileDependencies`; its removal triggers + * re-resolution, at which point the fallback target is returned. + * + * Callers that cache successful resolves (e.g. webpack's `unsafeCache`) + * are responsible for invalidating those entries when the tracked + * dependencies change -- otherwise a stale path may survive across + * rebuilds even though this plugin itself would return the correct + * fallback on a fresh resolve. + */ +module.exports = class AliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {AliasOption | AliasOption[]} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = Array.isArray(options) ? options : [options]; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const compiled = compileAliasOptions(resolver, this.options); + + resolver + .getHook(this.source) + .tapAsync("AliasPlugin", (request, resolveContext, callback) => { + aliasResolveHandler( + resolver, + compiled, + target, + request, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/AliasUtils.js b/e-commerce/node_modules/enhanced-resolve/lib/AliasUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..e4ab4cbd3889013238ea74e4f27e1a253df03cdc --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/AliasUtils.js @@ -0,0 +1,333 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const { PathType, getType } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ +/** @typedef {string | string[] | false} Alias */ +/** @typedef {{ alias: Alias, name: string, onlyModule?: boolean }} AliasOption */ + +/** + * @typedef {object} CompiledAliasOption + * @property {string} name original alias name + * @property {string} nameWithSlash name + "/" — precomputed to avoid per-resolve concat + * @property {Alias} alias alias target(s) + * @property {boolean} onlyModule normalized onlyModule flag + * @property {string | null} absolutePath absolute form of `name` (with slash ending), null when not absolute + * @property {string | null} wildcardPrefix substring before the single "*" in `name`, null when no wildcard + * @property {string | null} wildcardSuffix substring after the single "*" in `name`, null when no wildcard + * @property {number} firstCharCode first character code of `name` — used as a cheap screen on the hot path. `-1` indicates "matches any first char" (empty wildcard prefix). + * @property {boolean} arrayAlias true when `alias` is an array — precomputed so the hot path skips `Array.isArray` + */ + +/** + * Bucketed view of compiled options used by `aliasResolveHandler` to avoid + * walking the full option list on every resolve. The `all` array preserves + * the legacy linear order (declaration order) for the fallback path. The + * `byFirstChar` map buckets options by the first char code of their `name` + * — each bucket preserves declaration order among its members. The + * `hasAnyFirstChar` flag is true when at least one option matches any + * first char (`firstCharCode === -1`), in which case resolve-time scans + * fall back to `all` to keep declaration-order semantics across buckets. + * The `useBuckets` flag is true only when bucketing would actually help — + * i.e. there are at least 2 distinct first chars AND no empty-prefix + * wildcard. When false, the resolve hot path skips the `Map.get` and + * iterates `all` directly with the per-option first-char-code screen + * (matching the pre-bucketing behavior). This avoids paying for `Map.get` + * on degenerate single-bucket lists like a long chain of aliases that + * all share one first char — the bucket lookup adds overhead without + * narrowing the candidate set, which showed up as a transient-memory + * regression on `pathological-deep-stack`. + * @typedef {object} CompiledAliasOptions + * @property {CompiledAliasOption[]} all declaration-ordered list + * @property {Map} byFirstChar bucketed by first char code + * @property {boolean} hasAnyFirstChar true when an empty-prefix wildcard is present + * @property {boolean} useBuckets true when the bucket fast-path should be used at resolve time + */ + +const EMPTY_LIST = /** @type {CompiledAliasOption[]} */ ([]); +const EMPTY_COMPILED_OPTIONS = /** @type {CompiledAliasOptions} */ ({ + all: EMPTY_LIST, + byFirstChar: new Map(), + hasAnyFirstChar: false, + useBuckets: false, +}); + +/** + * Precompute per-option strings used on every resolve so the hot path in + * `aliasResolveHandler` does no string concatenation / split work per entry. + * Called once per plugin apply — the returned structure is stable for the + * lifetime of the resolver. + * + * Beyond the per-option precompute step, this also partitions the list into + * a `byFirstChar` map so that, when no "empty-prefix" wildcards are + * present, the resolve-time scan only walks options whose `name` starts + * with the same char as the current request. For large alias lists (300+ + * entries) this turns an O(N) screen into O(K) where K is the bucket size + * for the request's first char. + * @param {Resolver} resolver resolver + * @param {AliasOption[]} options options + * @returns {CompiledAliasOptions} compiled options + */ +function compileAliasOptions(resolver, options) { + if (options.length === 0) return EMPTY_COMPILED_OPTIONS; + const all = /** @type {CompiledAliasOption[]} */ ( + Array.from({ length: options.length }) + ); + /** @type {Map} */ + const byFirstChar = new Map(); + let hasAnyFirstChar = false; + for (let i = 0; i < options.length; i++) { + const item = options[i]; + const { name } = item; + let absolutePath = null; + const type = getType(name); + if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { + absolutePath = resolver.join(name, "_").slice(0, -1); + } + const firstStar = name.indexOf("*"); + let wildcardPrefix = null; + let wildcardSuffix = null; + if (firstStar !== -1 && !name.includes("*", firstStar + 1)) { + wildcardPrefix = name.slice(0, firstStar); + wildcardSuffix = name.slice(firstStar + 1); + } + // firstCharCode: used by `aliasResolveHandler` to quickly skip aliases + // whose name can't possibly match the current innerRequest. For a plain + // alias (no wildcard) the first char of the name is also the first char + // of `nameWithSlash` and of `absolutePath` (since the latter is derived + // from name via `resolver.join(name, "_")`, which only appends). For a + // wildcard with a non-empty prefix, the first char of that prefix is + // also the first char of name. Only the `name === "*"` case (empty + // wildcard prefix) can match arbitrary first chars — encode that as -1. + let firstCharCode; + if (wildcardPrefix !== null && wildcardPrefix.length === 0) { + firstCharCode = -1; + } else { + firstCharCode = name.length > 0 ? name.charCodeAt(0) : -1; + } + const compiled = { + name, + nameWithSlash: `${name}/`, + alias: item.alias, + onlyModule: Boolean(item.onlyModule), + absolutePath, + wildcardPrefix, + wildcardSuffix, + firstCharCode, + arrayAlias: Array.isArray(item.alias), + }; + all[i] = compiled; + if (firstCharCode === -1) { + hasAnyFirstChar = true; + } else { + let bucket = byFirstChar.get(firstCharCode); + if (bucket === undefined) { + bucket = []; + byFirstChar.set(firstCharCode, bucket); + } + bucket.push(compiled); + } + } + // Only enable the bucket fast-path when it would actually help. With + // a single bucket (all aliases share one first char, e.g. a chain of + // `chain-0 -> chain-1 -> …` rewrites), the resolve-time `Map.get` + // does no discrimination — every request lands in that one bucket + // or in nothing — and the lookup is overhead compared to walking + // `all` with the per-option first-char-code screen. Requiring 2+ + // distinct first chars matches the cases where bucketing has + // measurable benefit (huge-alias-* / large-alias-list / stack-churn). + const useBuckets = !hasAnyFirstChar && byFirstChar.size >= 2; + return { all, byFirstChar, hasAnyFirstChar, useBuckets }; +} + +/** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */ +/** + * @param {Resolver} resolver resolver + * @param {CompiledAliasOptions} options compiled options + * @param {ResolveStepHook} target target + * @param {ResolveRequest} request request + * @param {ResolveContext} resolveContext resolve context + * @param {InnerCallback} callback callback + * @returns {void} + */ +function aliasResolveHandler( + resolver, + options, + target, + request, + resolveContext, + callback, +) { + if (options.all.length === 0) return callback(); + const innerRequest = request.request || request.path; + if (!innerRequest) return callback(); + + // Precompute values used in the inner scan loop so we don't recompute + // them per option. This is meaningful when `options` has hundreds of + // entries (e.g. monorepos with generated alias lists) — see the + // `huge-alias-list` / `huge-alias-miss` benchmarks. + const innerFirstCharCode = innerRequest.charCodeAt(0); + const hasRequestString = Boolean(request.request); + + // Dispatch through the first-char-code bucket when it actually + // narrows the candidate set (`useBuckets` requires 2+ distinct + // first chars and no empty-prefix wildcard). When the field has + // only one first-char bucket — e.g. a long chain of `chain-N` + // aliases that all start with the same char — every request lands + // in that one bucket or nothing, so `Map.get` is overhead vs. just + // walking `all` with the per-option char-code screen. Walking + // `all` also matches the pre-bucketing behavior and keeps the + // `pathological-deep-stack` allocation profile flat. + let scan; + if (options.useBuckets) { + const bucket = options.byFirstChar.get(innerFirstCharCode); + if (bucket === undefined) return callback(); + scan = bucket; + } else { + scan = options.all; + } + + forEachBail( + scan, + (item, callback) => { + // Char-code screen left in for the fallback (`options.all`) path + // where the bucket dispatch above wasn't usable. In the bucket + // path this is always true and folds into a no-op. + const { firstCharCode } = item; + if (firstCharCode !== -1 && firstCharCode !== innerFirstCharCode) { + return callback(); + } + + /** @type {boolean} */ + let shouldStop = false; + + // For absolute-name aliases, accept the normalized + // `absolutePath` form as well as the raw `nameWithSlash`. + // `nameWithSlash` unconditionally appends `/`, so a raw + // windows request with native backslashes + // (e.g. `C:\\abs\\foo\\baz` against `name: "C:\\abs\\foo"`) + // otherwise fails `startsWith("C:\\abs\\foo/")` and is + // silently skipped. Mirroring the `absolutePath` check in + // both branches closes the gap without changing any + // existing matches. + const { absolutePath } = item; + const matchRequest = + innerRequest === item.name || + (!item.onlyModule && + ((hasRequestString && innerRequest.startsWith(item.nameWithSlash)) || + (absolutePath !== null && innerRequest.startsWith(absolutePath)))); + + const matchWildcard = !item.onlyModule && item.wildcardPrefix !== null; + + if (matchRequest || matchWildcard) { + /** + * @param {Alias} alias alias + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @returns {void} + */ + const resolveWithAlias = (alias, callback) => { + if (alias === false) { + /** @type {ResolveRequest} */ + const ignoreObj = { + ...request, + path: false, + }; + if (typeof resolveContext.yield === "function") { + resolveContext.yield(ignoreObj); + return callback(null, null); + } + return callback(null, ignoreObj); + } + + let newRequestStr; + + if ( + matchWildcard && + innerRequest.startsWith( + /** @type {string} */ (item.wildcardPrefix), + ) && + innerRequest.endsWith(/** @type {string} */ (item.wildcardSuffix)) + ) { + const match = innerRequest.slice( + /** @type {string} */ (item.wildcardPrefix).length, + innerRequest.length - + /** @type {string} */ (item.wildcardSuffix).length, + ); + newRequestStr = alias.toString().replace("*", match); + } + + if ( + matchRequest && + innerRequest !== alias && + !innerRequest.startsWith(`${alias}/`) + ) { + /** @type {string} */ + const remainingRequest = innerRequest.slice(item.name.length); + newRequestStr = alias + remainingRequest; + } + + if (newRequestStr !== undefined) { + shouldStop = true; + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: newRequestStr, + fullySpecified: false, + }; + return resolver.doResolve( + target, + obj, + `aliased with mapping '${item.name}': '${alias}' to '${newRequestStr}'`, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + return callback(); + }, + ); + } + return callback(); + }; + + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + const stoppingCallback = (err, result) => { + if (err) return callback(err); + + if (result) return callback(null, result); + // Don't allow other aliasing or raw request + if (shouldStop) return callback(null, null); + return callback(); + }; + + if (item.arrayAlias) { + return forEachBail( + /** @type {string[]} */ (item.alias), + resolveWithAlias, + stoppingCallback, + ); + } + return resolveWithAlias(item.alias, stoppingCallback); + } + + return callback(); + }, + callback, + ); +} + +module.exports.aliasResolveHandler = aliasResolveHandler; +module.exports.compileAliasOptions = compileAliasOptions; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/AppendPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/AppendPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..6763d5284a224a4b2eac6c920c2d9fbc685a7a18 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/AppendPlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class AppendPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} appending appending + * @param {string | ResolveStepHook} target target + */ + constructor(source, appending, target) { + this.source = source; + this.appending = appending; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("AppendPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: request.path + this.appending, + relativePath: + request.relativePath && request.relativePath + this.appending, + }; + resolver.doResolve( + target, + obj, + this.appending, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js b/e-commerce/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js new file mode 100644 index 0000000000000000000000000000000000000000..73d3dc89cc4c26ee0a3c239fdcc0d2347970513d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js @@ -0,0 +1,845 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// eslint-disable-next-line n/prefer-global/process +const { nextTick } = require("process"); + +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").PathLike} PathLike */ +/** @typedef {import("./Resolver").PathOrFileDescriptor} PathOrFileDescriptor */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {FileSystem & SyncFileSystem} BaseFileSystem */ + +/** + * @template T + * @typedef {import("./Resolver").FileSystemCallback} FileSystemCallback + */ + +/** + * @param {string} path path + * @returns {string} dirname + */ +const dirname = (path) => { + let idx = path.length - 1; + while (idx >= 0) { + const char = path.charCodeAt(idx); + // slash or backslash + if (char === 47 || char === 92) break; + idx--; + } + if (idx < 0) return ""; + return path.slice(0, idx); +}; + +/** + * @template T + * @param {FileSystemCallback[]} callbacks callbacks + * @param {Error | null} err error + * @param {T} result result + */ +const runCallbacks = (callbacks, err, result) => { + if (callbacks.length === 1) { + callbacks[0](err, result); + callbacks.length = 0; + return; + } + let error; + for (const callback of callbacks) { + try { + callback(err, result); + } catch (err) { + if (!error) error = err; + } + } + callbacks.length = 0; + if (error) throw error; +}; + +// eslint-disable-next-line jsdoc/reject-function-type +/** @typedef {Function} EXPECTED_FUNCTION */ +// eslint-disable-next-line jsdoc/reject-any-type +/** @typedef {any} EXPECTED_ANY */ + +/** + * The first pending cache hit is held in these slots (a scheduled tick is + * pending iff `firstCallback` is set); later hits from the same synchronous + * burst spill into `dispatchQueue` as flat [callback, err, result] triples + * and are drained by the same tick. This keeps the common single-hit case + * as cheap as a plain `nextTick` while bursts share one tick. + * @type {FileSystemCallback | undefined} + */ +let firstCallback; +/** @type {Error | null} */ +let firstErr = null; +/** @type {EXPECTED_ANY} */ +let firstResult; +/** @type {EXPECTED_ANY[]} */ +let dispatchQueue = []; +let dispatchQueueLength = 0; +/** @type {EXPECTED_ANY[]} */ +let spareQueue = []; +// upper bound on the spill-array capacity kept alive between bursts +const MAX_RETAINED_QUEUE_LENGTH = 1024; + +const runDispatch = () => { + const callback = /** @type {FileSystemCallback} */ ( + firstCallback + ); + const err = firstErr; + const result = firstResult; + // clear before calling: hits made from inside a callback start a new tick + firstCallback = undefined; + firstErr = null; + firstResult = undefined; + if (dispatchQueueLength === 0) { + // single hit: no queue bookkeeping, a throw affects nobody else + callback(err, result); + return; + } + const queue = dispatchQueue; + const length = dispatchQueueLength; + // ping-pong the two arrays so draining never allocates + dispatchQueue = spareQueue; + dispatchQueueLength = 0; + let i = -3; + try { + callback(err, result); + for (i = 0; i < length; i += 3) { + queue[i](queue[i + 1], queue[i + 2]); + } + } finally { + // a throwing callback must not starve the rest: re-schedule the + // remainder ahead of anything scheduled during this drain (matching + // the old per-tick FIFO order) and rethrow + i += 3; + if (i < length) { + if (firstCallback === undefined) { + // no reentrant hit took the slot, so `dispatchQueue` is empty + firstCallback = queue[i]; + firstErr = queue[i + 1]; + firstResult = queue[i + 2]; + nextTick(runDispatch); + for (let j = i + 3; j < length; j++) { + dispatchQueue[dispatchQueueLength++] = queue[j]; + } + } else { + // a reentrant hit claimed the slot (and scheduled the tick); + // displace it behind the remainder to keep FIFO order + const rest = queue.slice(i, length); + rest.push(firstCallback, firstErr, firstResult); + for (let j = 0; j < dispatchQueueLength; j++) { + rest.push(dispatchQueue[j]); + } + [firstCallback, firstErr, firstResult] = rest; + dispatchQueue = rest.slice(3); + dispatchQueueLength = dispatchQueue.length; + } + } + // release references but keep the backing store, so the next burst + // does not have to re-grow the array from scratch + for (let j = 0; j < length; j++) queue[j] = undefined; + // bound the permanently retained capacity after a rare giant burst + if (queue.length > MAX_RETAINED_QUEUE_LENGTH) { + queue.length = MAX_RETAINED_QUEUE_LENGTH; + } + spareQueue = queue; + } +}; + +/** + * Cache hits stay asynchronous, but all hits from the same synchronous + * execution share a single `nextTick` instead of scheduling one each. + * @param {FileSystemCallback} callback callback + * @param {Error | null} err error + * @param {EXPECTED_ANY} result result + */ +const scheduleDispatch = (callback, err, result) => { + if (firstCallback === undefined) { + firstCallback = callback; + firstErr = err; + firstResult = result; + nextTick(runDispatch); + } else { + const queue = dispatchQueue; + queue[dispatchQueueLength] = callback; + queue[dispatchQueueLength + 1] = err; + queue[dispatchQueueLength + 2] = result; + dispatchQueueLength += 3; + } +}; + +class OperationMergerBackend { + /** + * @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method in filesystem + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor(provider, syncProvider, providerContext) { + this._provider = provider; + this._syncProvider = syncProvider; + this._providerContext = providerContext; + this._activeAsyncOperations = new Map(); + + this.provide = this._provider + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object | FileSystemCallback | undefined} options options + * @param {FileSystemCallback=} callback callback + * @returns {EXPECTED_ANY} result + */ + (path, options, callback) => { + if (typeof options === "function") { + callback = + /** @type {FileSystemCallback} */ + (options); + options = undefined; + } + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + /** @type {EXPECTED_FUNCTION} */ + (callback)( + new TypeError("path must be a string, Buffer, URL or number"), + ); + return; + } + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( + this._providerContext, + path, + options, + callback, + ); + } + let callbacks = this._activeAsyncOperations.get(path); + if (callbacks) { + callbacks.push(callback); + return; + } + this._activeAsyncOperations.set(path, (callbacks = [callback])); + /** @type {EXPECTED_FUNCTION} */ + (provider)( + path, + /** + * @param {Error} err error + * @param {EXPECTED_ANY} result result + */ + (err, result) => { + this._activeAsyncOperations.delete(path); + runCallbacks(callbacks, err, result); + }, + ); + } + : null; + this.provideSync = this._syncProvider + ? // Comment to align jsdoc + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {object=} options options + * @returns {EXPECTED_ANY} result + */ + (path, options) => + /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + options, + ) + : null; + } + + purge() {} + + purgeParent() {} +} + +/* + +IDLE: + insert data: goto SYNC + +SYNC: + before provide: run ticks + event loop tick: goto ASYNC_ACTIVE + +ASYNC: + timeout: run tick, goto ASYNC_PASSIVE + +ASYNC_PASSIVE: + before provide: run ticks + +IDLE --[insert data]--> SYNC --[event loop tick]--> ASYNC_ACTIVE --[interval tick]-> ASYNC_PASSIVE + ^ | + +---------[insert data]-------+ +*/ + +const STORAGE_MODE_IDLE = 0; +const STORAGE_MODE_SYNC = 1; +const STORAGE_MODE_ASYNC = 2; + +/** + * @callback Provide + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ + +class CacheBackend { + /** + * @param {number} duration max cache duration of items + * @param {EXPECTED_FUNCTION | undefined} provider async method + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor(duration, provider, syncProvider, providerContext) { + this._duration = duration; + this._provider = provider; + this._syncProvider = syncProvider; + this._providerContext = providerContext; + /** @type {Map[]>} */ + this._activeAsyncOperations = new Map(); + /** @type {Map }>} */ + this._data = new Map(); + /** @type {Set[]} */ + this._levels = []; + for (let i = 0; i < 10; i++) this._levels.push(new Set()); + if (duration !== Infinity) { + for (let i = 5000; i < duration; i += 500) { + this._levels.push(new Set()); + } + } + this._currentLevel = 0; + this._tickInterval = Math.floor(duration / this._levels.length); + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ + this._mode = STORAGE_MODE_IDLE; + + /** @type {NodeJS.Timeout | undefined} */ + this._timeout = undefined; + /** @type {number | undefined} */ + this._nextDecay = undefined; + + // eslint-disable-next-line no-warning-comments + // @ts-ignore + this.provide = provider ? this.provide.bind(this) : null; + // eslint-disable-next-line no-warning-comments + // @ts-ignore + this.provideSync = syncProvider ? this.provideSync.bind(this) : null; + } + + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ + provide(path, options, callback) { + if (typeof options === "function") { + callback = options; + options = undefined; + } + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + callback(new TypeError("path must be a string, Buffer, URL or number")); + return; + } + const strPath = typeof path !== "string" ? path.toString() : path; + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( + this._providerContext, + path, + options, + callback, + ); + } + + // When in sync mode we can move to async mode + if (this._mode === STORAGE_MODE_SYNC) { + this._enterAsyncMode(); + } + + // Check in cache + const cacheEntry = this._data.get(strPath); + if (cacheEntry !== undefined) { + if (cacheEntry.err) { + return scheduleDispatch(callback, cacheEntry.err, undefined); + } + return scheduleDispatch(callback, null, cacheEntry.result); + } + + // Check if there is already the same operation running + let callbacks = this._activeAsyncOperations.get(strPath); + if (callbacks !== undefined) { + callbacks.push(callback); + return; + } + this._activeAsyncOperations.set(strPath, (callbacks = [callback])); + + // Run the operation + /** @type {EXPECTED_FUNCTION} */ + (this._provider).call( + this._providerContext, + path, + /** + * @param {Error | null} err error + * @param {EXPECTED_ANY=} result result + */ + (err, result) => { + this._activeAsyncOperations.delete(strPath); + this._storeResult(strPath, err, result); + + // Enter async mode if not yet done + this._enterAsyncMode(); + + runCallbacks( + /** @type {FileSystemCallback[]} */ (callbacks), + err, + result, + ); + }, + ); + } + + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @returns {EXPECTED_ANY} result + */ + provideSync(path, options) { + if ( + typeof path !== "string" && + !Buffer.isBuffer(path) && + !(path instanceof URL) && + typeof path !== "number" + ) { + throw new TypeError("path must be a string"); + } + const strPath = typeof path !== "string" ? path.toString() : path; + if (options) { + return /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + options, + ); + } + + // In sync mode we may have to decay some cache items + if (this._mode === STORAGE_MODE_SYNC) { + this._runDecays(); + } + + // Check in cache + const cacheEntry = this._data.get(strPath); + if (cacheEntry !== undefined) { + if (cacheEntry.err) throw cacheEntry.err; + return cacheEntry.result; + } + + // Get all active async operations + // This sync operation will also complete them + const callbacks = this._activeAsyncOperations.get(strPath); + this._activeAsyncOperations.delete(strPath); + + // Run the operation + // When in idle mode, we will enter sync mode + let result; + try { + result = /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( + this._providerContext, + path, + ); + } catch (err) { + this._storeResult(strPath, /** @type {Error} */ (err), undefined); + this._enterSyncModeWhenIdle(); + if (callbacks) { + runCallbacks(callbacks, /** @type {Error} */ (err), undefined); + } + throw err; + } + this._storeResult(strPath, null, result); + this._enterSyncModeWhenIdle(); + if (callbacks) { + runCallbacks(callbacks, null, result); + } + return result; + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + * @param {{ exact?: boolean }=} options options; `exact: true` removes only entries whose key matches `what` exactly instead of any entry whose key starts with `what` + */ + purge(what, options) { + if (what === undefined || what === null) { + if (this._mode !== STORAGE_MODE_IDLE) { + this._data.clear(); + for (const level of this._levels) { + level.clear(); + } + this._enterIdleMode(); + } + return; + } + const exact = + options !== undefined && options !== null && options.exact === true; + if (exact) { + if ( + typeof what === "string" || + Buffer.isBuffer(what) || + what instanceof URL || + typeof what === "number" + ) { + const strWhat = typeof what !== "string" ? what.toString() : what; + const data = this._data.get(strWhat); + if (data !== undefined) { + this._data.delete(strWhat); + data.level.delete(strWhat); + } + } else { + for (const item of what) { + const strItem = typeof item !== "string" ? item.toString() : item; + const data = this._data.get(strItem); + if (data !== undefined) { + this._data.delete(strItem); + data.level.delete(strItem); + } + } + } + if (this._data.size === 0) { + this._enterIdleMode(); + } + return; + } + if ( + typeof what === "string" || + Buffer.isBuffer(what) || + what instanceof URL || + typeof what === "number" + ) { + const strWhat = typeof what !== "string" ? what.toString() : what; + if (strWhat === "") { + // empty string is a prefix of every key — short-circuit the O(n) scan + if (this._mode !== STORAGE_MODE_IDLE) { + this._data.clear(); + for (const level of this._levels) { + level.clear(); + } + this._enterIdleMode(); + } + return; + } + for (const [key, data] of this._data) { + if (key.startsWith(strWhat)) { + this._data.delete(key); + data.level.delete(key); + } + } + if (this._data.size === 0) { + this._enterIdleMode(); + } + } else { + for (const [key, data] of this._data) { + for (const item of what) { + const strItem = typeof item !== "string" ? item.toString() : item; + if (key.startsWith(strItem)) { + this._data.delete(key); + data.level.delete(key); + break; + } + } + } + if (this._data.size === 0) { + this._enterIdleMode(); + } + } + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + */ + purgeParent(what) { + if (what === undefined || what === null) { + this.purge(); + } else if ( + typeof what === "string" || + Buffer.isBuffer(what) || + what instanceof URL || + typeof what === "number" + ) { + const strWhat = typeof what !== "string" ? what.toString() : what; + this.purge(dirname(strWhat)); + } else { + const set = new Set(); + for (const item of what) { + const strItem = typeof item !== "string" ? item.toString() : item; + set.add(dirname(strItem)); + } + this.purge(set); + } + } + + /** + * @param {string} path path + * @param {Error | null} err error + * @param {EXPECTED_ANY} result result + */ + _storeResult(path, err, result) { + if (this._data.has(path)) return; + const level = this._levels[this._currentLevel]; + this._data.set(path, { err, result, level }); + level.add(path); + } + + _decayLevel() { + const nextLevel = (this._currentLevel + 1) % this._levels.length; + const decay = this._levels[nextLevel]; + this._currentLevel = nextLevel; + for (const item of decay) { + this._data.delete(item); + } + decay.clear(); + if (this._data.size === 0) { + this._enterIdleMode(); + } else { + /** @type {number} */ + (this._nextDecay) += this._tickInterval; + } + } + + _runDecays() { + while ( + /** @type {number} */ (this._nextDecay) <= Date.now() && + this._mode !== STORAGE_MODE_IDLE + ) { + this._decayLevel(); + } + } + + _enterAsyncMode() { + let timeout = 0; + switch (this._mode) { + case STORAGE_MODE_ASYNC: + return; + case STORAGE_MODE_IDLE: + this._nextDecay = Date.now() + this._tickInterval; + timeout = this._tickInterval; + break; + case STORAGE_MODE_SYNC: + this._runDecays(); + // _runDecays may change the mode + if ( + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ + (this._mode) === STORAGE_MODE_IDLE + ) { + return; + } + timeout = Math.max( + 0, + /** @type {number} */ (this._nextDecay) - Date.now(), + ); + break; + } + this._mode = STORAGE_MODE_ASYNC; + // When duration is Infinity, cache entries never expire, so there + // is no need to schedule a decay timer. + if (this._duration === Infinity) { + return; + } + const ref = setTimeout(() => { + this._mode = STORAGE_MODE_SYNC; + this._runDecays(); + }, timeout); + if (ref.unref) ref.unref(); + this._timeout = ref; + } + + _enterSyncModeWhenIdle() { + if (this._mode === STORAGE_MODE_IDLE) { + this._mode = STORAGE_MODE_SYNC; + this._nextDecay = Date.now() + this._tickInterval; + } + } + + _enterIdleMode() { + this._mode = STORAGE_MODE_IDLE; + this._nextDecay = undefined; + if (this._timeout) clearTimeout(this._timeout); + } +} + +/** + * @template {EXPECTED_FUNCTION} Provider + * @template {EXPECTED_FUNCTION} AsyncProvider + * @template FileSystem + * @param {number} duration duration in ms files are cached + * @param {Provider | undefined} provider provider + * @param {AsyncProvider | undefined} syncProvider sync provider + * @param {BaseFileSystem} providerContext provider context + * @returns {OperationMergerBackend | CacheBackend} backend + */ +const createBackend = (duration, provider, syncProvider, providerContext) => { + if (duration > 0) { + return new CacheBackend(duration, provider, syncProvider, providerContext); + } + return new OperationMergerBackend(provider, syncProvider, providerContext); +}; + +module.exports = class CachedInputFileSystem { + /** + * @param {BaseFileSystem} fileSystem file system + * @param {number} duration duration in ms files are cached + */ + constructor(fileSystem, duration) { + this.fileSystem = fileSystem; + + this._lstatBackend = createBackend( + duration, + this.fileSystem.lstat, + this.fileSystem.lstatSync, + this.fileSystem, + ); + const lstat = this._lstatBackend.provide; + this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); + const lstatSync = this._lstatBackend.provideSync; + this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ (lstatSync); + + this._statBackend = createBackend( + duration, + this.fileSystem.stat, + this.fileSystem.statSync, + this.fileSystem, + ); + const stat = this._statBackend.provide; + this.stat = /** @type {FileSystem["stat"]} */ (stat); + const statSync = this._statBackend.provideSync; + this.statSync = /** @type {SyncFileSystem["statSync"]} */ (statSync); + + this._readdirBackend = createBackend( + duration, + this.fileSystem.readdir, + this.fileSystem.readdirSync, + this.fileSystem, + ); + const readdir = this._readdirBackend.provide; + this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); + const readdirSync = this._readdirBackend.provideSync; + this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( + readdirSync + ); + + this._readFileBackend = createBackend( + duration, + this.fileSystem.readFile, + this.fileSystem.readFileSync, + this.fileSystem, + ); + const readFile = this._readFileBackend.provide; + this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); + const readFileSync = this._readFileBackend.provideSync; + this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ( + readFileSync + ); + + this._readJsonBackend = createBackend( + duration, + // prettier-ignore + this.fileSystem.readJson || + (this.readFile && + ( + /** + * @param {string} path path + * @param {FileSystemCallback} callback callback + */ + (path, callback) => { + this.readFile(path, (err, buffer) => { + if (err) return callback(err); + if (!buffer || buffer.length === 0) + {return callback(new Error("No file content"));} + let data; + try { + data = JSON.parse(buffer.toString("utf8")); + } catch (err_) { + return callback(/** @type {Error} */ (err_)); + } + callback(null, data); + }); + }) + ), + // prettier-ignore + this.fileSystem.readJsonSync || + (this.readFileSync && + ( + /** + * @param {string} path path + * @returns {EXPECTED_ANY} result + */ + (path) => { + const buffer = this.readFileSync(path); + const data = JSON.parse(buffer.toString("utf8")); + return data; + } + )), + this.fileSystem, + ); + const readJson = this._readJsonBackend.provide; + this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); + const readJsonSync = this._readJsonBackend.provideSync; + this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ( + readJsonSync + ); + + this._readlinkBackend = createBackend( + duration, + this.fileSystem.readlink, + this.fileSystem.readlinkSync, + this.fileSystem, + ); + const readlink = this._readlinkBackend.provide; + this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); + const readlinkSync = this._readlinkBackend.provideSync; + this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( + readlinkSync + ); + + this._realpathBackend = createBackend( + duration, + this.fileSystem.realpath, + this.fileSystem.realpathSync, + this.fileSystem, + ); + const realpath = this._realpathBackend.provide; + this.realpath = /** @type {FileSystem["realpath"]} */ (realpath); + const realpathSync = this._realpathBackend.provideSync; + this.realpathSync = /** @type {SyncFileSystem["realpathSync"]} */ ( + realpathSync + ); + } + + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + * @param {{ exact?: boolean }=} options options; `exact: true` removes only cache entries whose key matches `what` exactly instead of any entry whose key starts with `what` + */ + purge(what, options) { + this._statBackend.purge(what, options); + this._lstatBackend.purge(what, options); + if (options !== undefined && options !== null && options.exact === true) { + this._readdirBackend.purge(what, options); + } else { + this._readdirBackend.purgeParent(what); + } + this._readFileBackend.purge(what, options); + this._readlinkBackend.purge(what, options); + this._readJsonBackend.purge(what, options); + this._realpathBackend.purge(what, options); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..f60803692994e130ba6dd852c47eb71e03a4890f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js @@ -0,0 +1,51 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class CloneBasenamePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { + const requestPath = /** @type {string} */ (request.path); + const filename = resolver.basename(requestPath); + const filePath = resolver.join(requestPath, filename); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, filename), + }; + resolver.doResolve( + target, + obj, + `using path: ${filePath}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ConditionalPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ConditionalPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..99cc09d47cff81f00165f848e4e75964729d9530 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ConditionalPlugin.js @@ -0,0 +1,59 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ConditionalPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} test compare object + * @param {string | null} message log message + * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches + * @param {string | ResolveStepHook} target target + */ + constructor(source, test, message, allowAlternatives, target) { + this.source = source; + this.test = test; + this.message = message; + this.allowAlternatives = allowAlternatives; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const { test, message, allowAlternatives } = this; + const keys = /** @type {(keyof ResolveRequest)[]} */ (Object.keys(test)); + resolver + .getHook(this.source) + .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { + for (const prop of keys) { + if (request[prop] !== test[prop]) return callback(); + } + resolver.doResolve( + target, + request, + message, + resolveContext, + allowAlternatives + ? callback + : (err, result) => { + if (err) return callback(err); + + // Don't allow other alternatives + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..91a7f3be37e10e33a962b02c99de646430a44bb4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js @@ -0,0 +1,103 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const BACKSLASH_G = /\\/g; + +module.exports = class DescriptionFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string[]} filenames filenames + * @param {boolean} pathIsFile pathIsFile + * @param {string | ResolveStepHook} target target + */ + constructor(source, filenames, pathIsFile, target) { + this.source = source; + this.filenames = filenames; + this.pathIsFile = pathIsFile; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DescriptionFilePlugin", + (request, resolveContext, callback) => { + const { path } = request; + if (!path) return callback(); + const directory = this.pathIsFile + ? DescriptionFileUtils.cdUp(path) + : path; + if (!directory) return callback(); + DescriptionFileUtils.loadDescriptionFile( + resolver, + directory, + this.filenames, + request.descriptionFilePath + ? { + path: request.descriptionFilePath, + content: request.descriptionFileData, + directory: + /** @type {string} */ + (request.descriptionFileRoot), + } + : undefined, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (!result) { + if (resolveContext.log) { + resolveContext.log( + `No description file found in ${directory} or above`, + ); + } + return callback(); + } + const rawRelative = path.slice(result.directory.length); + const relativePath = `.${ + rawRelative.includes("\\") + ? rawRelative.replace(BACKSLASH_G, "/") + : rawRelative + }`; + /** @type {ResolveRequest} */ + const obj = { + ...request, + descriptionFilePath: result.path, + descriptionFileData: result.content, + descriptionFileRoot: result.directory, + relativePath, + }; + resolver.doResolve( + target, + obj, + `using description file: ${result.path} (relative path: ${relativePath})`, + resolveContext, + (err, result) => { + if (err) return callback(err); + + // Don't allow other processing + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }, + ); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js b/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..18de52b8b047d419ef48b49310979d737e9a4d6d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js @@ -0,0 +1,232 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const { decodeText } = require("./util/fs"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").JsonValue} JsonValue */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @typedef {object} DescriptionFileInfo + * @property {JsonObject=} content content + * @property {string} path path + * @property {string} directory directory + */ + +/** + * @callback ErrorFirstCallback + * @param {Error | null=} error + * @param {DescriptionFileInfo=} result + */ + +/** + * @typedef {object} Result + * @property {string} path path to description file + * @property {string} directory directory of description file + * @property {JsonObject} content content of description file + */ + +const CHAR_SLASH = 47; +const CHAR_BACKSLASH = 92; + +/** + * Walk up one directory. Called once per package-root candidate and once per + * `described-resolve` (to find the enclosing description file), so it's on + * the resolver's hot path. + * + * Previous implementation called `lastIndexOf("/")` and `lastIndexOf("\\")` + * separately and then picked the larger. For any non-trivial directory + * string on POSIX, `lastIndexOf("\\")` scans the full string just to return + * -1. A single reverse char-code scan does the same work in one pass. + * + * Any single-character directory is treated as a root — `directory.length + * <= 1` collapses the `"/"`, `"\\"` and `""` branches into one compare. + * Without the `"\\"` case, `cdUp("\\")` (reached from a UNC root or a DOS + * device path like `\\?\…`) would return itself via `slice(0, i || 1)` + * and trap `loadDescriptionFile` in an infinite loop. Once single-char + * roots are filtered up front, the reverse scan always produces a + * strictly shorter string. + * @param {string} directory directory + * @returns {string | null} parent directory or null + */ +function cdUp(directory) { + if (directory.length <= 1) return null; + for (let i = directory.length - 1; i >= 0; i--) { + const code = directory.charCodeAt(i); + if (code === CHAR_SLASH || code === CHAR_BACKSLASH) { + return directory.slice(0, i || 1); + } + } + return null; +} + +/** + * @param {Resolver} resolver resolver + * @param {string} directory directory + * @param {string[]} filenames filenames + * @param {DescriptionFileInfo | undefined} oldInfo oldInfo + * @param {ResolveContext} resolveContext resolveContext + * @param {ErrorFirstCallback} callback callback + */ +function loadDescriptionFile( + resolver, + directory, + filenames, + oldInfo, + resolveContext, + callback, +) { + // Hoist the per-filename iterator and the per-level done callback out + // of `findDescriptionFile`. They both close over `directory`, which we + // reassign as we walk up the tree, so the same closures keep working + // across every level — the previous implementation re-allocated both + // arrows on every recursion step, which adds up on deep walks (multiple + // `DescriptionFilePlugin` taps per resolve, each climbing several + // directories looking for `package.json`). + /** + * @param {string} filename filename + * @param {(err?: null | Error, result?: null | Result) => void} iterCallback callback + * @returns {void} + */ + const iterFilename = (filename, iterCallback) => { + const descriptionFilePath = resolver.join(directory, filename); + + /** + * @param {(null | Error)=} err error + * @param {JsonObject=} resolvedContent content + * @returns {void} + */ + function onJson(err, resolvedContent) { + if (err) { + if (resolveContext.log) { + resolveContext.log( + `${descriptionFilePath} (directory description file): ${err}`, + ); + } else { + err.message = `${descriptionFilePath} (directory description file): ${err}`; + } + return iterCallback(err); + } + iterCallback(null, { + content: /** @type {JsonObject} */ (resolvedContent), + directory, + path: descriptionFilePath, + }); + } + + if (resolver.fileSystem.readJson) { + resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { + if (err) { + if ( + typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !== + "undefined" + ) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(descriptionFilePath); + } + return iterCallback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + return onJson(err); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + onJson(null, content); + }); + } else { + resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { + if (err) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(descriptionFilePath); + } + return iterCallback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(descriptionFilePath); + } + + /** @type {JsonObject | undefined} */ + let json; + + if (content) { + try { + json = JSON.parse(decodeText(content)); + } catch (/** @type {unknown} */ err_) { + return onJson(/** @type {Error} */ (err_)); + } + } else { + return onJson(new Error("No content in file")); + } + + onJson(null, json); + }); + } + }; + // Forward-declared so the helpers below can reference each other + // without falling foul of `no-use-before-define`. + /** @type {() => void} */ + let findDescriptionFile; + /** + * @param {(null | Error)=} err error + * @param {(null | Result)=} result result + * @returns {void} + */ + const onLevelDone = (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + const dir = cdUp(directory); + if (!dir) { + return callback(); + } + directory = dir; + return findDescriptionFile(); + }; + findDescriptionFile = () => { + if (oldInfo && oldInfo.directory === directory) { + // We already have info for this directory and can reuse it + return callback(null, oldInfo); + } + forEachBail(filenames, iterFilename, onLevelDone); + }; + findDescriptionFile(); +} + +/** + * @param {JsonObject} content content + * @param {string | string[]} field field + * @returns {JsonValue | undefined} field data + */ +function getField(content, field) { + if (!content) return undefined; + if (Array.isArray(field)) { + /** @type {JsonValue} */ + let current = content; + for (let j = 0; j < field.length; j++) { + if (current === null || typeof current !== "object") { + current = null; + break; + } + current = /** @type {JsonValue} */ ( + /** @type {JsonObject} */ + (current)[field[j]] + ); + } + return current; + } + return content[field]; +} + +module.exports.cdUp = cdUp; +module.exports.getField = getField; +module.exports.loadDescriptionFile = loadDescriptionFile; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..04069e4274408e467aa1ad8961ef42c50282752c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js @@ -0,0 +1,68 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class DirectoryExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "DirectoryExistsPlugin", + (request, resolveContext, callback) => { + const fs = resolver.fileSystem; + const directory = request.path; + if (!directory) return callback(); + fs.stat(directory, (err, stat) => { + // Combine the two miss branches: a stat failure and a + // "not a directory" result share the same handling — record + // the path on `missingDependencies`, log the right reason, + // then bail. The error-message ternary picks the wording + // that matched the failing condition. + if (err || !stat || !stat.isDirectory()) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(directory); + } + if (resolveContext.log) { + resolveContext.log( + err || !stat + ? `${directory} doesn't exist` + : `${directory} is not a directory`, + ); + } + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(directory); + } + resolver.doResolve( + target, + request, + `existing directory ${directory}`, + resolveContext, + callback, + ); + }); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..8ff1bdbdeaea4e65d3e594fbc0df5a31045a191d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js @@ -0,0 +1,279 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const forEachBail = require("./forEachBail"); +const { + explainSubpathsInConditions, + processExportsField, +} = require("./util/entrypoints"); +const { parseIdentifier } = require("./util/identifier"); +const { + deprecatedInvalidSegmentRegEx, + invalidSegmentRegEx, +} = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ +/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ + +module.exports = class ExportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + * @param {boolean=} restrictions whether `restrictions` are configured (enables exports-target fallback when a target is filtered out) + */ + constructor(source, conditionNames, fieldNamePath, target, restrictions) { + this.source = source; + this.target = target; + this.conditionNames = conditionNames; + this.fieldName = fieldNamePath; + this.restrictions = Boolean(restrictions); + // `null` is cached for description files that have no exports field, + // so subsequent resolves against the same package.json skip the + // `DescriptionFileUtils.getField` walk entirely. + /** @type {WeakMap} */ + this._fieldProcessorCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ExportsFieldPlugin", (request, resolveContext, callback) => { + // When there is no description file, abort + if (!request.descriptionFileData) return callback(); + if ( + // When the description file is inherited from parent, abort + // (There is no description file inside of this package) + request.relativePath !== "." || + request.request === undefined + ) { + return callback(); + } + + const { descriptionFileData } = request; + const remainingRequest = + request.query || request.fragment + ? (request.request === "." ? "./" : request.request) + + request.query + + request.fragment + : request.request; + + /** @type {string[]} */ + let paths; + /** @type {string | null} */ + let usedField; + + try { + // Look up the cached processor first. On a cache hit we + // avoid re-walking the description file for the exports + // field — and `null` is cached for description files that + // have no exports field at all, so those skip the read + // entirely. `processExportsField` can throw on a malformed + // `exports` map (e.g. a key without a leading `.`), so + // building the processor must stay inside this try/catch. + let fieldProcessor = + this._fieldProcessorCache.get(descriptionFileData); + if ( + fieldProcessor === undefined && + !this._fieldProcessorCache.has(descriptionFileData) + ) { + const exportsField = + /** @type {ExportsField | null | undefined} */ + ( + DescriptionFileUtils.getField( + descriptionFileData, + this.fieldName, + ) + ); + fieldProcessor = exportsField + ? processExportsField(exportsField) + : null; + this._fieldProcessorCache.set(descriptionFileData, fieldProcessor); + } + if (!fieldProcessor) return callback(); + + if (request.directory) { + return callback( + new Error( + `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)`, + ), + ); + } + + [paths, usedField] = fieldProcessor( + remainingRequest, + this.conditionNames, + ); + } catch (/** @type {unknown} */ err) { + // Name the package.json in the error itself, not only in the + // log: a malformed field is a mistake in someone's package, + // and without the path there is nothing to go on. The + // original message is kept verbatim inside this one. + const error = new Error( + `${/** @type {Error} */ (err).message} (see exports field in ${ + request.descriptionFilePath + })`, + ); + if (resolveContext.log) { + resolveContext.log(error.message); + } + return callback(error); + } + + if (paths.length === 0) { + const conditions = [...this.conditionNames]; + const conditionsStr = + conditions.length === 1 + ? `the condition "${conditions[0]}"` + : `the conditions ${JSON.stringify(conditions)}`; + // Nothing matched. The usual reason is that the package + // really does not export this path, but a field whose + // conditions wrap subpaths matches nothing either - and + // then the message above points at the request rather than + // at the mistake. Only this failing branch pays for the + // check. See https://github.com/webpack/enhanced-resolve/issues/325. + const explanation = explainSubpathsInConditions( + /** @type {ExportsField | null | undefined} */ + ( + DescriptionFileUtils.getField(descriptionFileData, this.fieldName) + ), + true, + ); + return callback( + new Error( + `"${remainingRequest}" is not exported under ${conditionsStr} from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})${ + explanation ? `. In that exports field, ${explanation}` : "" + }`, + ), + ); + } + + // When `restrictions` are configured, share a marker down the + // chain so RestrictionsPlugin can tell us it filtered out an + // otherwise-valid target — then we fall back instead of erroring. + const restrictionsMarker = this.restrictions + ? { blocked: false } + : undefined; + + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @param {number} i index + * @returns {void} + */ + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); + + if (!parsedIdentifier) return callback(); + + const [relativePath, query, fragment] = parsedIdentifier; + + if (!relativePath.startsWith("./")) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + const withoutDotSlash = relativePath.slice(2); + if ( + invalidSegmentRegEx.test(withoutDotSlash) && + deprecatedInvalidSegmentRegEx.test(withoutDotSlash) + ) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: undefined, + path: resolver.join( + /** @type {string} */ (request.descriptionFileRoot), + relativePath, + ), + relativePath, + query, + fragment, + }; + // Attach the marker only when restrictions are configured, so + // resolves without restrictions keep their request shape and + // never leak the property onto the result. + if (restrictionsMarker) { + obj.__restrictionsMarker = restrictionsMarker; + } + + resolver.doResolve( + target, + obj, + `using exports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + }, + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + (err, result) => { + if (err) return callback(err); + // When an exports field match was found but the target file doesn't exist, + // return an error to prevent fallback to parent node_modules directories. + // Per the Node.js ESM spec, a matched exports entry that fails to resolve + // is a hard error, not a signal to continue searching up the directory tree. + // See: https://github.com/webpack/enhanced-resolve/issues/399 + if (!result) { + // Exception: the target existed but `restrictions` filtered it + // out — return no result so the next `modules` entry is tried. + if (restrictionsMarker && restrictionsMarker.blocked) { + return callback(null, null); + } + return callback( + new Error( + `Package path ${remainingRequest} is exported from package ${request.descriptionFileRoot}, but no valid target file was found (see exports field in ${request.descriptionFilePath})`, + ), + ); + } + // Drop the internal marker before it reaches the result. + if (restrictionsMarker) delete result.__restrictionsMarker; + callback(null, result); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..1c17b98d70bc780c2440ac904d55799f55caeb2f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js @@ -0,0 +1,137 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {{ alias: string | string[], extension: string }} ExtensionAliasOption */ + +module.exports = class ExtensionAliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {ExtensionAliasOption} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const { extension, alias } = this.options; + resolver + .getHook(this.source) + .tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => { + // Two modes of operation: + // - "request" mode: original request specifier still carries the + // extension (e.g. user wrote `./foo.js`). We swap the extension + // on `request.request` and re-resolve. + // - "path" mode: the specifier has already been joined into an + // absolute `request.path` (e.g. produced by the imports field). + // We swap the extension on `request.path` and `request.relativePath`. + const useRequest = request.request !== undefined; + const source = useRequest + ? /** @type {string} */ (request.request) + : request.path; + if (!source || !source.endsWith(extension)) return callback(); + const isAliasString = typeof alias === "string"; + // Hoist the base (everything before the old extension) out of the + // per-alias `resolve` callback. For an array `alias`, the callback + // runs once per candidate extension; the base does not change + // between iterations, so there's no reason to recompute it. + const sourceBase = source.slice(0, -extension.length); + const relativePathBase = + !useRequest && + request.relativePath && + request.relativePath.endsWith(extension) + ? request.relativePath.slice(0, -extension.length) + : null; + /** + * @param {string} alias extension alias + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @param {number=} index index + * @returns {void} + */ + const resolve = (alias, callback, index) => { + const newValue = `${sourceBase}${alias}`; + const nextRequest = useRequest + ? { + ...request, + request: newValue, + fullySpecified: true, + } + : { + ...request, + path: newValue, + relativePath: + relativePathBase !== null + ? `${relativePathBase}${alias}` + : request.relativePath, + fullySpecified: true, + }; + + return resolver.doResolve( + target, + nextRequest, + `aliased from extension alias with mapping '${extension}' to '${alias}'`, + resolveContext, + (err, result) => { + // Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias + if (!isAliasString && index) { + if (index !== this.options.alias.length) { + if (resolveContext.log) { + resolveContext.log( + `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newValue}': ${err}`, + ); + } + + return callback(null, result); + } + + return callback(err, result); + } + callback(err, result); + }, + ); + }; + /** + * @param {(null | Error)=} err error + * @param {(null | ResolveRequest)=} result result + * @returns {void} + */ + const stoppingCallback = (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Listing the source extension among its own aliases keeps the + // original request valid, so it must still be resolvable in its + // normal (not fully specified) form: as a directory, or with + // extensions appended. Only a mapping that drops the source + // extension is strict. + if (isAliasString ? alias === extension : alias.includes(extension)) { + return callback(); + } + // Don't allow other aliasing or raw request + return callback(null, null); + }; + if (isAliasString) { + resolve(alias, stoppingCallback); + } else if (alias.length > 1) { + forEachBail(alias, resolve, stoppingCallback); + } else { + resolve(alias[0], stoppingCallback); + } + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/FileExistsPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/FileExistsPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..c6343c826e4d6150bbd414d8452861459d63fcee --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/FileExistsPlugin.js @@ -0,0 +1,65 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class FileExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { + const file = request.path; + if (!file) return callback(); + fs.stat(file, (err, stat) => { + // Combine the two miss branches: a stat failure and a + // "not a file" result share the same handling — record the + // path on `missingDependencies`, log the right reason, then + // bail. The error-message ternary picks the wording that + // matched the failing condition. + if (err || !stat || !stat.isFile()) { + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(file); + } + if (resolveContext.log) { + resolveContext.log( + err || !stat + ? `${file} doesn't exist` + : `${file} is not a file`, + ); + } + return callback(); + } + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(file); + } + resolver.doResolve( + target, + request, + `existing file: ${file}`, + resolveContext, + callback, + ); + }); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..adb4815b2d1094378f27166dcd69ed56cd7db7c2 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js @@ -0,0 +1,254 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); +const forEachBail = require("./forEachBail"); +const { + explainSubpathsInConditions, + processImportsField, +} = require("./util/entrypoints"); +const { parseIdentifier } = require("./util/identifier"); +const { invalidSegmentRegEx } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ +/** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ + +const dotCode = ".".charCodeAt(0); + +module.exports = class ImportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} targetFile target file + * @param {string | ResolveStepHook} targetPackage target package + */ + constructor( + source, + conditionNames, + fieldNamePath, + targetFile, + targetPackage, + ) { + this.source = source; + this.targetFile = targetFile; + this.targetPackage = targetPackage; + this.conditionNames = conditionNames; + this.fieldName = fieldNamePath; + // `null` is cached for description files that have no imports field, + // so subsequent resolves against the same package.json skip the + // `DescriptionFileUtils.getField` walk entirely. + /** @type {WeakMap} */ + this._fieldProcessorCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const targetFile = resolver.ensureHook(this.targetFile); + const targetPackage = resolver.ensureHook(this.targetPackage); + + resolver + .getHook(this.source) + .tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => { + // When there is no description file, abort + if (!request.descriptionFileData || request.request === undefined) { + return callback(); + } + + const { descriptionFileData } = request; + // Skip the concat when there's nothing to append — the common + // case has empty query/fragment, so this avoids an allocation + // per resolve. Mirrors the pattern in ExportsFieldPlugin. + const remainingRequest = + request.query || request.fragment + ? request.request + request.query + request.fragment + : request.request; + + /** @type {string[]} */ + let paths; + /** @type {string | null} */ + let usedField; + + try { + // Look up the cached processor first. On a cache hit we + // avoid re-walking the description file for the imports + // field — and `null` is cached for description files that + // have no imports field at all, so those skip the read + // entirely. `processImportsField` can throw on a + // malformed `imports` map, so building the processor must + // stay inside this try/catch. + let fieldProcessor = + this._fieldProcessorCache.get(descriptionFileData); + if ( + fieldProcessor === undefined && + !this._fieldProcessorCache.has(descriptionFileData) + ) { + const importsField = + /** @type {ImportsField | null | undefined} */ + ( + DescriptionFileUtils.getField( + descriptionFileData, + this.fieldName, + ) + ); + fieldProcessor = importsField + ? processImportsField(importsField) + : null; + this._fieldProcessorCache.set(descriptionFileData, fieldProcessor); + } + if (!fieldProcessor) return callback(); + + if (request.directory) { + return callback( + new Error( + `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)`, + ), + ); + } + + [paths, usedField] = fieldProcessor( + remainingRequest, + this.conditionNames, + ); + } catch (/** @type {unknown} */ err) { + // Name the package.json in the error itself, not only in the + // log: a malformed field is a mistake in someone's package, + // and without the path there is nothing to go on. The + // original message is kept verbatim inside this one. + const error = new Error( + `${/** @type {Error} */ (err).message} (see imports field in ${ + request.descriptionFilePath + })`, + ); + if (resolveContext.log) { + resolveContext.log(error.message); + } + return callback(error); + } + + if (paths.length === 0) { + // See the matching comment in ExportsFieldPlugin: only this + // already-failing branch pays for the diagnosis. + const explanation = explainSubpathsInConditions( + /** @type {ImportsField | null | undefined} */ + ( + DescriptionFileUtils.getField(descriptionFileData, this.fieldName) + ), + false, + ); + return callback( + new Error( + `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})${ + explanation ? `. In that imports field, ${explanation}` : "" + }`, + ), + ); + } + + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @param {number} i index + * @returns {void} + */ + (path, callback, i) => { + const parsedIdentifier = parseIdentifier(path); + + if (!parsedIdentifier) return callback(); + + const [path_, query, fragment] = parsedIdentifier; + + switch (path_.charCodeAt(0)) { + // should be relative + case dotCode: { + const withoutDotSlash = path_.slice(2); + if (invalidSegmentRegEx.test(withoutDotSlash)) { + if (paths.length === i) { + return callback( + new Error( + `Invalid "imports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, + ), + ); + } + + return callback(); + } + + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: undefined, + path: resolver.join( + /** @type {string} */ (request.descriptionFileRoot), + path_, + ), + relativePath: path_, + query, + fragment, + }; + + resolver.doResolve( + targetFile, + obj, + `using imports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + break; + } + + // package resolving + default: { + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: path_, + relativePath: path_, + fullySpecified: true, + query, + fragment, + }; + + resolver.doResolve( + targetPackage, + obj, + `using imports field: ${path}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 + if (result === undefined) return callback(null, null); + callback(null, result); + }, + ); + } + } + }, + /** + * @param {null | Error=} err error + * @param {null | ResolveRequest=} result result + * @returns {void} + */ + (err, result) => callback(err, result || null), + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..a171b988046e97682bbdb35ba502d44e81959f10 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js @@ -0,0 +1,75 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const namespaceStartCharCode = "@".charCodeAt(0); + +module.exports = class JoinRequestPartPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "JoinRequestPartPlugin", + (request, resolveContext, callback) => { + const req = request.request || ""; + let i = req.indexOf("/", 3); + + if (i >= 0 && req.charCodeAt(2) === namespaceStartCharCode) { + i = req.indexOf("/", i + 1); + } + + /** @type {string} */ + let moduleName; + /** @type {string} */ + let remainingRequest; + /** @type {boolean} */ + let fullySpecified; + if (i < 0) { + moduleName = req; + remainingRequest = "."; + fullySpecified = false; + } else { + moduleName = req.slice(0, i); + remainingRequest = `.${req.slice(i)}`; + fullySpecified = /** @type {boolean} */ (request.fullySpecified); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolver.join( + /** @type {string} */ + (request.path), + moduleName, + ), + relativePath: + request.relativePath && + resolver.join(request.relativePath, moduleName), + request: remainingRequest, + fullySpecified, + }; + resolver.doResolve(target, obj, null, resolveContext, callback); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..108958ec9f1b5b9031d38cc84ac4672036a53141 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js @@ -0,0 +1,45 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class JoinRequestPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { + const requestPath = /** @type {string} */ (request.path); + const requestRequest = /** @type {string} */ (request.request); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolver.join(requestPath, requestRequest), + relativePath: + request.relativePath && + resolver.join(request.relativePath, requestRequest), + request: undefined, + }; + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/LogInfoPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/LogInfoPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..5dbb688e08671e5d6252705251e9af85ccde1a60 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/LogInfoPlugin.js @@ -0,0 +1,58 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class LogInfoPlugin { + /** + * @param {string | ResolveStepHook} source source + */ + constructor(source) { + this.source = source; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const { source } = this; + resolver + .getHook(this.source) + .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { + if (!resolveContext.log) return callback(); + const { log } = resolveContext; + const prefix = `[${source}] `; + if (request.path) { + log(`${prefix}Resolving in directory: ${request.path}`); + } + if (request.request) { + log(`${prefix}Resolving request: ${request.request}`); + } + if (request.module) log(`${prefix}Request is an module request.`); + if (request.directory) log(`${prefix}Request is a directory request.`); + if (request.query) { + log(`${prefix}Resolving request query: ${request.query}`); + } + if (request.fragment) { + log(`${prefix}Resolving request fragment: ${request.fragment}`); + } + if (request.descriptionFilePath) { + log( + `${prefix}Has description data from ${request.descriptionFilePath}`, + ); + } + if (request.relativePath) { + log( + `${prefix}Relative path from description file is: ${request.relativePath}`, + ); + } + callback(); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/MainFieldPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/MainFieldPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..7616b9e2731b897b0ccaab8ad3869754e403fbf2 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/MainFieldPlugin.js @@ -0,0 +1,97 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +/** @typedef {{ name: string | string[], forceRelative: boolean }} MainFieldOptions */ + +const alreadyTriedMainField = Symbol("alreadyTriedMainField"); + +// Sentinel cached for description files where the main field resolves to a +// value we cannot use (missing, non-string, ".", "./"). Cheaper to store and +// check than to re-walk the description file on every resolve. +const NO_MAIN = Symbol("NoMain"); + +module.exports = class MainFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {MainFieldOptions} options options + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, target) { + this.source = source; + this.options = options; + this.target = target; + // Cache the resolved `mainModule` per description-file content. The + // options (`name`, `forceRelative`) are fixed for this plugin + // instance, so caching against content alone is safe. Stores either + // the ready-to-use request string or the `NO_MAIN` sentinel. + /** @type {WeakMap} */ + this._mainModuleCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { + if ( + request.path !== request.descriptionFileRoot || + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ + (request)[alreadyTriedMainField] === request.descriptionFilePath || + !request.descriptionFilePath + ) { + return callback(); + } + const descFileData = /** @type {JsonObject} */ ( + request.descriptionFileData + ); + let mainModule = this._mainModuleCache.get(descFileData); + if (mainModule === undefined) { + let raw = + /** @type {string | null | undefined} */ + (DescriptionFileUtils.getField(descFileData, this.options.name)); + if (!raw || typeof raw !== "string" || raw === "." || raw === "./") { + this._mainModuleCache.set(descFileData, NO_MAIN); + return callback(); + } + if (this.options.forceRelative && !/^\.\.?\//.test(raw)) { + raw = `./${raw}`; + } + mainModule = raw; + this._mainModuleCache.set(descFileData, mainModule); + } else if (mainModule === NO_MAIN) { + return callback(); + } + const filename = resolver.basename(request.descriptionFilePath); + /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ + const obj = { + ...request, + request: mainModule, + module: false, + directory: mainModule.endsWith("/"), + [alreadyTriedMainField]: request.descriptionFilePath, + }; + return resolver.doResolve( + target, + obj, + `use ${mainModule} from ${this.options.name} in ${filename}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..06065e82c6b216628da2b6f57a84c79cfc75ae24 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js @@ -0,0 +1,9 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// TODO remove in next major +module.exports = require("./ModulesInHierarchicalDirectoriesPlugin"); diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..4f19fc3105a9667973e08791e4e06b95cfbbabd2 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js @@ -0,0 +1,47 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { modulesResolveHandler } = require("./ModulesUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ModulesInHierarchicalDirectoriesPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} directories directories + * @param {string | ResolveStepHook} target target + */ + constructor(source, directories, target) { + this.source = source; + this.directories = /** @type {string[]} */ [...directories]; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync( + "ModulesInHierarchicalDirectoriesPlugin", + (request, resolveContext, callback) => { + modulesResolveHandler( + resolver, + this.directories, + target, + request, + resolveContext, + callback, + ); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..7797a11e884a5b2a740da480db943e386510a162 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ModulesInRootPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} path path + * @param {string | ResolveStepHook} target target + */ + constructor(source, path, target) { + this.source = source; + this.path = path; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: this.path, + request: `./${request.request}`, + module: false, + }; + resolver.doResolve( + target, + obj, + `looking for modules in ${this.path}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ModulesUtils.js b/e-commerce/node_modules/enhanced-resolve/lib/ModulesUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..3de32daeb6371aba34f69c436fd7415b04a56ead --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ModulesUtils.js @@ -0,0 +1,132 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const { getPathsCached } = require("./getPaths"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */ + +/** + * Per-(directories-array) cache of the flat `addrs` list produced for a given + * `request.path`. For a fixed directories configuration the fan-out of + * `ancestor × directory` is deterministic per request.path, and many resolves + * share the same starting directory (sibling files in one project, loops over + * a batch of imports, etc.) — caching avoids the `getPaths` regex split plus + * `len(paths) × len(directories)` join calls per resolve. + * + * The outer map is keyed on the directories array reference (plugin-owned, + * stable for the lifetime of the resolver), and the inner map on the + * starting `request.path`. Kept private to this module (rather than hung off + * `resolver.pathCache`) so the pathCache's hidden-class shape is unchanged — + * that avoids perturbing the interpreter-mode IC state for the + * `resolver.pathCache.{join,dirname,basename}.fn(...)` accesses that run on + * every resolve, which the CodSpeed instruction-count harness is sensitive to. + * @type {WeakMap>} + */ +const _addrsCacheByDirs = new WeakMap(); + +/** + * @param {Resolver} resolver resolver + * @param {string[]} directories directories + * @param {ResolveStepHook} target target + * @param {ResolveRequest} request request + * @param {ResolveContext} resolveContext resolve context + * @param {InnerCallback} callback callback + * @returns {void} + */ +function modulesResolveHandler( + resolver, + directories, + target, + request, + resolveContext, + callback, +) { + const fs = resolver.fileSystem; + const requestPath = /** @type {string} */ (request.path); + // Compute-or-reuse the flat `addrs` list. Inlined (rather than a helper + // function) so the cache-hit path — which is the vast majority of + // invocations — stays a single WeakMap + Map lookup with no function-call + // overhead. See `_addrsCacheByDirs` above for caching rationale. + let addrs; + let perPath = _addrsCacheByDirs.get(directories); + if (perPath === undefined) { + perPath = new Map(); + _addrsCacheByDirs.set(directories, perPath); + } else { + addrs = perPath.get(requestPath); + } + if (addrs === undefined) { + const { paths } = getPathsCached(fs, requestPath); + const pathsLen = paths.length; + const dirsLen = directories.length; + // Pre-size the flat array rather than going through `map().reduce()` + // with intermediate arrays + spreads. + // eslint-disable-next-line unicorn/no-new-array + addrs = new Array(pathsLen * dirsLen); + let idx = 0; + const joinFn = resolver.pathCache.join.fn; + for (let pi = 0; pi < pathsLen; pi++) { + const pathItem = paths[pi]; + for (let di = 0; di < dirsLen; di++) { + addrs[idx++] = joinFn(pathItem, directories[di]); + } + } + perPath.set(requestPath, addrs); + } + // Hoist the dot-prefixed request out of the per-addr iterator. `addrs` + // can have up to `paths.length × directories.length` entries (e.g. 36 + // for an 8-deep source dir × 4-module config), and concatenating the + // same `./${request.request}` string on every iteration is wasted + // work — it's constant for the whole fan-out. + const relRequest = `./${request.request}`; + forEachBail( + addrs, + /** + * @param {string} addr addr + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @returns {void} + */ + (addr, callback) => { + fs.stat(addr, (err, stat) => { + if (!err && stat && stat.isDirectory()) { + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: addr, + request: relRequest, + module: false, + }; + const message = `looking for modules in ${addr}`; + return resolver.doResolve( + target, + obj, + message, + resolveContext, + callback, + ); + } + if (resolveContext.log) { + resolveContext.log(`${addr} doesn't exist or is not a directory`); + } + if (resolveContext.missingDependencies) { + resolveContext.missingDependencies.add(addr); + } + return callback(); + }); + }, + callback, + ); +} + +module.exports = { + modulesResolveHandler, +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/NextPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/NextPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..e59c56b8e04ba7abcc45d6232ea6e7890a1708bc --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/NextPlugin.js @@ -0,0 +1,33 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class NextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("NextPlugin", (request, resolveContext, callback) => { + resolver.doResolve(target, request, null, resolveContext, callback); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/PackageMapPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/PackageMapPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..39377b3362e5d6bcad7d0612895bbf5ca0b4e1f4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/PackageMapPlugin.js @@ -0,0 +1,297 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +const { readJson } = require("./util/fs"); +const { + createError, + findPackageIds, + parsePackageMap, +} = require("./util/packageMap"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./util/packageMap").PackageMap} PackageMap */ +/** @typedef {import("./util/packageMap").PackageMapPackages} PackageMapPackages */ + +/** + * @typedef {object} PackageMapOptions + * @property {string} configFile absolute path of the configuration file, read lazily when `packages` is not given + * @property {PackageMapPackages | null} packages an already-parsed `packages` object, used instead of reading `configFile` + */ + +/** @typedef {(err: Error | null, packageMap?: PackageMap) => void} PackageMapCallback */ + +const PACKAGE_NAME_REGEXP = /^(@[^/]+\/)?[^/]+/; + +/** + * Resolves bare specifiers through a Node.js package map instead of walking + * `node_modules`: the importing package's `dependencies` table names the + * package id to use, and that entry's location is handed to the regular + * resolution pipeline to finish the job (`exports`, `main`, extensions...). + * + * The importing package is taken from an explicit package id when the caller + * propagates one (`context.packageId`, or `packageId` carried over from a + * previous result) and located by path otherwise. Two situations are hard + * errors rather than a miss, because guessing would silently resolve to the + * wrong package: the importer sitting outside every mapped package, and + * several package entries sharing the importer's location. A specifier that is + * simply absent from `dependencies` is reported as unresolved, and no + * `node_modules` fallback is attempted. + * @experimental Package maps are stability 1 (experimental) in Node.js and are + * only reachable there behind `--experimental-package-map`. This plugin tracks + * that specification and may change with it, including in a patch release. + */ +module.exports = class PackageMapPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {PackageMapOptions} options package map options + * @param {boolean} symlinks whether the resolver resolves symlinks + * @param {string | ResolveStepHook} target target + */ + constructor(source, options, symlinks, target) { + this.source = source; + this.options = options; + this.symlinks = symlinks; + this.target = target; + /** @type {PackageMap | undefined} */ + this._packageMap = undefined; + /** @type {PackageMapCallback[] | undefined} */ + this._pending = undefined; + } + + /** + * Read and parse the configuration file once, queueing every request that + * arrives while the read is in flight so a cold start does not re-read the + * same file for each of them. + * @param {Resolver} resolver the resolver + * @param {ResolveContext} resolveContext resolve context + * @param {PackageMapCallback} callback callback + * @returns {void} + */ + _getPackageMap(resolver, resolveContext, callback) { + const { configFile, packages } = this.options; + + if (configFile && resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(configFile); + } + + if (this._packageMap !== undefined) { + return callback(null, this._packageMap); + } + + if (this._pending) { + this._pending.push(callback); + return; + } + this._pending = [callback]; + + /** + * @param {Error | null} error error + * @param {PackageMap=} packageMap package map + * @returns {void} + */ + const finish = (error, packageMap) => { + const pending = /** @type {PackageMapCallback[]} */ (this._pending); + this._pending = undefined; + for (const pendingCallback of pending) { + pendingCallback(error, packageMap); + } + }; + + // Package locations are matched against the paths the pipeline hands + // over, and those have their symlinks resolved when `symlinks` is on. + // Resolve the configuration file the same way so both sides are spelled + // alike; with `symlinks` off both keep the symlinked spelling instead. + this._resolveConfigFile(resolver, (realConfigFile) => { + if (packages) { + /** @type {PackageMap} */ + let packageMap; + try { + packageMap = parsePackageMap({ packages }, realConfigFile); + } catch (err) { + return finish(/** @type {Error} */ (err)); + } + this._packageMap = packageMap; + return finish(null, packageMap); + } + + readJson( + resolver.fileSystem, + realConfigFile, + { stripComments: false }, + (err, content) => { + /** @type {Error | null} */ + let error = err || null; + /** @type {PackageMap | undefined} */ + let packageMap; + + if (!error) { + try { + packageMap = parsePackageMap( + /** @type {import("./Resolver").JsonObject} */ (content), + realConfigFile, + ); + this._packageMap = packageMap; + } catch (parseErr) { + error = /** @type {Error} */ (parseErr); + } + } + + finish(error, packageMap); + }, + ); + }); + } + + /** + * Hand back the configuration file path package locations resolve against: + * its real path when the resolver follows symlinks, and the path as given + * otherwise. A configuration file whose real path cannot be read (it may not + * exist, or the file system may not implement it) is used as-is, so the + * read below reports the problem. + * @param {Resolver} resolver the resolver + * @param {(configFile: string) => void} callback callback + * @returns {void} + */ + _resolveConfigFile(resolver, callback) { + const { configFile } = this.options; + const { realpath } = resolver.fileSystem; + + if (!this.symlinks || !realpath) return callback(configFile); + + realpath(configFile, (err, result) => { + callback(err || !result ? configFile : String(result)); + }); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + /** @type {ResolveStepHook} */ + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("PackageMapPlugin", (request, resolveContext, callback) => { + const req = request.request; + if (!req) return callback(); + // Builtins are not affected by package maps. + if (req.startsWith("node:")) return callback(); + + const packageMatch = PACKAGE_NAME_REGEXP.exec(req); + if (!packageMatch) return callback(); + + const [packageName] = packageMatch; + const innerRequest = `.${req.slice(packageName.length)}`; + + this._getPackageMap(resolver, resolveContext, (err, packageMap) => { + if (err) return callback(err); + + const { packages } = /** @type {PackageMap} */ (packageMap); + const issuerPath = request.path; + // A package id may be any key of the `packages` object, the empty + // string included, so distinguish "not provided" from falsy. + const contextId = + request.context && + /** @type {string | undefined} */ (request.context.packageId); + const explicitId = + request.packageId !== undefined ? request.packageId : contextId; + + /** @type {string} */ + let issuerId; + + if (explicitId !== undefined && explicitId !== null) { + if (!packages.has(explicitId)) { + return callback( + createError( + `Unknown package id "${explicitId}" for request "${req}"`, + "ERR_PACKAGE_MAP_UNKNOWN_PACKAGE", + ), + ); + } + issuerId = explicitId; + } else { + const ids = + issuerPath === false + ? [] + : findPackageIds( + /** @type {PackageMap} */ (packageMap), + issuerPath, + ); + + if (ids.length === 0) { + return callback( + createError( + `Cannot resolve "${req}" from "${issuerPath}": the importing file is not inside any package of the package map`, + "ERR_PACKAGE_MAP_EXTERNAL_FILE", + ), + ); + } + if (ids.length > 1) { + return callback( + createError( + `Cannot resolve "${req}" from "${issuerPath}": the package ids ${ids + .map((id) => `"${id}"`) + .join( + ", ", + )} share this location, so the importing package is ambiguous. Propagate the package id of the previous resolution to disambiguate.`, + "ERR_PACKAGE_MAP_AMBIGUOUS_PACKAGE", + ), + ); + } + [issuerId] = ids; + } + + const issuer = + /** @type {import("./util/packageMap").PackageMapEntry} */ ( + packages.get(issuerId) + ); + const targetId = issuer.dependencies.get(packageName); + + if (targetId === undefined) { + if (resolveContext.log) { + resolveContext.log( + `"${packageName}" is not a dependency of package "${issuerId}" in the package map`, + ); + } + // Bail without a result: the package map is authoritative, so + // there is no `node_modules` fallback to try. + return callback(null, null); + } + + const targetEntry = + /** @type {import("./util/packageMap").PackageMapEntry} */ ( + packages.get(targetId) + ); + + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: targetEntry.path, + request: innerRequest, + packageId: targetId, + fullySpecified: request.fullySpecified && innerRequest !== ".", + }; + + resolver.doResolve( + target, + obj, + `resolved "${packageName}" to package "${targetId}" by the package map`, + resolveContext, + (resolveErr, result) => { + if (resolveErr) return callback(resolveErr); + if (result) return callback(null, result); + // Skip alternatives + return callback(null, null); + }, + ); + }); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ParsePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ParsePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..bcac8f6db58d9c906c0056efd918e53df4d590da --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ParsePlugin.js @@ -0,0 +1,84 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ParsePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} requestOptions request options + * @param {string | ResolveStepHook} target target + */ + constructor(source, requestOptions, target) { + this.source = source; + this.requestOptions = requestOptions; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const { requestOptions } = this; + resolver + .getHook(this.source) + .tapAsync("ParsePlugin", (request, resolveContext, callback) => { + const parsed = resolver.parse(/** @type {string} */ (request.request)); + /** @type {ResolveRequest} */ + // Single spread + direct field assignment instead of + // `{ ...request, ...parsed, ...requestOptions }` — avoids + // two extra property enumerations on every resolve. + // Keep in sync with Resolver.parse() output shape. + const obj = { ...request }; + obj.request = parsed.request; + obj.query = parsed.query || request.query || ""; + obj.fragment = parsed.fragment || request.fragment || ""; + obj.module = parsed.module; + obj.directory = parsed.directory; + obj.file = parsed.file; + obj.internal = parsed.internal; + Object.assign(obj, requestOptions); + if (parsed && resolveContext.log) { + if (parsed.module) resolveContext.log("Parsed request is a module"); + if (parsed.directory) { + resolveContext.log("Parsed request is a directory"); + } + } + // There is an edge-case where a request with # can be a path or a fragment -> try both + if (obj.request && !obj.query && obj.fragment) { + const directory = obj.fragment.endsWith("/"); + /** @type {ResolveRequest} */ + const alternative = { + ...obj, + directory, + request: + obj.request + + (obj.directory ? "/" : "") + + (directory ? obj.fragment.slice(0, -1) : obj.fragment), + fragment: "", + }; + resolver.doResolve( + target, + alternative, + null, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + resolver.doResolve(target, obj, null, resolveContext, callback); + }, + ); + return; + } + resolver.doResolve(target, obj, null, resolveContext, callback); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/PnpPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/PnpPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..42b230e76ea8afd80acbba246127046340c75ef1 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/PnpPlugin.js @@ -0,0 +1,134 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Maël Nison @arcanis +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** + * @typedef {object} PnpApiImpl + * @property {(packageName: string, issuer: string, options: { considerBuiltins: boolean }) => string | null} resolveToUnqualified resolve to unqualified + */ + +module.exports = class PnpPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {PnpApiImpl} pnpApi pnpApi + * @param {string | ResolveStepHook} target target + * @param {string | ResolveStepHook} alternateTarget alternateTarget + */ + constructor(source, pnpApi, target, alternateTarget) { + this.source = source; + this.pnpApi = pnpApi; + this.target = target; + this.alternateTarget = alternateTarget; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + /** @type {ResolveStepHook} */ + const target = resolver.ensureHook(this.target); + const alternateTarget = resolver.ensureHook(this.alternateTarget); + resolver + .getHook(this.source) + .tapAsync("PnpPlugin", (request, resolveContext, callback) => { + const req = request.request; + if (!req) return callback(); + + // The trailing slash indicates to PnP that this value is a folder rather than a file + const issuer = `${request.path}/`; + + const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); + if (!packageMatch) return callback(); + + const [packageName] = packageMatch; + const innerRequest = `.${req.slice(packageName.length)}`; + + /** @type {string | undefined | null} */ + let resolution; + /** @type {string | undefined | null} */ + let apiResolution; + try { + resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { + considerBuiltins: false, + }); + + if (resolution === null) { + // This is either not a PnP managed issuer or it's a Node builtin + // Try to continue resolving with our alternatives + resolver.doResolve( + alternateTarget, + request, + "issuer is not managed by a pnpapi", + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Skip alternatives + return callback(null, null); + }, + ); + return; + } + + if (resolveContext.fileDependencies) { + apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { + considerBuiltins: false, + }); + } + } catch (/** @type {unknown} */ error) { + if ( + /** @type {Error & { code: string }} */ + (error).code === "MODULE_NOT_FOUND" && + /** @type {Error & { pnpCode: string }} */ + (error).pnpCode === "UNDECLARED_DEPENDENCY" + ) { + // This is not a PnP managed dependency. + // Try to continue resolving with our alternatives + if (resolveContext.log) { + resolveContext.log("request is not managed by the pnpapi"); + for (const line of /** @type {Error} */ (error).message + .split("\n") + .filter(Boolean)) { + resolveContext.log(` ${line}`); + } + } + return callback(); + } + return callback(/** @type {Error} */ (error)); + } + + if (resolution === packageName) return callback(); + + if (apiResolution && resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(apiResolution); + } + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: resolution, + request: innerRequest, + ignoreSymlinks: true, + fullySpecified: request.fullySpecified && innerRequest !== ".", + }; + resolver.doResolve( + target, + obj, + `resolved by pnp to ${resolution}`, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // Skip alternatives + return callback(null, null); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/Resolver.js b/e-commerce/node_modules/enhanced-resolve/lib/Resolver.js new file mode 100644 index 0000000000000000000000000000000000000000..1921884e667ddd24b2e5fa151d8e9b69e1f58441 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/Resolver.js @@ -0,0 +1,1254 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = require("tapable"); +const createInnerContext = require("./createInnerContext"); +const { parseIdentifier } = require("./util/identifier"); +const { + PathType, + createCachedBasename, + createCachedDirname, + createCachedJoin, + getType, + isFileURL, + normalize, + toPath, +} = require("./util/path"); + +/* eslint-disable jsdoc/check-alignment */ +// TODO in the next major release use only `Promise.withResolvers()` +const _withResolvers = + // eslint-disable-next-line n/no-unsupported-features/es-syntax + Promise.withResolvers + ? /** + * @param {Resolver} self resolver + * @param {Context} context context information object + * @param {string | URL} path context path or a `file:` URL instance + * @param {string | URL} request request string or a `file:` URL instance + * @param {ResolveContext} resolveContext resolve context + * @returns {Promise} result + */ + (self, context, path, request, resolveContext) => { + // eslint-disable-next-line n/no-unsupported-features/es-syntax + const { promise, resolve, reject } = Promise.withResolvers(); + self.resolve(context, path, request, resolveContext, (err, res) => { + if (err) reject(err); + else resolve(/** @type {string | false} */ (res)); + }); + return promise; + } + : /** + * @param {Resolver} self resolver + * @param {Context} context context information object + * @param {string | URL} path context path or a `file:` URL instance + * @param {string | URL} request request string or a `file:` URL instance + * @param {ResolveContext} resolveContext resolve context + * @returns {Promise} result + */ + (self, context, path, request, resolveContext) => + new Promise((resolve, reject) => { + self.resolve(context, path, request, resolveContext, (err, res) => { + if (err) reject(err); + else resolve(/** @type {string | false} */ (res)); + }); + }); +/* eslint-enable jsdoc/check-alignment */ + +/** @typedef {import("./AliasUtils").AliasOption} AliasOption */ +/** @typedef {import("./util/path").CachedJoin} CachedJoin */ +/** @typedef {import("./util/path").CachedDirname} CachedDirname */ +/** @typedef {import("./util/path").CachedBasename} CachedBasename */ + +/** + * @typedef {object} JoinCacheEntry + * @property {CachedJoin["fn"]} fn cached join function + * @property {CachedJoin["cache"]} cache the underlying cache map + */ + +/** + * @typedef {object} DirnameCacheEntry + * @property {CachedDirname["fn"]} fn cached dirname function + * @property {CachedDirname["cache"]} cache the underlying cache map + */ + +/** + * @typedef {object} BasenameCacheEntry + * @property {CachedBasename["fn"]} fn cached dirname function + * @property {CachedBasename["cache"]} cache the underlying cache map + */ + +/** + * @typedef {object} PathCacheFunctions + * @property {JoinCacheEntry} join cached join + * @property {DirnameCacheEntry} dirname cached dirname + * @property {BasenameCacheEntry} basename cached basename + */ + +/** @type {WeakMap} */ +const _pathCacheByFs = new WeakMap(); + +const HASH_ESCAPE_RE = /#/g; + +/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ + +/** + * @typedef {object} KnownContext + * @property {string[]=} environments environments + * @property {string=} packageId package id of the importing file in the package map, propagated from a previous result to disambiguate package entries that share a location (`@experimental`, see the `packageMap` option) + */ + +// eslint-disable-next-line jsdoc/reject-any-type +/** @typedef {KnownContext & Record} Context */ + +/** @typedef {Error & { details?: string }} ErrorWithDetail */ + +/** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */ + +/** + * @typedef {object} PossibleFileSystemError + * @property {string=} code code + * @property {number=} errno number + * @property {string=} path path + * @property {string=} syscall syscall + */ + +/** + * @template T + * @callback FileSystemCallback + * @param {PossibleFileSystemError & Error | null} err + * @param {T=} result + */ + +/** + * @typedef {string | Buffer | URL} PathLike + */ + +/** + * @typedef {PathLike | number} PathOrFileDescriptor + */ + +/** + * @typedef {object} ObjectEncodingOptions + * @property {BufferEncoding | null | undefined=} encoding encoding + */ + +/** + * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption + */ + +/** @typedef {(err: NodeJS.ErrnoException | null, result?: string) => void} StringCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer) => void} BufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (string | Buffer)) => void} StringOrBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IStats) => void} StatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IBigIntStats) => void} BigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (IStats | IBigIntStats)) => void} StatsOrBigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | Error | null, result?: JsonObject) => void} ReadJsonCallback */ + +/** + * @template T + * @typedef {object} IStatsBase + * @property {() => boolean} isFile is file + * @property {() => boolean} isDirectory is directory + * @property {() => boolean} isBlockDevice is block device + * @property {() => boolean} isCharacterDevice is character device + * @property {() => boolean} isSymbolicLink is symbolic link + * @property {() => boolean} isFIFO is FIFO + * @property {() => boolean} isSocket is socket + * @property {T} dev dev + * @property {T} ino ino + * @property {T} mode mode + * @property {T} nlink nlink + * @property {T} uid uid + * @property {T} gid gid + * @property {T} rdev rdev + * @property {T} size size + * @property {T} blksize blksize + * @property {T} blocks blocks + * @property {T} atimeMs atime ms + * @property {T} mtimeMs mtime ms + * @property {T} ctimeMs ctime ms + * @property {T} birthtimeMs birthtime ms + * @property {Date} atime atime + * @property {Date} mtime mtime + * @property {Date} ctime ctime + * @property {Date} birthtime birthtime + */ + +/** + * @typedef {IStatsBase} IStats + */ + +/** + * @typedef {IStatsBase & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats + */ + +/** + * @template {string | Buffer} [T=string] + * @typedef {object} Dirent + * @property {() => boolean} isFile true when is file, otherwise false + * @property {() => boolean} isDirectory true when is directory, otherwise false + * @property {() => boolean} isBlockDevice true when is block device, otherwise false + * @property {() => boolean} isCharacterDevice true when is character device, otherwise false + * @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false + * @property {() => boolean} isFIFO true when is FIFO, otherwise false + * @property {() => boolean} isSocket true when is socket, otherwise false + * @property {T} name name + * @property {string} parentPath path + * @property {string=} path path + */ + +/** + * @typedef {object} StatOptions + * @property {(boolean | undefined)=} bigint need bigint values + */ + +/** + * @typedef {object} StatSyncOptions + * @property {(boolean | undefined)=} bigint need bigint values + * @property {(boolean | undefined)=} throwIfNoEntry throw if no entry + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void, + * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void, + * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void, + * (path: PathOrFileDescriptor, callback: BufferCallback): void, + * }} ReadFile + */ + +/** + * @typedef {"buffer" | { encoding: "buffer" }} BufferEncodingOption + */ + +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer, + * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string, + * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer, + * }} ReadFileSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, + * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer", callback: (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void): void, + * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void): void, + * (path: PathLike, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files?: Dirent[]) => void): void, + * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void, + * }} Readdir + */ + +/** + * @typedef {{ + * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | null): string[], + * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer"): Buffer[], + * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[], + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[], + * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }): Dirent[], + * }} ReaddirSync + */ + +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor, callback: ReadJsonCallback) => void} ReadJson + */ + +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor) => JsonObject} ReadJsonSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void, + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, + * (path: PathLike, callback: StringCallback): void, + * }} Readlink + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string, + * (path: PathLike, options: BufferEncodingOption): Buffer, + * (path: PathLike, options?: EncodingOption): string | Buffer, + * }} ReadlinkSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void, + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, + * }} LStat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, + * }} LStatSync + */ + +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void, + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, + * }} Stat + */ + +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, + * }} StatSync + */ + +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void, + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, + * (path: PathLike, callback: StringCallback): void, + * }} RealPath + */ + +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string, + * (path: PathLike, options: BufferEncodingOption): Buffer, + * (path: PathLike, options?: EncodingOption): string | Buffer, + * }} RealPathSync + */ + +/** + * @typedef {object} FileSystem + * @property {ReadFile} readFile read file method + * @property {Readdir} readdir readdir method + * @property {ReadJson=} readJson read json method + * @property {Readlink} readlink read link method + * @property {LStat=} lstat lstat method + * @property {Stat} stat stat method + * @property {RealPath=} realpath realpath method + */ + +/** + * @typedef {object} SyncFileSystem + * @property {ReadFileSync} readFileSync read file sync method + * @property {ReaddirSync} readdirSync read dir sync method + * @property {ReadJsonSync=} readJsonSync read json sync method + * @property {ReadlinkSync} readlinkSync read link sync method + * @property {LStatSync=} lstatSync lstat sync method + * @property {StatSync} statSync stat sync method + * @property {RealPathSync=} realpathSync real path sync method + */ + +/** + * @typedef {object} ParsedIdentifier + * @property {string} request request + * @property {string} query query + * @property {string} fragment fragment + * @property {boolean} directory is directory + * @property {boolean} module is module + * @property {boolean} file is file + * @property {boolean} internal is internal + */ + +/** @typedef {string | number | boolean | null} JsonPrimitive */ +/** @typedef {JsonValue[]} JsonArray */ +/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ +/** @typedef {{ [Key in string]?: JsonValue | undefined }} JsonObject */ + +/** + * @typedef {object} TsconfigPathsMap + * @property {TsconfigPathsData} main main tsconfig paths data + * @property {string} mainContext main tsconfig base URL (absolute path) + * @property {{ [baseUrl: string]: TsconfigPathsData }} refs referenced tsconfig paths data mapped by baseUrl + * @property {{ [context: string]: TsconfigPathsData }} allContexts all contexts (main + refs) for quick lookup + * @property {string[]} contextList precomputed `Object.keys(allContexts)` — read-only; used on the `_selectPathsDataForContext` hot path + * @property {Set} fileDependencies file dependencies + */ + +/** + * @typedef {object} TsconfigPathsData + * @property {import("./AliasUtils").CompiledAliasOptions} alias tsconfig file data + * @property {string[]} modules tsconfig file data + */ + +/** + * @typedef {object} BaseResolveRequest + * @property {string | false} path path + * @property {Context=} context content + * @property {string=} descriptionFilePath description file path + * @property {string=} descriptionFileRoot description file root + * @property {JsonObject=} descriptionFileData description file data + * @property {TsconfigPathsMap | null | undefined=} tsconfigPathsMap tsconfig paths map + * @property {string=} relativePath relative path + * @property {boolean=} ignoreSymlinks true when need to ignore symlinks, otherwise false + * @property {boolean=} fullySpecified true when full specified, otherwise false + * @property {string=} packageId package id the request was resolved to in the package map, to be propagated to resolutions made from the resulting file (`@experimental`, see the `packageMap` option) + * @property {string=} __innerRequest inner request for internal usage + * @property {string=} __innerRequest_request inner request for internal usage + * @property {string=} __innerRequest_relativePath inner relative path for internal usage + * @property {{ blocked: boolean }=} __restrictionsMarker internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring + */ + +/** @typedef {BaseResolveRequest & Partial} ResolveRequest */ + +/** + * @template T + * @typedef {{ add: (item: T) => void }} WriteOnlySet + */ + +/** @typedef {(request: ResolveRequest) => void} ResolveContextYield */ + +/** + * Singly-linked stack entry that also exposes a Set-like API + * (`has`, `size`, iteration). Each `doResolve` call prepends a new + * `StackEntry` that points at the previous tip via `.parent`, so pushing + * is O(1) in time and memory. Recursion detection walks the linked list + * (O(n)) but the stack is typically shallow, so this is cheaper overall + * than cloning a `Set` per call. + */ +class StackEntry { + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {StackEntry=} parent previous tip + * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API + */ + constructor(hook, request, parent, preSeeded) { + this.name = hook.name; + this.path = request.path; + this.request = request.request || ""; + this.query = request.query || ""; + this.fragment = request.fragment || ""; + this.directory = Boolean(request.directory); + this.module = Boolean(request.module); + /** @type {StackEntry | undefined} */ + this.parent = parent; + /** + * Strings seeded by callers that still pass `stack: new Set([...])`. + * Propagated through the chain so deeper `doResolve` calls still see + * them during recursion checks. `undefined` in the common case so + * there is no extra work on the hot path. + * @type {Set | undefined} + */ + this.preSeeded = preSeeded; + } + + /** + * Walk the linked list looking for an entry with the same request shape. + * Set-compatible: callers that used `stack.has(entry)` keep working. + * + * NOTE: kept monomorphic on purpose. An earlier draft accepted a string + * query too (so pre-5.21 plugins keeping their own `Set` of + * seen entries could probe the live stack with the formatted form), + * but adding the second shape regressed `doResolve`'s heap profile by + * ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic + * call-site state for `parent.has(stackEntry)` once `has` has two + * argument shapes. Plugins that need string membership can reach for + * `[...stack].find(e => e.includes(formattedString))` via the + * `String`-method proxies on `StackEntry` instead. + * @param {StackEntry} query entry to look for + * @returns {boolean} whether the stack already contains an equivalent entry + */ + has(query) { + /** @type {StackEntry | undefined} */ + let node = this; + while (node) { + if ( + node.name === query.name && + node.path === query.path && + node.request === query.request && + node.query === query.query && + node.fragment === query.fragment && + node.directory === query.directory && + node.module === query.module + ) { + return true; + } + node = node.parent; + } + return this.preSeeded !== undefined && this.preSeeded.has(query.toString()); + } + + /** + * Number of entries on the stack (oldest-to-newest length). + * @returns {number} size + */ + get size() { + let count = this.preSeeded ? this.preSeeded.size : 0; + /** @type {StackEntry | undefined} */ + let node = this; + while (node) { + count++; + node = node.parent; + } + return count; + } + + /** + * Iterate entries from oldest (root) to newest (tip), matching how a + * `Set` that was populated in insertion order would iterate. Pre-seeded + * legacy `Set` entries come first so error-message output stays + * ordered oldest-to-newest. + * + * Yields each entry as its formatted `toString()` form. Plugins written + * against the pre-5.21 `Set` shape — e.g. + * `[...resolveContext.stack].find(a => a.includes("module:"))` — keep + * working unchanged because each yielded value is a plain string with + * all of `String.prototype` available natively. Resolves that never + * iterate the stack pay nothing; iteration costs one `toString()` + * allocation per stack frame. + * @returns {IterableIterator} iterator + */ + *[Symbol.iterator]() { + if (this.preSeeded !== undefined) { + for (const entry of this.preSeeded) yield entry; + } + /** @type {StackEntry[]} */ + const entries = []; + /** @type {StackEntry | undefined} */ + let node = this; + while (node) { + entries.push(node); + node = node.parent; + } + for (let i = entries.length - 1; i >= 0; i--) yield entries[i].toString(); + } + + /** + * Human-readable form used in recursion error messages, logs, and the + * iterator above. Not memoized: caching would require an extra slot on + * every `StackEntry`, which costs heap even on resolves that never look + * at the formatted form. + * @returns {string} formatted entry + */ + toString() { + return `${this.name}: (${this.path}) ${this.request}${this.query}${ + this.fragment + }${this.directory ? " directory" : ""}${this.module ? " module" : ""}`; + } +} + +/** + * Resolve context + * @typedef {object} ResolveContext + * @property {WriteOnlySet=} contextDependencies directories that was found on file system + * @property {WriteOnlySet=} fileDependencies files that was found on file system + * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system + * @property {StackEntry | Set=} stack tip of the resolver call stack (a singly-linked list with Set-like API). For instance, `resolve → parsedResolve → describedResolve`. Accepts a legacy `Set` for back-compat with older callers; it is normalized internally without a hot-path branch. + * @property {((str: string) => void)=} log log function + * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results + */ + +/** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ + +/** + * @typedef {object} KnownHooks + * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep resolve step hook + * @property {SyncHook<[ResolveRequest, Error]>} noResolve no resolve hook + * @property {ResolveStepHook} resolve resolve hook + * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result result hook + */ + +/** + * @typedef {{ [key: string]: ResolveStepHook }} EnsuredHooks + */ + +/** + * @param {string} str input string + * @returns {string} in camel case + */ +function toCamelCase(str) { + return str.replace(/-([a-z])/g, (str) => str.slice(1).toUpperCase()); +} + +class Resolver { + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {StackEntry=} parent previous tip of the stack + * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API + * @returns {StackEntry} stack entry + */ + static createStackEntry(hook, request, parent, preSeeded) { + return new StackEntry(hook, request, parent, preSeeded); + } + + /** + * @param {FileSystem} fileSystem a filesystem + * @param {ResolveOptions} options options + */ + constructor(fileSystem, options) { + /** @type {FileSystem} */ + this.fileSystem = fileSystem; + /** @type {ResolveOptions} */ + this.options = options; + let pathCache = _pathCacheByFs.get(fileSystem); + if (!pathCache) { + pathCache = { + join: createCachedJoin(), + dirname: createCachedDirname(), + basename: createCachedBasename(), + }; + _pathCacheByFs.set(fileSystem, pathCache); + } + /** @type {PathCacheFunctions} */ + this.pathCache = pathCache; + /** @type {KnownHooks} */ + this.hooks = { + resolveStep: new SyncHook(["hook", "request"], "resolveStep"), + noResolve: new SyncHook(["request", "error"], "noResolve"), + resolve: new AsyncSeriesBailHook( + ["request", "resolveContext"], + "resolve", + ), + result: new AsyncSeriesHook(["result", "resolveContext"], "result"), + }; + } + + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + ensureHook(name) { + if (typeof name !== "string") { + return name; + } + name = toCamelCase(name); + if (name.startsWith("before")) { + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10, + }) + ); + } + if (name.startsWith("after")) { + return /** @type {ResolveStepHook} */ ( + this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10, + }) + ); + } + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + if (!hook) { + /** @type {KnownHooks & EnsuredHooks} */ + (this.hooks)[name] = new AsyncSeriesBailHook( + ["request", "resolveContext"], + name, + ); + + return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + } + return hook; + } + + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + getHook(name) { + if (typeof name !== "string") { + return name; + } + name = toCamelCase(name); + if (name.startsWith("before")) { + return /** @type {ResolveStepHook} */ ( + this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ + stage: -10, + }) + ); + } + if (name.startsWith("after")) { + return /** @type {ResolveStepHook} */ ( + this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ + stage: 10, + }) + ); + } + /** @type {ResolveStepHook} */ + const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; + if (!hook) { + throw new Error(`Hook ${name} doesn't exist`); + } + return hook; + } + + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} result + */ + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} result + */ + /** + * @param {Context | string | URL} context context information object, or the context path (a path or a `file:` URL) when no context is provided + * @param {string | URL | ResolveContext=} parent context path (a path or a `file:` URL) or resolve context when no context is provided + * @param {string | URL | ResolveContext=} specifier request string (or a `file:` URL) or resolve context when no context is provided + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} result + */ + resolveSync(context, parent, specifier, resolveContext) { + /** @type {Error | null | undefined} */ + let err; + /** @type {string | false | undefined} */ + let result; + let sync = false; + // `|| {}` so the underlying `resolve()` hits its 5-arg fast path + // (skips the overload-shifting prologue) regardless of whether the + // caller supplied a resolveContext. + this.resolve( + /** @type {Context} */ (context), + /** @type {string} */ (parent), + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext) || {}, + (_err, r) => { + err = _err; + result = r; + sync = true; + }, + ); + if (!sync) { + throw new Error( + "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!", + ); + } + if (err) throw err; + if (result === undefined) throw new Error("No result"); + return result; + } + + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} result + */ + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} result + */ + /** + * @param {Context | string | URL} context context information object, or the context path (a path or a `file:` URL) when no context is provided + * @param {string | URL | ResolveContext=} parent context path (a path or a `file:` URL) or resolve context when no context is provided + * @param {string | URL | ResolveContext=} specifier request string (or a `file:` URL) or resolve context when no context is provided + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} result + */ + resolvePromise(context, parent, specifier, resolveContext) { + // `|| {}` ensures the 5-arg fast path inside `resolve()` is reached + // even when the caller doesn't pass a resolveContext. + return _withResolvers( + this, + /** @type {Context} */ (context), + /** @type {string} */ (parent), + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext) || {}, + ); + } + + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext} resolveContext resolve context + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext} resolveContext resolve context + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + /** + * @param {Context | string | URL} context context information object, or the context path (a path or a `file:` URL) when no context is provided + * @param {string | URL | ResolveContext | ResolveCallback=} parent context path (a path or a `file:` URL) or (when no context) resolve context or callback + * @param {string | URL | ResolveContext | ResolveCallback=} specifier request string (or a `file:` URL) or (when no context) resolve context or callback + * @param {ResolveContext | ResolveCallback=} resolveContext resolve context or callback when no resolve context is provided + * @param {ResolveCallback=} callback callback function + * @returns {void} + */ + resolve(context, parent, specifier, resolveContext, callback) { + // Fast path for the common 5-arg call (`resolver.resolve(ctx, from, + // req, resolveCtx, cb)`) — every call from `resolveSync` / + // `resolvePromise` plus the vast majority of direct API callers. + // PR #536 added runtime overload-shifting to support optional + // `context` / `resolveContext`; that adds several `typeof` checks + // per resolve which show up as a measurable instruction-count + // regression on every benchmark that calls into this method. Skip + // the shifting entirely when all 5 args are already well-typed. + if ( + typeof callback === "function" && + typeof context === "object" && + context !== null && + typeof resolveContext === "object" && + resolveContext !== null + ) { + // proceed straight to per-arg validation below + } else { + // Slow path: shift positional args based on what was supplied. + // Shift when context is omitted (first positional arg is the parent, + // either a path or a `file:` URL). + if (typeof context === "string" || context instanceof URL) { + // Keep an already-supplied callback (resolveSync / resolvePromise + // always pass one in the 5th position). + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback | undefined} */ ( + resolveContext + ); + } + resolveContext = + /** @type {ResolveContext | ResolveCallback | undefined} */ ( + specifier + ); + specifier = /** @type {string} */ (parent); + parent = context; + context = {}; + } + // 4-arg form: the resolveContext slot holds the callback. + if (typeof resolveContext === "function") { + callback = resolveContext; + resolveContext = {}; + } else if (!resolveContext || typeof resolveContext !== "object") { + resolveContext = {}; + } + if (typeof callback !== "function") { + throw new TypeError("callback argument is not a function"); + } + if (!context || typeof context !== "object") { + context = {}; + } + } + // Accept `file:` URLs for parent/specifier, converting to a filesystem + // path (mirrors the URL support in resolve options). The `instanceof` + // check sits on the error branch and `isFileURL` reads one character of + // a path, so the common string case stays cheap on this hot path. + // A `file:` specifier string needs nothing here — `parseIdentifier` + // converts it once the request is parsed. + if (typeof parent !== "string") { + if (parent instanceof URL) parent = toPath(parent); + else return callback(new Error("path argument is not a string")); + } else if (isFileURL(parent)) { + parent = toPath(parent); + } + if (typeof specifier !== "string") { + if (specifier instanceof URL) specifier = toPath(specifier); + else return callback(new Error("request argument is not a string")); + } + + /** @type {ResolveRequest} */ + const obj = { + context, + path: parent, + request: specifier, + }; + + /** @type {ResolveContextYield | undefined} */ + let yield_; + let yieldCalled = false; + /** @type {ResolveContextYield | undefined} */ + let finishYield; + if (typeof resolveContext.yield === "function") { + const old = resolveContext.yield; + /** + * @param {ResolveRequest} obj object + */ + yield_ = (obj) => { + old(obj); + yieldCalled = true; + }; + /** + * @param {ResolveRequest} result result + * @returns {void} + */ + finishYield = (result) => { + if (result) { + /** @type {ResolveContextYield} */ (yield_)(result); + } + callback(null); + }; + } + + /** + * @param {ResolveRequest} result result + * @returns {void} + */ + const finishResolved = (result) => { + const resultPath = result.path; + if (resultPath === false) return callback(null, false, result); + const escapedPath = resultPath.includes("#") + ? resultPath.replace(HASH_ESCAPE_RE, "\0#") + : resultPath; + const resultQuery = result.query; + let escapedQuery; + if (resultQuery) { + escapedQuery = resultQuery.includes("#") + ? resultQuery.replace(HASH_ESCAPE_RE, "\0#") + : resultQuery; + } else { + escapedQuery = ""; + } + return callback( + null, + `${escapedPath}${escapedQuery}${result.fragment || ""}`, + result, + ); + }; + + /** + * @param {string} message resolve message + * @param {string[]} log logs + * @returns {void} + */ + const finishWithoutResolve = (message, log) => { + /** + * @type {ErrorWithDetail} + */ + const error = new Error(`Can't ${message}`); + error.details = log.join("\n"); + this.hooks.noResolve.call(obj, error); + return callback(error); + }; + + if (resolveContext.log) { + const message = `resolve '${specifier}' in '${parent}'`; + // We need log anyway to capture it in case of an error + const parentLog = resolveContext.log; + /** @type {string[]} */ + const log = []; + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: (msg) => { + parentLog(msg); + log.push(msg); + }, + yield: yield_, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + if (result) return finishResolved(result); + + return finishWithoutResolve(message, log); + }, + ); + } + // Try to resolve assuming there is no error + // We don't log stuff in this case + // When there is no yield wrapper, the caller's resolveContext can + // be passed directly — its `log` is already falsy (we are in the + // !log branch) and `yield` is undefined, so a fresh wrapper would + // be an identical copy. + const rc = yield_ + ? { + log: undefined, + yield: yield_, + fileDependencies: resolveContext.fileDependencies, + contextDependencies: resolveContext.contextDependencies, + missingDependencies: resolveContext.missingDependencies, + stack: resolveContext.stack, + } + : resolveContext; + return this.doResolve(this.hooks.resolve, obj, null, rc, (err, result) => { + if (err) return callback(err); + + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + if (result) return finishResolved(result); + + // log is missing for the error details + // so we redo the resolving for the log info + // this is more expensive to the success case + // is assumed by default + const message = `resolve '${specifier}' in '${parent}'`; + /** @type {string[]} */ + const log = []; + + return this.doResolve( + this.hooks.resolve, + obj, + message, + { + log: (msg) => log.push(msg), + yield: yield_, + stack: resolveContext.stack, + }, + (err, result) => { + if (err) return callback(err); + + // In a case that there is a race condition and yield will be called + if (yieldCalled || (result && yield_)) { + return /** @type {ResolveContextYield} */ (finishYield)( + /** @type {ResolveRequest} */ (result), + ); + } + + return finishWithoutResolve(message, log); + }, + ); + }); + } + + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {null | string} message string + * @param {ResolveContext} resolveContext resolver context + * @param {(err?: null | Error, result?: ResolveRequest) => void} callback callback + * @returns {void} + */ + doResolve(hook, request, message, resolveContext, callback) { + const rawStack = resolveContext.stack; + /** @type {StackEntry | undefined} */ + let parent; + /** @type {Set | undefined} */ + let preSeeded; + if (rawStack instanceof StackEntry) { + parent = rawStack; + preSeeded = rawStack.preSeeded; + } else if (rawStack) { + // TODO in the next major remove `Set` support in favor of `StackEntry` + // Legacy `stack: new Set()` API: don't link the Set into + // the parent chain (it would pollute iteration and field-compare + // walks). Carry the strings on the StackEntry itself instead so + // deeper `doResolve` calls keep seeing pre-seeded entries. + preSeeded = /** @type {Set} */ (rawStack); + } + // Prepend a new linked-list node. O(1) allocation, no Set clone. + const stackEntry = Resolver.createStackEntry( + hook, + request, + parent, + preSeeded, + ); + + // When `parent` exists, its `has()` already consults `preSeeded` + // (inherited from the same chain), so we only need the direct Set + // lookup on the very first `doResolve` call (no parent yet). + if ( + parent !== undefined + ? parent.has(stackEntry) + : preSeeded !== undefined && preSeeded.has(stackEntry.toString()) + ) { + /** + * Prevent recursion + * @type {Error & { recursion?: boolean }} + */ + const recursionError = new Error( + `Recursion in resolving\nStack:\n ${[...stackEntry].join("\n ")}`, + ); + recursionError.recursion = true; + if (resolveContext.log) { + resolveContext.log("abort resolving because of recursion"); + } + return callback(recursionError); + } + this.hooks.resolveStep.call(hook, request); + + if (hook.isUsed()) { + // No-log fast path: when the context was created internally + // (stack is already a StackEntry from a prior doResolve), we + // can mutate stack in-place and restore it in the callback, + // avoiding the createInnerContext allocation entirely. + if (!resolveContext.log && rawStack instanceof StackEntry) { + resolveContext.stack = stackEntry; + return hook.callAsync(request, resolveContext, (err, result) => { + resolveContext.stack = rawStack; + if (err) return callback(err); + if (result) return callback(null, result); + callback(); + }); + } + const innerContext = createInnerContext( + resolveContext, + stackEntry, + message, + ); + return hook.callAsync(request, innerContext, (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + callback(); + }); + } + callback(); + } + + /** + * @param {string} identifier identifier + * @returns {ParsedIdentifier} parsed identifier + */ + parse(identifier) { + /** @type {ParsedIdentifier} */ + const part = { + request: "", + query: "", + fragment: "", + module: false, + directory: false, + file: false, + internal: false, + }; + + const parsedIdentifier = parseIdentifier(identifier); + + if (!parsedIdentifier) return part; + + [part.request, part.query, part.fragment] = parsedIdentifier; + + if (part.request.length > 0) { + // `getType` looks at the prefix of its input and the prefix is + // identical between `identifier` and `part.request` in every + // non-`\0`-escape case (slicing off `?query` / `#fragment` doesn't + // touch the head). `parseIdentifier`'s common fast path returns + // the same `identifier` reference as `parsedIdentifier[0]`, so a + // pointer-equality check detects the case where we can compute + // `getType` once and use it for both `module` and `internal`. The + // `\0#…` escape path produces a fresh `part.request` and falls + // through to the second `getType(identifier)` call to preserve + // the original `internal` flag. + const requestType = getType(part.request); + part.module = requestType === PathType.Normal; + part.internal = + identifier === part.request + ? requestType === PathType.Internal + : getType(identifier) === PathType.Internal; + // `isDirectory` is just `endsWith("/")` — inline so `parse()` + // doesn't pay for the extra method dispatch on every resolve. + part.directory = part.request.endsWith("/"); + if (part.directory) { + part.request = part.request.slice(0, -1); + } + } + + return part; + } + + /** + * @param {string} path path + * @returns {boolean} true, if the path is a module + */ + isModule(path) { + return getType(path) === PathType.Normal; + } + + /** + * @param {string} path path + * @returns {boolean} true, if the path is private + */ + isPrivate(path) { + return getType(path) === PathType.Internal; + } + + /** + * @param {string} path a path + * @returns {boolean} true, if the path is a directory path + */ + isDirectory(path) { + return path.endsWith("/"); + } + + /** + * @param {string} path path + * @returns {string} normalized path + */ + normalize(path) { + return normalize(path); + } + + /** + * @param {string} path path + * @param {string} request request + * @returns {string} joined path + */ + join(path, request) { + return this.pathCache.join.fn(path, request); + } + + /** + * @param {string} path path + * @returns {string} parent directory + */ + dirname(path) { + return this.pathCache.dirname.fn(path); + } + + /** + * @param {string} path the path to evaluate + * @param {string=} suffix an extension to remove from the result + * @returns {string} the last portion of a path + */ + basename(path, suffix) { + return this.pathCache.basename.fn(path, suffix); + } +} + +module.exports = Resolver; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ResolverFactory.js b/e-commerce/node_modules/enhanced-resolve/lib/ResolverFactory.js new file mode 100644 index 0000000000000000000000000000000000000000..ceed58d6c2d4e73965108dbe21ee19cc7da9882d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ResolverFactory.js @@ -0,0 +1,942 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +// eslint-disable-next-line n/prefer-global/process +const { cwd, versions } = require("process"); + +const AliasFieldPlugin = require("./AliasFieldPlugin"); +const AliasPlugin = require("./AliasPlugin"); +const AppendPlugin = require("./AppendPlugin"); +const ConditionalPlugin = require("./ConditionalPlugin"); +const DescriptionFilePlugin = require("./DescriptionFilePlugin"); +const DirectoryExistsPlugin = require("./DirectoryExistsPlugin"); +const ExportsFieldPlugin = require("./ExportsFieldPlugin"); +const ExtensionAliasPlugin = require("./ExtensionAliasPlugin"); +const FileExistsPlugin = require("./FileExistsPlugin"); +const ImportsFieldPlugin = require("./ImportsFieldPlugin"); +const JoinRequestPartPlugin = require("./JoinRequestPartPlugin"); +const JoinRequestPlugin = require("./JoinRequestPlugin"); +const MainFieldPlugin = require("./MainFieldPlugin"); +const ModulesInHierarchicalDirectoriesPlugin = require("./ModulesInHierarchicalDirectoriesPlugin"); +const ModulesInRootPlugin = require("./ModulesInRootPlugin"); +const NextPlugin = require("./NextPlugin"); +const PackageMapPlugin = require("./PackageMapPlugin"); +const ParsePlugin = require("./ParsePlugin"); +const PnpPlugin = require("./PnpPlugin"); +const Resolver = require("./Resolver"); +const RestrictionsPlugin = require("./RestrictionsPlugin"); +const ResultPlugin = require("./ResultPlugin"); +const RootsPlugin = require("./RootsPlugin"); +const SelfReferencePlugin = require("./SelfReferencePlugin"); +const SymlinkPlugin = require("./SymlinkPlugin"); +const SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator"); +const TryNextPlugin = require("./TryNextPlugin"); +const TsconfigPathsPlugin = require("./TsconfigPathsPlugin"); +const UnsafeCachePlugin = require("./UnsafeCachePlugin"); +const UseFilePlugin = require("./UseFilePlugin"); +const { PathType, getType, join, toPath } = require("./util/path"); + +/** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ +/** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */ +/** @typedef {import("./PackageMapPlugin").PackageMapOptions} PackageMapOptions */ +/** @typedef {import("./util/packageMap").PackageMapPackages} PackageMapPackages */ +/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ +/** @typedef {import("./Resolver").EnsuredHooks} EnsuredHooks */ +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").KnownHooks} KnownHooks */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {import("./UnsafeCachePlugin").Cache} Cache */ + +/** @typedef {string | string[] | false} AliasOptionNewRequest */ +/** @typedef {{ [k: string]: AliasOptionNewRequest }} AliasOptions */ +/** @typedef {string | URL | (string | URL)[] | false} UserAliasOptionNewRequest */ +/** @typedef {{ [k: string]: UserAliasOptionNewRequest }} UserAliasOptions */ +/** @typedef {{ alias: UserAliasOptionNewRequest, name: string, onlyModule?: boolean }} UserAliasOptionEntry */ +/** @typedef {{ [k: string]: string | string[] }} ExtensionAliasOptions */ +/** @typedef {false | 0 | "" | null | undefined} Falsy */ +/** @typedef {{ apply: (resolver: Resolver) => void } | ((this: Resolver, resolver: Resolver) => void) | Falsy} Plugin */ + +/** + * @typedef {object} TsconfigOptions + * @property {string=} configFile A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file + * @property {string[] | "auto"=} references References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths + * @property {string=} baseUrl Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file + */ + +/** + * @typedef {object} UserTsconfigOptions + * @property {(string | URL)=} configFile A path, or `file:` URL, pointing at the tsconfig file + * @property {((string | URL)[] | "auto")=} references References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths or `file:` URLs + * @property {(string | URL)=} baseUrl Override baseUrl from tsconfig.json with a path or `file:` URL + */ + +/** + * A Node.js package map (https://nodejs.org/api/packages.html#package-maps), + * either as the path of the configuration file or as its already-parsed + * contents. + * @experimental Package maps are stability 1 (experimental) in Node.js and are + * only reachable there behind `--experimental-package-map`. This option tracks + * that specification and may change with it, including in a patch release. + * @typedef {object} UserPackageMapOptions + * @property {(string | URL)=} configFile A path, or `file:` `URL` instance, pointing at the package map file. Required together with `packages`, whose relative `url` values are resolved against it + * @property {PackageMapPackages=} packages An already-parsed `packages` object, used instead of reading `configFile` from disk + */ + +/** + * @typedef {object} UserResolveOptions + * @property {(UserAliasOptions | UserAliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value + * @property {(UserAliasOptions | UserAliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option + * @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases + * @property {boolean=} extensionAliasForExports Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned); when enabled, matches TypeScript's behavior for packages that ship TS sources alongside compiled JS. + * @property {(string | string[])[]=} aliasFields A list of alias fields in description files + * @property {((predicate: ResolveRequest) => boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. + * @property {string[]=} descriptionFiles A list of description files to read from + * @property {string[]=} conditionNames A list of exports field condition names. + * @property {boolean=} enforceExtension Enforce that a extension from extensions must be used + * @property {(string | string[])[]=} exportsFields A list of exports fields in description files + * @property {(string | string[])[]=} importsFields A list of imports fields in description files + * @property {string[]=} extensions A list of extensions which should be tried for files + * @property {FileSystem} fileSystem The file system which should be used + * @property {(Cache | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests + * @property {boolean=} symlinks Resolve symlinks to their symlinked location + * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached + * @property {(string | URL)[] | string | URL=} modules A list of directories to resolve modules from, can be absolute path, folder name, or a `file:` URL + * @property {(string | string[] | { name: string | string[], forceRelative: boolean })[]=} mainFields A list of main fields in description files + * @property {string[]=} mainFiles A list of main files in directories + * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied + * @property {(string | URL | UserPackageMapOptions)=} packageMap A Node.js package map file path (or `file:` `URL` instance), or an object with the already-parsed `packages`. When set, bare specifiers resolve through the map instead of `node_modules` (`@experimental`) + * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" + * @property {(string | URL)[]=} roots A list of root paths, each an absolute path or a `file:` URL + * @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it + * @property {boolean=} resolveToContext Resolve to a context instead of a file + * @property {(string | URL | RegExp)[]=} restrictions A list of resolve restrictions, each an absolute path, a `file:` URL, or a RegExp + * @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls + * @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules + * @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots + * @property {string | URL | boolean | UserTsconfigOptions=} tsconfig TypeScript config file path (or `file:` URL) or config object with configFile and references + */ + +/** + * @typedef {object} ResolveOptions + * @property {AliasOptionEntry[]} alias alias + * @property {AliasOptionEntry[]} fallback fallback + * @property {Set} aliasFields alias fields + * @property {ExtensionAliasOption[]} extensionAlias extension alias + * @property {boolean} extensionAliasForExports apply extension alias to exports field targets + * @property {(predicate: ResolveRequest) => boolean} cachePredicate cache predicate + * @property {boolean} cacheWithContext cache with context + * @property {Set} conditionNames A list of exports field condition names. + * @property {string[]} descriptionFiles description files + * @property {boolean} enforceExtension enforce extension + * @property {Set} exportsFields exports fields + * @property {Set} importsFields imports fields + * @property {Set} extensions extensions + * @property {FileSystem} fileSystem fileSystem + * @property {Cache | false} unsafeCache unsafe cache + * @property {boolean} symlinks symlinks + * @property {Resolver=} resolver resolver + * @property {(string | string[])[]} modules modules + * @property {{ name: string[], forceRelative: boolean }[]} mainFields main fields + * @property {Set} mainFiles main files + * @property {Plugin[]} plugins plugins + * @property {PackageMapOptions | null} packageMap package map + * @property {PnpApi | null} pnpApi pnp API + * @property {Set} roots roots + * @property {boolean} fullySpecified fully specified + * @property {boolean} resolveToContext resolve to context + * @property {Set} restrictions restrictions + * @property {boolean} preferRelative prefer relative + * @property {boolean} preferAbsolute prefer absolute + * @property {string | boolean | TsconfigOptions} tsconfig tsconfig file path or config object + */ + +/** + * @param {PnpApi | null=} option option + * @returns {PnpApi | null} processed option + */ +function processPnpApiOption(option) { + if ( + option === undefined && + /** @type {NodeJS.ProcessVersions & { pnp: string }} */ versions.pnp + ) { + const _findPnpApi = + /** @type {(issuer: string) => PnpApi | null}} */ + ( + // @ts-expect-error maybe nothing + require("module").findPnpApi + ); + + if (_findPnpApi) { + return { + resolveToUnqualified(request, issuer, opts) { + const pnpapi = _findPnpApi(issuer); + + if (!pnpapi) { + // Issuer isn't managed by PnP + return null; + } + + return pnpapi.resolveToUnqualified(request, issuer, opts); + }, + }; + } + } + + return option || null; +} + +/** + * @param {UserAliasOptionNewRequest} alias alias target(s) + * @returns {AliasOptionNewRequest} target(s) with `file:` URLs converted to paths + */ +function toPathAlias(alias) { + if (alias === false) return false; + return Array.isArray(alias) ? alias.map(toPath) : toPath(alias); +} + +/** + * @param {UserAliasOptions | UserAliasOptionEntry[] | undefined} alias alias + * @returns {AliasOptionEntry[]} normalized aliases + */ +function normalizeAlias(alias) { + if (typeof alias === "object" && !Array.isArray(alias) && alias !== null) { + return Object.keys(alias).map((key) => { + /** @type {AliasOptionEntry} */ + const obj = { + name: key, + onlyModule: false, + alias: toPathAlias(alias[key]), + }; + + if (/\$$/.test(key)) { + obj.onlyModule = true; + obj.name = key.slice(0, -1); + } + + return obj; + }); + } + + return alias + ? alias.map((item) => ({ ...item, alias: toPathAlias(item.alias) })) + : []; +} + +/** + * @param {string | URL} configFile the `packageMap` configuration file option + * @returns {string} the absolute path of the configuration file + */ +function toPackageMapConfigFile(configFile) { + const file = toPath(configFile); + const type = getType(file); + + if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { + return file; + } + + // The configuration file is the base every package `url` resolves against, + // so it has to be absolute before it is turned into a URL. Relative paths + // are taken from the working directory, like `tsconfig` — where there is no + // working directory to take them from (the resolver also runs in browsers), + // say so instead of silently resolving against the filesystem root. + if (typeof cwd !== "function") { + throw new Error( + "The 'packageMap' option needs an absolute 'configFile' in an environment without a working directory", + ); + } + + return join(cwd(), file); +} + +/** + * @param {string | URL | UserPackageMapOptions | undefined} packageMap package map option + * @returns {PackageMapOptions | null} normalized package map, or `null` when the option is unset + */ +function normalizePackageMap(packageMap) { + if (packageMap === undefined) return null; + if (typeof packageMap === "string" || packageMap instanceof URL) { + return { configFile: toPackageMapConfigFile(packageMap), packages: null }; + } + + const { configFile, packages } = packageMap; + + // Relative `url` values are resolved against the configuration file, so an + // inline `packages` object still needs to say where it would have lived. + // There is no working directory to fall back on: the resolver runs in + // browsers too. + if (packages !== undefined && configFile === undefined) { + throw new Error( + "The 'packageMap' option needs a 'configFile' next to 'packages' to resolve the package urls against", + ); + } + if (configFile === undefined) { + throw new Error( + "The 'packageMap' option needs either a 'configFile' or 'packages'", + ); + } + + return { + configFile: toPackageMapConfigFile(configFile), + packages: packages === undefined ? null : packages, + }; +} + +/** + * @param {string | URL | boolean | UserTsconfigOptions | undefined} tsconfig tsconfig option + * @returns {string | boolean | TsconfigOptions} normalized tsconfig with `file:` URLs converted to paths + */ +function normalizeTsconfig(tsconfig) { + if (tsconfig === undefined) return false; + if (typeof tsconfig === "boolean") return tsconfig; + if (typeof tsconfig === "string" || tsconfig instanceof URL) { + return toPath(tsconfig); + } + + /** @type {TsconfigOptions} */ + const result = {}; + + if (tsconfig.configFile !== undefined) { + result.configFile = toPath(tsconfig.configFile); + } + if (tsconfig.baseUrl !== undefined) { + result.baseUrl = toPath(tsconfig.baseUrl); + } + if (tsconfig.references !== undefined) { + result.references = Array.isArray(tsconfig.references) + ? tsconfig.references.map(toPath) + : tsconfig.references; + } + + return result; +} + +/** + * Merging filtered elements + * @param {string[]} array source array + * @param {(item: string) => boolean} filter predicate + * @returns {(string | string[])[]} merge result + */ +function mergeFilteredToArray(array, filter) { + /** @type {(string | string[])[]} */ + const result = []; + const set = new Set(array); + + for (const item of set) { + if (filter(item)) { + const lastElement = + result.length > 0 ? result[result.length - 1] : undefined; + if (Array.isArray(lastElement)) { + lastElement.push(item); + } else { + result.push([item]); + } + } else { + result.push(item); + } + } + + return result; +} + +/** + * @param {UserResolveOptions} options input options + * @returns {ResolveOptions} output options + */ +function createOptions(options) { + const mainFieldsSet = new Set(options.mainFields || ["main"]); + /** @type {ResolveOptions["mainFields"]} */ + const mainFields = []; + + for (const item of mainFieldsSet) { + if (typeof item === "string") { + mainFields.push({ + name: [item], + forceRelative: true, + }); + } else if (Array.isArray(item)) { + mainFields.push({ + name: item, + forceRelative: true, + }); + } else { + mainFields.push({ + name: Array.isArray(item.name) ? item.name : [item.name], + forceRelative: item.forceRelative, + }); + } + } + + return { + alias: normalizeAlias(options.alias), + fallback: normalizeAlias(options.fallback), + aliasFields: new Set(options.aliasFields), + cachePredicate: + options.cachePredicate || + function trueFn() { + return true; + }, + cacheWithContext: + typeof options.cacheWithContext !== "undefined" + ? options.cacheWithContext + : true, + exportsFields: new Set(options.exportsFields || ["exports"]), + importsFields: new Set(options.importsFields || ["imports"]), + conditionNames: new Set(options.conditionNames), + descriptionFiles: [ + ...new Set(options.descriptionFiles || ["package.json"]), + ], + enforceExtension: + options.enforceExtension === undefined + ? Boolean(options.extensions && options.extensions.includes("")) + : options.enforceExtension, + extensions: new Set(options.extensions || [".js", ".json", ".node"]), + extensionAlias: options.extensionAlias + ? Object.keys(options.extensionAlias).map((k) => ({ + extension: k, + alias: /** @type {ExtensionAliasOptions} */ (options.extensionAlias)[ + k + ], + })) + : [], + extensionAliasForExports: options.extensionAliasForExports || false, + fileSystem: options.useSyncFileSystemCalls + ? new SyncAsyncFileSystemDecorator( + /** @type {SyncFileSystem} */ ( + /** @type {unknown} */ (options.fileSystem) + ), + ) + : options.fileSystem, + unsafeCache: + options.unsafeCache && typeof options.unsafeCache !== "object" + ? /** @type {Cache} */ ({}) + : options.unsafeCache || false, + symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, + resolver: options.resolver, + modules: mergeFilteredToArray( + Array.isArray(options.modules) + ? options.modules.map(toPath) + : options.modules + ? [toPath(options.modules)] + : ["node_modules"], + (item) => { + const type = getType(item); + return type === PathType.Normal || type === PathType.Relative; + }, + ), + mainFields, + mainFiles: new Set(options.mainFiles || ["index"]), + plugins: options.plugins || [], + packageMap: normalizePackageMap(options.packageMap), + pnpApi: processPnpApiOption(options.pnpApi), + roots: new Set(options.roots ? options.roots.map(toPath) : undefined), + fullySpecified: options.fullySpecified || false, + resolveToContext: options.resolveToContext || false, + preferRelative: options.preferRelative || false, + preferAbsolute: options.preferAbsolute || false, + restrictions: new Set( + options.restrictions && + options.restrictions.map((r) => (r instanceof RegExp ? r : toPath(r))), + ), + tsconfig: normalizeTsconfig(options.tsconfig), + }; +} + +/** + * @param {UserResolveOptions} options resolve options + * @returns {Resolver} created resolver + */ +module.exports.createResolver = function createResolver(options) { + const normalizedOptions = createOptions(options); + + const { + alias, + fallback, + aliasFields, + extensionAliasForExports, + cachePredicate, + cacheWithContext, + conditionNames, + descriptionFiles, + enforceExtension, + exportsFields, + extensionAlias, + importsFields, + extensions, + fileSystem, + fullySpecified, + mainFields, + mainFiles, + modules, + packageMap, + plugins: userPlugins, + pnpApi, + resolveToContext, + preferRelative, + preferAbsolute, + symlinks, + unsafeCache, + resolver: customResolver, + restrictions, + roots, + tsconfig, + } = normalizedOptions; + + const plugins = [...userPlugins]; + + const resolver = + customResolver || new Resolver(fileSystem, normalizedOptions); + + // // pipeline //// + + resolver.ensureHook("resolve"); + resolver.ensureHook("internalResolve"); + resolver.ensureHook("newInternalResolve"); + resolver.ensureHook("importsResolve"); + resolver.ensureHook("parsedResolve"); + resolver.ensureHook("describedResolve"); + resolver.ensureHook("rawResolve"); + resolver.ensureHook("normalResolve"); + resolver.ensureHook("internal"); + resolver.ensureHook("rawModule"); + resolver.ensureHook("alternateRawModule"); + resolver.ensureHook("module"); + resolver.ensureHook("resolveAsModule"); + resolver.ensureHook("undescribedResolveInPackage"); + resolver.ensureHook("resolveInPackage"); + resolver.ensureHook("resolveInExistingDirectory"); + resolver.ensureHook("importsFieldRelative"); + if (extensionAliasForExports) { + resolver.ensureHook("exportsFieldRelative"); + } + resolver.ensureHook("relative"); + resolver.ensureHook("describedRelative"); + resolver.ensureHook("directory"); + resolver.ensureHook("undescribedExistingDirectory"); + resolver.ensureHook("existingDirectory"); + resolver.ensureHook("undescribedRawFile"); + resolver.ensureHook("rawFile"); + resolver.ensureHook("file"); + resolver.ensureHook("finalFile"); + resolver.ensureHook("existingFile"); + resolver.ensureHook("resolved"); + + // TODO remove in next major + // cspell:word Interal + // Backward-compat + // @ts-expect-error + resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; + + // resolve + for (const { source, resolveOptions } of [ + { source: "resolve", resolveOptions: { fullySpecified } }, + { source: "internal-resolve", resolveOptions: { fullySpecified: false } }, + // Entry point for non-relative targets from the imports field. + // Sets internal: false to prevent re-entering imports resolution, + // aligning with the Node.js ESM spec where PACKAGE_IMPORTS_RESOLVE + // does not recursively resolve # specifiers. + // https://nodejs.org/api/esm.html#resolution-algorithm-specification + { + source: "imports-resolve", + resolveOptions: { fullySpecified: false, internal: false }, + }, + ]) { + plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); + } + + // parsed-resolve + plugins.push( + new DescriptionFilePlugin( + "parsed-resolve", + descriptionFiles, + false, + "described-resolve", + ), + ); + plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); + + // described-resolve + if (unsafeCache) { + plugins.push( + new UnsafeCachePlugin( + "described-resolve", + cachePredicate, + /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), + cacheWithContext, + "raw-resolve", + ), + ); + } else { + plugins.push(new NextPlugin("described-resolve", "raw-resolve")); + } + if (fallback.length > 0) { + plugins.push( + new AliasPlugin("described-resolve", fallback, "internal-resolve"), + ); + } + // raw-resolve + if (alias.length > 0) { + plugins.push(new AliasPlugin("raw-resolve", alias, "internal-resolve")); + } + if (tsconfig) { + plugins.push(new TsconfigPathsPlugin(tsconfig)); + } + for (const item of aliasFields) { + plugins.push(new AliasFieldPlugin("raw-resolve", item, "internal-resolve")); + } + for (const item of extensionAlias) { + plugins.push( + new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve"), + ); + } + plugins.push(new NextPlugin("raw-resolve", "normal-resolve")); + + // normal-resolve + if (preferRelative) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + plugins.push( + new ConditionalPlugin( + "after-normal-resolve", + { module: true }, + "resolve as module", + false, + "raw-module", + ), + ); + plugins.push( + new ConditionalPlugin( + "after-normal-resolve", + { internal: true }, + "resolve as internal import", + false, + "internal", + ), + ); + if (preferAbsolute) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + if (roots.size > 0) { + plugins.push(new RootsPlugin("after-normal-resolve", roots, "relative")); + } + if (!preferRelative && !preferAbsolute) { + plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); + } + + // internal + for (const importsField of importsFields) { + plugins.push( + new ImportsFieldPlugin( + "internal", + conditionNames, + importsField, + "imports-field-relative", + "imports-resolve", + ), + ); + } + // imports-field-relative: apply extensionAlias to paths produced by the + // imports field (TypeScript-style extension substitution for self-package + // imports like `#foo` -> `./foo.js` -> `./foo.ts`). Unlike the exports + // field, the imports field is internal to the package, so applying the + // consumer's extension aliases does not expose files the package author + // did not intend to export. See issue #413. + for (const item of extensionAlias) { + plugins.push( + new ExtensionAliasPlugin("imports-field-relative", item, "relative"), + ); + } + plugins.push(new NextPlugin("imports-field-relative", "relative")); + + // raw-module + // A package map is authoritative for every bare specifier that is not a + // builtin, so it runs ahead of both self-reference and the `modules` + // directories below: a package that does not declare a dependency on + // itself must not reach its own `exports` through the self-reference + // shortcut, and nothing falls back to `node_modules`. + if (packageMap) { + plugins.push( + new PackageMapPlugin( + "raw-module", + packageMap, + symlinks, + "undescribed-resolve-in-package", + ), + ); + } + for (const exportsField of exportsFields) { + plugins.push( + new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module"), + ); + } + for (const item of modules) { + if (Array.isArray(item)) { + if (item.includes("node_modules") && pnpApi) { + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "raw-module", + item.filter((i) => i !== "node_modules"), + "module", + ), + ); + plugins.push( + new PnpPlugin( + "raw-module", + pnpApi, + "undescribed-resolve-in-package", + "alternate-raw-module", + ), + ); + + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "alternate-raw-module", + ["node_modules"], + "module", + ), + ); + } else { + plugins.push( + new ModulesInHierarchicalDirectoriesPlugin( + "raw-module", + item, + "module", + ), + ); + } + } else { + plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); + } + } + + // module + plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); + + // resolve-as-module + if (!resolveToContext) { + plugins.push( + new ConditionalPlugin( + "resolve-as-module", + { directory: false, request: "." }, + "single file module", + true, + "undescribed-raw-file", + ), + ); + } + plugins.push( + new DirectoryExistsPlugin( + "resolve-as-module", + "undescribed-resolve-in-package", + ), + ); + + // undescribed-resolve-in-package + plugins.push( + new DescriptionFilePlugin( + "undescribed-resolve-in-package", + descriptionFiles, + false, + "resolve-in-package", + ), + ); + plugins.push( + new NextPlugin( + "after-undescribed-resolve-in-package", + "resolve-in-package", + ), + ); + + // resolve-in-package + const exportsFieldTarget = extensionAliasForExports + ? "exports-field-relative" + : "relative"; + for (const exportsField of exportsFields) { + plugins.push( + new ExportsFieldPlugin( + "resolve-in-package", + conditionNames, + exportsField, + exportsFieldTarget, + restrictions.size > 0, + ), + ); + } + plugins.push( + new NextPlugin("resolve-in-package", "resolve-in-existing-directory"), + ); + + // exports-field-relative (opt-in via `extensionAliasForExports`): + // apply `extensionAlias` to paths produced by the exports field. This is + // off by default to match Node.js (which does not substitute extensions on + // bare-module targets), and on opt-in aligns with TypeScript for packages + // that ship TS sources alongside the compiled JS they list in `exports`. + if (extensionAliasForExports) { + for (const item of extensionAlias) { + plugins.push( + new ExtensionAliasPlugin("exports-field-relative", item, "relative"), + ); + } + plugins.push(new NextPlugin("exports-field-relative", "relative")); + } + + // resolve-in-existing-directory + plugins.push( + new JoinRequestPlugin("resolve-in-existing-directory", "relative"), + ); + + // relative + plugins.push( + new DescriptionFilePlugin( + "relative", + descriptionFiles, + true, + "described-relative", + ), + ); + plugins.push(new NextPlugin("after-relative", "described-relative")); + + // described-relative + if (resolveToContext) { + plugins.push(new NextPlugin("described-relative", "directory")); + } else { + plugins.push( + new ConditionalPlugin( + "described-relative", + { directory: false }, + null, + true, + "raw-file", + ), + ); + plugins.push( + new ConditionalPlugin( + "described-relative", + { fullySpecified: false }, + "as directory", + true, + "directory", + ), + ); + } + + // directory + plugins.push( + new DirectoryExistsPlugin("directory", "undescribed-existing-directory"), + ); + + if (resolveToContext) { + // undescribed-existing-directory + plugins.push(new NextPlugin("undescribed-existing-directory", "resolved")); + } else { + // undescribed-existing-directory + plugins.push( + new DescriptionFilePlugin( + "undescribed-existing-directory", + descriptionFiles, + false, + "existing-directory", + ), + ); + for (const item of mainFiles) { + plugins.push( + new UseFilePlugin( + "undescribed-existing-directory", + item, + "undescribed-raw-file", + ), + ); + } + + // described-existing-directory + for (const item of mainFields) { + plugins.push( + new MainFieldPlugin( + "existing-directory", + item, + "resolve-in-existing-directory", + ), + ); + } + for (const item of mainFiles) { + plugins.push( + new UseFilePlugin("existing-directory", item, "undescribed-raw-file"), + ); + } + + // undescribed-raw-file + plugins.push( + new DescriptionFilePlugin( + "undescribed-raw-file", + descriptionFiles, + true, + "raw-file", + ), + ); + plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); + + // raw-file + plugins.push( + new ConditionalPlugin( + "raw-file", + { fullySpecified: true }, + null, + false, + "file", + ), + ); + if (!enforceExtension) { + plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); + } + for (const item of extensions) { + plugins.push(new AppendPlugin("raw-file", item, "file")); + } + + // file + if (alias.length > 0) { + plugins.push(new AliasPlugin("file", alias, "internal-resolve")); + } + for (const item of aliasFields) { + plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); + } + plugins.push(new NextPlugin("file", "final-file")); + + // final-file + plugins.push(new FileExistsPlugin("final-file", "existing-file")); + + // existing-file + if (symlinks) { + plugins.push(new SymlinkPlugin("existing-file", "existing-file")); + } + plugins.push(new NextPlugin("existing-file", "resolved")); + } + + const { resolved } = + /** @type {KnownHooks & EnsuredHooks} */ + (resolver.hooks); + + // resolved + if (restrictions.size > 0) { + plugins.push(new RestrictionsPlugin(resolved, restrictions)); + } + + plugins.push(new ResultPlugin(resolved)); + + // // RESOLVER //// + + for (const plugin of plugins) { + if (typeof plugin === "function") { + /** @type {(this: Resolver, resolver: Resolver) => void} */ + (plugin).call(resolver, resolver); + } else if (plugin) { + plugin.apply(resolver); + } + } + + return resolver; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..2605de4a928e83360b5b5976dceb1c93aac4625a --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js @@ -0,0 +1,86 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const { isInside, normalize } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +/** + * @typedef {object} PathRestriction + * @property {"path"} type type of the restriction + * @property {string} rule normalized path the request has to be inside of + */ + +/** + * @typedef {object} RegExpRestriction + * @property {"regexp"} type type of the restriction + * @property {RegExp} rule pattern the request has to match + */ + +/** @typedef {PathRestriction | RegExpRestriction} Restriction */ + +module.exports = class RestrictionsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} restrictions restrictions + */ + constructor(source, restrictions) { + this.source = source; + this.restrictions = restrictions; + // Restrictions never change, so bringing them into the shape requests + // arrive in is done once here instead of on every request. + /** @type {Restriction[]} */ + this._restrictions = []; + for (const rule of restrictions) { + this._restrictions.push( + typeof rule === "string" + ? { type: "path", rule: normalize(rule) } + : { type: "regexp", rule }, + ); + } + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + resolver + .getHook(this.source) + .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { + if (typeof request.path === "string") { + const { path } = request; + for (const restriction of this._restrictions) { + if (restriction.type === "path") { + if (isInside(restriction.rule, path)) continue; + if (resolveContext.log) { + resolveContext.log( + `${path} is not inside of the restriction ${restriction.rule}`, + ); + } + } else { + if (restriction.rule.test(path)) continue; + if (resolveContext.log) { + resolveContext.log( + `${path} doesn't match the restriction ${restriction.rule}`, + ); + } + } + // Target existed (FileExistsPlugin already passed) but is + // outside the jail; signal ExportsFieldPlugin to fall back. + if (request.__restrictionsMarker) { + request.__restrictionsMarker.blocked = true; + } + return callback(null, null); + } + } + + callback(); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/ResultPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/ResultPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..57dbdddc3ad43fdb70c81da5365fe96cab4b6318 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/ResultPlugin.js @@ -0,0 +1,43 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class ResultPlugin { + /** + * @param {ResolveStepHook} source source + */ + constructor(source) { + this.source = source; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + this.source.tapAsync( + "ResultPlugin", + (request, resolverContext, callback) => { + const obj = { ...request }; + if (resolverContext.log) { + resolverContext.log(`reporting result ${obj.path}`); + } + resolver.hooks.result.callAsync(obj, resolverContext, (err) => { + if (err) return callback(err); + if (typeof resolverContext.yield === "function") { + resolverContext.yield(obj); + callback(null, null); + } else { + callback(null, obj); + } + }); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/RootsPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/RootsPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..539e08b69e40ef1c805a01b8d356ded5e77085f3 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/RootsPlugin.js @@ -0,0 +1,69 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +class RootsPlugin { + /** + * @param {string | ResolveStepHook} source source hook + * @param {Set} roots roots + * @param {string | ResolveStepHook} target target hook + */ + constructor(source, roots, target) { + this.roots = [...roots]; + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + + resolver + .getHook(this.source) + .tapAsync("RootsPlugin", (request, resolveContext, callback) => { + const req = request.request; + if (!req) return callback(); + if (!req.startsWith("/")) return callback(); + + forEachBail( + this.roots, + /** + * @param {string} root root + * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback + * @returns {void} + */ + (root, callback) => { + const path = resolver.join(root, req.slice(1)); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path, + relativePath: request.relativePath && path, + }; + resolver.doResolve( + target, + obj, + `root path ${root}`, + resolveContext, + callback, + ); + }, + callback, + ); + }); + } +} + +module.exports = RootsPlugin; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..b1ee64bc0ad97c4b1c9a04fc8fb353ad380938f3 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js @@ -0,0 +1,106 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const DescriptionFileUtils = require("./DescriptionFileUtils"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonObject} JsonObject */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +const slashCode = "/".charCodeAt(0); + +// Sentinel stored in `_nameCache` when the description file either has no +// exports field (so self-reference can't apply) or no string `name`. +const NO_SELF_REF = Symbol("NoSelfRef"); + +module.exports = class SelfReferencePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + */ + constructor(source, fieldNamePath, target) { + this.source = source; + this.target = target; + this.fieldName = fieldNamePath; + // Self-reference needs both an exports field and a `"name"` string. + // Both are stable per description-file content, so cache the decision + // in one WeakMap: the resolved name when self-reference is possible, + // or `NO_SELF_REF` when it isn't. This skips the two per-resolve + // `DescriptionFileUtils.getField` walks for hot packages. + /** @type {WeakMap} */ + this._nameCache = new WeakMap(); + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("SelfReferencePlugin", (request, resolveContext, callback) => { + if (!request.descriptionFileData) return callback(); + + const req = request.request; + if (!req) return callback(); + + const { descriptionFileData } = request; + let name = this._nameCache.get(descriptionFileData); + if (name === undefined) { + // Feature is only enabled when an exports field is present + const exportsField = DescriptionFileUtils.getField( + descriptionFileData, + this.fieldName, + ); + if (!exportsField) { + this._nameCache.set(descriptionFileData, NO_SELF_REF); + return callback(); + } + const rawName = DescriptionFileUtils.getField( + descriptionFileData, + "name", + ); + if (typeof rawName !== "string") { + this._nameCache.set(descriptionFileData, NO_SELF_REF); + return callback(); + } + name = rawName; + this._nameCache.set(descriptionFileData, name); + } else if (name === NO_SELF_REF) { + return callback(); + } + + if ( + req.startsWith(name) && + (req.length === name.length || + req.charCodeAt(name.length) === slashCode) + ) { + const remainingRequest = `.${req.slice(name.length)}`; + /** @type {ResolveRequest} */ + const obj = { + ...request, + request: remainingRequest, + path: /** @type {string} */ (request.descriptionFileRoot), + relativePath: ".", + }; + + resolver.doResolve( + target, + obj, + "self reference", + resolveContext, + callback, + ); + } else { + return callback(); + } + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/SymlinkPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/SymlinkPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..fb6c4580a37727535758656e0c2b466f62fbda9f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/SymlinkPlugin.js @@ -0,0 +1,132 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const forEachBail = require("./forEachBail"); +const { getPathsCached } = require("./getPaths"); +const { PathType, getType } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class SymlinkPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor(source, target) { + this.source = source; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + const fs = resolver.fileSystem; + resolver + .getHook(this.source) + .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { + if (request.ignoreSymlinks) return callback(); + const pathsResult = getPathsCached( + fs, + /** @type {string} */ (request.path), + ); + const { paths, segments } = pathsResult; + // `pathsResult.segments` is shared across callers via the cache. + // The only place we need to mutate is `pathSegments[idx] = result` + // when `fs.readlink` succeeds — which is rare (the vast majority + // of paths contain no symlinks, e.g. every resolve on + // `cache-predicate`'s no-symlink fixture). Defer the copy until + // we actually see a symlink so the common no-symlink path stays + // allocation-free. + /** @type {string[] | null} */ + let pathSegments = null; + + let containsSymlink = false; + let idx = -1; + forEachBail( + paths, + /** + * @param {string} path path + * @param {(err?: null | Error, result?: null | number) => void} callback callback + * @returns {void} + */ + (path, callback) => { + idx++; + if (resolveContext.fileDependencies) { + resolveContext.fileDependencies.add(path); + } + fs.readlink(path, (err, result) => { + if (!err && result) { + // First symlink seen — take our own copy now, so + // the cached `segments` array stays pristine for + // sibling resolves. + if (pathSegments === null) { + pathSegments = [...segments]; + } + pathSegments[idx] = /** @type {string} */ (result); + containsSymlink = true; + // Shortcut when absolute symlink found + const resultType = getType(result.toString()); + if ( + resultType === PathType.AbsoluteWin || + resultType === PathType.AbsolutePosix + ) { + return callback(null, idx); + } + } + callback(); + }); + }, + /** + * @param {null | Error=} err error + * @param {null | number=} idx result + * @returns {void} + */ + (err, idx) => { + if (!containsSymlink) return callback(); + // `containsSymlink === true` implies we took a copy in + // `pathSegments` already, so it's non-null. The copy is + // our own, so `slice` to trim is fine and spreading to + // "unshare" is no longer necessary. + const own = /** @type {string[]} */ (pathSegments); + const resultSegments = + typeof idx === "number" ? own.slice(0, idx + 1) : own; + const result = resultSegments.reduceRight((a, b) => + resolver.join(a, b), + ); + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: result, + }; + resolver.doResolve( + target, + obj, + `resolved symlink to ${result}`, + resolveContext, + (err, innerResult) => { + if (err) return callback(err); + // The symlink-resolved (real) path is authoritative. If + // resolving it produced a result, use it. If it did not — + // e.g. a `restrictions` rule rejected the real target — + // stop here with no result instead of letting the next + // plugin report the original in-root symlink path, which + // would leave the symlink unresolved and bypass + // `restrictions`. + if (innerResult) return callback(null, innerResult); + return callback(null, null); + }, + ); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js b/e-commerce/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js new file mode 100644 index 0000000000000000000000000000000000000000..2a526d2f00972fc0d29503099efc857c10314036 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js @@ -0,0 +1,258 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").StringCallback} StringCallback */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ + +// eslint-disable-next-line jsdoc/reject-function-type +/** @typedef {Function} SyncOrAsyncFunction */ +// eslint-disable-next-line jsdoc/reject-any-type +/** @typedef {any} ResultOfSyncOrAsyncFunction */ + +/** + * @param {SyncFileSystem} fs file system implementation + * @constructor + */ +function SyncAsyncFileSystemDecorator(fs) { + this.fs = fs; + + this.lstat = undefined; + this.lstatSync = undefined; + const { lstatSync } = fs; + if (lstatSync) { + this.lstat = + /** @type {FileSystem["lstat"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? lstatSync.call(fs, arg, options) + : lstatSync.call(fs, arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.lstatSync = + /** @type {SyncFileSystem["lstatSync"]} */ + ((arg, options) => lstatSync.call(fs, arg, options)); + } + + this.stat = + /** @type {FileSystem["stat"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.statSync(arg, options) + : fs.statSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.statSync = + /** @type {SyncFileSystem["statSync"]} */ + ((arg, options) => fs.statSync(arg, options)); + + this.readdir = + /** @type {FileSystem["readdir"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readdirSync( + arg, + /** @type {Exclude[1], (err: NodeJS.ErrnoException | null, files: string[]) => void>} */ + (options), + ) + : fs.readdirSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + [], + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readdirSync = + /** @type {SyncFileSystem["readdirSync"]} */ + ( + (arg, options) => + fs.readdirSync( + arg, + /** @type {Parameters[1]} */ (options), + ) + ); + + this.readFile = + /** @type {FileSystem["readFile"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readFileSync(arg, options) + : fs.readFileSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readFileSync = + /** @type {SyncFileSystem["readFileSync"]} */ + ((arg, options) => fs.readFileSync(arg, options)); + + this.readlink = + /** @type {FileSystem["readlink"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? fs.readlinkSync( + arg, + /** @type {Exclude[1], StringCallback>} */ + (options), + ) + : fs.readlinkSync(arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.readlinkSync = + /** @type {SyncFileSystem["readlinkSync"]} */ + ( + (arg, options) => + fs.readlinkSync( + arg, + /** @type {Parameters[1]} */ ( + options + ), + ) + ); + + this.readJson = undefined; + this.readJsonSync = undefined; + const { readJsonSync } = fs; + if (readJsonSync) { + this.readJson = + /** @type {FileSystem["readJson"]} */ + ( + (arg, callback) => { + let result; + try { + result = readJsonSync.call(fs, arg); + } catch (err) { + return callback( + /** @type {NodeJS.ErrnoException | Error | null} */ (err), + ); + } + + callback(null, result); + } + ); + this.readJsonSync = + /** @type {SyncFileSystem["readJsonSync"]} */ + ((arg) => readJsonSync.call(fs, arg)); + } + + this.realpath = undefined; + this.realpathSync = undefined; + const { realpathSync } = fs; + if (realpathSync) { + this.realpath = + /** @type {FileSystem["realpath"]} */ + ( + (arg, options, callback) => { + let result; + try { + result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) + ? realpathSync.call( + fs, + arg, + /** @type {Exclude>[1], StringCallback>} */ + (options), + ) + : realpathSync.call(fs, arg); + } catch (err) { + return (callback || options)( + /** @type {NodeJS.ErrnoException | null} */ + (err), + ); + } + + (callback || options)( + null, + /** @type {ResultOfSyncOrAsyncFunction} */ + (result), + ); + } + ); + this.realpathSync = + /** @type {SyncFileSystem["realpathSync"]} */ + ( + (arg, options) => + realpathSync.call( + fs, + arg, + /** @type {Parameters>[1]} */ + (options), + ) + ); + } +} + +module.exports = SyncAsyncFileSystemDecorator; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/TryNextPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/TryNextPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..4b467871eba72d030132b5b1a081735fe80c3f2a --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/TryNextPlugin.js @@ -0,0 +1,41 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class TryNextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} message message + * @param {string | ResolveStepHook} target target + */ + constructor(source, message, target) { + this.source = source; + this.message = message; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { + resolver.doResolve( + target, + request, + this.message, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/TsconfigPathsPlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/TsconfigPathsPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..98dac470df00b2e64b4c807e57fde6dc6fe9a51f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/TsconfigPathsPlugin.js @@ -0,0 +1,908 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Natsu @xiaoxiaojx +*/ + +"use strict"; + +const { aliasResolveHandler, compileAliasOptions } = require("./AliasUtils"); +const { modulesResolveHandler } = require("./ModulesUtils"); +const { readJson } = require("./util/fs"); +const { PathType: _PathType, isSubPath, normalize } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./AliasUtils").AliasOption} AliasOption */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").TsconfigPathsData} TsconfigPathsData */ +/** @typedef {import("./Resolver").TsconfigPathsMap} TsconfigPathsMap */ +/** @typedef {import("./ResolverFactory").TsconfigOptions} TsconfigOptions */ + +// Sentinel stored in `_contextSelectionCache` for `requestPath`s whose +// scan returned `null` ("no context matched"). Using a non-null marker +// lets the cache-hit path be a single `Map.get()` — we distinguish +// "cached null" from "not cached yet" without a second `has` lookup. +const NULL_CONTEXT = Symbol("NULL_CONTEXT"); + +/** + * Per-`TsconfigPathsMap` memoization of `_selectPathsDataForContext`. + * + * Real-world builds resolve hundreds of requests per source file (every + * import in the file), and webpack-style resolvers walk the same + * `requestPath` (= source-file directory) for each one. Without this + * cache every resolve re-scans the full `contextList` even though the + * answer is invariant for a given `(map, requestPath)` pair. + * + * The outer key is the `TsconfigPathsMap` itself — rebuilt on every + * tsconfig change — so a `WeakMap` lets the inner map be collected + * automatically once the map goes away. The inner Map is keyed by + * `requestPath` (string); a `Symbol` sentinel stands in for "no + * matching context" so `Map.get` alone distinguishes the three states + * (cached data / cached null / not cached). + * @type {WeakMap>} + */ +const _contextSelectionCache = new WeakMap(); + +/** + * @typedef {object} TsconfigCompilerOptions + * @property {string=} baseUrl Base URL for resolving paths + * @property {{ [key: string]: string[] }=} paths TypeScript paths mapping + */ + +/** + * @typedef {object} TsconfigReference + * @property {string} path Path to the referenced project + */ + +/** + * @typedef {object} Tsconfig + * @property {TsconfigCompilerOptions=} compilerOptions Compiler options + * @property {string | string[]=} extends Extended configuration paths + * @property {TsconfigReference[]=} references Project references + */ + +const DEFAULT_CONFIG_FILE = "tsconfig.json"; + +const READ_JSON_OPTIONS = { stripComments: true }; + +// Trailing `/*` or `\*` segment of a tsconfig `paths` mapping (e.g. +// `./src/*` → `./src`). Hoisted so we don't allocate a fresh regex per +// path entry on every tsconfig load — and so the same regex object can be +// reused for the matching `test` + `replace` pair below. +const WILDCARD_TAIL_RE = /[/\\]\*$/; + +/** + * @param {string} pattern Path pattern + * @returns {number} Length of the prefix + */ +function getPrefixLength(pattern) { + const prefixLength = pattern.indexOf("*"); + if (prefixLength === -1) { + return pattern.length; + } + return prefixLength; +} + +/** + * Sort path patterns. + * If a module name can be matched with multiple patterns then pattern with the longest prefix will be picked. + * @param {string[]} arr Array of path patterns + * @returns {string[]} Array of path patterns sorted by longest prefix + */ +function sortByLongestPrefix(arr) { + return [...arr].sort((a, b) => getPrefixLength(b) - getPrefixLength(a)); +} + +/** + * Merge two tsconfig objects + * @param {Tsconfig | null} base base config + * @param {Tsconfig | null} config config to merge + * @returns {Tsconfig} merged config + */ +function mergeTsconfigs(base, config) { + base = base || {}; + config = config || {}; + + return { + ...base, + ...config, + compilerOptions: { + .../** @type {TsconfigCompilerOptions} */ (base.compilerOptions), + .../** @type {TsconfigCompilerOptions} */ (config.compilerOptions), + }, + }; +} + +/** + * Substitute ${configDir} template variable in path + * @param {string} pathValue the path value + * @param {string} configDir the config directory + * @returns {string} the path with substituted template + */ +function substituteConfigDir(pathValue, configDir) { + // eslint-disable-next-line no-template-curly-in-string + if (!pathValue.includes("${configDir}")) return pathValue; + return pathValue.replace(/\$\{configDir\}/g, configDir); +} + +/** + * Convert tsconfig paths to resolver options + * @param {string} configDir Config file directory + * @param {{ [key: string]: string[] }} paths TypeScript paths mapping + * @param {Resolver} resolver resolver instance + * @param {string=} baseUrl Base URL for resolving paths (relative to configDir) + * @returns {TsconfigPathsData} the resolver options + */ +function tsconfigPathsToResolveOptions(configDir, paths, resolver, baseUrl) { + // Calculate absolute base URL + const absoluteBaseUrl = !baseUrl + ? configDir + : resolver.join(configDir, baseUrl); + + /** @type {string[]} */ + const sortedKeys = sortByLongestPrefix(Object.keys(paths)); + /** @type {AliasOption[]} */ + const alias = []; + /** @type {string[]} */ + const modules = []; + + for (const pattern of sortedKeys) { + const mappings = paths[pattern]; + // Substitute ${configDir} in path mappings + const absolutePaths = mappings.map((mapping) => { + const substituted = substituteConfigDir(mapping, configDir); + return resolver.join(absoluteBaseUrl, substituted); + }); + + if (absolutePaths.length > 0) { + if (pattern === "*") { + // Pull `dir/*` entries directly into `modules` with their + // trailing wildcard stripped, skipping anything else. The + // previous `.map(...).filter(Boolean)` form allocated two + // throwaway arrays plus a spread iterator per `*` mapping. + for (let j = 0; j < absolutePaths.length; j++) { + const dir = absolutePaths[j]; + if (WILDCARD_TAIL_RE.test(dir)) { + modules.push(dir.replace(WILDCARD_TAIL_RE, "")); + } + } + } else { + alias.push({ name: pattern, alias: absolutePaths }); + } + } + } + + if (baseUrl && absoluteBaseUrl && !modules.includes(absoluteBaseUrl)) { + modules.push(absoluteBaseUrl); + } + + return { + alias: compileAliasOptions(resolver, alias), + modules, + }; +} + +/** + * Get the base context for the current project + * @param {string} context the context + * @param {Resolver} resolver resolver instance + * @param {string=} baseUrl base URL for resolving paths + * @returns {string} the base context + */ +function getAbsoluteBaseUrl(context, resolver, baseUrl) { + return !baseUrl ? context : resolver.join(context, baseUrl); +} + +/** + * @param {TsconfigPathsData} main main paths data + * @param {string} mainContext main context + * @param {{ [baseUrl: string]: TsconfigPathsData }} refs references map + * @param {Set} fileDependencies file dependencies + * @returns {TsconfigPathsMap} the tsconfig paths map + */ +function buildTsconfigPathsMap(main, mainContext, refs, fileDependencies) { + const allContexts = /** @type {{ [context: string]: TsconfigPathsData }} */ ({ + [mainContext]: main, + ...refs, + }); + // Precompute the key list once per tsconfig load. `_selectPathsDataForContext` + // runs per resolve and otherwise would call `Object.entries(allContexts)` + // each time, allocating a fresh [key, value][] array. + const contextList = Object.keys(allContexts); + return { + main, + mainContext, + refs, + allContexts, + contextList, + fileDependencies, + }; +} + +module.exports = class TsconfigPathsPlugin { + /** + * @param {true | string | TsconfigOptions} configFileOrOptions tsconfig file path or options object + */ + constructor(configFileOrOptions) { + if ( + typeof configFileOrOptions === "object" && + configFileOrOptions !== null + ) { + // Options object format + const { configFile } = configFileOrOptions; + /** @type {boolean} */ + this.isAutoConfigFile = typeof configFile !== "string"; + /** @type {string} */ + this.configFile = this.isAutoConfigFile + ? DEFAULT_CONFIG_FILE + : /** @type {string} */ (configFile); + /** @type {string[] | "auto"} */ + if (Array.isArray(configFileOrOptions.references)) { + /** @type {TsconfigReference[] | "auto"} */ + this.references = configFileOrOptions.references.map((ref) => ({ + path: ref, + })); + } else if (configFileOrOptions.references === "auto") { + this.references = "auto"; + } else { + this.references = []; + } + /** @type {string | undefined} */ + this.baseUrl = configFileOrOptions.baseUrl; + } else { + /** @type {boolean} */ + this.isAutoConfigFile = configFileOrOptions === true; + /** @type {string} */ + this.configFile = this.isAutoConfigFile + ? DEFAULT_CONFIG_FILE + : /** @type {string} */ (configFileOrOptions); + /** @type {TsconfigReference[] | "auto"} */ + this.references = []; + /** @type {string | undefined} */ + this.baseUrl = undefined; + } + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const aliasTarget = resolver.ensureHook("internal-resolve"); + const moduleTarget = resolver.ensureHook("module"); + + resolver + .getHook("raw-resolve") + .tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => { + this._getTsconfigPathsMap( + resolver, + request, + resolveContext, + (err, tsconfigPathsMap) => { + if (err) return callback(err); + if (!tsconfigPathsMap) return callback(); + + const selectedData = this._selectPathsDataForContext( + request.path, + tsconfigPathsMap, + ); + + if (!selectedData) return callback(); + + aliasResolveHandler( + resolver, + selectedData.alias, + aliasTarget, + request, + resolveContext, + (err, result) => { + if (err) return callback(err); + if (result) return callback(null, result); + // https://github.com/webpack/webpack/issues/20944 + // Unlike resolve.alias, tsconfig paths should fall through + // when a pattern matches but the mapped path does not exist + // (matching TypeScript's native resolution behavior). + return callback(); + }, + ); + }, + ); + }); + + resolver + .getHook("raw-module") + .tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => { + this._getTsconfigPathsMap( + resolver, + request, + resolveContext, + (err, tsconfigPathsMap) => { + if (err) return callback(err); + if (!tsconfigPathsMap) return callback(); + + const selectedData = this._selectPathsDataForContext( + request.path, + tsconfigPathsMap, + ); + + if (!selectedData) return callback(); + + modulesResolveHandler( + resolver, + selectedData.modules, + moduleTarget, + request, + resolveContext, + callback, + ); + }, + ); + }); + } + + /** + * Get TsconfigPathsMap for the request (with caching) + * @param {Resolver} resolver the resolver + * @param {ResolveRequest} request the request + * @param {ResolveContext} resolveContext the resolve context + * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback + * @returns {void} + */ + _getTsconfigPathsMap(resolver, request, resolveContext, callback) { + if (typeof request.tsconfigPathsMap !== "undefined") { + const cached = request.tsconfigPathsMap; + if (!cached) return callback(null, null); + if (resolveContext.fileDependencies) { + for (const fileDependency of cached.fileDependencies) { + resolveContext.fileDependencies.add(fileDependency); + } + } + return callback(null, cached); + } + + if (this.isAutoConfigFile) { + this._findTsconfigUpward( + resolver, + request.path || process.cwd(), + (err, result) => { + if (err) { + request.tsconfigPathsMap = null; + return callback(err); + } + if (!result) { + request.tsconfigPathsMap = null; + return callback(null, null); + } + const map = /** @type {TsconfigPathsMap} */ (result); + request.tsconfigPathsMap = map; + if (resolveContext.fileDependencies) { + for (const fileDependency of map.fileDependencies) { + resolveContext.fileDependencies.add(fileDependency); + } + } + callback(null, map); + }, + ); + return; + } + + const absTsconfigPath = resolver.join( + request.path || process.cwd(), + this.configFile, + ); + this._loadTsconfigPathsMap(resolver, absTsconfigPath, (err, result) => { + if (err) { + request.tsconfigPathsMap = null; + return callback(err); + } + + const map = /** @type {TsconfigPathsMap} */ (result); + request.tsconfigPathsMap = map; + if (resolveContext.fileDependencies) { + for (const fileDependency of map.fileDependencies) { + resolveContext.fileDependencies.add(fileDependency); + } + } + callback(null, map); + }); + } + + /** + * Walk up from startDir to the filesystem root looking for tsconfig.json. + * Like TypeScript's own `findConfigFile` / `forEachAncestorDirectory`. + * @param {Resolver} resolver the resolver + * @param {string} startDir the directory to start searching from + * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback + * @returns {void} + */ + _findTsconfigUpward(resolver, startDir, callback) { + const { fileSystem } = resolver; + const configFileName = this.configFile; + + /** + * @param {string} dir current directory + * @returns {void} + */ + const check = (dir) => { + const candidate = resolver.join(dir, configFileName); + fileSystem.stat(candidate, (statErr) => { + if (!statErr) { + // Found — load it + this._loadTsconfigPathsMap(resolver, candidate, (loadErr, result) => { + if (loadErr) { + // Auto mode: soft-fail silently. + return callback(null, null); + } + callback(null, result); + }); + return; + } + // Not found — move to parent + const parentDir = resolver.dirname(dir); + if (parentDir === dir) { + // Reached filesystem root, no tsconfig.json found + return callback(null, null); + } + check(parentDir); + }); + }; + + check(startDir); + } + + /** + * Load tsconfig.json and build complete TsconfigPathsMap + * Includes main project paths and all referenced projects + * @param {Resolver} resolver the resolver + * @param {string} absTsconfigPath absolute path to tsconfig.json + * @param {(err: Error | null, result?: TsconfigPathsMap) => void} callback the callback + * @returns {void} + */ + _loadTsconfigPathsMap(resolver, absTsconfigPath, callback) { + /** @type {Set} */ + const fileDependencies = new Set(); + + this._loadTsconfig( + resolver, + absTsconfigPath, + fileDependencies, + undefined, + (err, config) => { + if (err) return callback(err); + + const cfg = /** @type {Tsconfig} */ (config); + const compilerOptions = cfg.compilerOptions || {}; + const mainContext = resolver.dirname(absTsconfigPath); + + const baseUrl = + this.baseUrl !== undefined ? this.baseUrl : compilerOptions.baseUrl; + + const main = tsconfigPathsToResolveOptions( + mainContext, + compilerOptions.paths || {}, + resolver, + baseUrl, + ); + /** @type {{ [baseUrl: string]: TsconfigPathsData }} */ + const refs = {}; + + let referencesToUse = null; + if (this.references === "auto") { + referencesToUse = cfg.references; + } else if (Array.isArray(this.references)) { + referencesToUse = this.references; + } + + if (!Array.isArray(referencesToUse)) { + return callback( + null, + buildTsconfigPathsMap(main, mainContext, refs, fileDependencies), + ); + } + + this._loadTsconfigReferences( + resolver, + mainContext, + referencesToUse, + fileDependencies, + refs, + (refErr) => { + if (refErr) return callback(refErr); + callback( + null, + buildTsconfigPathsMap(main, mainContext, refs, fileDependencies), + ); + }, + ); + }, + ); + } + + /** + * Select the correct TsconfigPathsData based on request.path (context-aware) + * Matches the behavior of tsconfig-paths-webpack-plugin + * @param {string | false} requestPath the request path + * @param {TsconfigPathsMap} tsconfigPathsMap the tsconfig paths map + * @returns {TsconfigPathsData | null} the selected paths data + */ + _selectPathsDataForContext(requestPath, tsconfigPathsMap) { + const { main, allContexts, contextList } = tsconfigPathsMap; + if (!requestPath) { + return main; + } + // Single-context tsconfigs (no project references) hit the loop + // below at most once; in that case the cache lookup costs more + // than the loop itself. Only memoize when there are 2+ contexts + // — that's the monorepo / project-references shape where the + // scan actually walks multiple entries per resolve and the + // `(map, requestPath)` answer can be reused. + /** @type {Map | undefined} */ + let perMap; + if (contextList.length >= 2) { + perMap = _contextSelectionCache.get(tsconfigPathsMap); + if (perMap !== undefined) { + const cached = perMap.get(requestPath); + if (cached !== undefined) { + return cached === NULL_CONTEXT + ? null + : /** @type {TsconfigPathsData} */ (cached); + } + } else { + perMap = new Map(); + _contextSelectionCache.set(tsconfigPathsMap, perMap); + } + } + let longestMatchContext = null; + let longestMatchLength = 0; + // Iterate the pre-computed key list (the previous + // `Object.entries(allContexts)` form allocated a fresh + // `[key, value][]` per resolve). Defer the `allContexts[context]` + // lookup to after we know the context actually matches — non-matches + // are the common case and don't need the property access. + for (let i = 0; i < contextList.length; i++) { + const context = contextList[i]; + if (context === requestPath) { + const exact = allContexts[context]; + if (perMap !== undefined) perMap.set(requestPath, exact); + return exact; + } + // Cheap integer-compare gate first: a context can only beat the + // current longest match if its own length is strictly greater. + // Skipping `isSubPath` (a `startsWith` + char-code probe) when the + // length already disqualifies the candidate avoids the per-resolve + // scan over every shorter context. + if ( + context.length > longestMatchLength && + isSubPath(context, requestPath) + ) { + longestMatchContext = context; + longestMatchLength = context.length; + } + } + const result = + longestMatchContext === null ? null : allContexts[longestMatchContext]; + if (perMap !== undefined) { + perMap.set(requestPath, result === null ? NULL_CONTEXT : result); + } + return result; + } + + /** + * Load tsconfig from extends path + * @param {Resolver} resolver the resolver + * @param {string} configFilePath current config file path + * @param {string} extendedConfigValue extends value + * @param {Set} fileDependencies the file dependencies + * @param {Set} visitedConfigPaths config paths being loaded (for circular extends detection) + * @param {(err: Error | null, result?: Tsconfig) => void} callback callback + * @returns {void} + */ + _loadTsconfigFromExtends( + resolver, + configFilePath, + extendedConfigValue, + fileDependencies, + visitedConfigPaths, + callback, + ) { + const { fileSystem } = resolver; + const currentDir = resolver.dirname(configFilePath); + + // Substitute ${configDir} in extends path + extendedConfigValue = substituteConfigDir(extendedConfigValue, currentDir); + + // Remember the original value before potentially appending .json + const originalExtendedConfigValue = extendedConfigValue; + + if ( + typeof extendedConfigValue === "string" && + !extendedConfigValue.includes(".json") + ) { + extendedConfigValue += ".json"; + } + + const initialExtendedConfigPath = resolver.join( + currentDir, + extendedConfigValue, + ); + + /** + * @param {string} extendedConfigPath resolved config path to load + */ + const loadExtended = (extendedConfigPath) => { + this._loadTsconfig( + resolver, + extendedConfigPath, + fileDependencies, + visitedConfigPaths, + (err, config) => { + if (err) return callback(err); + + const cfg = /** @type {Tsconfig} */ (config); + const compilerOptions = cfg.compilerOptions || { + baseUrl: undefined, + }; + + if (compilerOptions.baseUrl) { + const extendedConfigDir = resolver.dirname(extendedConfigPath); + compilerOptions.baseUrl = getAbsoluteBaseUrl( + extendedConfigDir, + resolver, + compilerOptions.baseUrl, + ); + } + + delete cfg.references; + + callback(null, cfg); + }, + ); + }; + + fileSystem.stat(initialExtendedConfigPath, (existsErr) => { + if (!existsErr) return loadExtended(initialExtendedConfigPath); + + // The relative form does not exist — treat the value as a package + // specifier and compute its `node_modules/<...>` sub-path. + let nodeModulesSubPath = null; + if ( + typeof originalExtendedConfigValue === "string" && + originalExtendedConfigValue.startsWith("@") && + originalExtendedConfigValue.split("/").length === 2 + ) { + // Scoped package, no sub-path ("@scope/name") → + // node_modules/@scope/name/tsconfig.json (not @scope/name.json). + // See: test/fixtures/tsconfig-paths/extends-pkg-entry/ + nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`; + } else if ( + extendedConfigValue.includes("/") && + !originalExtendedConfigValue.startsWith(".") && + !originalExtendedConfigValue.startsWith("/") + ) { + // Package sub-path ("react/tsconfig", "@scope/name/tsconfig") → + // node_modules/react/tsconfig.json. + // See: test/fixtures/tsconfig-paths/extends-npm/ + nodeModulesSubPath = extendedConfigValue; + } else if ( + !originalExtendedConfigValue.startsWith(".") && + !originalExtendedConfigValue.startsWith("/") + ) { + // Unscoped package, no sub-path ("my-base-config") → + // node_modules/my-base-config/tsconfig.json. + nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`; + } + + // Not a package specifier (relative/absolute) — load the missing + // path anyway so the read surfaces its own ENOENT. + if (nodeModulesSubPath === null) { + return loadExtended(initialExtendedConfigPath); + } + + // Walk ancestor node_modules like Node.js/TypeScript so a package + // hoisted to a parent workspace directory is found. #21457 + const subPath = normalize(`node_modules/${nodeModulesSubPath}`); + this._findExtendsInNodeModules(resolver, currentDir, subPath, (found) => { + loadExtended(found || resolver.join(currentDir, subPath)); + }); + }); + } + + /** + * Walk up from startDir looking for `/` (a + * `node_modules/...` sub-path), matching Node.js module resolution so a + * package hoisted to a parent workspace's node_modules is found. + * @param {Resolver} resolver the resolver + * @param {string} startDir directory to start searching from + * @param {string} subPath node_modules-relative sub-path to look for + * @param {(found: string | null) => void} callback receives the found path or null + * @returns {void} + */ + _findExtendsInNodeModules(resolver, startDir, subPath, callback) { + const { fileSystem } = resolver; + + /** + * @param {string} dir current directory + */ + const check = (dir) => { + const candidate = resolver.join(dir, subPath); + fileSystem.stat(candidate, (statErr) => { + if (!statErr) return callback(candidate); + const parentDir = resolver.dirname(dir); + if (parentDir === dir) return callback(null); + check(parentDir); + }); + }; + + check(startDir); + } + + /** + * Load referenced tsconfig projects and store in referenceMatchMap + * Simple implementation matching tsconfig-paths-webpack-plugin: + * Just load each reference and store independently + * @param {Resolver} resolver the resolver + * @param {string} context the context + * @param {TsconfigReference[]} references array of references + * @param {Set} fileDependencies the file dependencies + * @param {{ [baseUrl: string]: TsconfigPathsData }} referenceMatchMap the map to populate + * @param {(err: Error | null) => void} callback callback + * @param {Set=} visitedRefPaths visited reference config paths (for circular reference detection) + * @returns {void} + */ + _loadTsconfigReferences( + resolver, + context, + references, + fileDependencies, + referenceMatchMap, + callback, + visitedRefPaths, + ) { + if (references.length === 0) return callback(null); + + const visited = visitedRefPaths || new Set(); + let pending = references.length; + const finishOne = () => { + if (--pending === 0) callback(null); + }; + + for (const ref of references) { + const refPath = substituteConfigDir(ref.path, context); + const refConfigPath = resolver.join( + resolver.join(context, refPath), + DEFAULT_CONFIG_FILE, + ); + + if (visited.has(refConfigPath)) { + finishOne(); + continue; + } + visited.add(refConfigPath); + + this._loadTsconfig( + resolver, + refConfigPath, + fileDependencies, + undefined, + (err, refConfig) => { + // Failures are swallowed to match tsconfig-paths-webpack-plugin: + // a broken reference must not abort the main project's resolution. + if (err) return finishOne(); + + const cfg = /** @type {Tsconfig} */ (refConfig); + if (cfg.compilerOptions && cfg.compilerOptions.paths) { + const refContext = resolver.dirname(refConfigPath); + + referenceMatchMap[refContext] = tsconfigPathsToResolveOptions( + refContext, + cfg.compilerOptions.paths || {}, + resolver, + cfg.compilerOptions.baseUrl, + ); + } + + if (this.references === "auto" && Array.isArray(cfg.references)) { + this._loadTsconfigReferences( + resolver, + resolver.dirname(refConfigPath), + cfg.references, + fileDependencies, + referenceMatchMap, + finishOne, + visited, + ); + } else { + finishOne(); + } + }, + ); + } + } + + /** + * Load tsconfig.json with extends support + * @param {Resolver} resolver the resolver + * @param {string} configFilePath absolute path to tsconfig.json + * @param {Set} fileDependencies the file dependencies + * @param {Set | undefined} visitedConfigPaths config paths being loaded (for circular extends detection) + * @param {(err: Error | null, result?: Tsconfig) => void} callback callback + * @returns {void} + */ + _loadTsconfig( + resolver, + configFilePath, + fileDependencies, + visitedConfigPaths, + callback, + ) { + const visited = visitedConfigPaths || new Set(); + + if (visited.has(configFilePath)) { + return callback(null, /** @type {Tsconfig} */ ({})); + } + visited.add(configFilePath); + + readJson( + resolver.fileSystem, + configFilePath, + READ_JSON_OPTIONS, + (err, parsed) => { + if (err) return callback(/** @type {Error} */ (err)); + + const config = /** @type {Tsconfig} */ (parsed); + fileDependencies.add(configFilePath); + + const extendedConfig = config.extends; + if (!extendedConfig) return callback(null, config); + + if (!Array.isArray(extendedConfig)) { + this._loadTsconfigFromExtends( + resolver, + configFilePath, + extendedConfig, + fileDependencies, + visited, + (extErr, extendedTsconfig) => { + if (extErr) return callback(extErr); + callback( + null, + mergeTsconfigs( + /** @type {Tsconfig} */ (extendedTsconfig), + config, + ), + ); + }, + ); + return; + } + + /** @type {Tsconfig} */ + let base = {}; + let i = 0; + const next = () => { + if (i >= extendedConfig.length) { + return callback(null, mergeTsconfigs(base, config)); + } + this._loadTsconfigFromExtends( + resolver, + configFilePath, + extendedConfig[i++], + fileDependencies, + visited, + (extErr, extendedTsconfig) => { + if (extErr) return callback(extErr); + base = mergeTsconfigs( + base, + /** @type {Tsconfig} */ (extendedTsconfig), + ); + next(); + }, + ); + }; + next(); + }, + ); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..d661c1c4386046a13681cf8c897e8eba4b5a971c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js @@ -0,0 +1,200 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { isRelativeRequest } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ +/** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */ + +/** + * @param {string} relativePath relative path from package root + * @param {string} request relative request + * @param {Resolver} resolver resolver instance + * @returns {string} normalized request with a preserved leading dot + */ +function joinRelativePreservingLeadingDot(relativePath, request, resolver) { + const normalized = resolver.join(relativePath, request); + return isRelativeRequest(normalized) ? normalized : `./${normalized}`; +} + +/** + * @param {ResolveRequest} request request + * @returns {string | false | undefined} normalized path + */ +function getCachePath(request) { + if (request.descriptionFileRoot && !request.module) { + return request.descriptionFileRoot; + } + return request.path; +} + +/** + * @param {ResolveRequest} request request + * @param {Resolver} resolver resolver instance + * @returns {string | undefined} normalized request string + */ +function getCacheRequest(request, resolver) { + const requestString = request.request; + if ( + !requestString || + !request.relativePath || + !isRelativeRequest(requestString) + ) { + return requestString; + } + return joinRelativePreservingLeadingDot( + request.relativePath, + requestString, + resolver, + ); +} + +// Cache-key separator: `\0` is safe because paths, requests, queries and +// fragments produced by `parseIdentifier` never contain a raw NUL (the +// \0-escape in identifier.js is decoded back to the original char), and the +// context, when included, is passed through `JSON.stringify`, which escapes +// any NUL to \u0000. +// const SEP = "\0"; + +/** + * Build the cache id for a request. Called on every `described-resolve` + * invocation when `unsafeCache` is on, so it's a hot path. + * + * Equivalent in meaning to the previous `JSON.stringify({ ... })` form, but + * ~3–5× faster since we avoid the object allocation and JSON serializer for + * the fields that are already plain strings. + * @param {string} type type of cache + * @param {ResolveRequest} request request + * @param {boolean} withContext cache with context? + * @param {Resolver} resolver resolver instance + * @returns {string} cache id + */ +function getCacheId(type, request, withContext, resolver) { + // TODO use it in the next major release, it is faster + // const contextPart = withContext ? JSON.stringify(request.context) : ""; + // const path = getCachePath(request); + // const cacheRequest = getCacheRequest(request, resolver); + // return ( + // type + + // SEP + + // contextPart + + // SEP + + // (path || "") + + // SEP + + // (request.query || "") + + // SEP + + // (request.fragment || "") + + // SEP + + // (cacheRequest || "") + // ); + + return JSON.stringify({ + type, + context: withContext ? request.context : "", + path: getCachePath(request), + query: request.query, + fragment: request.fragment, + request: getCacheRequest(request, resolver), + }); +} + +module.exports = class UnsafeCachePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate + * @param {Cache} cache cache + * @param {boolean} withContext withContext + * @param {string | ResolveStepHook} target target + */ + constructor(source, filterPredicate, cache, withContext, target) { + this.source = source; + this.filterPredicate = filterPredicate; + this.withContext = withContext; + this.cache = cache; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { + if (!this.filterPredicate(request)) { + return resolver.doResolve( + target, + request, + null, + resolveContext, + callback, + ); + } + const isYield = typeof resolveContext.yield === "function"; + const cacheId = getCacheId( + isYield ? "yield" : "default", + request, + this.withContext, + resolver, + ); + const cacheEntry = this.cache[cacheId]; + if (cacheEntry) { + if (isYield) { + const yield_ = + /** @type {ResolveContextYield} */ + (resolveContext.yield); + if (Array.isArray(cacheEntry)) { + for (const result of cacheEntry) yield_(result); + } else { + yield_(cacheEntry); + } + return callback(null, null); + } + return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); + } + + /** @type {ResolveContextYield | undefined} */ + let yieldFn; + /** @type {ResolveContextYield | undefined} */ + let yield_; + /** @type {ResolveRequest[]} */ + const yieldResult = []; + if (isYield) { + yieldFn = resolveContext.yield; + yield_ = (result) => { + yieldResult.push(result); + }; + } + + resolver.doResolve( + target, + request, + null, + yield_ ? { ...resolveContext, yield: yield_ } : resolveContext, + (err, result) => { + if (err) return callback(err); + if (isYield) { + if (result) yieldResult.push(result); + for (const result of yieldResult) { + /** @type {ResolveContextYield} */ + (yieldFn)(result); + } + this.cache[cacheId] = yieldResult; + return callback(null, null); + } + if (result) return callback(null, (this.cache[cacheId] = result)); + callback(); + }, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/UseFilePlugin.js b/e-commerce/node_modules/enhanced-resolve/lib/UseFilePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..f81c27f5fbbb3ff0d7ddbf7a88d737a3b711b584 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/UseFilePlugin.js @@ -0,0 +1,55 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ + +module.exports = class UseFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} filename filename + * @param {string | ResolveStepHook} target target + */ + constructor(source, filename, target) { + this.source = source; + this.filename = filename; + this.target = target; + } + + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver) { + const target = resolver.ensureHook(this.target); + resolver + .getHook(this.source) + .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { + const filePath = resolver.join( + /** @type {string} */ (request.path), + this.filename, + ); + + /** @type {ResolveRequest} */ + const obj = { + ...request, + path: filePath, + relativePath: + request.relativePath && + resolver.join(request.relativePath, this.filename), + }; + resolver.doResolve( + target, + obj, + `using path: ${filePath}`, + resolveContext, + callback, + ); + }); + } +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/createInnerContext.js b/e-commerce/node_modules/enhanced-resolve/lib/createInnerContext.js new file mode 100644 index 0000000000000000000000000000000000000000..226d09841cee6b30b111125506ed13b4ada1d5a7 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/createInnerContext.js @@ -0,0 +1,56 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ + +/** + * Build the `ResolveContext` passed into the next hook in the chain. + * + * The caller — `Resolver.doResolve` — runs on every resolve step, so we + * want to allocate as little as possible here. Previously the caller + * constructed a temporary `{ log, yield, fileDependencies, ... }` literal + * and handed it to this helper, which then copied those same fields into + * a second fresh object. That's two allocations per step for what is + * effectively a struct copy with one mutated field (`stack`) and one + * optionally-wrapped field (`log`). Taking the parent context and the + * two things we actually want to change (stack, message) as separate + * arguments lets us allocate exactly one inner context. + * @param {ResolveContext} parent parent resolve context to inherit dependency sets / yield from + * @param {ResolveContext["stack"]} stack new stack tip for the nested call + * @param {null | string} message log message prefix for this step + * @returns {ResolveContext} inner context + */ +module.exports = function createInnerContext(parent, stack, message) { + const parentLog = parent.log; + let innerLog; + if (parentLog) { + if (message) { + let messageReported = false; + /** + * @param {string} msg message + */ + innerLog = (msg) => { + if (!messageReported) { + parentLog(message); + messageReported = true; + } + parentLog(` ${msg}`); + }; + } else { + innerLog = parentLog; + } + } + + return { + log: innerLog, + yield: parent.yield, + fileDependencies: parent.fileDependencies, + contextDependencies: parent.contextDependencies, + missingDependencies: parent.missingDependencies, + stack, + }; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/forEachBail.js b/e-commerce/node_modules/enhanced-resolve/lib/forEachBail.js new file mode 100644 index 0000000000000000000000000000000000000000..ec021848fdc820f6e3d9e89626110d8a9d082205 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/forEachBail.js @@ -0,0 +1,50 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @template T + * @template Z + * @callback Iterator + * @param {T} item item + * @param {(err?: null | Error, result?: null | Z) => void} callback callback + * @param {number} i index + * @returns {void} + */ + +/** + * @template T + * @template Z + * @param {T[]} array array + * @param {Iterator} iterator iterator + * @param {(err?: null | Error, result?: null | Z, i?: number) => void} callback callback after all items are iterated + * @returns {void} + */ +module.exports = function forEachBail(array, iterator, callback) { + if (array.length === 0) return callback(); + + let i = 0; + const next = () => { + /** @type {boolean | undefined} */ + let loop; + iterator( + array[i++], + (err, result) => { + if (err || result !== undefined || i >= array.length) { + return callback(err, result, i); + } + if (loop === false) while (next()); + loop = true; + }, + i, + ); + if (!loop) loop = false; + return loop; + }; + while (next()); +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/getInnerRequest.js b/e-commerce/node_modules/enhanced-resolve/lib/getInnerRequest.js new file mode 100644 index 0000000000000000000000000000000000000000..affa6c48413cee3f38ccebd5d42c6a606ba88f25 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/getInnerRequest.js @@ -0,0 +1,41 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const { isRelativeRequest } = require("./util/path"); + +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ + +/** + * @param {Resolver} resolver resolver + * @param {ResolveRequest} request string + * @returns {string} inner request + */ +module.exports = function getInnerRequest(resolver, request) { + if ( + typeof request.__innerRequest === "string" && + request.__innerRequest_request === request.request && + request.__innerRequest_relativePath === request.relativePath + ) { + return request.__innerRequest; + } + /** @type {string | undefined} */ + let innerRequest; + if (request.request) { + innerRequest = request.request; + if (request.relativePath && isRelativeRequest(innerRequest)) { + innerRequest = resolver.join(request.relativePath, innerRequest); + } + } else { + innerRequest = request.relativePath; + } + // eslint-disable-next-line camelcase + request.__innerRequest_request = request.request; + // eslint-disable-next-line camelcase + request.__innerRequest_relativePath = request.relativePath; + return (request.__innerRequest = /** @type {string} */ (innerRequest)); +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/getPaths.js b/e-commerce/node_modules/enhanced-resolve/lib/getPaths.js new file mode 100644 index 0000000000000000000000000000000000000000..4e4005124ac80b65e17a1ae5e15562ce0e522ae8 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/getPaths.js @@ -0,0 +1,87 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {{ paths: string[], segments: string[] }} GetPathsResult */ + +/** + * Walk `path` from tip to root, returning every ancestor directory (plus the + * input itself) in `paths`, and each corresponding segment name in `segments`. + * + * The return value may be shared across callers via `getPathsCached` — treat + * it as read-only. Callers that need to mutate (currently only + * `SymlinkPlugin`) should `slice()` the arrays locally before writing. + * @param {string} path path + * @returns {GetPathsResult} paths and segments + */ +function getPaths(path) { + if (path === "/") return { paths: ["/"], segments: [""] }; + const parts = path.split(/(.*?[\\/]+)/); + const paths = [path]; + const segments = [parts[parts.length - 1]]; + let part = parts[parts.length - 1]; + path = path.slice(0, Math.max(0, path.length - part.length - 1)); + for (let i = parts.length - 2; i > 2; i -= 2) { + paths.push(path); + part = parts[i]; + path = path.slice(0, Math.max(0, path.length - part.length)) || "/"; + segments.push(part.slice(0, -1)); + } + [, part] = parts; + segments.push(part); + paths.push(part); + return { + paths, + segments, + }; +} + +/** + * Per-filesystem memoization of `getPaths`. Kept in a standalone WeakMap + * rather than being hung off `resolver.pathCache` so that adding this cache + * does not change the hidden-class shape of `pathCache` — which is accessed + * on the hot path of every resolve as `resolver.pathCache.{join,dirname, + * basename}.fn(...)`. CodSpeed caught that shape change as a ~1–2% + * instruction-count regression on `cache-predicate`, so we keep pathCache + * shape-stable by owning this cache here instead. + * + * The cache lifetime is tied to the filesystem object (same invariant as + * `_pathCacheByFs` in `Resolver.js`): when the user swaps filesystems the + * entries become unreachable and get collected. + * @type {WeakMap>} + */ +const _getPathsCacheByFs = new WeakMap(); + +/** + * Memoized `getPaths`. The returned object is shared across callers — do + * not mutate the `paths` or `segments` arrays in-place; `slice()` first if + * you need a mutable copy. + * @param {FileSystem} fileSystem filesystem used as the cache namespace + * @param {string} path path + * @returns {GetPathsResult} paths and segments + */ +function getPathsCached(fileSystem, path) { + let cache = _getPathsCacheByFs.get(fileSystem); + if (cache === undefined) { + cache = new Map(); + _getPathsCacheByFs.set(fileSystem, cache); + } else { + const cached = cache.get(path); + if (cached !== undefined) return cached; + } + const { paths, segments } = getPaths(path); + // `push` leaves a store sized for 17 entries while a path has a handful, and + // what is cached here is kept for the filesystem's lifetime. A copy sizes both + // to what they hold, and copying a pushed array keeps them packed, which is + // the element kind every reader of them is compiled for. + const result = { paths: [...paths], segments: [...segments] }; + cache.set(path, result); + return result; +} + +module.exports = getPaths; +module.exports.getPathsCached = getPathsCached; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/index.js b/e-commerce/node_modules/enhanced-resolve/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b7f7a0c17749e1beb3b967d9b7a47e36fa6f55f2 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/index.js @@ -0,0 +1,314 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const memoize = require("./util/memoize"); + +/** @typedef {import("./CachedInputFileSystem")} CachedInputFileSystem */ +/** @typedef {import("./CachedInputFileSystem").BaseFileSystem} BaseFileSystem */ +/** @typedef {import("./CloneBasenamePlugin")} CloneBasenamePlugin */ +/** @typedef {import("./LogInfoPlugin")} LogInfoPlugin */ +/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").Context} Context */ +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ +/** @typedef {import("./Resolver").ResolveContext} ResolveContext */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {import("./ResolverFactory").Plugin} Plugin */ +/** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ +/** @typedef {import("./TsconfigPathsPlugin")} TsconfigPathsPlugin */ + +/** + * @typedef {{ + * (context: Context, parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void, + * (context: Context, parent: string | URL, specifier: string | URL, callback: ResolveCallback): void, + * (parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void, + * (parent: string | URL, specifier: string | URL, callback: ResolveCallback): void, + * }} ResolveFunctionAsync + */ + +/** + * @typedef {{ + * (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false, + * (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false, + * }} ResolveFunction + */ + +/** + * @typedef {{ + * (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise, + * (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise, + * }} ResolveFunctionPromise + */ + +const getCachedFileSystem = memoize(() => require("./CachedInputFileSystem")); + +const getNodeFileSystem = memoize(() => { + const fs = require("graceful-fs"); + + const CachedInputFileSystem = getCachedFileSystem(); + + return new CachedInputFileSystem(fs, 4000); +}); +const getNodeContext = memoize(() => ({ + environments: ["node+es3+es5+process+native"], +})); + +const getResolverFactory = memoize(() => require("./ResolverFactory")); + +const getAsyncResolver = memoize(() => + getResolverFactory().createResolver({ + conditionNames: ["node"], + extensions: [".js", ".json", ".node"], + fileSystem: getNodeFileSystem(), + }), +); + +/** + * @type {ResolveFunctionAsync} + */ +const resolve = + /** + * @param {object | string | URL} context context + * @param {string | URL} parent parent path + * @param {string | URL | ResolveContext | ResolveCallback} specifier specifier to resolve + * @param {ResolveContext | ResolveCallback=} resolveContext resolve context + * @param {ResolveCallback=} callback callback + */ + (context, parent, specifier, resolveContext, callback) => { + if (typeof context === "string" || context instanceof URL) { + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback} */ (resolveContext); + } + getAsyncResolver().resolve( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + /** @type {ResolveCallback} */ (callback), + ); + }; + +const getSyncResolver = memoize(() => + getResolverFactory().createResolver({ + conditionNames: ["node"], + extensions: [".js", ".json", ".node"], + useSyncFileSystemCalls: true, + fileSystem: getNodeFileSystem(), + }), +); + +/** + * @type {ResolveFunction} + */ +const resolveSync = + /** + * @param {object | string | URL} context context + * @param {string | URL} parent parent path + * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} resolved path + */ + (context, parent, specifier, resolveContext) => { + if (typeof context === "string" || context instanceof URL) { + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + return getSyncResolver().resolveSync( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + ); + }; + +/** + * @type {ResolveFunctionPromise} + */ +const resolvePromise = + /** + * @param {object | string | URL} context context + * @param {string | URL} parent parent path + * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} resolved path + */ + (context, parent, specifier, resolveContext) => { + if (typeof context === "string" || context instanceof URL) { + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + return getAsyncResolver().resolvePromise( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + ); + }; + +/** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionAsync} Resolver function + */ +function create(options) { + const resolver = getResolverFactory().createResolver({ + ...options, + fileSystem: options.fileSystem || getNodeFileSystem(), + }); + /** + * @param {object | string | URL} context Custom context + * @param {string | URL} parent Base/parent path + * @param {string | URL | ResolveContext | ResolveCallback} specifier Specifier to resolve + * @param {ResolveContext | ResolveCallback=} resolveContext Resolve context + * @param {ResolveCallback=} callback Result callback + */ + return function create(context, parent, specifier, resolveContext, callback) { + if (typeof context === "string" || context instanceof URL) { + callback = /** @type {ResolveCallback} */ (resolveContext); + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + if (typeof callback !== "function") { + callback = /** @type {ResolveCallback} */ (resolveContext); + } + resolver.resolve( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + callback, + ); + }; +} + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunction} Resolver function + */ +function createSync(options) { + const resolver = getResolverFactory().createResolver({ + useSyncFileSystemCalls: true, + ...options, + fileSystem: options.fileSystem || getNodeFileSystem(), + }); + /** + * @param {object | string | URL} context custom context + * @param {string | URL} parent base/parent path + * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve + * @param {ResolveContext=} resolveContext Resolve context + * @returns {string | false} Resolved path or false + */ + return function createSync(context, parent, specifier, resolveContext) { + if (typeof context === "string" || context instanceof URL) { + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + return resolver.resolveSync( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + ); + }; +} + +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionPromise} Resolver function + */ +function createPromise(options) { + const resolver = getResolverFactory().createResolver({ + ...options, + fileSystem: options.fileSystem || getNodeFileSystem(), + }); + /** + * @param {object | string | URL} context Custom context + * @param {string | URL} parent Base/parent path + * @param {string | URL | ResolveContext | undefined} specifier Specifier to resolve + * @param {ResolveContext=} resolveContext Resolve context + * @returns {Promise} resolved path + */ + return function createPromise(context, parent, specifier, resolveContext) { + if (typeof context === "string" || context instanceof URL) { + resolveContext = /** @type {ResolveContext} */ (specifier); + specifier = parent; + parent = context; + context = getNodeContext(); + } + return resolver.resolvePromise( + context, + parent, + /** @type {string} */ (specifier), + /** @type {ResolveContext} */ (resolveContext), + ); + }; +} + +/** + * @template A + * @template B + * @param {A} obj input a + * @param {B} exports input b + * @returns {A & B} merged + */ +const mergeExports = (obj, exports) => { + const descriptors = Object.getOwnPropertyDescriptors(exports); + Object.defineProperties(obj, descriptors); + return /** @type {A & B} */ (Object.freeze(obj)); +}; + +module.exports = mergeExports(resolve, { + get sync() { + return resolveSync; + }, + get promise() { + return resolvePromise; + }, + create: mergeExports(create, { + get sync() { + return createSync; + }, + get promise() { + return createPromise; + }, + }), + get ResolverFactory() { + return getResolverFactory(); + }, + get CachedInputFileSystem() { + return getCachedFileSystem(); + }, + get CloneBasenamePlugin() { + return require("./CloneBasenamePlugin"); + }, + get LogInfoPlugin() { + return require("./LogInfoPlugin"); + }, + get TsconfigPathsPlugin() { + return require("./TsconfigPathsPlugin"); + }, + get forEachBail() { + return require("./forEachBail"); + }, +}); diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/entrypoints.js b/e-commerce/node_modules/enhanced-resolve/lib/util/entrypoints.js new file mode 100644 index 0000000000000000000000000000000000000000..0b834f8fb12d45b53b3ac1c2a7a0f3f9b4ce50fb --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/entrypoints.js @@ -0,0 +1,849 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const { parseIdentifier } = require("./identifier"); + +/** @typedef {string | (string | ConditionalMapping)[]} DirectMapping */ +/** @typedef {{ [k: string]: MappingValue }} ConditionalMapping */ +/** @typedef {ConditionalMapping | DirectMapping | null} MappingValue */ +/** @typedef {Record | ConditionalMapping | DirectMapping} ExportsField */ +/** @typedef {Record} ImportsField */ + +/** + * Processing exports/imports field + * @callback FieldProcessor + * @param {string} request request + * @param {Set} conditionNames condition names + * @returns {[string[], string | null]} resolved paths with used field + */ + +/* +Example exports field: +{ + ".": "./main.js", + "./feature": { + "browser": "./feature-browser.js", + "default": "./feature.js" + } +} +Terminology: + +Enhanced-resolve name keys ("." and "./feature") as exports field keys. + +If value is string or string[], mapping is called as a direct mapping +and value called as a direct export. + +If value is key-value object, mapping is called as a conditional mapping +and value called as a conditional export. + +Key in conditional mapping is called condition name. + +Conditional mapping nested in another conditional mapping is called nested mapping. + +---------- + +Example imports field: +{ + "#a": "./main.js", + "#moment": { + "browser": "./moment/index.js", + "default": "moment" + }, + "#moment/": { + "browser": "./moment/", + "default": "moment/" + } +} +Terminology: + +Enhanced-resolve name keys ("#a" and "#moment/", "#moment") as imports field keys. + +If value is string or string[], mapping is called as a direct mapping +and value called as a direct export. + +If value is key-value object, mapping is called as a conditional mapping +and value called as a conditional export. + +Key in conditional mapping is called condition name. + +Conditional mapping nested in another conditional mapping is called nested mapping. + +*/ + +const slashCode = "/".charCodeAt(0); +const dotCode = ".".charCodeAt(0); +const hashCode = "#".charCodeAt(0); +const patternRegEx = /\*/g; +const DOLLAR_ESCAPE_RE = /\$/g; + +/** @typedef {Record} RecordMapping */ + +/** + * Cached `Object.keys()` for objects whose shape does not change after the + * first observation — i.e. parsed `package.json` fields and the nested + * conditional mappings inside them. `Object.keys` allocates a fresh array + * on every call; since `findMatch` / `conditionalMapping` run on every + * bare-specifier resolve, the allocation adds up quickly. + * @type {WeakMap} + */ +const _keysCache = new WeakMap(); + +/** + * @param {RecordMapping} obj object to read keys from + * @returns {string[]} cached keys array (DO NOT mutate) + */ +function cachedKeys(obj) { + let keys = _keysCache.get(obj); + if (keys === undefined) { + keys = Object.keys(obj); + _keysCache.set(obj, keys); + } + return keys; +} + +/** + * Per-key precomputed info used by `findMatch`. Equivalent to what the + * previous implementation recomputed inline on every resolve. + * @typedef {object} FieldKeyInfo + * @property {string} key the original key + * @property {number} patternIndex position of the single "*" in the key, or -1 when absent + * @property {string} wildcardPrefix substring before "*" (empty when patternIndex === -1) + * @property {string} wildcardSuffix substring after "*" (empty when patternIndex === -1) + * @property {boolean} isLegacySubpath true when key is a legacy `./foo/`-style folder key with no "*" + * @property {boolean} isPattern true when key contains "*" + * @property {boolean} isSubpathMapping true when key ends with "/" + * @property {boolean} isValidPattern true when key has at most one "*" + */ + +/** + * Cached per-field key metadata, keyed by the exports/imports field + * object. Computed lazily on first `findMatch` call and reused forever. + * Safe because `package.json` fields are immutable JSON values. + * @type {WeakMap} + */ +const _fieldKeyInfoCache = new WeakMap(); + +/** + * @param {ExportsField | ImportsField} field field object + * @returns {FieldKeyInfo[]} precomputed per-key info + */ +function getFieldKeyInfos(field) { + const fieldKey = /** @type {RecordMapping} */ (field); + let infos = _fieldKeyInfoCache.get(fieldKey); + if (infos !== undefined) return infos; + const keys = Object.getOwnPropertyNames(field); + infos = Array.from({ length: keys.length }); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = key.indexOf("*"); + // `isValidPattern` is true when the key has at most one `*`. Searching + // from `patternIndex + 1` stops as soon as a second `*` is found, so + // we avoid the full-string scan that `lastIndexOf` would do — and the + // single-star common case finishes in one pass. + const isValidPattern = + patternIndex === -1 || !key.includes("*", patternIndex + 1); + const keyLen = key.length; + const endsWithSlash = + keyLen > 0 && key.charCodeAt(keyLen - 1) === slashCode; + infos[i] = { + key, + patternIndex, + wildcardPrefix: patternIndex === -1 ? "" : key.slice(0, patternIndex), + wildcardSuffix: patternIndex === -1 ? "" : key.slice(patternIndex + 1), + isLegacySubpath: patternIndex === -1 && endsWithSlash, + isPattern: patternIndex !== -1, + isSubpathMapping: endsWithSlash, + isValidPattern, + }; + } + _fieldKeyInfoCache.set(fieldKey, infos); + return infos; +} + +/** + * @param {string} a first string + * @param {string} b second string + * @returns {number} compare result + */ +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf("*"); + const bPatternIndex = b.indexOf("*"); + const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + + return 0; +} + +/** @typedef {[MappingValue, string, boolean, boolean, string] | null} MatchTuple */ + +/** + * Per-field memoization of `findMatch(request, field)`. For a given field + * the result depends only on the `request` string (it does NOT depend on + * `conditionNames` — that's applied separately by `conditionalMapping`), + * so we can cache the tuple keyed by request. + * + * Typical build traffic runs the same request through the resolver + * repeatedly (same import re-resolved from different source files, module + * graph traversals that revisit a package, etc.), and every one of those + * hits walks the same key list and allocates the same tuple. Caching the + * tuple turns the second-and-onward call into a single Map lookup. + * + * Keyed on the field object via a module-level `WeakMap`, so the cache + * is freed automatically when the owning description file is GC'd. + * @type {WeakMap>} + */ +const _findMatchCache = new WeakMap(); + +/** + * @param {string} request request + * @param {ExportsField | ImportsField} field exports or import field + * @returns {MatchTuple} match result (uncached) + */ +function computeFindMatch(request, field) { + const requestLen = request.length; + const requestEndsWithSlash = + requestLen > 0 && request.charCodeAt(requestLen - 1) === slashCode; + const requestHasStar = request.includes("*"); + + if ( + !requestHasStar && + !requestEndsWithSlash && + Object.prototype.hasOwnProperty.call(field, request) + ) { + const target = /** @type {{ [k: string]: MappingValue }} */ (field)[ + request + ]; + + return [target, "", false, false, request]; + } + + /** @type {string} */ + let bestMatch = ""; + /** @type {FieldKeyInfo | null} */ + let bestMatchInfo = null; + /** @type {string | undefined} */ + let bestMatchSubpath; + + const infos = getFieldKeyInfos(field); + + for (let i = 0; i < infos.length; i++) { + const info = infos[i]; + const { key, patternIndex } = info; + + if (patternIndex !== -1) { + if ( + !info.isValidPattern || + !request.startsWith(info.wildcardPrefix) || + requestLen < key.length || + !request.endsWith(info.wildcardSuffix) || + patternKeyCompare(bestMatch, key) !== 1 + ) { + continue; + } + bestMatch = key; + bestMatchInfo = info; + bestMatchSubpath = request.slice( + patternIndex, + requestLen - info.wildcardSuffix.length, + ); + } else if ( + info.isLegacySubpath && + request.startsWith(key) && + patternKeyCompare(bestMatch, key) === 1 + ) { + bestMatch = key; + bestMatchInfo = info; + bestMatchSubpath = request.slice(key.length); + } + } + + if (bestMatch === "") return null; + + const target = + /** @type {{ [k: string]: MappingValue }} */ + (field)[bestMatch]; + + return [ + target, + /** @type {string} */ (bestMatchSubpath), + /** @type {FieldKeyInfo} */ (bestMatchInfo).isSubpathMapping, + /** @type {FieldKeyInfo} */ (bestMatchInfo).isPattern, + bestMatch, + ]; +} + +/** + * Trying to match request to field + * @param {string} request request + * @param {ExportsField | ImportsField} field exports or import field + * @returns {MatchTuple} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings + */ +function findMatch(request, field) { + const fieldKey = /** @type {RecordMapping} */ (field); + let perRequest = _findMatchCache.get(fieldKey); + if (perRequest === undefined) { + perRequest = new Map(); + _findMatchCache.set(fieldKey, perRequest); + } else { + // `computeFindMatch` only ever returns `MatchTuple | null` — never + // `undefined` — and `Map.set(k, null)` then `Map.get(k)` returns + // `null`, not `undefined`. So `get(...) === undefined` already + // unambiguously means "not cached yet"; one Map lookup is enough, + // no follow-up `has` needed to disambiguate "cached null". + const cached = perRequest.get(request); + if (cached !== undefined) return cached; + } + + const result = computeFindMatch(request, field); + perRequest.set(request, result); + return result; +} + +/** + * Sentinel stored in the conditional-mapping cache for inputs whose walk + * returns `null` ("no condition matched"). Using a non-null marker lets the + * cache-hit path be a single `WeakMap.get()` — we distinguish + * "cached null" from "not cached yet" without a second `has` call. + */ +const NULL_RESULT = Symbol("NULL_RESULT"); + +/** + * Memoization of `conditionalMapping(mapping, conditionNames)`. The result + * depends only on the mapping object (immutable — owned by a parsed + * `package.json`) and the `conditionNames` Set (owned by the resolver's + * options and stable for its lifetime), so it is safe to cache per (mapping, + * conditionNames) pair. + * + * A conditional `exports` entry that appears inside a `directMapping` array + * (the common `"browser": [...fallback list...]` shape, plus nested + * conditions) gets walked on every resolve that traverses the parent entry. + * Without this cache each of those walks re-reads `Object.keys` on the + * mapping and re-visits every condition until one matches, even though the + * inputs are identical. + * + * Outer key is the conditional mapping itself; inner key is the condition + * Set. Both are object references, so WeakMap-of-WeakMap lets both levels + * be collected automatically when the description file or resolver go away. + * @type {WeakMap, DirectMapping | typeof NULL_RESULT>>} + */ +const _conditionalMappingCache = new WeakMap(); + +/** + * @param {ConditionalMapping} conditionalMapping_ conditional mapping + * @param {Set} conditionNames condition names + * @returns {DirectMapping | null} direct mapping if found (uncached) + */ +function computeConditionalMapping(conditionalMapping_, conditionNames) { + /** @type {[ConditionalMapping, string[], number][]} */ + const lookup = [[conditionalMapping_, cachedKeys(conditionalMapping_), 0]]; + + loop: while (lookup.length > 0) { + const top = lookup[lookup.length - 1]; + const [mapping, conditions, j] = top; + + for (let i = j; i < conditions.length; i++) { + const condition = conditions[i]; + + if (condition === "default" || conditionNames.has(condition)) { + const innerMapping = mapping[condition]; + if ( + innerMapping !== null && + typeof innerMapping === "object" && + !Array.isArray(innerMapping) + ) { + const nested = /** @type {ConditionalMapping} */ (innerMapping); + top[2] = i + 1; + lookup.push([nested, cachedKeys(nested), 0]); + continue loop; + } + + return /** @type {DirectMapping} */ (innerMapping); + } + } + + lookup.pop(); + } + + return null; +} + +/** + * @param {ConditionalMapping} conditionalMapping_ conditional mapping + * @param {Set} conditionNames condition names + * @returns {DirectMapping | null} direct mapping if found + */ +function conditionalMapping(conditionalMapping_, conditionNames) { + let perSet = _conditionalMappingCache.get(conditionalMapping_); + if (perSet !== undefined) { + const cached = perSet.get(conditionNames); + if (cached !== undefined) { + return cached === NULL_RESULT + ? null + : /** @type {DirectMapping} */ (cached); + } + } else { + perSet = new WeakMap(); + _conditionalMappingCache.set(conditionalMapping_, perSet); + } + const result = computeConditionalMapping(conditionalMapping_, conditionNames); + perSet.set(conditionNames, result === null ? NULL_RESULT : result); + return result; +} + +/** + * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings + * @param {string} mappingTarget direct export + * @param {(d: string, f: boolean) => void} assert asserting direct value + * @returns {string} mapping result + */ +function targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert, +) { + if (remainingRequest === undefined) { + assert(mappingTarget, false); + + return mappingTarget; + } + + if (isSubpathMapping) { + assert(mappingTarget, true); + + return mappingTarget + remainingRequest; + } + + assert(mappingTarget, false); + + let result = mappingTarget; + + if (isPattern) { + const escapedRemainder = remainingRequest.includes("$") + ? remainingRequest.replace(DOLLAR_ESCAPE_RE, "$$") + : remainingRequest; + result = result.replace(patternRegEx, escapedRemainder); + } + + return result; +} + +/** + * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings + * @param {boolean} isPattern true, if mapping is a pattern (contains "*") + * @param {boolean} isSubpathMapping true, for subpath mappings + * @param {DirectMapping | null} mappingTarget direct export + * @param {Set} conditionNames condition names + * @param {(d: string, f: boolean) => void} assert asserting direct value + * @returns {string[]} mapping result + */ +function directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + conditionNames, + assert, +) { + if (mappingTarget === null) return []; + + if (typeof mappingTarget === "string") { + return [ + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mappingTarget, + assert, + ), + ]; + } + + /** @type {string[]} */ + const targets = []; + + for (let i = 0, len = mappingTarget.length; i < len; i++) { + const exp = mappingTarget[i]; + if (typeof exp === "string") { + targets.push( + targetMapping( + remainingRequest, + isPattern, + isSubpathMapping, + exp, + assert, + ), + ); + continue; + } + + const mapping = conditionalMapping(exp, conditionNames); + if (!mapping) continue; + const innerExports = directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + mapping, + conditionNames, + assert, + ); + for (let j = 0, innerLen = innerExports.length; j < innerLen; j++) { + targets.push(innerExports[j]); + } + } + + return targets; +} + +/** @type {[string[], null]} */ +const EMPTY_NO_MATCH = /** @type {[string[], null]} */ ([[], null]); + +/** + * @param {ExportsField | ImportsField} field root + * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` + * @param {(s: string) => string} assertRequest assertRequest + * @param {(s: string, f: boolean) => void} assertTarget assertTarget + * @returns {FieldProcessor} field processor + */ +function createFieldProcessor( + field, + normalizeRequest, + assertRequest, + assertTarget, +) { + return function fieldProcessor(request, conditionNames) { + const match = findMatch(normalizeRequest(assertRequest(request)), field); + + if (match === null) return EMPTY_NO_MATCH; + + const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] = + match; + + /** @type {DirectMapping | null} */ + let direct; + if ( + mapping !== null && + typeof mapping === "object" && + !Array.isArray(mapping) + ) { + direct = conditionalMapping( + /** @type {ConditionalMapping} */ (mapping), + conditionNames, + ); + if (direct === null) return EMPTY_NO_MATCH; + } else { + direct = /** @type {DirectMapping} */ (mapping); + } + + return [ + directMapping( + remainingRequest, + isPattern, + isSubpathMapping, + direct, + conditionNames, + assertTarget, + ), + usedField, + ]; + }; +} + +/** + * @param {string} request request + * @returns {string} updated request + */ +function assertExportsFieldRequest(request) { + if (request.charCodeAt(0) !== dotCode) { + throw new Error('Request should be relative path and start with "."'); + } + if (request.length === 1) return ""; + if (request.charCodeAt(1) !== slashCode) { + throw new Error('Request should be relative path and start with "./"'); + } + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); + } + + return request.slice(2); +} + +/** + * Looks for a conditional mapping whose keys are subpaths - the "conditions + * wrapping subpaths" shape from + * https://github.com/webpack/enhanced-resolve/issues/325, which Node.js does + * not support: the subpaths are read as condition names and match nothing. + * + * Diagnostic only, and deliberately not part of building the field. Walking + * every target of every package.json would cost a full tree walk per package + * to catch a mistake almost none of them make, and rejecting the field + * outright would break packages that resolve today under some conditions. + * Callers run this once a request has already failed, where the walk is free + * relative to the error being raised anyway. + * @param {MappingValue} mapping mapping in target position + * @param {number} subpathCode leading char code that marks a subpath key + * @param {string[]} trail keys walked from the field root down to `mapping` + * @returns {{ trail: string[], keys: string[] } | null} offending mapping + */ +function findSubpathsInConditions(mapping, subpathCode, trail) { + if (mapping === null || typeof mapping !== "object") return null; + + if (Array.isArray(mapping)) { + for (let i = 0; i < mapping.length; i++) { + const found = findSubpathsInConditions(mapping[i], subpathCode, trail); + if (found) return found; + } + return null; + } + + const keys = Object.keys(mapping); + + for (let i = 0; i < keys.length; i++) { + if (keys[i].charCodeAt(0) === subpathCode) { + return { trail: [...trail], keys }; + } + } + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + trail.push(key); + const found = findSubpathsInConditions(mapping[key], subpathCode, trail); + if (found) return found; + trail.pop(); + } + + return null; +} + +/** + * Explains why nothing matched, when the reason is a conditional mapping that + * wraps subpaths. Returns `null` when the field does not have that shape, so + * the caller keeps its ordinary "not exported" wording. + * + * Only the top-level values are descended into, never the field's own keys: + * in both forms of `exports` and in `imports` those values are targets, while + * the keys are either subpaths or - for the `exports` shorthand, where the + * whole field is one conditional mapping - condition names that + * `buildExportsField` has already checked. + * @param {ExportsField | ImportsField | null | undefined} field the field + * @param {boolean} isExports true for `exports`, false for `imports` + * @returns {string | null} explanation to append to the error, if any + */ +module.exports.explainSubpathsInConditions = + function explainSubpathsInConditions(field, isExports) { + if (field === null || typeof field !== "object" || Array.isArray(field)) { + return null; + } + + const subpathCode = isExports ? dotCode : hashCode; + const keys = Object.keys(field); + /** @type {string[]} */ + const trail = []; + /** @type {{ trail: string[], keys: string[] } | null} */ + let found = null; + + for (let i = 0; i < keys.length && !found; i++) { + trail.push(keys[i]); + found = findSubpathsInConditions( + /** @type {Record} */ (field)[keys[i]], + subpathCode, + trail, + ); + trail.pop(); + } + + if (!found) return null; + + const quote = (/** @type {string} */ key) => JSON.stringify(key); + const subpathKeys = found.keys.filter( + (key) => key.charCodeAt(0) === subpathCode, + ); + const condition = found.trail[found.trail.length - 1]; + const example = subpathKeys + .map((key) => `${quote(key)}: { ${quote(condition)}: ... }`) + .join(", "); + + return `the value at ${found.trail + .map(quote) + .join(" -> ")} is an object with subpath keys (${subpathKeys + .map(quote) + .join( + ", ", + )}), which is not supported - a condition can only map to a target or to further conditions, so those subpaths never match. Put the subpaths at the top level and nest the conditions inside them instead, e.g. { ${example} }.`; + }; + +/** + * @param {ExportsField} field exports field + * @returns {ExportsField} normalized exports field + */ +function buildExportsField(field) { + // handle syntax sugar, if exports field is direct mapping for "." + if (typeof field === "string" || Array.isArray(field)) { + return { ".": field }; + } + + const keys = Object.keys(field); + + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + + if (key.charCodeAt(0) !== dotCode) { + // handle syntax sugar, if exports field is conditional mapping for "." + if (i === 0) { + while (i < keys.length) { + const charCode = keys[i].charCodeAt(0); + if (charCode === dotCode || charCode === slashCode) { + throw new Error( + `Exports field key should be relative path and start with "." (key: ${JSON.stringify( + key, + )})`, + ); + } + i++; + } + + return { ".": field }; + } + + throw new Error( + `Exports field key should be relative path and start with "." (key: ${JSON.stringify( + key, + )})`, + ); + } + + if (key.length === 1) { + continue; + } + + if (key.charCodeAt(1) !== slashCode) { + throw new Error( + `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( + key, + )})`, + ); + } + } + + return field; +} + +/** + * @param {string} exp export target + * @param {boolean} expectFolder is folder expected + */ +function assertExportTarget(exp, expectFolder) { + const parsedIdentifier = parseIdentifier(exp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + exp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + exp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ExportsField} exportsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processExportsField = function processExportsField( + exportsField, +) { + return createFieldProcessor( + buildExportsField(exportsField), + (request) => (request.length === 0 ? "." : `./${request}`), + assertExportsFieldRequest, + assertExportTarget, + ); +}; + +/** + * @param {string} request request + * @returns {string} updated request + */ +function assertImportsFieldRequest(request) { + if (request.charCodeAt(0) !== hashCode) { + throw new Error('Request should start with "#"'); + } + if (request.length === 1) { + throw new Error("Request should have at least 2 characters"); + } + // Note: #/ patterns are now allowed per Node.js PR #60864 + // https://github.com/nodejs/node/pull/60864 + if (request.charCodeAt(request.length - 1) === slashCode) { + throw new Error("Only requesting file allowed"); + } + + return request.slice(1); +} + +/** + * @param {string} imp import target + * @param {boolean} expectFolder is folder expected + */ +function assertImportTarget(imp, expectFolder) { + const parsedIdentifier = parseIdentifier(imp); + + if (!parsedIdentifier) { + return; + } + + const [relativePath] = parsedIdentifier; + const isFolder = + relativePath.charCodeAt(relativePath.length - 1) === slashCode; + + if (isFolder !== expectFolder) { + throw new Error( + expectFolder + ? `Expecting folder to folder mapping. ${JSON.stringify( + imp, + )} should end with "/"` + : `Expecting file to file mapping. ${JSON.stringify( + imp, + )} should not end with "/"`, + ); + } +} + +/** + * @param {ImportsField} importsField the exports field + * @returns {FieldProcessor} process callback + */ +module.exports.processImportsField = function processImportsField( + importsField, +) { + return createFieldProcessor( + importsField, + (request) => `#${request}`, + assertImportsFieldRequest, + assertImportTarget, + ); +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/fileURLToPath.js b/e-commerce/node_modules/enhanced-resolve/lib/util/fileURLToPath.js new file mode 100644 index 0000000000000000000000000000000000000000..e96c24d4245992cb2a50524e752b15c37630a5c0 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/fileURLToPath.js @@ -0,0 +1,93 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// A runtime-agnostic port of Node's `url.fileURLToPath`, built on the global +// `URL` (available in Node, browsers, Deno and Bun) so the resolver does not +// depend on the Node `url` builtin. The platform branch can be forced via the +// `windows` option; otherwise it follows the host platform like Node does. + +const CHAR_LOWERCASE_A = 97; +const CHAR_LOWERCASE_Z = 122; + +const isWindows = + typeof process !== "undefined" && process.platform === "win32"; + +const forwardSlashRegEx = /\//g; + +/** + * @param {URL} url file: URL instance + * @returns {string} Windows filesystem path + */ +function getPathFromURLWin32(url) { + const { hostname } = url; + let { pathname } = url; + for (let n = 0; n < pathname.length; n++) { + if (pathname[n] === "%") { + const third = (pathname.codePointAt(n + 2) || 0) | 0x20; + if ( + (pathname[n + 1] === "2" && third === 102) || // 2f 2F (/) + (pathname[n + 1] === "5" && third === 99) // 5c 5C (\) + ) { + throw new TypeError( + "File URL path must not include encoded \\ or / characters", + ); + } + } + } + pathname = pathname.replace(forwardSlashRegEx, "\\"); + pathname = decodeURIComponent(pathname); + if (hostname !== "") { + // UNC path: `\\host\share\…`. Node runs the host through + // `domainToUnicode`; we keep the (already punycode) hostname as-is, + // which is identical for ASCII hosts and only differs for rare IDN UNC. + return `\\\\${hostname}${pathname}`; + } + const letter = (pathname.codePointAt(1) || 0) | 0x20; + const sep = pathname.charAt(2); + if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || sep !== ":") { + throw new TypeError("File URL path must be absolute"); + } + return pathname.slice(1); +} + +/** + * @param {URL} url file: URL instance + * @returns {string} POSIX filesystem path + */ +function getPathFromURLPosix(url) { + if (url.hostname !== "") { + throw new TypeError('File URL host must be "localhost" or empty'); + } + const { pathname } = url; + for (let n = 0; n < pathname.length; n++) { + if (pathname[n] === "%") { + const third = (pathname.codePointAt(n + 2) || 0) | 0x20; + if (pathname[n + 1] === "2" && third === 102) { + throw new TypeError( + "File URL path must not include encoded / characters", + ); + } + } + } + return decodeURIComponent(pathname); +} + +/** + * @param {string | URL} path a `file:` URL string or `URL` instance + * @param {{ windows?: boolean }=} options force the platform branch + * @returns {string} the filesystem path + */ +function fileURLToPath(path, options) { + const url = typeof path === "string" ? new URL(path) : path; + if (url.protocol !== "file:") { + throw new TypeError("The URL must be of scheme file"); + } + const windows = + options && options.windows !== undefined ? options.windows : isWindows; + return windows ? getPathFromURLWin32(url) : getPathFromURLPosix(url); +} + +module.exports = fileURLToPath; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/fs.js b/e-commerce/node_modules/enhanced-resolve/lib/util/fs.js new file mode 100644 index 0000000000000000000000000000000000000000..6c06b0a8d90fc7c3aea50cf80a1f945c6fe1fd31 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/fs.js @@ -0,0 +1,106 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Natsu @xiaoxiaojx +*/ + +"use strict"; + +const memoize = require("./memoize"); +const stripJsonComments = require("./strip-json-comments"); + +/** @typedef {import("../Resolver").FileSystem} FileSystem */ +/** @typedef {import("../Resolver").JsonObject} JsonObject */ + +/** + * @typedef {object} ReadJsonOptions + * @property {boolean=} stripComments Whether to strip JSONC comments + */ + +/** @type {WeakMap} */ +const _stripCommentsCache = new WeakMap(); + +// Only constructed for non-Buffer input: on Node the `Buffer.isBuffer` branch +// in `decodeText` handles decoding, so the global `TextDecoder` (Node 11+, +// always present in browsers/Deno/Bun) is only reached off the Buffer path. +// `ignoreBOM: true` keeps a leading BOM in the output, matching +// `Buffer.toString("utf8")` so both decode paths behave identically. +// eslint-disable-next-line n/no-unsupported-features/node-builtins +const getDecoder = memoize(() => new TextDecoder("utf-8", { ignoreBOM: true })); + +/** + * Decode a file's raw contents to text without assuming a Node runtime. A + * `Buffer` (Node) uses its fast native `toString`; any other binary input + * (`Uint8Array` from a browser/Deno/Bun file system) goes through + * `TextDecoder`, and strings are returned as-is. + * @param {string | Buffer | Uint8Array} data raw file contents + * @returns {string} decoded text + */ +const decodeText = (data) => { + if (typeof data === "string") return data; + if (typeof Buffer !== "undefined" && Buffer.isBuffer(data)) { + return data.toString("utf8"); + } + return getDecoder().decode(data); +}; + +/** + * Read and parse JSON file (supports JSONC with comments). + * Callback-based so a synchronous `fileSystem` stays synchronous all the + * way through — Promise wrapping would defer resolution by a Promise tick + * and break `resolveSync` when `tsconfig` is used together with + * `useSyncFileSystemCalls: true`. + * @param {FileSystem} fileSystem the file system + * @param {string} jsonFilePath absolute path to JSON file + * @param {ReadJsonOptions} options Options + * @param {(err: NodeJS.ErrnoException | Error | null, content?: JsonObject) => void} callback callback + * @returns {void} + */ +function readJson(fileSystem, jsonFilePath, options, callback) { + const { stripComments = false } = options; + const { readJson: fsReadJson } = fileSystem; + if (fsReadJson && !stripComments) { + fsReadJson(jsonFilePath, (err, content) => { + if (err) return callback(err); + callback(null, /** @type {JsonObject} */ (content)); + }); + return; + } + + fileSystem.readFile(jsonFilePath, (err, data) => { + if (err) return callback(err); + const buf = /** @type {Buffer | Uint8Array | string} */ (data); + + // The strip-comments cache is keyed by the file-contents object; a file + // system may hand back a plain string, which cannot be a WeakMap key, so + // only cache when the contents are an object. + const cacheable = stripComments && typeof buf === "object"; + + if (cacheable) { + const cached = _stripCommentsCache.get(buf); + if (cached !== undefined) return callback(null, cached); + } + + let result; + try { + const jsonText = decodeText(buf); + const jsonWithoutComments = stripComments + ? stripJsonComments(jsonText, { + trailingCommas: true, + whitespace: true, + }) + : jsonText; + result = JSON.parse(jsonWithoutComments); + } catch (parseErr) { + return callback(/** @type {Error} */ (parseErr)); + } + + if (cacheable) { + _stripCommentsCache.set(buf, result); + } + + callback(null, result); + }); +} + +module.exports.decodeText = decodeText; +module.exports.readJson = readJson; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/graceful-fs-browser.js b/e-commerce/node_modules/enhanced-resolve/lib/util/graceful-fs-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..63210c8fd8f241e94745e6d95189ffbe9914da00 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/graceful-fs-browser.js @@ -0,0 +1,44 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// Browser stub for the default `graceful-fs` file system. A browser has no +// ambient file system, so the convenience entry's default resolver has nothing +// to read — pass your own `fileSystem` to `create()` / +// `ResolverFactory.createResolver()` instead. Each method throws a clear error +// if the default is actually used, while keeping the package able to bundle for +// the browser (no Node `fs` dependency is pulled in). + +const message = + "enhanced-resolve: no default file system is available in the browser. " + + "Pass a `fileSystem` to `create()` or `ResolverFactory.createResolver()`."; + +/** + * Takes the arguments its callers pass - `readFile(path, callback)` and the + * rest - so the declaration describes a call that actually compiles, even + * though every one of them throws. + * @param {...unknown} _args arguments, ignored + * @returns {never} always throws + */ +const unavailable = (..._args) => { + throw new Error(message); +}; + +// The same set of methods `CachedInputFileSystem` reads from the file system +// (graceful-fs has no `readJson`/`readJsonSync`, so those stay undefined). +module.exports = { + lstat: unavailable, + lstatSync: unavailable, + readFile: unavailable, + readFileSync: unavailable, + readdir: unavailable, + readdirSync: unavailable, + readlink: unavailable, + readlinkSync: unavailable, + realpath: unavailable, + realpathSync: unavailable, + stat: unavailable, + statSync: unavailable, +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/identifier.js b/e-commerce/node_modules/enhanced-resolve/lib/util/identifier.js new file mode 100644 index 0000000000000000000000000000000000000000..5c71711717f71a2d944ff7bcd9621b02c759a1dd --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/identifier.js @@ -0,0 +1,103 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const { fileURLToPath } = require("url"); +const { isFileURL } = require("./path"); + +const PATH_QUERY_FRAGMENT_REGEXP = + /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; +const ZERO_ESCAPE_REGEXP = /\0(.)/g; + +/** + * Index past a DOS device path prefix (`\\?\…` or `\\.\…`), or 0. Kept + * out of `parseIdentifier` on purpose: inlining it back bloats the caller + * beyond the size where V8's interpreter and JIT both handle it well + * (the cause of the description-files-multi CodSpeed regression). + * @param {string} identifier identifier known to start with `\` + * @returns {number} 4 if identifier starts with a DOS device prefix, else 0 + */ +function dosPrefixEnd(identifier) { + if ( + identifier.length >= 4 && + identifier.charCodeAt(1) === 92 && + identifier.charCodeAt(3) === 92 + ) { + const c2 = identifier.charCodeAt(2); + if (c2 === 63 || c2 === 46) return 4; + } + return 0; +} + +/** + * @param {string} identifier identifier + * @returns {[string, string, string] | null} parsed identifier + */ +function parseIdentifier(identifier) { + if (!identifier) { + return null; + } + + // Only a whole `file:` URL is one - a path segment spelled `file:`, which + // `/tmp/profile:1.js` also contains, stays the path it is. + if (isFileURL(identifier)) { + identifier = fileURLToPath(identifier); + } + + const firstEscape = identifier.indexOf("\0"); + + // Handle `\0` + if (firstEscape !== -1) { + const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier); + + if (!match) return null; + + return [ + match[1].replace(ZERO_ESCAPE_REGEXP, "$1"), + match[2] ? match[2].replace(ZERO_ESCAPE_REGEXP, "$1") : "", + match[3] || "", + ]; + } + + // Fast path for inputs that don't use \0 escaping. DOS device paths + // (`\\?\…`, `\\.\…`) embed a literal `?` / `.` that must not be read + // as a query separator; skip past the prefix when the input actually + // starts with `\`. Gate is a single char-code compare so this function + // stays inside V8's inline budget for its hot callers (resolver parse). + const scanStart = + identifier.charCodeAt(0) === 92 ? dosPrefixEnd(identifier) : 0; + const queryStart = identifier.indexOf("?", scanStart); + // Start at index 1 (or past a DOS prefix) to ignore a possible leading hash. + const fragmentStart = identifier.indexOf("#", scanStart || 1); + + if (fragmentStart < 0) { + if (queryStart < 0) { + // No fragment, no query + return [identifier, "", ""]; + } + + // Query, no fragment + return [identifier.slice(0, queryStart), identifier.slice(queryStart), ""]; + } + + if (queryStart < 0 || fragmentStart < queryStart) { + // Fragment, no query + return [ + identifier.slice(0, fragmentStart), + "", + identifier.slice(fragmentStart), + ]; + } + + // Query and fragment + return [ + identifier.slice(0, queryStart), + identifier.slice(queryStart, fragmentStart), + identifier.slice(fragmentStart), + ]; +} + +module.exports.parseIdentifier = parseIdentifier; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/memoize.js b/e-commerce/node_modules/enhanced-resolve/lib/util/memoize.js new file mode 100644 index 0000000000000000000000000000000000000000..b46e252ad6a2e1d4901a6c06c84b47f174a3d9a9 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/memoize.js @@ -0,0 +1,37 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** + * @template T + * @typedef {() => T} FunctionReturning + */ + +/** + * @template T + * @param {FunctionReturning} fn memorized function + * @returns {FunctionReturning} new function + */ +const memoize = (fn) => { + let cache = false; + /** @type {T | undefined} */ + let result; + return () => { + if (cache) { + return /** @type {T} */ (result); + } + + result = fn(); + cache = true; + // Allow to clean up memory for fn + // and all dependent resources + /** @type {FunctionReturning | undefined} */ + (fn) = undefined; + return /** @type {T} */ (result); + }; +}; + +module.exports = memoize; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/module-browser.js b/e-commerce/node_modules/enhanced-resolve/lib/util/module-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..1258c22e150fe2a691a8bc3589cd5fcd575edf7f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/module-browser.js @@ -0,0 +1,8 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +module.exports = {}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/packageMap.js b/e-commerce/node_modules/enhanced-resolve/lib/util/packageMap.js new file mode 100644 index 0000000000000000000000000000000000000000..7c1e67e426f872e48ec282d3601d4f7d7e2aa28d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/packageMap.js @@ -0,0 +1,224 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// Node.js package maps: https://nodejs.org/api/packages.html#package-maps +// +// A package map is a static table that maps bare specifiers to package +// locations per importing package, so resolution never has to walk +// `node_modules`. This module turns the configuration file into the lookup +// tables `PackageMapPlugin` needs; no file system access is involved beyond +// reading the file itself. +// +// @experimental Package maps are stability 1 (experimental) in Node.js and are +// only reachable there behind `--experimental-package-map`. This parser tracks +// that specification and may change with it, including in a patch release. + +const fileURLToPath = require("./fileURLToPath"); +const { isInside, normalize } = require("./path"); +const pathToFileURL = require("./pathToFileURL"); + +/** @typedef {import("../Resolver").JsonObject} JsonObject */ + +/** @typedef {{ [specifier: string]: string }} PackageMapDependencies */ + +/** + * A single entry of the configuration file's `packages` object. + * @typedef {object} PackageMapPackage + * @property {string} url an absolute or relative `file:` URL, resolved against the configuration file + * @property {PackageMapDependencies=} dependencies bare specifier to package id + */ + +/** @typedef {{ [id: string]: PackageMapPackage }} PackageMapPackages */ + +/** + * The parsed contents of a package map configuration file. + * @typedef {object} PackageMapJson + * @property {PackageMapPackages} packages package entries by package id + */ + +/** + * @typedef {object} PackageMapEntry + * @property {string} id the package id this entry is keyed by + * @property {string} path absolute filesystem path the entry's `url` points at + * @property {Map} dependencies bare specifier to package id + */ + +/** + * @typedef {object} PackageMap + * @property {Map} packages entries by package id + * @property {{ path: string, ids: string[] }[]} locations package ids by location, longest path first + */ + +/** + * @param {string} message message + * @param {string} code error code + * @returns {Error & { code: string }} the error + */ +function createError(message, code) { + const error = /** @type {Error & { code: string }} */ (new Error(message)); + error.code = code; + return error; +} + +/** + * Resolve an entry's `url` the way Node does: through the WHATWG `URL` parser + * with the configuration file as the base, accepting only `file:`. + * @param {string} url the entry's `url` value + * @param {URL} base the configuration file URL + * @param {string} id the package id, for error messages + * @returns {string} the absolute filesystem path + */ +function toPackagePath(url, base, id) { + let parsed; + try { + parsed = new URL(url, base); + } catch (_err) { + throw createError( + `Package map entry "${id}" has an invalid "url": ${url}`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + if (parsed.protocol !== "file:") { + throw createError( + `Package map entry "${id}" must use a "file:" url, received: ${url}`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + return normalize(fileURLToPath(parsed)); +} + +/** + * Parse and validate a package map configuration file. + * + * Dangling dependency targets are rejected here rather than at resolution + * time: the map is static, so a broken table is a configuration error that is + * better surfaced once and in full. + * @param {JsonObject} data the parsed configuration file contents + * @param {string} configFilePath absolute path of the configuration file, used as the base for relative urls + * @returns {PackageMap} the parsed package map + */ +function parsePackageMap(data, configFilePath) { + if (!data || typeof data !== "object" || Array.isArray(data)) { + throw createError( + `Package map "${configFilePath}" must contain a JSON object`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + + const rawPackages = data.packages; + + if ( + !rawPackages || + typeof rawPackages !== "object" || + Array.isArray(rawPackages) + ) { + throw createError( + `Package map "${configFilePath}" must contain a "packages" object`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + + const base = pathToFileURL(configFilePath); + /** @type {Map} */ + const packages = new Map(); + /** @type {Map} */ + const idsByPath = new Map(); + + for (const id of Object.keys(rawPackages)) { + const rawEntry = /** @type {JsonObject} */ (rawPackages[id]); + + if (!rawEntry || typeof rawEntry !== "object" || Array.isArray(rawEntry)) { + throw createError( + `Package map entry "${id}" must be an object`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + // An empty `url` would resolve to the configuration file itself rather + // than to a package directory, so reject it like Node does. + if (typeof rawEntry.url !== "string" || rawEntry.url === "") { + throw createError( + `Package map entry "${id}" must have a non-empty string "url"`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + + const packagePath = toPackagePath(rawEntry.url, base, id); + /** @type {Map} */ + const dependencies = new Map(); + const rawDependencies = rawEntry.dependencies; + + if (rawDependencies !== undefined) { + if ( + !rawDependencies || + typeof rawDependencies !== "object" || + Array.isArray(rawDependencies) + ) { + throw createError( + `Package map entry "${id}" has a non-object "dependencies"`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + for (const specifier of Object.keys(rawDependencies)) { + const target = rawDependencies[specifier]; + + if (typeof target !== "string") { + throw createError( + `Package map entry "${id}" maps "${specifier}" to a non-string package id`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + dependencies.set(specifier, target); + } + } + + packages.set(id, { id, path: packagePath, dependencies }); + + const ids = idsByPath.get(packagePath); + if (ids) { + ids.push(id); + } else { + idsByPath.set(packagePath, [id]); + } + } + + for (const entry of packages.values()) { + for (const [specifier, target] of entry.dependencies) { + if (!packages.has(target)) { + throw createError( + `Package map entry "${entry.id}" maps "${specifier}" to unknown package id "${target}"`, + "ERR_INVALID_PACKAGE_MAP", + ); + } + } + } + + // Longest path first so a package nested inside another one wins the + // containment lookup below. + const locations = [...idsByPath] + .map(([path, ids]) => ({ path, ids })) + .sort((a, b) => b.path.length - a.path.length); + + return { packages, locations }; +} + +/** + * Find the package ids whose location contains `filePath`. More than one id is + * returned when several package entries share the same `url`, which the caller + * has to disambiguate with an explicit package id. + * @param {PackageMap} packageMap the package map + * @param {string} filePath an absolute filesystem path + * @returns {string[]} the matching package ids, empty when the path is outside every package + */ +function findPackageIds(packageMap, filePath) { + for (const location of packageMap.locations) { + if (isInside(location.path, filePath)) return location.ids; + } + return []; +} + +module.exports.createError = createError; +module.exports.findPackageIds = findPackageIds; +module.exports.parsePackageMap = parsePackageMap; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/path-browser.js b/e-commerce/node_modules/enhanced-resolve/lib/util/path-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..5b7fd4cc6f56b5a7ff959f4e35b7b097b8c7f663 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/path-browser.js @@ -0,0 +1,407 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// A browser shim for the Node `path` builtin, exposing only the subset used by +// `lib/util/path.js`: `posix.normalize`, `posix.dirname`, `win32.normalize`, +// `win32.dirname` and a (posix) `basename`. It is a faithful port of Node's +// `path` implementation and is wired in through the package `browser` field, so +// Node, Deno and Bun keep using their native `path` and only browser bundles +// use this. Inputs are always strings here, so Node's `validateString` guards +// are omitted. + +const CHAR_UPPERCASE_A = 65; +const CHAR_UPPERCASE_Z = 90; +const CHAR_LOWERCASE_A = 97; +const CHAR_LOWERCASE_Z = 122; +const CHAR_DOT = 46; +const CHAR_FORWARD_SLASH = 47; +const CHAR_BACKWARD_SLASH = 92; +const CHAR_COLON = 58; + +/** + * @param {number} code char code + * @returns {boolean} true for `/` + */ +const isPosixPathSeparator = (code) => code === CHAR_FORWARD_SLASH; + +/** + * @param {number} code char code + * @returns {boolean} true for `/` or `\` + */ +const isPathSeparator = (code) => + code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; + +/** + * @param {number} code char code + * @returns {boolean} true for an ASCII letter (a windows device root) + */ +const isWindowsDeviceRoot = (code) => + (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) || + (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z); + +/** + * Resolve `.` and `..` segments in a path. Ported from Node's internal + * `normalizeString`. + * @param {string} path path + * @param {boolean} allowAboveRoot whether leading `..` may be kept + * @param {string} separator path separator to emit + * @param {(code: number) => boolean} isSeparator separator predicate + * @returns {string} normalized path string (without root) + */ +function normalizeString(path, allowAboveRoot, separator, isSeparator) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let code = 0; + for (let i = 0; i <= path.length; ++i) { + if (i < path.length) { + code = path.charCodeAt(i); + } else if (isSeparator(code)) { + break; + } else { + code = CHAR_FORWARD_SLASH; + } + + if (isSeparator(code)) { + if (lastSlash === i - 1 || dots === 1) { + // NOOP + } else if (dots === 2) { + if ( + res.length < 2 || + lastSegmentLength !== 2 || + res.charCodeAt(res.length - 1) !== CHAR_DOT || + res.charCodeAt(res.length - 2) !== CHAR_DOT + ) { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf(separator); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); + } + lastSlash = i; + dots = 0; + continue; + } else if (res.length !== 0) { + res = ""; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + res += res.length > 0 ? `${separator}..` : ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) { + res += `${separator}${path.slice(lastSlash + 1, i)}`; + } else { + res = path.slice(lastSlash + 1, i); + } + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === CHAR_DOT && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +/** + * @param {string} path path + * @returns {string} normalized posix path + */ +function posixNormalize(path) { + if (path.length === 0) return "."; + + const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + const trailingSeparator = + path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; + + path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); + + if (path.length === 0) { + if (isAbsolute) return "/"; + return trailingSeparator ? "./" : "."; + } + if (trailingSeparator) path += "/"; + + return isAbsolute ? `/${path}` : path; +} + +/** + * @param {string} path path + * @returns {string} posix dirname + */ +function posixDirname(path) { + if (path.length === 0) return "."; + const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; + let end = -1; + let matchedSlash = true; + for (let i = path.length - 1; i >= 1; --i) { + if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + end = i; + break; + } + } else { + matchedSlash = false; + } + } + + if (end === -1) return hasRoot ? "/" : "."; + if (hasRoot && end === 1) return "//"; + return path.slice(0, end); +} + +/** + * Normalizes drive paths (`C:\…`), UNC paths (`\\server\share\…`), DOS device + * paths (`\\.\…`, `\\?\…`) and relative/normal segments like Node's + * `path.win32.normalize`, including the CVE-2024-36139 colon-segment guard. + * + * Scope note: reserved Windows device names (`CON`, `COM1`, `LPT1`, …) are not + * special-cased, so e.g. `\\.\COM1:` differs from Node. Such names cannot occur + * in a browser (the only place this shim is used) and the resolver never routes + * them to `win32.normalize`, so this does not affect resolution. + * @param {string} path path + * @returns {string} normalized win32 path + */ +function win32Normalize(path) { + const len = path.length; + if (len === 0) return "."; + let rootEnd = 0; + /** @type {string | undefined} */ + let device; + let isAbsolute = false; + const code = path.charCodeAt(0); + + if (len === 1) { + return isPosixPathSeparator(code) ? "\\" : path; + } + + if (isPathSeparator(code)) { + // Possible UNC root; an initial separator means an absolute path. + isAbsolute = true; + + if (isPathSeparator(path.charCodeAt(1))) { + // Matched double path separator at beginning + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) j++; + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; + if (j === len || j !== last) { + if (firstPart === "." || firstPart === "?") { + // Device root, e.g. `\\.\pipe\…` or `\\?\C:\…` + device = `\\\\${firstPart}`; + rootEnd = 4; + } else if (j === len) { + // Matched a UNC root only + return `\\\\${firstPart}\\${path.slice(last)}\\`; + } else { + // Matched a UNC root with leftovers + device = `\\\\${firstPart}\\${path.slice(last, j)}`; + rootEnd = j; + } + } + } + } + } else { + rootEnd = 1; + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + // Possible device root + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2 && isPathSeparator(path.charCodeAt(2))) { + isAbsolute = true; + rootEnd = 3; + } + } + + let tail = + rootEnd < len + ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) + : ""; + if (tail.length === 0 && !isAbsolute) tail = "."; + if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { + tail += "\\"; + } + if (!isAbsolute && device === undefined && path.includes(":")) { + // A relative path that wasn't resolved to a device must not turn into + // something Windows could read as an absolute/drive path (CVE-2024-36139). + if ( + tail.length >= 2 && + isWindowsDeviceRoot(tail.charCodeAt(0)) && + tail.charCodeAt(1) === CHAR_COLON + ) { + return `.\\${tail}`; + } + let index = path.indexOf(":"); + do { + if (index === len - 1 || isPathSeparator(path.charCodeAt(index + 1))) { + return `.\\${tail}`; + } + } while ((index = path.indexOf(":", index + 1)) !== -1); + } + if (device === undefined) { + return isAbsolute ? `\\${tail}` : tail; + } + return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; +} + +/** + * @param {string} path path + * @returns {string} win32 dirname + */ +function win32Dirname(path) { + const len = path.length; + if (len === 0) return "."; + let rootEnd = -1; + let offset = 0; + const code = path.charCodeAt(0); + + if (len === 1) { + return isPathSeparator(code) ? path : "."; + } + + if (isPathSeparator(code)) { + // Possible UNC root + rootEnd = offset = 1; + + if (isPathSeparator(path.charCodeAt(1))) { + let j = 2; + let last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; + if (j < len && j !== last) { + last = j; + while (j < len && isPathSeparator(path.charCodeAt(j))) j++; + if (j < len && j !== last) { + last = j; + while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; + if (j === len) { + // Matched a UNC root only + return path; + } + if (j !== last) { + // Matched a UNC root with leftovers + rootEnd = offset = j + 1; + } + } + } + } + } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { + rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; + offset = rootEnd; + } + + let end = -1; + let matchedSlash = true; + for (let i = len - 1; i >= offset; --i) { + if (isPathSeparator(path.charCodeAt(i))) { + if (!matchedSlash) { + end = i; + break; + } + } else { + matchedSlash = false; + } + } + + if (end === -1) { + if (rootEnd === -1) return "."; + end = rootEnd; + } + return path.slice(0, end); +} + +/** + * Posix `basename` — the browser is treated as a posix platform, matching how + * Node picks the posix variant for `path.basename` on non-Windows systems. + * @param {string} path path + * @param {string=} suffix optional suffix to strip + * @returns {string} basename + */ +function basename(path, suffix) { + let start = 0; + let end = -1; + let matchedSlash = true; + + if ( + suffix !== undefined && + suffix.length > 0 && + suffix.length <= path.length + ) { + if (suffix === path) return ""; + let extIdx = suffix.length - 1; + let firstNonSlashEnd = -1; + for (let i = path.length - 1; i >= 0; --i) { + const code = path.charCodeAt(i); + if (code === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + if (code === suffix.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + + if (start === end) { + end = firstNonSlashEnd; + } else if (end === -1) { + end = path.length; + } + return path.slice(start, end); + } + for (let i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i + 1; + } + } + + if (end === -1) return ""; + return path.slice(start, end); +} + +module.exports = { + basename, + posix: { normalize: posixNormalize, dirname: posixDirname }, + win32: { normalize: win32Normalize, dirname: win32Dirname }, +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/path.js b/e-commerce/node_modules/enhanced-resolve/lib/util/path.js new file mode 100644 index 0000000000000000000000000000000000000000..daf1262e16ffcb046cddcc4cae17e7069be5f793 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/path.js @@ -0,0 +1,471 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +const path = require("path"); +const { fileURLToPath } = require("url"); + +const CHAR_HASH = "#".charCodeAt(0); +const CHAR_SLASH = "/".charCodeAt(0); +const CHAR_BACKSLASH = "\\".charCodeAt(0); +const CHAR_A = "A".charCodeAt(0); +const CHAR_Z = "Z".charCodeAt(0); +const CHAR_LOWER_A = "a".charCodeAt(0); +const CHAR_LOWER_Z = "z".charCodeAt(0); +const CHAR_DOT = ".".charCodeAt(0); +const CHAR_COLON = ":".charCodeAt(0); +const CHAR_F = "F".charCodeAt(0); +const CHAR_LOWER_F = "f".charCodeAt(0); + +const FILE_URL_REGEXP = /^file:\//i; + +const posixNormalize = path.posix.normalize; +const winNormalize = path.win32.normalize; + +/** + * @enum {number} + */ +const PathType = Object.freeze({ + Empty: 0, + Normal: 1, + Relative: 2, + AbsoluteWin: 3, + AbsolutePosix: 4, + Internal: 5, +}); + +const deprecatedInvalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; + +const invalidSegmentRegEx = + /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; + +/** + * @param {string} maybePath a path + * @returns {PathType} type of path + */ +const getType = (maybePath) => { + switch (maybePath.length) { + case 0: + return PathType.Empty; + case 1: { + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: + return PathType.Relative; + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + return PathType.Normal; + } + case 2: { + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: { + const c1 = maybePath.charCodeAt(1); + switch (c1) { + case CHAR_DOT: + case CHAR_SLASH: + return PathType.Relative; + } + return PathType.Normal; + } + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + const c1 = maybePath.charCodeAt(1); + if ( + c1 === CHAR_COLON && + ((c0 >= CHAR_A && c0 <= CHAR_Z) || + (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) + ) { + return PathType.AbsoluteWin; + } + if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) { + return PathType.AbsoluteWin; + } + return PathType.Normal; + } + } + const c0 = maybePath.charCodeAt(0); + switch (c0) { + case CHAR_DOT: { + const c1 = maybePath.charCodeAt(1); + switch (c1) { + case CHAR_SLASH: + return PathType.Relative; + case CHAR_DOT: { + const c2 = maybePath.charCodeAt(2); + if (c2 === CHAR_SLASH) return PathType.Relative; + return PathType.Normal; + } + } + return PathType.Normal; + } + case CHAR_SLASH: + return PathType.AbsolutePosix; + case CHAR_HASH: + return PathType.Internal; + } + const c1 = maybePath.charCodeAt(1); + if (c1 === CHAR_COLON) { + const c2 = maybePath.charCodeAt(2); + if ( + (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && + ((c0 >= CHAR_A && c0 <= CHAR_Z) || + (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) + ) { + return PathType.AbsoluteWin; + } + } + // Two leading backslashes root a UNC share (`\\server\share`) or a DOS + // device path (`\\?\…`, `\\.\…`); `path.win32` reads either as absolute, + // so both belong on `path.win32` and not on posix. + if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) { + return PathType.AbsoluteWin; + } + return PathType.Normal; +}; + +/** + * @param {string} maybePath a path + * @returns {string} the normalized path + */ +const normalize = (maybePath) => { + switch (getType(maybePath)) { + case PathType.Empty: + return maybePath; + case PathType.AbsoluteWin: + return winNormalize(maybePath); + case PathType.Relative: { + const r = posixNormalize(maybePath); + return getType(r) === PathType.Relative ? r : `./${r}`; + } + } + return posixNormalize(maybePath); +}; + +/** + * @param {string} rootPath the root path + * @param {string | undefined} request the request path + * @returns {string} the joined path + */ +const join = (rootPath, request) => { + if (!request) return normalize(rootPath); + const requestType = getType(request); + switch (requestType) { + case PathType.AbsolutePosix: + return posixNormalize(request); + case PathType.AbsoluteWin: + return winNormalize(request); + } + switch (getType(rootPath)) { + case PathType.Normal: + case PathType.Relative: + case PathType.AbsolutePosix: + return posixNormalize(`${rootPath}/${request}`); + case PathType.AbsoluteWin: + return winNormalize(`${rootPath}\\${request}`); + } + switch (requestType) { + case PathType.Empty: + return rootPath; + case PathType.Relative: { + const r = posixNormalize(rootPath); + return getType(r) === PathType.Relative ? r : `./${r}`; + } + } + return posixNormalize(rootPath); +}; + +/** + * @param {string} maybePath a path + * @returns {string} the directory name + */ +const dirname = (maybePath) => { + switch (getType(maybePath)) { + case PathType.AbsoluteWin: + return path.win32.dirname(maybePath); + } + return path.posix.dirname(maybePath); +}; + +/** @typedef {{ fn: (rootPath: string, request: string) => string, cache: Map> }} CachedJoin */ + +/** + * @returns {CachedJoin} cached join + */ +const createCachedJoin = () => { + /** @type {CachedJoin["cache"]} */ + const cache = new Map(); + /** @type {CachedJoin["fn"]} */ + const fn = (rootPath, request) => { + /** @type {string | undefined} */ + let cacheEntry; + let inner = cache.get(rootPath); + if (inner === undefined) { + cache.set(rootPath, (inner = new Map())); + } else { + cacheEntry = inner.get(request); + if (cacheEntry !== undefined) return cacheEntry; + } + cacheEntry = join(rootPath, request); + inner.set(request, cacheEntry); + return cacheEntry; + }; + return { fn, cache }; +}; + +/** @typedef {{ fn: (maybePath: string) => string, cache: Map }} CachedDirname */ + +/** + * @returns {CachedDirname} cached dirname + */ +const createCachedDirname = () => { + /** @type {CachedDirname["cache"]} */ + const cache = new Map(); + /** @type {CachedDirname["fn"]} */ + const fn = (maybePath) => { + const cacheEntry = cache.get(maybePath); + if (cacheEntry !== undefined) return cacheEntry; + const result = dirname(maybePath); + cache.set(maybePath, result); + return result; + }; + return { fn, cache }; +}; + +/** @typedef {{ fn: (maybePath: string, suffix?: string) => string, cache: Map> }} CachedBasename */ + +/** + * @returns {CachedBasename} cached basename + */ +const createCachedBasename = () => { + /** @type {CachedBasename["cache"]} */ + const cache = new Map(); + /** @type {CachedBasename["fn"]} */ + const fn = (maybePath, suffix) => { + /** @type {string | undefined} */ + let cacheEntry; + let inner = cache.get(maybePath); + if (inner === undefined) { + cache.set(maybePath, (inner = new Map())); + } else { + cacheEntry = inner.get(suffix); + if (cacheEntry !== undefined) return cacheEntry; + } + cacheEntry = path.basename(maybePath, suffix); + inner.set(suffix, cacheEntry); + return cacheEntry; + }; + return { fn, cache }; +}; + +/** + * Whether `request` is a relative request — i.e. matches `^\.\.?(?:\/|$)`. + * + * This is called on every `doResolve` via `UnsafeCachePlugin` and + * `getInnerRequest`, so the char-code form is meaningfully faster than the + * equivalent regex test: no regex state machine, no string object churn. + * @param {string} request request string + * @returns {boolean} true if request is relative + */ +const isRelativeRequest = (request) => { + const len = request.length; + if (len === 0 || request.charCodeAt(0) !== CHAR_DOT) return false; + if (len === 1) return true; // "." + const c1 = request.charCodeAt(1); + if (c1 === CHAR_SLASH) return true; // "./..." + if (c1 !== CHAR_DOT) return false; // ".x..." + if (len === 2) return true; // ".." + return request.charCodeAt(2) === CHAR_SLASH; // "../..." +}; + +/** + * Whether this is a Windows path, in which `/` and `\` are interchangeable and + * paths compare case-insensitively, as opposed to a posix path, in which `\` is + * an ordinary filename character. Decided by the root — a drive letter or a + * leading `\` — which is where `path.win32` and `path.posix` disagree about + * `parse(maybePath).root`, and never by the host platform, since Windows paths + * are resolved on posix hosts and in browsers too. A path starting with `//` + * stays posix: `path.win32` reads it as a UNC root, but here it cannot be told + * apart from a posix path, where `\` has to keep being a filename character. + * @param {string} maybePath a path + * @returns {boolean} true, when the path is a Windows path + */ +const isWindowsPath = (maybePath) => { + const c0 = maybePath.charCodeAt(0); + if (c0 === CHAR_BACKSLASH) return true; + if (maybePath.charCodeAt(1) !== CHAR_COLON) return false; + return ( + (c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z) + ); +}; + +/** + * @param {number} charCode a char code + * @param {boolean} windowsPath whether `\` separates segments + * @returns {boolean} true, when the char code separates path segments + */ +const isSeparator = (charCode, windowsPath) => + charCode === CHAR_SLASH || (windowsPath && charCode === CHAR_BACKSLASH); + +/** + * @param {string} parentPath parent directory path + * @param {boolean} windowsPath whether `parentPath` is a Windows path + * @returns {number} length of `parentPath` without its trailing separators + */ +const parentPathLength = (parentPath, windowsPath) => { + let end = parentPath.length; + while (end > 0 && isSeparator(parentPath.charCodeAt(end - 1), windowsPath)) { + end--; + } + return end; +}; + +/** + * Cold path of `startsWithPath`: Node lowercases whole paths rather than single + * characters, which only makes a difference outside of ASCII. + * @param {string} parentPath parent directory path + * @param {number} length number of characters to compare + * @param {string} childPath child path to check + * @returns {boolean} true, when both prefixes name the same Windows path + */ +const equalsWindowsPrefix = (parentPath, length, childPath) => + childPath.slice(0, length).replace(/\//g, "\\").toLowerCase() === + parentPath.slice(0, length).replace(/\//g, "\\").toLowerCase(); + +/** + * @param {string} parentPath parent directory path + * @param {number} length number of characters of `parentPath` to compare + * @param {string} childPath child path to check + * @param {boolean} windowsPath whether `parentPath` is a Windows path + * @returns {boolean} true, when `childPath` starts with that prefix + */ +const startsWithPath = (parentPath, length, childPath, windowsPath) => { + if (childPath.length < length) return false; + // The common case is an exact prefix of a parent without trailing + // separators, which `startsWith` answers natively and without a slice. For + // a posix parent that is the whole answer, only a Windows one has more + // spellings of the same path to try. + if (length === parentPath.length) { + if (childPath.startsWith(parentPath)) return true; + if (!windowsPath) return false; + } + for (let i = 0; i < length; i++) { + const childCharCode = childPath.charCodeAt(i); + const parentCharCode = parentPath.charCodeAt(i); + if (childCharCode === parentCharCode) continue; + if (!windowsPath) return false; + // Windows mixes `/` and `\` freely and compares case-insensitively. + if (isSeparator(childCharCode, true) && isSeparator(parentCharCode, true)) { + continue; + } + if (childCharCode > 127 || parentCharCode > 127) { + return equalsWindowsPrefix(parentPath, length, childPath); + } + const childLower = + childCharCode >= CHAR_A && childCharCode <= CHAR_Z + ? childCharCode + 32 + : childCharCode; + const parentLower = + parentCharCode >= CHAR_A && parentCharCode <= CHAR_Z + ? parentCharCode + 32 + : parentCharCode; + if (childLower !== parentLower) return false; + } + return true; +}; + +/** + * Whether childPath is parentPath itself or a path under it, the answer node's + * `relative(parentPath, childPath)` gives: not escaping upward and not + * absolute. A trailing separator on the parent is not part of the boundary, so + * `/a/b/` contains exactly what `/a/b` contains. + * @param {string} parentPath parent directory path + * @param {string} childPath child path to check + * @returns {boolean} true if childPath is parentPath or is under it + */ +const isInside = (parentPath, childPath) => { + const windowsPath = isWindowsPath(parentPath); + const length = parentPathLength(parentPath, windowsPath); + if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false; + // The parent itself, or a segment boundary right after it so that `/a/b` + // does not contain the sibling `/a/b-other`. + return ( + childPath.length === length || + isSeparator(childPath.charCodeAt(length), windowsPath) + ); +}; + +/** + * Check if childPath is a subdirectory of parentPath. Compares like `isInside`, + * except that a path is not a subpath of itself. + * + * Called from `TsconfigPathsPlugin._selectPathsDataForContext` inside a loop + * over every tsconfig-paths context on every resolve, so it's worth keeping + * cheap: a native `startsWith` plus a separator char check answers it, and the + * character loop only runs for a Windows path that the prefix test missed. + * @param {string} parentPath parent directory path + * @param {string} childPath child path to check + * @returns {boolean} true if childPath is under parentPath + */ +const isSubPath = (parentPath, childPath) => { + const windowsPath = isWindowsPath(parentPath); + const length = parentPathLength(parentPath, windowsPath); + if (childPath.length <= length) return false; + if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false; + return isSeparator(childPath.charCodeAt(length), windowsPath); +}; + +/** + * Whether a string names a `file:` URL rather than a path. The scheme has to + * open the string and be followed by a slash, as Node's own URL parser needs, + * so a path segment spelled `file:` stays a path and `file:x.js` — which Node + * reads as `/x.js` — stays the relative request it looks like. + * @param {string} maybePath a path or a `file:` URL string + * @returns {boolean} true when the string is a `file:` URL + */ +const isFileURL = (maybePath) => { + // The first character keeps every path not starting with `f` off the regexp + const c0 = maybePath.charCodeAt(0); + return ( + (c0 === CHAR_LOWER_F || c0 === CHAR_F) && FILE_URL_REGEXP.test(maybePath) + ); +}; + +/** + * Convert a `file:` URL — a `URL` instance or a `file:/` string, the form + * `import.meta.resolve` returns — to the path it names. Anything else is + * returned unchanged, so a path passes through. + * @param {string | URL} maybeURL a path, a `file:` URL string or a `file:` `URL` instance + * @returns {string} a filesystem path + */ +const toPath = (maybeURL) => { + if (maybeURL instanceof URL) return fileURLToPath(maybeURL); + return isFileURL(maybeURL) ? fileURLToPath(maybeURL) : maybeURL; +}; + +module.exports.PathType = PathType; +module.exports.createCachedBasename = createCachedBasename; +module.exports.createCachedDirname = createCachedDirname; +module.exports.createCachedJoin = createCachedJoin; +module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx; +module.exports.dirname = dirname; +module.exports.getType = getType; +module.exports.invalidSegmentRegEx = invalidSegmentRegEx; +module.exports.isFileURL = isFileURL; +module.exports.isInside = isInside; +module.exports.isRelativeRequest = isRelativeRequest; +module.exports.isSubPath = isSubPath; +module.exports.isWindowsPath = isWindowsPath; +module.exports.join = join; +module.exports.normalize = normalize; +module.exports.toPath = toPath; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/pathToFileURL.js b/e-commerce/node_modules/enhanced-resolve/lib/util/pathToFileURL.js new file mode 100644 index 0000000000000000000000000000000000000000..a99714b61070c28cfe7e9522bb4fcb666244f1bc --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/pathToFileURL.js @@ -0,0 +1,87 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// A runtime-agnostic port of Node's `url.pathToFileURL`, built on the global +// `URL` (available in Node, browsers, Deno and Bun) so the resolver does not +// depend on the Node `url` builtin. It is the inverse of `./fileURLToPath` and +// takes the same `windows` option to force the platform branch. +// +// Unlike Node's version this does not call `path.resolve` on the input: the +// resolver only ever converts paths it has already made absolute, and reaching +// for the current working directory would not work in a browser. + +const percentRegEx = /%/g; +const backslashRegEx = /\\/g; +const newlineRegEx = /\n/g; +const carriageReturnRegEx = /\r/g; +const tabRegEx = /\t/g; + +const isWindows = + typeof process !== "undefined" && process.platform === "win32"; + +/** + * Percent-encode the characters the `URL` pathname setter would otherwise + * interpret. Everything else is left to the setter itself. + * @param {string} filepath absolute filesystem path + * @param {boolean} windows true to follow the Windows branch + * @returns {string} the encoded path + */ +function encodePathChars(filepath, windows) { + if (filepath.includes("%")) { + filepath = filepath.replace(percentRegEx, "%25"); + } + // A backslash is a legal character in a POSIX file name, so it has to be + // encoded rather than treated as a separator. + if (!windows && filepath.includes("\\")) { + filepath = filepath.replace(backslashRegEx, "%5C"); + } + if (filepath.includes("\n")) { + filepath = filepath.replace(newlineRegEx, "%0A"); + } + if (filepath.includes("\r")) { + filepath = filepath.replace(carriageReturnRegEx, "%0D"); + } + if (filepath.includes("\t")) { + filepath = filepath.replace(tabRegEx, "%09"); + } + return filepath; +} + +/** + * @param {string} filepath an absolute filesystem path + * @param {{ windows?: boolean }=} options force the platform branch + * @returns {URL} the `file:` URL + */ +function pathToFileURL(filepath, options) { + const windows = + options && options.windows !== undefined ? options.windows : isWindows; + + if (windows && filepath.startsWith("\\\\")) { + // UNC path: `\\server\share\file` becomes `file://server/share/file`. + const hostnameEndIndex = filepath.indexOf("\\", 2); + if (hostnameEndIndex === -1) { + throw new TypeError( + `Missing UNC resource path in file path '${filepath}'`, + ); + } + if (hostnameEndIndex === 2) { + throw new TypeError(`Empty UNC servername in file path '${filepath}'`); + } + const url = new URL("file://"); + url.hostname = filepath.slice(2, hostnameEndIndex); + url.pathname = encodePathChars( + filepath.slice(hostnameEndIndex).replace(backslashRegEx, "/"), + windows, + ); + return url; + } + + const url = new URL("file://"); + url.pathname = encodePathChars(filepath, windows); + return url; +} + +module.exports = pathToFileURL; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/process-browser.js b/e-commerce/node_modules/enhanced-resolve/lib/util/process-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..95f8d5e0e7e9c08ca75db0745b7b7dd0af92596f --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/process-browser.js @@ -0,0 +1,23 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +module.exports = { + /** + * @type {Record} + */ + versions: {}, + // eslint-disable-next-line jsdoc/reject-function-type + /** @param {Function} fn function */ + nextTick(fn) { + // eslint-disable-next-line prefer-rest-params + const args = Array.prototype.slice.call(arguments, 1); + Promise.resolve().then(() => { + // eslint-disable-next-line prefer-spread + fn.apply(null, args); + }); + }, +}; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/strip-json-comments.js b/e-commerce/node_modules/enhanced-resolve/lib/util/strip-json-comments.js new file mode 100644 index 0000000000000000000000000000000000000000..5096f8bb0e35251e64b4882d1a1298dc83db5406 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/strip-json-comments.js @@ -0,0 +1,177 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Natsu @xiaoxiaojx + + This file contains code ported from strip-json-comments: + https://github.com/sindresorhus/strip-json-comments + Original license: MIT + Original author: Sindre Sorhus +*/ + +"use strict"; + +/** + * @typedef {object} StripJsonCommentsOptions + * @property {boolean=} whitespace Replace comments with whitespace + * @property {boolean=} trailingCommas Strip trailing commas + */ + +const singleComment = Symbol("singleComment"); +const multiComment = Symbol("multiComment"); + +/** + * Strip without whitespace (returns empty string) + * @param {string} _string Unused + * @param {number} _start Unused + * @param {number} _end Unused + * @returns {string} Empty string for all input + */ +const stripWithoutWhitespace = (_string, _start, _end) => ""; + +/** + * Replace all characters except ASCII spaces, tabs and line endings with regular spaces to ensure valid JSON output. + * @param {string} string String to process + * @param {number} start Start index + * @param {number} end End index + * @returns {string} Processed string with comments replaced by whitespace + */ +const stripWithWhitespace = (string, start, end) => + string.slice(start, end).replace(/[^ \t\r\n]/g, " "); + +/** + * Check if a quote is escaped + * @param {string} jsonString JSON string + * @param {number} quotePosition Position of the quote + * @returns {boolean} True if the quote at the given position is escaped + */ +const isEscaped = (jsonString, quotePosition) => { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === "\\") { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +}; + +/** + * Strip comments from JSON string + * @param {string} jsonString JSON string with potential comments + * @param {StripJsonCommentsOptions} options Options + * @returns {string} JSON string without comments + */ +function stripJsonComments( + jsonString, + { whitespace = true, trailingCommas = false } = {}, +) { + if (typeof jsonString !== "string") { + throw new TypeError( + `Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``, + ); + } + + const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace; + + let isInsideString = false; + /** @type {false | typeof singleComment | typeof multiComment} */ + let isInsideComment = false; + let offset = 0; + let buffer = ""; + let result = ""; + let commaIndex = -1; + + for (let index = 0; index < jsonString.length; index++) { + const currentCharacter = jsonString[index]; + const nextCharacter = jsonString[index + 1]; + + if (!isInsideComment && currentCharacter === '"') { + // Enter or exit string + const escaped = isEscaped(jsonString, index); + if (!escaped) { + isInsideString = !isInsideString; + } + } + + if (isInsideString) { + continue; + } + + if (!isInsideComment && currentCharacter + nextCharacter === "//") { + // Enter single-line comment + buffer += jsonString.slice(offset, index); + offset = index; + isInsideComment = singleComment; + index++; + } else if ( + isInsideComment === singleComment && + currentCharacter + nextCharacter === "\r\n" + ) { + // Exit single-line comment via \r\n + index++; + isInsideComment = false; + buffer += strip(jsonString, offset, index); + offset = index; + continue; + } else if (isInsideComment === singleComment && currentCharacter === "\n") { + // Exit single-line comment via \n + isInsideComment = false; + buffer += strip(jsonString, offset, index); + offset = index; + } else if (!isInsideComment && currentCharacter + nextCharacter === "/*") { + // Enter multiline comment + buffer += jsonString.slice(offset, index); + offset = index; + isInsideComment = multiComment; + index++; + continue; + } else if ( + isInsideComment === multiComment && + currentCharacter + nextCharacter === "*/" + ) { + // Exit multiline comment + index++; + isInsideComment = false; + buffer += strip(jsonString, offset, index + 1); + offset = index + 1; + continue; + } else if (trailingCommas && !isInsideComment) { + if (commaIndex !== -1) { + if (currentCharacter === "}" || currentCharacter === "]") { + // Strip trailing comma + buffer += jsonString.slice(offset, index); + result += strip(buffer, 0, 1) + buffer.slice(1); + buffer = ""; + offset = index; + commaIndex = -1; + } else if ( + currentCharacter !== " " && + currentCharacter !== "\t" && + currentCharacter !== "\r" && + currentCharacter !== "\n" + ) { + // Hit non-whitespace following a comma; comma is not trailing + buffer += jsonString.slice(offset, index); + offset = index; + commaIndex = -1; + } + } else if (currentCharacter === ",") { + // Flush buffer prior to this point, and save new comma index + result += buffer + jsonString.slice(offset, index); + buffer = ""; + offset = index; + commaIndex = index; + } + } + } + + const remaining = + isInsideComment === singleComment + ? strip(jsonString, offset, jsonString.length) + : jsonString.slice(offset); + + return result + buffer + remaining; +} + +module.exports = stripJsonComments; diff --git a/e-commerce/node_modules/enhanced-resolve/lib/util/url-browser.js b/e-commerce/node_modules/enhanced-resolve/lib/util/url-browser.js new file mode 100644 index 0000000000000000000000000000000000000000..3c23373e27a79e25d0c29a6114bdecb4afab6677 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/lib/util/url-browser.js @@ -0,0 +1,14 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php +*/ + +"use strict"; + +// Browser shim for the Node `url` builtin, providing the `fileURLToPath` the +// resolver uses. Node, Deno and Bun use the native `url` (so they get the fully +// correct implementation); only browser bundles use this, wired in through the +// package `browser` field. The implementation is a URL-based port — see +// ./fileURLToPath. +module.exports = { + fileURLToPath: require("./fileURLToPath"), +}; diff --git a/e-commerce/node_modules/enhanced-resolve/package.json b/e-commerce/node_modules/enhanced-resolve/package.json new file mode 100644 index 0000000000000000000000000000000000000000..275e83aecb1c6ba04974ed1d844e902612b546eb --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/package.json @@ -0,0 +1,84 @@ +{ + "name": "enhanced-resolve", + "version": "5.26.0", + "description": "Offers a async require.resolve function. It's highly configurable.", + "homepage": "https://github.com/webpack/enhanced-resolve#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/enhanced-resolve.git" + }, + "license": "MIT", + "author": "Tobias Koppers @sokra", + "main": "lib/index.js", + "browser": { + "process": "./lib/util/process-browser.js", + "module": "./lib/util/module-browser.js", + "path": "./lib/util/path-browser.js", + "url": "./lib/util/url-browser.js", + "graceful-fs": "./lib/util/graceful-fs-browser.js" + }, + "types": "types.d.ts", + "files": [ + "lib", + "types", + "types.d.ts", + "LICENSE" + ], + "scripts": { + "prepare": "husky", + "lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run fmt:check && npm run lint:spellcheck", + "lint:code": "eslint --cache .", + "lint:types": "tsc", + "lint:types-test": "tsc -p tsconfig.types.test.json", + "lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"", + "fmt": "npm run fmt:base -- --log-level warn --write", + "fmt:check": "npm run fmt:base -- --check", + "fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .", + "fix": "npm run fix:code && npm run build:types", + "fix:code": "npm run lint:code -- --fix", + "build:types": "node -e \"require('fs').rmSync('types', { recursive: true, force: true })\" && tsc -p tsconfig.types.json && prettier --log-level warn --write \"types/**/*.d.ts\"", + "type-report": "rimraf coverage && npm run cover:types && npm run cover:report && open-cli coverage/lcov-report/index.html", + "pretest": "npm run lint", + "test": "npm run test:only", + "test:only": "node scripts/test.js", + "test:watch": "node scripts/test.js --watch", + "test:coverage": "node scripts/test.js --experimental-test-coverage --test-coverage-include=\"lib/**\" --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info", + "test:browser": "node --experimental-vm-modules test/smoke/browser-run.cjs", + "version": "changeset version", + "release": "changeset publish", + "benchmark": "node --max-old-space-size=4096 --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./benchmark/run.mjs" + }, + "lint-staged": { + "*.{js,cjs,mjs}": [ + "eslint --cache --fix" + ], + "*": [ + "prettier --cache --write --ignore-unknown", + "cspell --cache --no-must-find-files" + ] + }, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "devDependencies": { + "@changesets/cli": "^3.0.2", + "@changesets/get-github-info": "^1.0.1", + "@codspeed/core": "^5.7.1", + "@types/graceful-fs": "^4.1.6", + "@types/node": "^24.10.4", + "cspell": "^10.0.0", + "eslint": "^9.39.2", + "eslint-config-webpack": "^4.9.5", + "husky": "^9.1.7", + "lint-staged": "^17.0.4", + "memfs": "^4.56.11", + "prettier": "^3.7.4", + "tinybench": "^6.0.0", + "typescript": "^6.0.2", + "webpack": "^5.107.2" + }, + "engines": { + "node": ">=10.13.0" + } +} diff --git a/e-commerce/node_modules/enhanced-resolve/types.d.ts b/e-commerce/node_modules/enhanced-resolve/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8ec3d3b0b266256edbc9e6950c7f89c0e7e71ca --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types.d.ts @@ -0,0 +1,9 @@ +/* + * The type declarations are generated from the JSDoc in `lib/` and live in + * `types/`. This file re-exports the entry point so that the `types` field and + * any direct reference to `enhanced-resolve/types.d.ts` keep resolving. + */ + +import resolve = require("./types/index"); + +export = resolve; diff --git a/e-commerce/node_modules/enhanced-resolve/types/AliasFieldPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/AliasFieldPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6ce2047b431c7e2f74ad0740223cac815893ddd --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/AliasFieldPlugin.d.ts @@ -0,0 +1,41 @@ +export = AliasFieldPlugin; +declare class AliasFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} field field + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + field: string | string[], + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + field: string | string[]; + target: string | import("./Resolver").ResolveStepHook; + /** @type {WeakMap} */ + _fieldDataCache: WeakMap< + import("./Resolver").JsonObject, + | { + [k: string]: JsonPrimitive; + } + | typeof NO_FIELD_OBJECT + >; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace AliasFieldPlugin { + export { Resolver, JsonPrimitive, ResolveRequest, ResolveStepHook }; +} +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +declare const NO_FIELD_OBJECT: unique symbol; +type Resolver = import("./Resolver"); +type JsonPrimitive = import("./Resolver").JsonPrimitive; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/AliasPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/AliasPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2aa176610a8add7c0123e77f07d302c9d26361a8 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/AliasPlugin.d.ts @@ -0,0 +1,32 @@ +export = AliasPlugin; +declare class AliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {AliasOption | AliasOption[]} options options + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + options: AliasOption | AliasOption[], + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + options: AliasOption[]; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace AliasPlugin { + export { Resolver, ResolveStepHook, Alias, AliasOption }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type Alias = string | string[] | false; +type AliasOption = { + alias: Alias; + name: string; + onlyModule?: boolean; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/AliasUtils.d.ts b/e-commerce/node_modules/enhanced-resolve/types/AliasUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2bf58f314051b62dfc060eaa62e450d4633008c9 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/AliasUtils.d.ts @@ -0,0 +1,128 @@ +export type InnerCallback = ( + err?: null | Error, + result?: null | ResolveRequest, +) => void; +export type Resolver = import("./Resolver"); +export type ResolveRequest = import("./Resolver").ResolveRequest; +export type ResolveContext = import("./Resolver").ResolveContext; +export type ResolveStepHook = import("./Resolver").ResolveStepHook; +export type ResolveCallback = import("./Resolver").ResolveCallback; +export type Alias = string | string[] | false; +export type AliasOption = { + alias: Alias; + name: string; + onlyModule?: boolean; +}; +export type CompiledAliasOption = { + /** + * original alias name + */ + name: string; + /** + * name + "/" — precomputed to avoid per-resolve concat + */ + nameWithSlash: string; + /** + * alias target(s) + */ + alias: Alias; + /** + * normalized onlyModule flag + */ + onlyModule: boolean; + /** + * absolute form of `name` (with slash ending), null when not absolute + */ + absolutePath: string | null; + /** + * substring before the single "*" in `name`, null when no wildcard + */ + wildcardPrefix: string | null; + /** + * substring after the single "*" in `name`, null when no wildcard + */ + wildcardSuffix: string | null; + /** + * first character code of `name` — used as a cheap screen on the hot path. `-1` indicates "matches any first char" (empty wildcard prefix). + */ + firstCharCode: number; + /** + * true when `alias` is an array — precomputed so the hot path skips `Array.isArray` + */ + arrayAlias: boolean; +}; +/** + * Bucketed view of compiled options used by `aliasResolveHandler` to avoid + * walking the full option list on every resolve. The `all` array preserves + * the legacy linear order (declaration order) for the fallback path. The + * `byFirstChar` map buckets options by the first char code of their `name` + * — each bucket preserves declaration order among its members. The + * `hasAnyFirstChar` flag is true when at least one option matches any + * first char (`firstCharCode === -1`), in which case resolve-time scans + * fall back to `all` to keep declaration-order semantics across buckets. + * The `useBuckets` flag is true only when bucketing would actually help — + * i.e. there are at least 2 distinct first chars AND no empty-prefix + * wildcard. When false, the resolve hot path skips the `Map.get` and + * iterates `all` directly with the per-option first-char-code screen + * (matching the pre-bucketing behavior). This avoids paying for `Map.get` + * on degenerate single-bucket lists like a long chain of aliases that + * all share one first char — the bucket lookup adds overhead without + * narrowing the candidate set, which showed up as a transient-memory + * regression on `pathological-deep-stack`. + */ +export type CompiledAliasOptions = { + /** + * declaration-ordered list + */ + all: CompiledAliasOption[]; + /** + * bucketed by first char code + */ + byFirstChar: Map; + /** + * true when an empty-prefix wildcard is present + */ + hasAnyFirstChar: boolean; + /** + * true when the bucket fast-path should be used at resolve time + */ + useBuckets: boolean; +}; +/** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */ +/** + * @param {Resolver} resolver resolver + * @param {CompiledAliasOptions} options compiled options + * @param {ResolveStepHook} target target + * @param {ResolveRequest} request request + * @param {ResolveContext} resolveContext resolve context + * @param {InnerCallback} callback callback + * @returns {void} + */ +export function aliasResolveHandler( + resolver: Resolver, + options: CompiledAliasOptions, + target: ResolveStepHook, + request: ResolveRequest, + resolveContext: ResolveContext, + callback: InnerCallback, +): void; +/** + * Precompute per-option strings used on every resolve so the hot path in + * `aliasResolveHandler` does no string concatenation / split work per entry. + * Called once per plugin apply — the returned structure is stable for the + * lifetime of the resolver. + * + * Beyond the per-option precompute step, this also partitions the list into + * a `byFirstChar` map so that, when no "empty-prefix" wildcards are + * present, the resolve-time scan only walks options whose `name` starts + * with the same char as the current request. For large alias lists (300+ + * entries) this turns an O(N) screen into O(K) where K is the bucket size + * for the request's first char. + * @param {Resolver} resolver resolver + * @param {AliasOption[]} options options + * @returns {CompiledAliasOptions} compiled options + */ +export function compileAliasOptions( + resolver: Resolver, + options: AliasOption[], +): CompiledAliasOptions; diff --git a/e-commerce/node_modules/enhanced-resolve/types/AppendPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/AppendPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97fcf625deef8dff8a640a2fedc548e602d5e448 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/AppendPlugin.d.ts @@ -0,0 +1,27 @@ +export = AppendPlugin; +declare class AppendPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} appending appending + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + appending: string, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + appending: string; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace AppendPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/CachedInputFileSystem.d.ts b/e-commerce/node_modules/enhanced-resolve/types/CachedInputFileSystem.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65f50c022e9ef71f7a835d7e5fdfe6c0ce1769ba --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/CachedInputFileSystem.d.ts @@ -0,0 +1,224 @@ +export = CachedInputFileSystem; +declare class CachedInputFileSystem { + /** + * @param {BaseFileSystem} fileSystem file system + * @param {number} duration duration in ms files are cached + */ + constructor(fileSystem: BaseFileSystem, duration: number); + fileSystem: BaseFileSystem; + _lstatBackend: OperationMergerBackend | CacheBackend; + lstat: import("./Resolver").LStat | undefined; + lstatSync: import("./Resolver").LStatSync | undefined; + _statBackend: OperationMergerBackend | CacheBackend; + stat: import("./Resolver").Stat; + statSync: import("./Resolver").StatSync; + _readdirBackend: OperationMergerBackend | CacheBackend; + readdir: import("./Resolver").Readdir; + readdirSync: import("./Resolver").ReaddirSync; + _readFileBackend: OperationMergerBackend | CacheBackend; + readFile: import("./Resolver").ReadFile; + readFileSync: import("./Resolver").ReadFileSync; + _readJsonBackend: OperationMergerBackend | CacheBackend; + readJson: import("./Resolver").ReadJson | undefined; + readJsonSync: import("./Resolver").ReadJsonSync | undefined; + _readlinkBackend: OperationMergerBackend | CacheBackend; + readlink: import("./Resolver").Readlink; + readlinkSync: import("./Resolver").ReadlinkSync; + _realpathBackend: OperationMergerBackend | CacheBackend; + realpath: import("./Resolver").RealPath | undefined; + realpathSync: import("./Resolver").RealPathSync | undefined; + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + * @param {{ exact?: boolean }=} options options; `exact: true` removes only cache entries whose key matches `what` exactly instead of any entry whose key starts with `what` + */ + purge( + what?: + | ( + | string + | Buffer + | URL + | number + | (string | URL | Buffer | number)[] + | Set + ) + | undefined, + options?: + | { + exact?: boolean; + } + | undefined, + ): void; +} +declare namespace CachedInputFileSystem { + export { + FileSystem, + PathLike, + PathOrFileDescriptor, + SyncFileSystem, + BaseFileSystem, + FileSystemCallback, + EXPECTED_FUNCTION, + EXPECTED_ANY, + Provide, + }; +} +declare class OperationMergerBackend { + /** + * @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method in filesystem + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor( + provider: EXPECTED_FUNCTION | undefined, + syncProvider: EXPECTED_FUNCTION | undefined, + providerContext: BaseFileSystem, + ); + _provider: Function | undefined; + _syncProvider: Function | undefined; + _providerContext: BaseFileSystem; + _activeAsyncOperations: Map; + provide: + | (( + path: PathLike | PathOrFileDescriptor, + options: object | FileSystemCallback | undefined, + callback?: FileSystemCallback | undefined, + ) => EXPECTED_ANY) + | null; + provideSync: + | (( + path: PathLike | PathOrFileDescriptor, + options?: object | undefined, + ) => EXPECTED_ANY) + | null; + purge(): void; + purgeParent(): void; +} +/** + * @callback Provide + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ +declare class CacheBackend { + /** + * @param {number} duration max cache duration of items + * @param {EXPECTED_FUNCTION | undefined} provider async method + * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method + * @param {BaseFileSystem} providerContext call context for the provider methods + */ + constructor( + duration: number, + provider: EXPECTED_FUNCTION | undefined, + syncProvider: EXPECTED_FUNCTION | undefined, + providerContext: BaseFileSystem, + ); + _duration: number; + _provider: Function | undefined; + _syncProvider: Function | undefined; + _providerContext: BaseFileSystem; + /** @type {Map[]>} */ + _activeAsyncOperations: Map[]>; + /** @type {Map }>} */ + _data: Map< + string, + { + err: Error | null; + result?: EXPECTED_ANY; + level: Set; + } + >; + /** @type {Set[]} */ + _levels: Set[]; + _currentLevel: number; + _tickInterval: number; + /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ + _mode: 0 | 1 | 2; + /** @type {NodeJS.Timeout | undefined} */ + _timeout: NodeJS.Timeout | undefined; + /** @type {number | undefined} */ + _nextDecay: number | undefined; + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @param {FileSystemCallback} callback callback + * @returns {void} + */ + provide( + path: PathLike | PathOrFileDescriptor, + options: EXPECTED_ANY, + callback: FileSystemCallback, + ): void; + /** + * @param {PathLike | PathOrFileDescriptor} path path + * @param {EXPECTED_ANY} options options + * @returns {EXPECTED_ANY} result + */ + provideSync( + path: PathLike | PathOrFileDescriptor, + options: EXPECTED_ANY, + ): EXPECTED_ANY; + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + * @param {{ exact?: boolean }=} options options; `exact: true` removes only entries whose key matches `what` exactly instead of any entry whose key starts with `what` + */ + purge( + what?: + | ( + | string + | Buffer + | URL + | number + | (string | URL | Buffer | number)[] + | Set + ) + | undefined, + options?: + | { + exact?: boolean; + } + | undefined, + ): void; + /** + * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge + */ + purgeParent( + what?: + | ( + | string + | Buffer + | URL + | number + | (string | URL | Buffer | number)[] + | Set + ) + | undefined, + ): void; + /** + * @param {string} path path + * @param {Error | null} err error + * @param {EXPECTED_ANY} result result + */ + _storeResult(path: string, err: Error | null, result: EXPECTED_ANY): void; + _decayLevel(): void; + _runDecays(): void; + _enterAsyncMode(): void; + _enterSyncModeWhenIdle(): void; + _enterIdleMode(): void; +} +type FileSystem = import("./Resolver").FileSystem; +type PathLike = import("./Resolver").PathLike; +type PathOrFileDescriptor = import("./Resolver").PathOrFileDescriptor; +type SyncFileSystem = import("./Resolver").SyncFileSystem; +type BaseFileSystem = FileSystem & SyncFileSystem; +/** + * + */ +type FileSystemCallback = import("./Resolver").FileSystemCallback; +type EXPECTED_FUNCTION = Function; +type EXPECTED_ANY = any; +type Provide = ( + path: PathLike | PathOrFileDescriptor, + options: EXPECTED_ANY, + callback: FileSystemCallback, +) => void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/CloneBasenamePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/CloneBasenamePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a0b852d967d98ac2118d3a77373952bbe823812b --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/CloneBasenamePlugin.d.ts @@ -0,0 +1,24 @@ +export = CloneBasenamePlugin; +declare class CloneBasenamePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace CloneBasenamePlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ConditionalPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ConditionalPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3c70e10c79744d178eebabba4207dc1d5d4fbe2 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ConditionalPlugin.d.ts @@ -0,0 +1,33 @@ +export = ConditionalPlugin; +declare class ConditionalPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} test compare object + * @param {string | null} message log message + * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + test: Partial, + message: string | null, + allowAlternatives: boolean, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + test: Partial; + message: string | null; + allowAlternatives: boolean; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ConditionalPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/DescriptionFilePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/DescriptionFilePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c063cd7e13ae1771aa961ebdbbfef812202fb6d1 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/DescriptionFilePlugin.d.ts @@ -0,0 +1,30 @@ +export = DescriptionFilePlugin; +declare class DescriptionFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string[]} filenames filenames + * @param {boolean} pathIsFile pathIsFile + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + filenames: string[], + pathIsFile: boolean, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + filenames: string[]; + pathIsFile: boolean; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace DescriptionFilePlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/DescriptionFileUtils.d.ts b/e-commerce/node_modules/enhanced-resolve/types/DescriptionFileUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2938564571510e99e9500633f0ce7fa607822bdc --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/DescriptionFileUtils.d.ts @@ -0,0 +1,83 @@ +export type Resolver = import("./Resolver"); +export type JsonObject = import("./Resolver").JsonObject; +export type JsonValue = import("./Resolver").JsonValue; +export type ResolveContext = import("./Resolver").ResolveContext; +export type ResolveRequest = import("./Resolver").ResolveRequest; +export type DescriptionFileInfo = { + /** + * content + */ + content?: JsonObject | undefined; + /** + * path + */ + path: string; + /** + * directory + */ + directory: string; +}; +export type ErrorFirstCallback = ( + error?: (Error | null) | undefined, + result?: DescriptionFileInfo | undefined, +) => any; +export type Result = { + /** + * path to description file + */ + path: string; + /** + * directory of description file + */ + directory: string; + /** + * content of description file + */ + content: JsonObject; +}; +/** + * Walk up one directory. Called once per package-root candidate and once per + * `described-resolve` (to find the enclosing description file), so it's on + * the resolver's hot path. + * + * Previous implementation called `lastIndexOf("/")` and `lastIndexOf("\\")` + * separately and then picked the larger. For any non-trivial directory + * string on POSIX, `lastIndexOf("\\")` scans the full string just to return + * -1. A single reverse char-code scan does the same work in one pass. + * + * Any single-character directory is treated as a root — `directory.length + * <= 1` collapses the `"/"`, `"\\"` and `""` branches into one compare. + * Without the `"\\"` case, `cdUp("\\")` (reached from a UNC root or a DOS + * device path like `\\?\…`) would return itself via `slice(0, i || 1)` + * and trap `loadDescriptionFile` in an infinite loop. Once single-char + * roots are filtered up front, the reverse scan always produces a + * strictly shorter string. + * @param {string} directory directory + * @returns {string | null} parent directory or null + */ +export function cdUp(directory: string): string | null; +/** + * @param {JsonObject} content content + * @param {string | string[]} field field + * @returns {JsonValue | undefined} field data + */ +export function getField( + content: JsonObject, + field: string | string[], +): JsonValue | undefined; +/** + * @param {Resolver} resolver resolver + * @param {string} directory directory + * @param {string[]} filenames filenames + * @param {DescriptionFileInfo | undefined} oldInfo oldInfo + * @param {ResolveContext} resolveContext resolveContext + * @param {ErrorFirstCallback} callback callback + */ +export function loadDescriptionFile( + resolver: Resolver, + directory: string, + filenames: string[], + oldInfo: DescriptionFileInfo | undefined, + resolveContext: ResolveContext, + callback: ErrorFirstCallback, +): void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/DirectoryExistsPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/DirectoryExistsPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..025b53ef295fd54c8d4d2dc4383eb14b38b437f4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/DirectoryExistsPlugin.d.ts @@ -0,0 +1,23 @@ +export = DirectoryExistsPlugin; +declare class DirectoryExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace DirectoryExistsPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ExportsFieldPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ExportsFieldPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84b5375d4b2d3d52edba56fffedb096a59a856fa --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ExportsFieldPlugin.d.ts @@ -0,0 +1,45 @@ +export = ExportsFieldPlugin; +declare class ExportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + * @param {boolean=} restrictions whether `restrictions` are configured (enables exports-target fallback when a target is filtered out) + */ + constructor( + source: string | ResolveStepHook, + conditionNames: Set, + fieldNamePath: string | string[], + target: string | ResolveStepHook, + restrictions?: boolean | undefined, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + conditionNames: Set; + fieldName: string | string[]; + restrictions: boolean; + /** @type {WeakMap} */ + _fieldProcessorCache: WeakMap; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ExportsFieldPlugin { + export { + Resolver, + JsonObject, + ResolveRequest, + ResolveStepHook, + ExportsField, + FieldProcessor, + }; +} +type Resolver = import("./Resolver"); +type JsonObject = import("./Resolver").JsonObject; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type ExportsField = import("./util/entrypoints").ExportsField; +type FieldProcessor = import("./util/entrypoints").FieldProcessor; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ExtensionAliasPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ExtensionAliasPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39b35495f7f7187ef75e97ffa48f7747bb08b385 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ExtensionAliasPlugin.d.ts @@ -0,0 +1,31 @@ +export = ExtensionAliasPlugin; +declare class ExtensionAliasPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {ExtensionAliasOption} options options + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + options: ExtensionAliasOption, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + options: ExtensionAliasOption; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ExtensionAliasPlugin { + export { Resolver, ResolveRequest, ResolveStepHook, ExtensionAliasOption }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type ExtensionAliasOption = { + alias: string | string[]; + extension: string; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/FileExistsPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/FileExistsPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4f7aeea99d64e96993f465a799ee96d986b7913 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/FileExistsPlugin.d.ts @@ -0,0 +1,23 @@ +export = FileExistsPlugin; +declare class FileExistsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace FileExistsPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ImportsFieldPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ImportsFieldPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..197d04b29e8eec23e30ef7f3fda0f2275067ba25 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ImportsFieldPlugin.d.ts @@ -0,0 +1,45 @@ +export = ImportsFieldPlugin; +declare class ImportsFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} conditionNames condition names + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} targetFile target file + * @param {string | ResolveStepHook} targetPackage target package + */ + constructor( + source: string | ResolveStepHook, + conditionNames: Set, + fieldNamePath: string | string[], + targetFile: string | ResolveStepHook, + targetPackage: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + targetFile: string | import("./Resolver").ResolveStepHook; + targetPackage: string | import("./Resolver").ResolveStepHook; + conditionNames: Set; + fieldName: string | string[]; + /** @type {WeakMap} */ + _fieldProcessorCache: WeakMap; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ImportsFieldPlugin { + export { + Resolver, + JsonObject, + ResolveRequest, + ResolveStepHook, + FieldProcessor, + ImportsField, + }; +} +type Resolver = import("./Resolver"); +type JsonObject = import("./Resolver").JsonObject; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type FieldProcessor = import("./util/entrypoints").FieldProcessor; +type ImportsField = import("./util/entrypoints").ImportsField; diff --git a/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPartPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPartPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2783403374fa30a17ed6923d05891d7cb2448b57 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPartPlugin.d.ts @@ -0,0 +1,24 @@ +export = JoinRequestPartPlugin; +declare class JoinRequestPartPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace JoinRequestPartPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9fe52697f3bdb52efffb6bfe4dc242edb1bb443 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/JoinRequestPlugin.d.ts @@ -0,0 +1,24 @@ +export = JoinRequestPlugin; +declare class JoinRequestPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace JoinRequestPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/LogInfoPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/LogInfoPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fe3d72aed0fce6c38e337ade022f9ac9eb1f6ae --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/LogInfoPlugin.d.ts @@ -0,0 +1,18 @@ +export = LogInfoPlugin; +declare class LogInfoPlugin { + /** + * @param {string | ResolveStepHook} source source + */ + constructor(source: string | ResolveStepHook); + source: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace LogInfoPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/MainFieldPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/MainFieldPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b311263006042d9e200804d31c558661876a6ea --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/MainFieldPlugin.d.ts @@ -0,0 +1,41 @@ +export = MainFieldPlugin; +declare class MainFieldPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {MainFieldOptions} options options + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + options: MainFieldOptions, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + options: MainFieldOptions; + target: string | import("./Resolver").ResolveStepHook; + /** @type {WeakMap} */ + _mainModuleCache: WeakMap; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace MainFieldPlugin { + export { + Resolver, + JsonObject, + ResolveRequest, + ResolveStepHook, + MainFieldOptions, + }; +} +declare const NO_MAIN: unique symbol; +type Resolver = import("./Resolver"); +type JsonObject = import("./Resolver").JsonObject; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type MainFieldOptions = { + name: string | string[]; + forceRelative: boolean; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierachicDirectoriesPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierachicDirectoriesPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c3094988062eed73155a25ad173eda8aab914b8 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierachicDirectoriesPlugin.d.ts @@ -0,0 +1,2 @@ +declare const _exports: typeof import("./ModulesInHierarchicalDirectoriesPlugin"); +export = _exports; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierarchicalDirectoriesPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierarchicalDirectoriesPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af501cee2d2f57393f9ea86a1188b6783576c61c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ModulesInHierarchicalDirectoriesPlugin.d.ts @@ -0,0 +1,26 @@ +export = ModulesInHierarchicalDirectoriesPlugin; +declare class ModulesInHierarchicalDirectoriesPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} directories directories + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + directories: string | string[], + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + directories: string[]; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ModulesInHierarchicalDirectoriesPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ModulesInRootPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ModulesInRootPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87a61fd343089b8b6718382beb0e2b822ac92ec6 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ModulesInRootPlugin.d.ts @@ -0,0 +1,27 @@ +export = ModulesInRootPlugin; +declare class ModulesInRootPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} path path + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + path: string, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + path: string; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ModulesInRootPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ModulesUtils.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ModulesUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a55bf73b356e31513498cc6f2f89b429b01ba6e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ModulesUtils.d.ts @@ -0,0 +1,25 @@ +export type Resolver = import("./Resolver"); +export type ResolveRequest = import("./Resolver").ResolveRequest; +export type ResolveStepHook = import("./Resolver").ResolveStepHook; +export type ResolveContext = import("./Resolver").ResolveContext; +export type InnerCallback = ( + err?: null | Error, + result?: null | ResolveRequest, +) => void; +/** + * @param {Resolver} resolver resolver + * @param {string[]} directories directories + * @param {ResolveStepHook} target target + * @param {ResolveRequest} request request + * @param {ResolveContext} resolveContext resolve context + * @param {InnerCallback} callback callback + * @returns {void} + */ +export function modulesResolveHandler( + resolver: Resolver, + directories: string[], + target: ResolveStepHook, + request: ResolveRequest, + resolveContext: ResolveContext, + callback: InnerCallback, +): void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/NextPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/NextPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a93aacc88985e2bf8d5b55c2b7fca5a8e4e70c4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/NextPlugin.d.ts @@ -0,0 +1,23 @@ +export = NextPlugin; +declare class NextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace NextPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/PackageMapPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/PackageMapPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76a3777d56700643f74d4f0781dbd62da32aa260 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/PackageMapPlugin.d.ts @@ -0,0 +1,85 @@ +export = PackageMapPlugin; +declare class PackageMapPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {PackageMapOptions} options package map options + * @param {boolean} symlinks whether the resolver resolves symlinks + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + options: PackageMapOptions, + symlinks: boolean, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + options: PackageMapOptions; + symlinks: boolean; + target: string | import("./Resolver").ResolveStepHook; + /** @type {PackageMap | undefined} */ + _packageMap: PackageMap | undefined; + /** @type {PackageMapCallback[] | undefined} */ + _pending: PackageMapCallback[] | undefined; + /** + * Read and parse the configuration file once, queueing every request that + * arrives while the read is in flight so a cold start does not re-read the + * same file for each of them. + * @param {Resolver} resolver the resolver + * @param {ResolveContext} resolveContext resolve context + * @param {PackageMapCallback} callback callback + * @returns {void} + */ + _getPackageMap( + resolver: Resolver, + resolveContext: ResolveContext, + callback: PackageMapCallback, + ): void; + /** + * Hand back the configuration file path package locations resolve against: + * its real path when the resolver follows symlinks, and the path as given + * otherwise. A configuration file whose real path cannot be read (it may not + * exist, or the file system may not implement it) is used as-is, so the + * read below reports the problem. + * @param {Resolver} resolver the resolver + * @param {(configFile: string) => void} callback callback + * @returns {void} + */ + _resolveConfigFile( + resolver: Resolver, + callback: (configFile: string) => void, + ): void; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace PackageMapPlugin { + export { + Resolver, + ResolveContext, + ResolveRequest, + ResolveStepHook, + PackageMap, + PackageMapPackages, + PackageMapOptions, + PackageMapCallback, + }; +} +type Resolver = import("./Resolver"); +type ResolveContext = import("./Resolver").ResolveContext; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type PackageMap = import("./util/packageMap").PackageMap; +type PackageMapPackages = import("./util/packageMap").PackageMapPackages; +type PackageMapOptions = { + /** + * absolute path of the configuration file, read lazily when `packages` is not given + */ + configFile: string; + /** + * an already-parsed `packages` object, used instead of reading `configFile` + */ + packages: PackageMapPackages | null; +}; +type PackageMapCallback = (err: Error | null, packageMap?: PackageMap) => void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ParsePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ParsePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..399750491dad83dc86fac3e32ecc8579ab3ff495 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ParsePlugin.d.ts @@ -0,0 +1,27 @@ +export = ParsePlugin; +declare class ParsePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Partial} requestOptions request options + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + requestOptions: Partial, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + requestOptions: Partial; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ParsePlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/PnpPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/PnpPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18e1109c6ecf086dbb7383f53b6255d6fea5e389 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/PnpPlugin.d.ts @@ -0,0 +1,42 @@ +export = PnpPlugin; +declare class PnpPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {PnpApiImpl} pnpApi pnpApi + * @param {string | ResolveStepHook} target target + * @param {string | ResolveStepHook} alternateTarget alternateTarget + */ + constructor( + source: string | ResolveStepHook, + pnpApi: PnpApiImpl, + target: string | ResolveStepHook, + alternateTarget: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + pnpApi: PnpApiImpl; + target: string | import("./Resolver").ResolveStepHook; + alternateTarget: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace PnpPlugin { + export { Resolver, ResolveStepHook, ResolveRequest, PnpApiImpl }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type ResolveRequest = import("./Resolver").ResolveRequest; +type PnpApiImpl = { + /** + * resolve to unqualified + */ + resolveToUnqualified: ( + packageName: string, + issuer: string, + options: { + considerBuiltins: boolean; + }, + ) => string | null; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/Resolver.d.ts b/e-commerce/node_modules/enhanced-resolve/types/Resolver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b88cd8cffde1a7e13e33f3bdd151fdd90a3b6f9 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/Resolver.d.ts @@ -0,0 +1,1545 @@ +export = Resolver; +declare class Resolver { + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {StackEntry=} parent previous tip of the stack + * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API + * @returns {StackEntry} stack entry + */ + static createStackEntry( + hook: ResolveStepHook, + request: ResolveRequest, + parent?: StackEntry | undefined, + preSeeded?: Set | undefined, + ): StackEntry; + /** + * @param {FileSystem} fileSystem a filesystem + * @param {ResolveOptions} options options + */ + constructor(fileSystem: FileSystem, options: ResolveOptions); + /** @type {FileSystem} */ + fileSystem: FileSystem; + /** @type {ResolveOptions} */ + options: ResolveOptions; + /** @type {PathCacheFunctions} */ + pathCache: PathCacheFunctions; + /** @type {KnownHooks} */ + hooks: KnownHooks; + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + ensureHook(name: string | ResolveStepHook): ResolveStepHook; + /** + * @param {string | ResolveStepHook} name hook name or hook itself + * @returns {ResolveStepHook} the hook + */ + getHook(name: string | ResolveStepHook): ResolveStepHook; + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} result + */ + resolveSync( + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext | undefined, + ): string | false; + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {string | false} result + */ + resolveSync( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext | undefined, + ): string | false; + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} result + */ + resolvePromise( + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext | undefined, + ): Promise; + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext=} resolveContext resolve context + * @returns {Promise} result + */ + resolvePromise( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext | undefined, + ): Promise; + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + resolve( + parent: string | URL, + specifier: string | URL, + callback: ResolveCallback, + ): void; + /** + * @overload + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext} resolveContext resolve context + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + resolve( + parent: string | URL, + specifier: string | URL, + resolveContext: ResolveContext, + callback: ResolveCallback, + ): void; + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + resolve( + context: Context, + parent: string | URL, + specifier: string | URL, + callback: ResolveCallback, + ): void; + /** + * @overload + * @param {Context} context context information object + * @param {string | URL} parent context path or a `file:` URL + * @param {string | URL} specifier request string or a `file:` URL + * @param {ResolveContext} resolveContext resolve context + * @param {ResolveCallback} callback callback function + * @returns {void} + */ + resolve( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext: ResolveContext, + callback: ResolveCallback, + ): void; + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {null | string} message string + * @param {ResolveContext} resolveContext resolver context + * @param {(err?: null | Error, result?: ResolveRequest) => void} callback callback + * @returns {void} + */ + doResolve( + hook: ResolveStepHook, + request: ResolveRequest, + message: null | string, + resolveContext: ResolveContext, + callback: (err?: null | Error, result?: ResolveRequest) => void, + ): void; + /** + * @param {string} identifier identifier + * @returns {ParsedIdentifier} parsed identifier + */ + parse(identifier: string): ParsedIdentifier; + /** + * @param {string} path path + * @returns {boolean} true, if the path is a module + */ + isModule(path: string): boolean; + /** + * @param {string} path path + * @returns {boolean} true, if the path is private + */ + isPrivate(path: string): boolean; + /** + * @param {string} path a path + * @returns {boolean} true, if the path is a directory path + */ + isDirectory(path: string): boolean; + /** + * @param {string} path path + * @returns {string} normalized path + */ + normalize(path: string): string; + /** + * @param {string} path path + * @param {string} request request + * @returns {string} joined path + */ + join(path: string, request: string): string; + /** + * @param {string} path path + * @returns {string} parent directory + */ + dirname(path: string): string; + /** + * @param {string} path the path to evaluate + * @param {string=} suffix an extension to remove from the result + * @returns {string} the last portion of a path + */ + basename(path: string, suffix?: string | undefined): string; +} +declare namespace Resolver { + export { + ResolveContext, + ResolveStepHook, + KnownHooks, + EnsuredHooks, + AliasOption, + CachedJoin, + CachedDirname, + CachedBasename, + JoinCacheEntry, + DirnameCacheEntry, + BasenameCacheEntry, + PathCacheFunctions, + ResolveOptions, + KnownContext, + Context, + ErrorWithDetail, + ResolveCallback, + PossibleFileSystemError, + FileSystemCallback, + PathLike, + PathOrFileDescriptor, + ObjectEncodingOptions, + EncodingOption, + StringCallback, + BufferCallback, + StringOrBufferCallback, + StatsCallback, + BigIntStatsCallback, + StatsOrBigIntStatsCallback, + ReadJsonCallback, + IStatsBase, + IStats, + IBigIntStats, + Dirent, + StatOptions, + StatSyncOptions, + ReadFile, + BufferEncodingOption, + ReadFileSync, + Readdir, + ReaddirSync, + ReadJson, + ReadJsonSync, + Readlink, + ReadlinkSync, + LStat, + LStatSync, + Stat, + StatSync, + RealPath, + RealPathSync, + FileSystem, + SyncFileSystem, + ParsedIdentifier, + JsonPrimitive, + JsonArray, + JsonValue, + JsonObject, + TsconfigPathsMap, + TsconfigPathsData, + BaseResolveRequest, + ResolveRequest, + WriteOnlySet, + ResolveContextYield, + }; +} +/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ +/** + * @typedef {object} KnownContext + * @property {string[]=} environments environments + * @property {string=} packageId package id of the importing file in the package map, propagated from a previous result to disambiguate package entries that share a location (`@experimental`, see the `packageMap` option) + */ +/** @typedef {KnownContext & Record} Context */ +/** @typedef {Error & { details?: string }} ErrorWithDetail */ +/** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */ +/** + * @typedef {object} PossibleFileSystemError + * @property {string=} code code + * @property {number=} errno number + * @property {string=} path path + * @property {string=} syscall syscall + */ +/** + * @template T + * @callback FileSystemCallback + * @param {PossibleFileSystemError & Error | null} err + * @param {T=} result + */ +/** + * @typedef {string | Buffer | URL} PathLike + */ +/** + * @typedef {PathLike | number} PathOrFileDescriptor + */ +/** + * @typedef {object} ObjectEncodingOptions + * @property {BufferEncoding | null | undefined=} encoding encoding + */ +/** + * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption + */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: string) => void} StringCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer) => void} BufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (string | Buffer)) => void} StringOrBufferCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IStats) => void} StatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: IBigIntStats) => void} BigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | null, result?: (IStats | IBigIntStats)) => void} StatsOrBigIntStatsCallback */ +/** @typedef {(err: NodeJS.ErrnoException | Error | null, result?: JsonObject) => void} ReadJsonCallback */ +/** + * @template T + * @typedef {object} IStatsBase + * @property {() => boolean} isFile is file + * @property {() => boolean} isDirectory is directory + * @property {() => boolean} isBlockDevice is block device + * @property {() => boolean} isCharacterDevice is character device + * @property {() => boolean} isSymbolicLink is symbolic link + * @property {() => boolean} isFIFO is FIFO + * @property {() => boolean} isSocket is socket + * @property {T} dev dev + * @property {T} ino ino + * @property {T} mode mode + * @property {T} nlink nlink + * @property {T} uid uid + * @property {T} gid gid + * @property {T} rdev rdev + * @property {T} size size + * @property {T} blksize blksize + * @property {T} blocks blocks + * @property {T} atimeMs atime ms + * @property {T} mtimeMs mtime ms + * @property {T} ctimeMs ctime ms + * @property {T} birthtimeMs birthtime ms + * @property {Date} atime atime + * @property {Date} mtime mtime + * @property {Date} ctime ctime + * @property {Date} birthtime birthtime + */ +/** + * @typedef {IStatsBase} IStats + */ +/** + * @typedef {IStatsBase & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats + */ +/** + * @template {string | Buffer} [T=string] + * @typedef {object} Dirent + * @property {() => boolean} isFile true when is file, otherwise false + * @property {() => boolean} isDirectory true when is directory, otherwise false + * @property {() => boolean} isBlockDevice true when is block device, otherwise false + * @property {() => boolean} isCharacterDevice true when is character device, otherwise false + * @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false + * @property {() => boolean} isFIFO true when is FIFO, otherwise false + * @property {() => boolean} isSocket true when is socket, otherwise false + * @property {T} name name + * @property {string} parentPath path + * @property {string=} path path + */ +/** + * @typedef {object} StatOptions + * @property {(boolean | undefined)=} bigint need bigint values + */ +/** + * @typedef {object} StatSyncOptions + * @property {(boolean | undefined)=} bigint need bigint values + * @property {(boolean | undefined)=} throwIfNoEntry throw if no entry + */ +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void, + * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void, + * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void, + * (path: PathOrFileDescriptor, callback: BufferCallback): void, + * }} ReadFile + */ +/** + * @typedef {"buffer" | { encoding: "buffer" }} BufferEncodingOption + */ +/** + * @typedef {{ + * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer, + * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string, + * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer, + * }} ReadFileSync + */ +/** + * @typedef {{ + * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, + * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer", callback: (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void): void, + * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void): void, + * (path: PathLike, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files?: Dirent[]) => void): void, + * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void, + * }} Readdir + */ +/** + * @typedef {{ + * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | null): string[], + * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer"): Buffer[], + * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[], + * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[], + * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }): Dirent[], + * }} ReaddirSync + */ +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor, callback: ReadJsonCallback) => void} ReadJson + */ +/** + * @typedef {(pathOrFileDescription: PathOrFileDescriptor) => JsonObject} ReadJsonSync + */ +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void, + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, + * (path: PathLike, callback: StringCallback): void, + * }} Readlink + */ +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string, + * (path: PathLike, options: BufferEncodingOption): Buffer, + * (path: PathLike, options?: EncodingOption): string | Buffer, + * }} ReadlinkSync + */ +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void, + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, + * }} LStat + */ +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, + * }} LStatSync + */ +/** + * @typedef {{ + * (path: PathLike, callback: StatsCallback): void, + * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, + * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, + * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, + * }} Stat + */ +/** + * @typedef {{ + * (path: PathLike, options?: undefined): IStats, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, + * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, + * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, + * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, + * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, + * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, + * }} StatSync + */ +/** + * @typedef {{ + * (path: PathLike, options: EncodingOption, callback: StringCallback): void, + * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, + * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, + * (path: PathLike, callback: StringCallback): void, + * }} RealPath + */ +/** + * @typedef {{ + * (path: PathLike, options?: EncodingOption): string, + * (path: PathLike, options: BufferEncodingOption): Buffer, + * (path: PathLike, options?: EncodingOption): string | Buffer, + * }} RealPathSync + */ +/** + * @typedef {object} FileSystem + * @property {ReadFile} readFile read file method + * @property {Readdir} readdir readdir method + * @property {ReadJson=} readJson read json method + * @property {Readlink} readlink read link method + * @property {LStat=} lstat lstat method + * @property {Stat} stat stat method + * @property {RealPath=} realpath realpath method + */ +/** + * @typedef {object} SyncFileSystem + * @property {ReadFileSync} readFileSync read file sync method + * @property {ReaddirSync} readdirSync read dir sync method + * @property {ReadJsonSync=} readJsonSync read json sync method + * @property {ReadlinkSync} readlinkSync read link sync method + * @property {LStatSync=} lstatSync lstat sync method + * @property {StatSync} statSync stat sync method + * @property {RealPathSync=} realpathSync real path sync method + */ +/** + * @typedef {object} ParsedIdentifier + * @property {string} request request + * @property {string} query query + * @property {string} fragment fragment + * @property {boolean} directory is directory + * @property {boolean} module is module + * @property {boolean} file is file + * @property {boolean} internal is internal + */ +/** @typedef {string | number | boolean | null} JsonPrimitive */ +/** @typedef {JsonValue[]} JsonArray */ +/** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ +/** @typedef {{ [Key in string]?: JsonValue | undefined }} JsonObject */ +/** + * @typedef {object} TsconfigPathsMap + * @property {TsconfigPathsData} main main tsconfig paths data + * @property {string} mainContext main tsconfig base URL (absolute path) + * @property {{ [baseUrl: string]: TsconfigPathsData }} refs referenced tsconfig paths data mapped by baseUrl + * @property {{ [context: string]: TsconfigPathsData }} allContexts all contexts (main + refs) for quick lookup + * @property {string[]} contextList precomputed `Object.keys(allContexts)` — read-only; used on the `_selectPathsDataForContext` hot path + * @property {Set} fileDependencies file dependencies + */ +/** + * @typedef {object} TsconfigPathsData + * @property {import("./AliasUtils").CompiledAliasOptions} alias tsconfig file data + * @property {string[]} modules tsconfig file data + */ +/** + * @typedef {object} BaseResolveRequest + * @property {string | false} path path + * @property {Context=} context content + * @property {string=} descriptionFilePath description file path + * @property {string=} descriptionFileRoot description file root + * @property {JsonObject=} descriptionFileData description file data + * @property {TsconfigPathsMap | null | undefined=} tsconfigPathsMap tsconfig paths map + * @property {string=} relativePath relative path + * @property {boolean=} ignoreSymlinks true when need to ignore symlinks, otherwise false + * @property {boolean=} fullySpecified true when full specified, otherwise false + * @property {string=} packageId package id the request was resolved to in the package map, to be propagated to resolutions made from the resulting file (`@experimental`, see the `packageMap` option) + * @property {string=} __innerRequest inner request for internal usage + * @property {string=} __innerRequest_request inner request for internal usage + * @property {string=} __innerRequest_relativePath inner relative path for internal usage + * @property {{ blocked: boolean }=} __restrictionsMarker internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring + */ +/** @typedef {BaseResolveRequest & Partial} ResolveRequest */ +/** + * @template T + * @typedef {{ add: (item: T) => void }} WriteOnlySet + */ +/** @typedef {(request: ResolveRequest) => void} ResolveContextYield */ +/** + * Singly-linked stack entry that also exposes a Set-like API + * (`has`, `size`, iteration). Each `doResolve` call prepends a new + * `StackEntry` that points at the previous tip via `.parent`, so pushing + * is O(1) in time and memory. Recursion detection walks the linked list + * (O(n)) but the stack is typically shallow, so this is cheaper overall + * than cloning a `Set` per call. + */ +declare class StackEntry { + /** + * @param {ResolveStepHook} hook hook + * @param {ResolveRequest} request request + * @param {StackEntry=} parent previous tip + * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API + */ + constructor( + hook: ResolveStepHook, + request: ResolveRequest, + parent?: StackEntry | undefined, + preSeeded?: Set | undefined, + ); + name: string | undefined; + path: string | false; + request: string; + query: string; + fragment: string; + directory: boolean; + module: boolean; + /** @type {StackEntry | undefined} */ + parent: StackEntry | undefined; + /** + * Strings seeded by callers that still pass `stack: new Set([...])`. + * Propagated through the chain so deeper `doResolve` calls still see + * them during recursion checks. `undefined` in the common case so + * there is no extra work on the hot path. + * @type {Set | undefined} + */ + preSeeded: Set | undefined; + /** + * Walk the linked list looking for an entry with the same request shape. + * Set-compatible: callers that used `stack.has(entry)` keep working. + * + * NOTE: kept monomorphic on purpose. An earlier draft accepted a string + * query too (so pre-5.21 plugins keeping their own `Set` of + * seen entries could probe the live stack with the formatted form), + * but adding the second shape regressed `doResolve`'s heap profile by + * ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic + * call-site state for `parent.has(stackEntry)` once `has` has two + * argument shapes. Plugins that need string membership can reach for + * `[...stack].find(e => e.includes(formattedString))` via the + * `String`-method proxies on `StackEntry` instead. + * @param {StackEntry} query entry to look for + * @returns {boolean} whether the stack already contains an equivalent entry + */ + has(query: StackEntry): boolean; + /** + * Number of entries on the stack (oldest-to-newest length). + * @returns {number} size + */ + get size(): number; + /** + * Human-readable form used in recursion error messages, logs, and the + * iterator above. Not memoized: caching would require an extra slot on + * every `StackEntry`, which costs heap even on resolves that never look + * at the formatted form. + * @returns {string} formatted entry + */ + toString(): string; + /** + * Iterate entries from oldest (root) to newest (tip), matching how a + * `Set` that was populated in insertion order would iterate. Pre-seeded + * legacy `Set` entries come first so error-message output stays + * ordered oldest-to-newest. + * + * Yields each entry as its formatted `toString()` form. Plugins written + * against the pre-5.21 `Set` shape — e.g. + * `[...resolveContext.stack].find(a => a.includes("module:"))` — keep + * working unchanged because each yielded value is a plain string with + * all of `String.prototype` available natively. Resolves that never + * iterate the stack pay nothing; iteration costs one `toString()` + * allocation per stack frame. + * @returns {IterableIterator} iterator + */ + [Symbol.iterator](): IterableIterator; +} +/** + * Resolve context + */ +type ResolveContext = { + /** + * directories that was found on file system + */ + contextDependencies?: WriteOnlySet | undefined; + /** + * files that was found on file system + */ + fileDependencies?: WriteOnlySet | undefined; + /** + * dependencies that was not found on file system + */ + missingDependencies?: WriteOnlySet | undefined; + /** + * tip of the resolver call stack (a singly-linked list with Set-like API). For instance, `resolve → parsedResolve → describedResolve`. Accepts a legacy `Set` for back-compat with older callers; it is normalized internally without a hot-path branch. + */ + stack?: (StackEntry | Set) | undefined; + /** + * log function + */ + log?: ((str: string) => void) | undefined; + /** + * yield result, if provided plugins can return several results + */ + yield?: ResolveContextYield | undefined; +}; +type ResolveStepHook = AsyncSeriesBailHook< + [ResolveRequest, ResolveContext], + ResolveRequest | null +>; +type KnownHooks = { + /** + * resolve step hook + */ + resolveStep: SyncHook<[ResolveStepHook, ResolveRequest], void>; + /** + * no resolve hook + */ + noResolve: SyncHook<[ResolveRequest, Error]>; + /** + * resolve hook + */ + resolve: ResolveStepHook; + /** + * result hook + */ + result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>; +}; +type EnsuredHooks = { + [key: string]: ResolveStepHook; +}; +type AliasOption = import("./AliasUtils").AliasOption; +type CachedJoin = import("./util/path").CachedJoin; +type CachedDirname = import("./util/path").CachedDirname; +type CachedBasename = import("./util/path").CachedBasename; +type JoinCacheEntry = { + /** + * cached join function + */ + fn: CachedJoin["fn"]; + /** + * the underlying cache map + */ + cache: CachedJoin["cache"]; +}; +type DirnameCacheEntry = { + /** + * cached dirname function + */ + fn: CachedDirname["fn"]; + /** + * the underlying cache map + */ + cache: CachedDirname["cache"]; +}; +type BasenameCacheEntry = { + /** + * cached dirname function + */ + fn: CachedBasename["fn"]; + /** + * the underlying cache map + */ + cache: CachedBasename["cache"]; +}; +type PathCacheFunctions = { + /** + * cached join + */ + join: JoinCacheEntry; + /** + * cached dirname + */ + dirname: DirnameCacheEntry; + /** + * cached basename + */ + basename: BasenameCacheEntry; +}; +type ResolveOptions = import("./ResolverFactory").ResolveOptions; +type KnownContext = { + /** + * environments + */ + environments?: string[] | undefined; + /** + * package id of the importing file in the package map, propagated from a previous result to disambiguate package entries that share a location (`@experimental`, see the `packageMap` option) + */ + packageId?: string | undefined; +}; +type Context = KnownContext & Record; +type ErrorWithDetail = Error & { + details?: string; +}; +type ResolveCallback = ( + err: ErrorWithDetail | null, + res?: string | false, + req?: ResolveRequest, +) => void; +type PossibleFileSystemError = { + /** + * code + */ + code?: string | undefined; + /** + * number + */ + errno?: number | undefined; + /** + * path + */ + path?: string | undefined; + /** + * syscall + */ + syscall?: string | undefined; +}; +type FileSystemCallback = ( + err: (PossibleFileSystemError & Error) | null, + result?: T | undefined, +) => any; +type PathLike = string | Buffer | URL; +type PathOrFileDescriptor = PathLike | number; +type ObjectEncodingOptions = { + /** + * encoding + */ + encoding?: (BufferEncoding | null | undefined) | undefined; +}; +type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; +type StringCallback = ( + err: NodeJS.ErrnoException | null, + result?: string, +) => void; +type BufferCallback = ( + err: NodeJS.ErrnoException | null, + result?: Buffer, +) => void; +type StringOrBufferCallback = ( + err: NodeJS.ErrnoException | null, + result?: string | Buffer, +) => void; +type StatsCallback = ( + err: NodeJS.ErrnoException | null, + result?: IStats, +) => void; +type BigIntStatsCallback = ( + err: NodeJS.ErrnoException | null, + result?: IBigIntStats, +) => void; +type StatsOrBigIntStatsCallback = ( + err: NodeJS.ErrnoException | null, + result?: IStats | IBigIntStats, +) => void; +type ReadJsonCallback = ( + err: NodeJS.ErrnoException | Error | null, + result?: JsonObject, +) => void; +type IStatsBase = { + /** + * is file + */ + isFile: () => boolean; + /** + * is directory + */ + isDirectory: () => boolean; + /** + * is block device + */ + isBlockDevice: () => boolean; + /** + * is character device + */ + isCharacterDevice: () => boolean; + /** + * is symbolic link + */ + isSymbolicLink: () => boolean; + /** + * is FIFO + */ + isFIFO: () => boolean; + /** + * is socket + */ + isSocket: () => boolean; + /** + * dev + */ + dev: T; + /** + * ino + */ + ino: T; + /** + * mode + */ + mode: T; + /** + * nlink + */ + nlink: T; + /** + * uid + */ + uid: T; + /** + * gid + */ + gid: T; + /** + * rdev + */ + rdev: T; + /** + * size + */ + size: T; + /** + * blksize + */ + blksize: T; + /** + * blocks + */ + blocks: T; + /** + * atime ms + */ + atimeMs: T; + /** + * mtime ms + */ + mtimeMs: T; + /** + * ctime ms + */ + ctimeMs: T; + /** + * birthtime ms + */ + birthtimeMs: T; + /** + * atime + */ + atime: Date; + /** + * mtime + */ + mtime: Date; + /** + * ctime + */ + ctime: Date; + /** + * birthtime + */ + birthtime: Date; +}; +type IStats = IStatsBase; +type IBigIntStats = IStatsBase & { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; +}; +type Dirent = { + /** + * true when is file, otherwise false + */ + isFile: () => boolean; + /** + * true when is directory, otherwise false + */ + isDirectory: () => boolean; + /** + * true when is block device, otherwise false + */ + isBlockDevice: () => boolean; + /** + * true when is character device, otherwise false + */ + isCharacterDevice: () => boolean; + /** + * true when is symbolic link, otherwise false + */ + isSymbolicLink: () => boolean; + /** + * true when is FIFO, otherwise false + */ + isFIFO: () => boolean; + /** + * true when is socket, otherwise false + */ + isSocket: () => boolean; + /** + * name + */ + name: T; + /** + * path + */ + parentPath: string; + /** + * path + */ + path?: string | undefined; +}; +type StatOptions = { + /** + * need bigint values + */ + bigint?: (boolean | undefined) | undefined; +}; +type StatSyncOptions = { + /** + * need bigint values + */ + bigint?: (boolean | undefined) | undefined; + /** + * throw if no entry + */ + throwIfNoEntry?: (boolean | undefined) | undefined; +}; +type ReadFile = { + ( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & import("events").Abortable) + | undefined + | null, + callback: BufferCallback, + ): void; + ( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & import("events").Abortable) + | BufferEncoding, + callback: StringCallback, + ): void; + ( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & import("events").Abortable) + | BufferEncoding + | undefined + | null, + callback: StringOrBufferCallback, + ): void; + (path: PathOrFileDescriptor, callback: BufferCallback): void; +}; +type BufferEncodingOption = + | "buffer" + | { + encoding: "buffer"; + }; +type ReadFileSync = { + ( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null, + ): Buffer; + ( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding, + ): string; + ( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null, + ): string | Buffer; +}; +type Readdir = { + ( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void, + ): void; + ( + path: PathLike, + options: + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | "buffer", + callback: (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void, + ): void; + ( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: ( + err: NodeJS.ErrnoException | null, + files?: string[] | Buffer[], + ) => void, + ): void; + ( + path: PathLike, + callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void, + ): void; + ( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: ( + err: NodeJS.ErrnoException | null, + files?: Dirent[], + ) => void, + ): void; + ( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: ( + err: NodeJS.ErrnoException | null, + files: Dirent[], + ) => void, + ): void; +}; +type ReaddirSync = { + ( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null, + ): string[]; + ( + path: PathLike, + options: + | { + encoding: "buffer"; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | "buffer", + ): Buffer[]; + ( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null, + ): string[] | Buffer[]; + ( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Dirent[]; + ( + path: PathLike, + options: { + encoding: "buffer"; + withFileTypes: true; + recursive?: boolean | undefined; + }, + ): Dirent[]; +}; +type ReadJson = ( + pathOrFileDescription: PathOrFileDescriptor, + callback: ReadJsonCallback, +) => void; +type ReadJsonSync = (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; +type Readlink = { + (path: PathLike, options: EncodingOption, callback: StringCallback): void; + ( + path: PathLike, + options: BufferEncodingOption, + callback: BufferCallback, + ): void; + ( + path: PathLike, + options: EncodingOption, + callback: StringOrBufferCallback, + ): void; + (path: PathLike, callback: StringCallback): void; +}; +type ReadlinkSync = { + (path: PathLike, options?: EncodingOption): string; + (path: PathLike, options: BufferEncodingOption): Buffer; + (path: PathLike, options?: EncodingOption): string | Buffer; +}; +type LStat = { + (path: PathLike, callback: StatsCallback): void; + ( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: StatsCallback, + ): void; + ( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: BigIntStatsCallback, + ): void; + ( + path: PathLike, + options: StatOptions | undefined, + callback: StatsOrBigIntStatsCallback, + ): void; +}; +type LStatSync = { + (path: PathLike, options?: undefined): IStats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + }, + ): IStats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + }, + ): IBigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + }, + ): IStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + }, + ): IBigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + }, + ): IStats | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): IStats | IBigIntStats | undefined; +}; +type Stat = { + (path: PathLike, callback: StatsCallback): void; + ( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: StatsCallback, + ): void; + ( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: BigIntStatsCallback, + ): void; + ( + path: PathLike, + options: StatOptions | undefined, + callback: StatsOrBigIntStatsCallback, + ): void; +}; +type StatSync = { + (path: PathLike, options?: undefined): IStats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + }, + ): IStats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + }, + ): IBigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + }, + ): IStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + }, + ): IBigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + }, + ): IStats | IBigIntStats; + ( + path: PathLike, + options?: StatSyncOptions, + ): IStats | IBigIntStats | undefined; +}; +type RealPath = { + (path: PathLike, options: EncodingOption, callback: StringCallback): void; + ( + path: PathLike, + options: BufferEncodingOption, + callback: BufferCallback, + ): void; + ( + path: PathLike, + options: EncodingOption, + callback: StringOrBufferCallback, + ): void; + (path: PathLike, callback: StringCallback): void; +}; +type RealPathSync = { + (path: PathLike, options?: EncodingOption): string; + (path: PathLike, options: BufferEncodingOption): Buffer; + (path: PathLike, options?: EncodingOption): string | Buffer; +}; +type FileSystem = { + /** + * read file method + */ + readFile: ReadFile; + /** + * readdir method + */ + readdir: Readdir; + /** + * read json method + */ + readJson?: ReadJson | undefined; + /** + * read link method + */ + readlink: Readlink; + /** + * lstat method + */ + lstat?: LStat | undefined; + /** + * stat method + */ + stat: Stat; + /** + * realpath method + */ + realpath?: RealPath | undefined; +}; +type SyncFileSystem = { + /** + * read file sync method + */ + readFileSync: ReadFileSync; + /** + * read dir sync method + */ + readdirSync: ReaddirSync; + /** + * read json sync method + */ + readJsonSync?: ReadJsonSync | undefined; + /** + * read link sync method + */ + readlinkSync: ReadlinkSync; + /** + * lstat sync method + */ + lstatSync?: LStatSync | undefined; + /** + * stat sync method + */ + statSync: StatSync; + /** + * real path sync method + */ + realpathSync?: RealPathSync | undefined; +}; +type ParsedIdentifier = { + /** + * request + */ + request: string; + /** + * query + */ + query: string; + /** + * fragment + */ + fragment: string; + /** + * is directory + */ + directory: boolean; + /** + * is module + */ + module: boolean; + /** + * is file + */ + file: boolean; + /** + * is internal + */ + internal: boolean; +}; +type JsonPrimitive = string | number | boolean | null; +type JsonArray = JsonValue[]; +type JsonValue = JsonPrimitive | JsonObject | JsonArray; +type JsonObject = { [Key in string]?: JsonValue | undefined }; +type TsconfigPathsMap = { + /** + * main tsconfig paths data + */ + main: TsconfigPathsData; + /** + * main tsconfig base URL (absolute path) + */ + mainContext: string; + /** + * referenced tsconfig paths data mapped by baseUrl + */ + refs: { + [baseUrl: string]: TsconfigPathsData; + }; + /** + * all contexts (main + refs) for quick lookup + */ + allContexts: { + [context: string]: TsconfigPathsData; + }; + /** + * precomputed `Object.keys(allContexts)` — read-only; used on the `_selectPathsDataForContext` hot path + */ + contextList: string[]; + /** + * file dependencies + */ + fileDependencies: Set; +}; +type TsconfigPathsData = { + /** + * tsconfig file data + */ + alias: import("./AliasUtils").CompiledAliasOptions; + /** + * tsconfig file data + */ + modules: string[]; +}; +type BaseResolveRequest = { + /** + * path + */ + path: string | false; + /** + * content + */ + context?: Context | undefined; + /** + * description file path + */ + descriptionFilePath?: string | undefined; + /** + * description file root + */ + descriptionFileRoot?: string | undefined; + /** + * description file data + */ + descriptionFileData?: JsonObject | undefined; + /** + * tsconfig paths map + */ + tsconfigPathsMap?: (TsconfigPathsMap | null | undefined) | undefined; + /** + * relative path + */ + relativePath?: string | undefined; + /** + * true when need to ignore symlinks, otherwise false + */ + ignoreSymlinks?: boolean | undefined; + /** + * true when full specified, otherwise false + */ + fullySpecified?: boolean | undefined; + /** + * package id the request was resolved to in the package map, to be propagated to resolutions made from the resulting file (`@experimental`, see the `packageMap` option) + */ + packageId?: string | undefined; + /** + * inner request for internal usage + */ + __innerRequest?: string | undefined; + /** + * inner request for internal usage + */ + __innerRequest_request?: string | undefined; + /** + * inner relative path for internal usage + */ + __innerRequest_relativePath?: string | undefined; + /** + * internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring + */ + __restrictionsMarker?: + | { + blocked: boolean; + } + | undefined; +}; +type ResolveRequest = BaseResolveRequest & Partial; +type WriteOnlySet = { + add: (item: T) => void; +}; +type ResolveContextYield = (request: ResolveRequest) => void; +import { AsyncSeriesBailHook } from "tapable"; +import { SyncHook } from "tapable"; +import { AsyncSeriesHook } from "tapable"; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ResolverFactory.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ResolverFactory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bad1977fed3f28c01cce6546ecc5f00abf13ad0e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ResolverFactory.d.ts @@ -0,0 +1,340 @@ +export function createResolver(options: UserResolveOptions): Resolver; +export type AliasOptionEntry = import("./AliasPlugin").AliasOption; +export type ExtensionAliasOption = + import("./ExtensionAliasPlugin").ExtensionAliasOption; +export type PackageMapOptions = import("./PackageMapPlugin").PackageMapOptions; +export type PackageMapPackages = import("./util/packageMap").PackageMapPackages; +export type PnpApi = import("./PnpPlugin").PnpApiImpl; +export type EnsuredHooks = import("./Resolver").EnsuredHooks; +export type FileSystem = import("./Resolver").FileSystem; +export type KnownHooks = import("./Resolver").KnownHooks; +export type ResolveRequest = import("./Resolver").ResolveRequest; +export type SyncFileSystem = import("./Resolver").SyncFileSystem; +export type Cache = import("./UnsafeCachePlugin").Cache; +export type AliasOptionNewRequest = string | string[] | false; +export type AliasOptions = { + [k: string]: AliasOptionNewRequest; +}; +export type UserAliasOptionNewRequest = string | URL | (string | URL)[] | false; +export type UserAliasOptions = { + [k: string]: UserAliasOptionNewRequest; +}; +export type UserAliasOptionEntry = { + alias: UserAliasOptionNewRequest; + name: string; + onlyModule?: boolean; +}; +export type ExtensionAliasOptions = { + [k: string]: string | string[]; +}; +export type Falsy = false | 0 | "" | null | undefined; +export type Plugin = + | { + apply: (resolver: Resolver) => void; + } + | ((this: Resolver, resolver: Resolver) => void) + | Falsy; +export type TsconfigOptions = { + /** + * A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file + */ + configFile?: string | undefined; + /** + * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths + */ + references?: (string[] | "auto") | undefined; + /** + * Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file + */ + baseUrl?: string | undefined; +}; +export type UserTsconfigOptions = { + /** + * A path, or `file:` URL, pointing at the tsconfig file + */ + configFile?: (string | URL) | undefined; + /** + * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths or `file:` URLs + */ + references?: ((string | URL)[] | "auto") | undefined; + /** + * Override baseUrl from tsconfig.json with a path or `file:` URL + */ + baseUrl?: (string | URL) | undefined; +}; +/** + * A Node.js package map (https://nodejs.org/api/packages.html#package-maps), + * either as the path of the configuration file or as its already-parsed + * contents. + */ +export type UserPackageMapOptions = { + /** + * A path, or `file:` `URL` instance, pointing at the package map file. Required together with `packages`, whose relative `url` values are resolved against it + */ + configFile?: (string | URL) | undefined; + /** + * An already-parsed `packages` object, used instead of reading `configFile` from disk + */ + packages?: PackageMapPackages | undefined; +}; +export type UserResolveOptions = { + /** + * A list of module alias configurations or an object which maps key to value + */ + alias?: (UserAliasOptions | UserAliasOptionEntry[]) | undefined; + /** + * A list of module alias configurations or an object which maps key to value, applied only after modules option + */ + fallback?: (UserAliasOptions | UserAliasOptionEntry[]) | undefined; + /** + * An object which maps extension to extension aliases + */ + extensionAlias?: ExtensionAliasOptions | undefined; + /** + * Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned); when enabled, matches TypeScript's behavior for packages that ship TS sources alongside compiled JS. + */ + extensionAliasForExports?: boolean | undefined; + /** + * A list of alias fields in description files + */ + aliasFields?: (string | string[])[] | undefined; + /** + * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. + */ + cachePredicate?: ((predicate: ResolveRequest) => boolean) | undefined; + /** + * Whether or not the unsafeCache should include request context as part of the cache key. + */ + cacheWithContext?: boolean | undefined; + /** + * A list of description files to read from + */ + descriptionFiles?: string[] | undefined; + /** + * A list of exports field condition names. + */ + conditionNames?: string[] | undefined; + /** + * Enforce that a extension from extensions must be used + */ + enforceExtension?: boolean | undefined; + /** + * A list of exports fields in description files + */ + exportsFields?: (string | string[])[] | undefined; + /** + * A list of imports fields in description files + */ + importsFields?: (string | string[])[] | undefined; + /** + * A list of extensions which should be tried for files + */ + extensions?: string[] | undefined; + /** + * The file system which should be used + */ + fileSystem: FileSystem; + /** + * Use this cache object to unsafely cache the successful requests + */ + unsafeCache?: (Cache | boolean) | undefined; + /** + * Resolve symlinks to their symlinked location + */ + symlinks?: boolean | undefined; + /** + * A prepared Resolver to which the plugins are attached + */ + resolver?: Resolver | undefined; + /** + * A list of directories to resolve modules from, can be absolute path, folder name, or a `file:` URL + */ + modules?: ((string | URL)[] | string | URL) | undefined; + /** + * A list of main fields in description files + */ + mainFields?: + | ( + | string + | string[] + | { + name: string | string[]; + forceRelative: boolean; + } + )[] + | undefined; + /** + * A list of main files in directories + */ + mainFiles?: string[] | undefined; + /** + * A list of additional resolve plugins which should be applied + */ + plugins?: Plugin[] | undefined; + /** + * A Node.js package map file path (or `file:` `URL` instance), or an object with the already-parsed `packages`. When set, bare specifiers resolve through the map instead of `node_modules` (`@experimental`) + */ + packageMap?: (string | URL | UserPackageMapOptions) | undefined; + /** + * A PnP API that should be used - null is "never", undefined is "auto" + */ + pnpApi?: (PnpApi | null) | undefined; + /** + * A list of root paths, each an absolute path or a `file:` URL + */ + roots?: (string | URL)[] | undefined; + /** + * The request is already fully specified and no extensions or directories are resolved for it + */ + fullySpecified?: boolean | undefined; + /** + * Resolve to a context instead of a file + */ + resolveToContext?: boolean | undefined; + /** + * A list of resolve restrictions, each an absolute path, a `file:` URL, or a RegExp + */ + restrictions?: (string | URL | RegExp)[] | undefined; + /** + * Use only the sync constraints of the file system calls + */ + useSyncFileSystemCalls?: boolean | undefined; + /** + * Prefer to resolve module requests as relative requests before falling back to modules + */ + preferRelative?: boolean | undefined; + /** + * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots + */ + preferAbsolute?: boolean | undefined; + /** + * TypeScript config file path (or `file:` URL) or config object with configFile and references + */ + tsconfig?: (string | URL | boolean | UserTsconfigOptions) | undefined; +}; +export type ResolveOptions = { + /** + * alias + */ + alias: AliasOptionEntry[]; + /** + * fallback + */ + fallback: AliasOptionEntry[]; + /** + * alias fields + */ + aliasFields: Set; + /** + * extension alias + */ + extensionAlias: ExtensionAliasOption[]; + /** + * apply extension alias to exports field targets + */ + extensionAliasForExports: boolean; + /** + * cache predicate + */ + cachePredicate: (predicate: ResolveRequest) => boolean; + /** + * cache with context + */ + cacheWithContext: boolean; + /** + * A list of exports field condition names. + */ + conditionNames: Set; + /** + * description files + */ + descriptionFiles: string[]; + /** + * enforce extension + */ + enforceExtension: boolean; + /** + * exports fields + */ + exportsFields: Set; + /** + * imports fields + */ + importsFields: Set; + /** + * extensions + */ + extensions: Set; + /** + * fileSystem + */ + fileSystem: FileSystem; + /** + * unsafe cache + */ + unsafeCache: Cache | false; + /** + * symlinks + */ + symlinks: boolean; + /** + * resolver + */ + resolver?: Resolver | undefined; + /** + * modules + */ + modules: (string | string[])[]; + /** + * main fields + */ + mainFields: { + name: string[]; + forceRelative: boolean; + }[]; + /** + * main files + */ + mainFiles: Set; + /** + * plugins + */ + plugins: Plugin[]; + /** + * package map + */ + packageMap: PackageMapOptions | null; + /** + * pnp API + */ + pnpApi: PnpApi | null; + /** + * roots + */ + roots: Set; + /** + * fully specified + */ + fullySpecified: boolean; + /** + * resolve to context + */ + resolveToContext: boolean; + /** + * restrictions + */ + restrictions: Set; + /** + * prefer relative + */ + preferRelative: boolean; + /** + * prefer absolute + */ + preferAbsolute: boolean; + /** + * tsconfig file path or config object + */ + tsconfig: string | boolean | TsconfigOptions; +}; +import Resolver = require("./Resolver"); diff --git a/e-commerce/node_modules/enhanced-resolve/types/RestrictionsPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/RestrictionsPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ceb2fb6070052187a0296598806f699214f0d1c0 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/RestrictionsPlugin.d.ts @@ -0,0 +1,52 @@ +export = RestrictionsPlugin; +declare class RestrictionsPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {Set} restrictions restrictions + */ + constructor( + source: string | ResolveStepHook, + restrictions: Set, + ); + source: string | import("./Resolver").ResolveStepHook; + restrictions: Set; + /** @type {Restriction[]} */ + _restrictions: Restriction[]; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace RestrictionsPlugin { + export { + Resolver, + ResolveStepHook, + PathRestriction, + RegExpRestriction, + Restriction, + }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type PathRestriction = { + /** + * type of the restriction + */ + type: "path"; + /** + * normalized path the request has to be inside of + */ + rule: string; +}; +type RegExpRestriction = { + /** + * type of the restriction + */ + type: "regexp"; + /** + * pattern the request has to match + */ + rule: RegExp; +}; +type Restriction = PathRestriction | RegExpRestriction; diff --git a/e-commerce/node_modules/enhanced-resolve/types/ResultPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/ResultPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94fe0b2f754e96badc2f6f68b11fb80c1ce544d4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/ResultPlugin.d.ts @@ -0,0 +1,18 @@ +export = ResultPlugin; +declare class ResultPlugin { + /** + * @param {ResolveStepHook} source source + */ + constructor(source: ResolveStepHook); + source: import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace ResultPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/RootsPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/RootsPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72625d25566c01bdbcb082a478e88cdb6985fb6c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/RootsPlugin.d.ts @@ -0,0 +1,30 @@ +export = RootsPlugin; +/** @typedef {import("./Resolver")} Resolver */ +/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ +/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ +declare class RootsPlugin { + /** + * @param {string | ResolveStepHook} source source hook + * @param {Set} roots roots + * @param {string | ResolveStepHook} target target hook + */ + constructor( + source: string | ResolveStepHook, + roots: Set, + target: string | ResolveStepHook, + ); + roots: string[]; + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace RootsPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/SelfReferencePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/SelfReferencePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..642e7d9cb87ab60ca5cfee32d3c4f46b823cdf01 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/SelfReferencePlugin.d.ts @@ -0,0 +1,31 @@ +export = SelfReferencePlugin; +declare class SelfReferencePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | string[]} fieldNamePath name path + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + fieldNamePath: string | string[], + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + fieldName: string | string[]; + /** @type {WeakMap} */ + _nameCache: WeakMap; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace SelfReferencePlugin { + export { Resolver, JsonObject, ResolveRequest, ResolveStepHook }; +} +declare const NO_SELF_REF: unique symbol; +type Resolver = import("./Resolver"); +type JsonObject = import("./Resolver").JsonObject; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/SymlinkPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/SymlinkPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09750b71ece47c40ee74e9b3b21be04e2a85c3d5 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/SymlinkPlugin.d.ts @@ -0,0 +1,24 @@ +export = SymlinkPlugin; +declare class SymlinkPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace SymlinkPlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/SyncAsyncFileSystemDecorator.d.ts b/e-commerce/node_modules/enhanced-resolve/types/SyncAsyncFileSystemDecorator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..716926b85d62cb573f1ddadc21f7ba718c76e19c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/SyncAsyncFileSystemDecorator.d.ts @@ -0,0 +1,52 @@ +export = SyncAsyncFileSystemDecorator; +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {import("./Resolver").StringCallback} StringCallback */ +/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ +/** @typedef {Function} SyncOrAsyncFunction */ +/** @typedef {any} ResultOfSyncOrAsyncFunction */ +/** + * @param {SyncFileSystem} fs file system implementation + * @constructor + */ +declare function SyncAsyncFileSystemDecorator(fs: SyncFileSystem): void; +declare class SyncAsyncFileSystemDecorator { + /** @typedef {import("./Resolver").FileSystem} FileSystem */ + /** @typedef {import("./Resolver").StringCallback} StringCallback */ + /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ + /** @typedef {Function} SyncOrAsyncFunction */ + /** @typedef {any} ResultOfSyncOrAsyncFunction */ + /** + * @param {SyncFileSystem} fs file system implementation + * @constructor + */ + constructor(fs: SyncFileSystem); + fs: import("./Resolver").SyncFileSystem; + lstat: import("./Resolver").LStat | undefined; + lstatSync: import("./Resolver").LStatSync | undefined; + stat: import("./Resolver").Stat; + statSync: import("./Resolver").StatSync; + readdir: import("./Resolver").Readdir; + readdirSync: import("./Resolver").ReaddirSync; + readFile: import("./Resolver").ReadFile; + readFileSync: import("./Resolver").ReadFileSync; + readlink: import("./Resolver").Readlink; + readlinkSync: import("./Resolver").ReadlinkSync; + readJson: import("./Resolver").ReadJson | undefined; + readJsonSync: import("./Resolver").ReadJsonSync | undefined; + realpath: import("./Resolver").RealPath | undefined; + realpathSync: import("./Resolver").RealPathSync | undefined; +} +declare namespace SyncAsyncFileSystemDecorator { + export { + FileSystem, + StringCallback, + SyncFileSystem, + SyncOrAsyncFunction, + ResultOfSyncOrAsyncFunction, + }; +} +type FileSystem = import("./Resolver").FileSystem; +type StringCallback = import("./Resolver").StringCallback; +type SyncFileSystem = import("./Resolver").SyncFileSystem; +type SyncOrAsyncFunction = Function; +type ResultOfSyncOrAsyncFunction = any; diff --git a/e-commerce/node_modules/enhanced-resolve/types/TryNextPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/TryNextPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c3ade87422813587fd1669efbf3b76abd144d305 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/TryNextPlugin.d.ts @@ -0,0 +1,26 @@ +export = TryNextPlugin; +declare class TryNextPlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} message message + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + message: string, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + message: string; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace TryNextPlugin { + export { Resolver, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/TsconfigPathsPlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/TsconfigPathsPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c65d39d3adc3a0656d1a87111f2de595c60d3f0 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/TsconfigPathsPlugin.d.ts @@ -0,0 +1,204 @@ +export = TsconfigPathsPlugin; +declare class TsconfigPathsPlugin { + /** + * @param {true | string | TsconfigOptions} configFileOrOptions tsconfig file path or options object + */ + constructor(configFileOrOptions: true | string | TsconfigOptions); + /** @type {boolean} */ + isAutoConfigFile: boolean; + /** @type {string} */ + configFile: string; + /** @type {TsconfigReference[] | "auto"} */ + references: TsconfigReference[] | "auto"; + /** @type {string | undefined} */ + baseUrl: string | undefined; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; + /** + * Get TsconfigPathsMap for the request (with caching) + * @param {Resolver} resolver the resolver + * @param {ResolveRequest} request the request + * @param {ResolveContext} resolveContext the resolve context + * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback + * @returns {void} + */ + _getTsconfigPathsMap( + resolver: Resolver, + request: ResolveRequest, + resolveContext: ResolveContext, + callback: (err: Error | null, result?: TsconfigPathsMap | null) => void, + ): void; + /** + * Walk up from startDir to the filesystem root looking for tsconfig.json. + * Like TypeScript's own `findConfigFile` / `forEachAncestorDirectory`. + * @param {Resolver} resolver the resolver + * @param {string} startDir the directory to start searching from + * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback + * @returns {void} + */ + _findTsconfigUpward( + resolver: Resolver, + startDir: string, + callback: (err: Error | null, result?: TsconfigPathsMap | null) => void, + ): void; + /** + * Load tsconfig.json and build complete TsconfigPathsMap + * Includes main project paths and all referenced projects + * @param {Resolver} resolver the resolver + * @param {string} absTsconfigPath absolute path to tsconfig.json + * @param {(err: Error | null, result?: TsconfigPathsMap) => void} callback the callback + * @returns {void} + */ + _loadTsconfigPathsMap( + resolver: Resolver, + absTsconfigPath: string, + callback: (err: Error | null, result?: TsconfigPathsMap) => void, + ): void; + /** + * Select the correct TsconfigPathsData based on request.path (context-aware) + * Matches the behavior of tsconfig-paths-webpack-plugin + * @param {string | false} requestPath the request path + * @param {TsconfigPathsMap} tsconfigPathsMap the tsconfig paths map + * @returns {TsconfigPathsData | null} the selected paths data + */ + _selectPathsDataForContext( + requestPath: string | false, + tsconfigPathsMap: TsconfigPathsMap, + ): TsconfigPathsData | null; + /** + * Load tsconfig from extends path + * @param {Resolver} resolver the resolver + * @param {string} configFilePath current config file path + * @param {string} extendedConfigValue extends value + * @param {Set} fileDependencies the file dependencies + * @param {Set} visitedConfigPaths config paths being loaded (for circular extends detection) + * @param {(err: Error | null, result?: Tsconfig) => void} callback callback + * @returns {void} + */ + _loadTsconfigFromExtends( + resolver: Resolver, + configFilePath: string, + extendedConfigValue: string, + fileDependencies: Set, + visitedConfigPaths: Set, + callback: (err: Error | null, result?: Tsconfig) => void, + ): void; + /** + * Walk up from startDir looking for `/` (a + * `node_modules/...` sub-path), matching Node.js module resolution so a + * package hoisted to a parent workspace's node_modules is found. + * @param {Resolver} resolver the resolver + * @param {string} startDir directory to start searching from + * @param {string} subPath node_modules-relative sub-path to look for + * @param {(found: string | null) => void} callback receives the found path or null + * @returns {void} + */ + _findExtendsInNodeModules( + resolver: Resolver, + startDir: string, + subPath: string, + callback: (found: string | null) => void, + ): void; + /** + * Load referenced tsconfig projects and store in referenceMatchMap + * Simple implementation matching tsconfig-paths-webpack-plugin: + * Just load each reference and store independently + * @param {Resolver} resolver the resolver + * @param {string} context the context + * @param {TsconfigReference[]} references array of references + * @param {Set} fileDependencies the file dependencies + * @param {{ [baseUrl: string]: TsconfigPathsData }} referenceMatchMap the map to populate + * @param {(err: Error | null) => void} callback callback + * @param {Set=} visitedRefPaths visited reference config paths (for circular reference detection) + * @returns {void} + */ + _loadTsconfigReferences( + resolver: Resolver, + context: string, + references: TsconfigReference[], + fileDependencies: Set, + referenceMatchMap: { + [baseUrl: string]: TsconfigPathsData; + }, + callback: (err: Error | null) => void, + visitedRefPaths?: Set | undefined, + ): void; + /** + * Load tsconfig.json with extends support + * @param {Resolver} resolver the resolver + * @param {string} configFilePath absolute path to tsconfig.json + * @param {Set} fileDependencies the file dependencies + * @param {Set | undefined} visitedConfigPaths config paths being loaded (for circular extends detection) + * @param {(err: Error | null, result?: Tsconfig) => void} callback callback + * @returns {void} + */ + _loadTsconfig( + resolver: Resolver, + configFilePath: string, + fileDependencies: Set, + visitedConfigPaths: Set | undefined, + callback: (err: Error | null, result?: Tsconfig) => void, + ): void; +} +declare namespace TsconfigPathsPlugin { + export { + Resolver, + ResolveStepHook, + AliasOption, + ResolveRequest, + ResolveContext, + FileSystem, + TsconfigPathsData, + TsconfigPathsMap, + TsconfigOptions, + TsconfigCompilerOptions, + TsconfigReference, + Tsconfig, + }; +} +type Resolver = import("./Resolver"); +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type AliasOption = import("./AliasUtils").AliasOption; +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveContext = import("./Resolver").ResolveContext; +type FileSystem = import("./Resolver").FileSystem; +type TsconfigPathsData = import("./Resolver").TsconfigPathsData; +type TsconfigPathsMap = import("./Resolver").TsconfigPathsMap; +type TsconfigOptions = import("./ResolverFactory").TsconfigOptions; +type TsconfigCompilerOptions = { + /** + * Base URL for resolving paths + */ + baseUrl?: string | undefined; + /** + * TypeScript paths mapping + */ + paths?: + | { + [key: string]: string[]; + } + | undefined; +}; +type TsconfigReference = { + /** + * Path to the referenced project + */ + path: string; +}; +type Tsconfig = { + /** + * Compiler options + */ + compilerOptions?: TsconfigCompilerOptions | undefined; + /** + * Extended configuration paths + */ + extends?: (string | string[]) | undefined; + /** + * Project references + */ + references?: TsconfigReference[] | undefined; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/UnsafeCachePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/UnsafeCachePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..efb46b7258c64b73e984dfc97655d1b34f1c959a --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/UnsafeCachePlugin.d.ts @@ -0,0 +1,43 @@ +export = UnsafeCachePlugin; +declare class UnsafeCachePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate + * @param {Cache} cache cache + * @param {boolean} withContext withContext + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + filterPredicate: (request: ResolveRequest) => boolean, + cache: Cache, + withContext: boolean, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + filterPredicate: (request: ResolveRequest) => boolean; + withContext: boolean; + cache: Cache; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace UnsafeCachePlugin { + export { + Resolver, + ResolveRequest, + ResolveStepHook, + ResolveContextYield, + Cache, + }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; +type ResolveContextYield = import("./Resolver").ResolveContextYield; +type Cache = { + [k: string]: undefined | ResolveRequest | ResolveRequest[]; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/UseFilePlugin.d.ts b/e-commerce/node_modules/enhanced-resolve/types/UseFilePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..58fb9403628e62f7efb80b98e7e61cda374e454d --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/UseFilePlugin.d.ts @@ -0,0 +1,27 @@ +export = UseFilePlugin; +declare class UseFilePlugin { + /** + * @param {string | ResolveStepHook} source source + * @param {string} filename filename + * @param {string | ResolveStepHook} target target + */ + constructor( + source: string | ResolveStepHook, + filename: string, + target: string | ResolveStepHook, + ); + source: string | import("./Resolver").ResolveStepHook; + filename: string; + target: string | import("./Resolver").ResolveStepHook; + /** + * @param {Resolver} resolver the resolver + * @returns {void} + */ + apply(resolver: Resolver): void; +} +declare namespace UseFilePlugin { + export { Resolver, ResolveRequest, ResolveStepHook }; +} +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; +type ResolveStepHook = import("./Resolver").ResolveStepHook; diff --git a/e-commerce/node_modules/enhanced-resolve/types/createInnerContext.d.ts b/e-commerce/node_modules/enhanced-resolve/types/createInnerContext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25c4bf42eae1e1c1d2cc380e92fc23760fe33d0c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/createInnerContext.d.ts @@ -0,0 +1,10 @@ +declare namespace _exports { + export { ResolveContext }; +} +declare function _exports( + parent: ResolveContext, + stack: ResolveContext["stack"], + message: null | string, +): ResolveContext; +export = _exports; +type ResolveContext = import("./Resolver").ResolveContext; diff --git a/e-commerce/node_modules/enhanced-resolve/types/forEachBail.d.ts b/e-commerce/node_modules/enhanced-resolve/types/forEachBail.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..472cae0696c08476658412c41d75b5885d18550e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/forEachBail.d.ts @@ -0,0 +1,15 @@ +declare namespace _exports { + export { ResolveRequest, Iterator }; +} +declare function _exports( + array: T[], + iterator: Iterator, + callback: (err?: null | Error, result?: null | Z, i?: number) => void, +): void; +export = _exports; +type ResolveRequest = import("./Resolver").ResolveRequest; +type Iterator = ( + item: T, + callback: (err?: null | Error, result?: null | Z) => void, + i: number, +) => void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/getInnerRequest.d.ts b/e-commerce/node_modules/enhanced-resolve/types/getInnerRequest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1271b98b8b40d42999700e8e881e7147e8285dc9 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/getInnerRequest.d.ts @@ -0,0 +1,7 @@ +declare namespace _exports { + export { Resolver, ResolveRequest }; +} +declare function _exports(resolver: Resolver, request: ResolveRequest): string; +export = _exports; +type Resolver = import("./Resolver"); +type ResolveRequest = import("./Resolver").ResolveRequest; diff --git a/e-commerce/node_modules/enhanced-resolve/types/getPaths.d.ts b/e-commerce/node_modules/enhanced-resolve/types/getPaths.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7fe471a65c39f36b29fc348ea9358cf9e3365d3 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/getPaths.d.ts @@ -0,0 +1,34 @@ +export = getPaths; +/** @typedef {import("./Resolver").FileSystem} FileSystem */ +/** @typedef {{ paths: string[], segments: string[] }} GetPathsResult */ +/** + * Walk `path` from tip to root, returning every ancestor directory (plus the + * input itself) in `paths`, and each corresponding segment name in `segments`. + * + * The return value may be shared across callers via `getPathsCached` — treat + * it as read-only. Callers that need to mutate (currently only + * `SymlinkPlugin`) should `slice()` the arrays locally before writing. + * @param {string} path path + * @returns {GetPathsResult} paths and segments + */ +declare function getPaths(path: string): GetPathsResult; +declare namespace getPaths { + export { getPathsCached, FileSystem, GetPathsResult }; +} +/** + * Memoized `getPaths`. The returned object is shared across callers — do + * not mutate the `paths` or `segments` arrays in-place; `slice()` first if + * you need a mutable copy. + * @param {FileSystem} fileSystem filesystem used as the cache namespace + * @param {string} path path + * @returns {GetPathsResult} paths and segments + */ +declare function getPathsCached( + fileSystem: FileSystem, + path: string, +): GetPathsResult; +type FileSystem = import("./Resolver").FileSystem; +type GetPathsResult = { + paths: string[]; + segments: string[]; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/index.d.ts b/e-commerce/node_modules/enhanced-resolve/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b7e2fabd66ece41cc107cf23358aa361626c9f4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/index.d.ts @@ -0,0 +1,131 @@ +declare namespace _exports { + export { + ResolveOptionsOptionalFS, + CachedInputFileSystem, + BaseFileSystem, + CloneBasenamePlugin, + LogInfoPlugin, + PnpApi, + Resolver, + Context, + FileSystem, + ResolveCallback, + ResolveContext, + ResolveRequest, + SyncFileSystem, + Plugin, + ResolveOptions, + TsconfigPathsPlugin, + ResolveFunctionAsync, + ResolveFunction, + ResolveFunctionPromise, + }; +} +declare const _exports: ResolveFunctionAsync & { + readonly sync: ResolveFunction; + readonly promise: ResolveFunctionPromise; + create: typeof create & { + readonly sync: typeof createSync; + readonly promise: typeof createPromise; + }; + readonly ResolverFactory: typeof import("./ResolverFactory"); + readonly CachedInputFileSystem: typeof import("./CachedInputFileSystem"); + readonly CloneBasenamePlugin: typeof import("./CloneBasenamePlugin"); + readonly LogInfoPlugin: typeof import("./LogInfoPlugin"); + readonly TsconfigPathsPlugin: typeof import("./TsconfigPathsPlugin"); + readonly forEachBail: ( + array: T[], + iterator: import("./forEachBail").Iterator, + callback: (err?: null | Error, result?: null | Z, i?: number) => void, + ) => void; +}; +export = _exports; +type ResolveOptionsOptionalFS = Omit & + Partial>; +type CachedInputFileSystem = import("./CachedInputFileSystem"); +type BaseFileSystem = import("./CachedInputFileSystem").BaseFileSystem; +type CloneBasenamePlugin = import("./CloneBasenamePlugin"); +type LogInfoPlugin = import("./LogInfoPlugin"); +type PnpApi = import("./PnpPlugin").PnpApiImpl; +type Resolver = import("./Resolver"); +type Context = import("./Resolver").Context; +type FileSystem = import("./Resolver").FileSystem; +type ResolveCallback = import("./Resolver").ResolveCallback; +type ResolveContext = import("./Resolver").ResolveContext; +type ResolveRequest = import("./Resolver").ResolveRequest; +type SyncFileSystem = import("./Resolver").SyncFileSystem; +type Plugin = import("./ResolverFactory").Plugin; +type ResolveOptions = import("./ResolverFactory").UserResolveOptions; +type TsconfigPathsPlugin = import("./TsconfigPathsPlugin"); +type ResolveFunctionAsync = { + ( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext: ResolveContext, + callback: ResolveCallback, + ): void; + ( + context: Context, + parent: string | URL, + specifier: string | URL, + callback: ResolveCallback, + ): void; + ( + parent: string | URL, + specifier: string | URL, + resolveContext: ResolveContext, + callback: ResolveCallback, + ): void; + ( + parent: string | URL, + specifier: string | URL, + callback: ResolveCallback, + ): void; +}; +type ResolveFunction = { + ( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext, + ): string | false; + ( + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext, + ): string | false; +}; +type ResolveFunctionPromise = { + ( + context: Context, + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext, + ): Promise; + ( + parent: string | URL, + specifier: string | URL, + resolveContext?: ResolveContext, + ): Promise; +}; +/** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionAsync} Resolver function + */ +declare function create( + options: ResolveOptionsOptionalFS, +): ResolveFunctionAsync; +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunction} Resolver function + */ +declare function createSync(options: ResolveOptionsOptionalFS): ResolveFunction; +/** + * @param {ResolveOptionsOptionalFS} options Resolver options + * @returns {ResolveFunctionPromise} Resolver function + */ +declare function createPromise( + options: ResolveOptionsOptionalFS, +): ResolveFunctionPromise; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/entrypoints.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/entrypoints.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ebe112e094e064cf4743239b0060432f44a64d4 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/entrypoints.d.ts @@ -0,0 +1,62 @@ +export function explainSubpathsInConditions( + field: ExportsField | ImportsField | null | undefined, + isExports: boolean, +): string | null; +export function processExportsField(exportsField: ExportsField): FieldProcessor; +export function processImportsField(importsField: ImportsField): FieldProcessor; +export type DirectMapping = string | (string | ConditionalMapping)[]; +export type ConditionalMapping = { + [k: string]: MappingValue; +}; +export type MappingValue = ConditionalMapping | DirectMapping | null; +export type ExportsField = + Record | ConditionalMapping | DirectMapping; +export type ImportsField = Record; +/** + * Processing exports/imports field + */ +export type FieldProcessor = ( + request: string, + conditionNames: Set, +) => [string[], string | null]; +export type RecordMapping = Record; +/** + * Per-key precomputed info used by `findMatch`. Equivalent to what the + * previous implementation recomputed inline on every resolve. + */ +export type FieldKeyInfo = { + /** + * the original key + */ + key: string; + /** + * position of the single "*" in the key, or -1 when absent + */ + patternIndex: number; + /** + * substring before "*" (empty when patternIndex === -1) + */ + wildcardPrefix: string; + /** + * substring after "*" (empty when patternIndex === -1) + */ + wildcardSuffix: string; + /** + * true when key is a legacy `./foo/`-style folder key with no "*" + */ + isLegacySubpath: boolean; + /** + * true when key contains "*" + */ + isPattern: boolean; + /** + * true when key ends with "/" + */ + isSubpathMapping: boolean; + /** + * true when key has at most one "*" + */ + isValidPattern: boolean; +}; +export type MatchTuple = + [MappingValue, string, boolean, boolean, string] | null; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/fileURLToPath.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/fileURLToPath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a217605c13f3d54fe0aefec571ead90a90ebe5f6 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/fileURLToPath.d.ts @@ -0,0 +1,14 @@ +export = fileURLToPath; +/** + * @param {string | URL} path a `file:` URL string or `URL` instance + * @param {{ windows?: boolean }=} options force the platform branch + * @returns {string} the filesystem path + */ +declare function fileURLToPath( + path: string | URL, + options?: + | { + windows?: boolean; + } + | undefined, +): string; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/fs.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/fs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b191ce2a14855f5dd3566cbdd1f5d2eab9461c28 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/fs.d.ts @@ -0,0 +1,38 @@ +export type FileSystem = import("../Resolver").FileSystem; +export type JsonObject = import("../Resolver").JsonObject; +export type ReadJsonOptions = { + /** + * Whether to strip JSONC comments + */ + stripComments?: boolean | undefined; +}; +/** + * Decode a file's raw contents to text without assuming a Node runtime. A + * `Buffer` (Node) uses its fast native `toString`; any other binary input + * (`Uint8Array` from a browser/Deno/Bun file system) goes through + * `TextDecoder`, and strings are returned as-is. + * @param {string | Buffer | Uint8Array} data raw file contents + * @returns {string} decoded text + */ +export function decodeText(data: string | Buffer | Uint8Array): string; +/** + * Read and parse JSON file (supports JSONC with comments). + * Callback-based so a synchronous `fileSystem` stays synchronous all the + * way through — Promise wrapping would defer resolution by a Promise tick + * and break `resolveSync` when `tsconfig` is used together with + * `useSyncFileSystemCalls: true`. + * @param {FileSystem} fileSystem the file system + * @param {string} jsonFilePath absolute path to JSON file + * @param {ReadJsonOptions} options Options + * @param {(err: NodeJS.ErrnoException | Error | null, content?: JsonObject) => void} callback callback + * @returns {void} + */ +export function readJson( + fileSystem: FileSystem, + jsonFilePath: string, + options: ReadJsonOptions, + callback: ( + err: NodeJS.ErrnoException | Error | null, + content?: JsonObject, + ) => void, +): void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/graceful-fs-browser.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/graceful-fs-browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8ee8eb800a05c8fe462770ae600323431f00b9c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/graceful-fs-browser.d.ts @@ -0,0 +1,22 @@ +/** + * Takes the arguments its callers pass - `readFile(path, callback)` and the + * rest - so the declaration describes a call that actually compiles, even + * though every one of them throws. + * @param {...unknown} _args arguments, ignored + * @returns {never} always throws + */ +declare function unavailable(..._args: unknown[]): never; +export { + unavailable as lstat, + unavailable as lstatSync, + unavailable as readFile, + unavailable as readFileSync, + unavailable as readdir, + unavailable as readdirSync, + unavailable as readlink, + unavailable as readlinkSync, + unavailable as realpath, + unavailable as realpathSync, + unavailable as stat, + unavailable as statSync, +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/identifier.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/identifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..996448901086544474a68f93e27f78bb93ddc17e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/identifier.d.ts @@ -0,0 +1,7 @@ +/** + * @param {string} identifier identifier + * @returns {[string, string, string] | null} parsed identifier + */ +export function parseIdentifier( + identifier: string, +): [string, string, string] | null; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/memoize.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/memoize.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4ada2d11745668257bfe5fc801865a8445ec7b0e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/memoize.d.ts @@ -0,0 +1,15 @@ +export = memoize; +/** + * @template T + * @typedef {() => T} FunctionReturning + */ +/** + * @template T + * @param {FunctionReturning} fn memorized function + * @returns {FunctionReturning} new function + */ +declare function memoize(fn: FunctionReturning): FunctionReturning; +declare namespace memoize { + export { FunctionReturning }; +} +type FunctionReturning = () => T; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/module-browser.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/module-browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/module-browser.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/packageMap.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/packageMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..deca530c798ec78745967e11774d86b1a597d4d7 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/packageMap.d.ts @@ -0,0 +1,118 @@ +export type JsonObject = import("../Resolver").JsonObject; +export type PackageMapDependencies = { + [specifier: string]: string; +}; +/** + * A single entry of the configuration file's `packages` object. + */ +export type PackageMapPackage = { + /** + * an absolute or relative `file:` URL, resolved against the configuration file + */ + url: string; + /** + * bare specifier to package id + */ + dependencies?: PackageMapDependencies | undefined; +}; +export type PackageMapPackages = { + [id: string]: PackageMapPackage; +}; +/** + * The parsed contents of a package map configuration file. + */ +export type PackageMapJson = { + /** + * package entries by package id + */ + packages: PackageMapPackages; +}; +export type PackageMapEntry = { + /** + * the package id this entry is keyed by + */ + id: string; + /** + * absolute filesystem path the entry's `url` points at + */ + path: string; + /** + * bare specifier to package id + */ + dependencies: Map; +}; +export type PackageMap = { + /** + * entries by package id + */ + packages: Map; + /** + * package ids by location, longest path first + */ + locations: { + path: string; + ids: string[]; + }[]; +}; +/** @typedef {import("../Resolver").JsonObject} JsonObject */ +/** @typedef {{ [specifier: string]: string }} PackageMapDependencies */ +/** + * A single entry of the configuration file's `packages` object. + * @typedef {object} PackageMapPackage + * @property {string} url an absolute or relative `file:` URL, resolved against the configuration file + * @property {PackageMapDependencies=} dependencies bare specifier to package id + */ +/** @typedef {{ [id: string]: PackageMapPackage }} PackageMapPackages */ +/** + * The parsed contents of a package map configuration file. + * @typedef {object} PackageMapJson + * @property {PackageMapPackages} packages package entries by package id + */ +/** + * @typedef {object} PackageMapEntry + * @property {string} id the package id this entry is keyed by + * @property {string} path absolute filesystem path the entry's `url` points at + * @property {Map} dependencies bare specifier to package id + */ +/** + * @typedef {object} PackageMap + * @property {Map} packages entries by package id + * @property {{ path: string, ids: string[] }[]} locations package ids by location, longest path first + */ +/** + * @param {string} message message + * @param {string} code error code + * @returns {Error & { code: string }} the error + */ +export function createError( + message: string, + code: string, +): Error & { + code: string; +}; +/** + * Find the package ids whose location contains `filePath`. More than one id is + * returned when several package entries share the same `url`, which the caller + * has to disambiguate with an explicit package id. + * @param {PackageMap} packageMap the package map + * @param {string} filePath an absolute filesystem path + * @returns {string[]} the matching package ids, empty when the path is outside every package + */ +export function findPackageIds( + packageMap: PackageMap, + filePath: string, +): string[]; +/** + * Parse and validate a package map configuration file. + * + * Dangling dependency targets are rejected here rather than at resolution + * time: the map is static, so a broken table is a configuration error that is + * better surfaced once and in full. + * @param {JsonObject} data the parsed configuration file contents + * @param {string} configFilePath absolute path of the configuration file, used as the base for relative urls + * @returns {PackageMap} the parsed package map + */ +export function parsePackageMap( + data: JsonObject, + configFilePath: string, +): PackageMap; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/path-browser.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/path-browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..05a5d2203b20b217c6b8de4ac14b4f5dadfcb458 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/path-browser.d.ts @@ -0,0 +1,45 @@ +/** + * Posix `basename` — the browser is treated as a posix platform, matching how + * Node picks the posix variant for `path.basename` on non-Windows systems. + * @param {string} path path + * @param {string=} suffix optional suffix to strip + * @returns {string} basename + */ +export function basename(path: string, suffix?: string | undefined): string; +/** + * @param {string} path path + * @returns {string} normalized posix path + */ +declare function posixNormalize(path: string): string; +/** + * @param {string} path path + * @returns {string} posix dirname + */ +declare function posixDirname(path: string): string; +/** + * Normalizes drive paths (`C:\…`), UNC paths (`\\server\share\…`), DOS device + * paths (`\\.\…`, `\\?\…`) and relative/normal segments like Node's + * `path.win32.normalize`, including the CVE-2024-36139 colon-segment guard. + * + * Scope note: reserved Windows device names (`CON`, `COM1`, `LPT1`, …) are not + * special-cased, so e.g. `\\.\COM1:` differs from Node. Such names cannot occur + * in a browser (the only place this shim is used) and the resolver never routes + * them to `win32.normalize`, so this does not affect resolution. + * @param {string} path path + * @returns {string} normalized win32 path + */ +declare function win32Normalize(path: string): string; +/** + * @param {string} path path + * @returns {string} win32 dirname + */ +declare function win32Dirname(path: string): string; +export declare namespace posix { + export { posixNormalize as normalize }; + export { posixDirname as dirname }; +} +export declare namespace win32 { + export { win32Normalize as normalize }; + export { win32Dirname as dirname }; +} +export {}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/path.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/path.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..572770b94b3964b3dc1e4a87b41ed4d3335fb852 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/path.d.ts @@ -0,0 +1,125 @@ +export type CachedJoin = { + fn: (rootPath: string, request: string) => string; + cache: Map>; +}; +export type CachedDirname = { + fn: (maybePath: string) => string; + cache: Map; +}; +export type CachedBasename = { + fn: (maybePath: string, suffix?: string) => string; + cache: Map>; +}; +export type PathType = number; +/** + * @enum {number} + */ +export const PathType: Readonly<{ + Empty: 0; + Normal: 1; + Relative: 2; + AbsoluteWin: 3; + AbsolutePosix: 4; + Internal: 5; +}>; +/** @typedef {{ fn: (maybePath: string, suffix?: string) => string, cache: Map> }} CachedBasename */ +/** + * @returns {CachedBasename} cached basename + */ +export function createCachedBasename(): CachedBasename; +/** @typedef {{ fn: (maybePath: string) => string, cache: Map }} CachedDirname */ +/** + * @returns {CachedDirname} cached dirname + */ +export function createCachedDirname(): CachedDirname; +/** @typedef {{ fn: (rootPath: string, request: string) => string, cache: Map> }} CachedJoin */ +/** + * @returns {CachedJoin} cached join + */ +export function createCachedJoin(): CachedJoin; +export const deprecatedInvalidSegmentRegEx: RegExp; +/** + * @param {string} maybePath a path + * @returns {string} the directory name + */ +export function dirname(maybePath: string): string; +/** + * @param {string} maybePath a path + * @returns {PathType} type of path + */ +export function getType(maybePath: string): PathType; +export const invalidSegmentRegEx: RegExp; +/** + * Whether a string names a `file:` URL rather than a path. The scheme has to + * open the string and be followed by a slash, as Node's own URL parser needs, + * so a path segment spelled `file:` stays a path and `file:x.js` — which Node + * reads as `/x.js` — stays the relative request it looks like. + * @param {string} maybePath a path or a `file:` URL string + * @returns {boolean} true when the string is a `file:` URL + */ +export function isFileURL(maybePath: string): boolean; +/** + * Whether childPath is parentPath itself or a path under it, the answer node's + * `relative(parentPath, childPath)` gives: not escaping upward and not + * absolute. A trailing separator on the parent is not part of the boundary, so + * `/a/b/` contains exactly what `/a/b` contains. + * @param {string} parentPath parent directory path + * @param {string} childPath child path to check + * @returns {boolean} true if childPath is parentPath or is under it + */ +export function isInside(parentPath: string, childPath: string): boolean; +/** + * Whether `request` is a relative request — i.e. matches `^\.\.?(?:\/|$)`. + * + * This is called on every `doResolve` via `UnsafeCachePlugin` and + * `getInnerRequest`, so the char-code form is meaningfully faster than the + * equivalent regex test: no regex state machine, no string object churn. + * @param {string} request request string + * @returns {boolean} true if request is relative + */ +export function isRelativeRequest(request: string): boolean; +/** + * Check if childPath is a subdirectory of parentPath. Compares like `isInside`, + * except that a path is not a subpath of itself. + * + * Called from `TsconfigPathsPlugin._selectPathsDataForContext` inside a loop + * over every tsconfig-paths context on every resolve, so it's worth keeping + * cheap: a native `startsWith` plus a separator char check answers it, and the + * character loop only runs for a Windows path that the prefix test missed. + * @param {string} parentPath parent directory path + * @param {string} childPath child path to check + * @returns {boolean} true if childPath is under parentPath + */ +export function isSubPath(parentPath: string, childPath: string): boolean; +/** + * Whether this is a Windows path, in which `/` and `\` are interchangeable and + * paths compare case-insensitively, as opposed to a posix path, in which `\` is + * an ordinary filename character. Decided by the root — a drive letter or a + * leading `\` — which is where `path.win32` and `path.posix` disagree about + * `parse(maybePath).root`, and never by the host platform, since Windows paths + * are resolved on posix hosts and in browsers too. A path starting with `//` + * stays posix: `path.win32` reads it as a UNC root, but here it cannot be told + * apart from a posix path, where `\` has to keep being a filename character. + * @param {string} maybePath a path + * @returns {boolean} true, when the path is a Windows path + */ +export function isWindowsPath(maybePath: string): boolean; +/** + * @param {string} rootPath the root path + * @param {string | undefined} request the request path + * @returns {string} the joined path + */ +export function join(rootPath: string, request: string | undefined): string; +/** + * @param {string} maybePath a path + * @returns {string} the normalized path + */ +export function normalize(maybePath: string): string; +/** + * Convert a `file:` URL — a `URL` instance or a `file:/` string, the form + * `import.meta.resolve` returns — to the path it names. Anything else is + * returned unchanged, so a path passes through. + * @param {string | URL} maybeURL a path, a `file:` URL string or a `file:` `URL` instance + * @returns {string} a filesystem path + */ +export function toPath(maybeURL: string | URL): string; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/pathToFileURL.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/pathToFileURL.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a12d55e31da51bb66bf020376cc748a52dd2dd29 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/pathToFileURL.d.ts @@ -0,0 +1,14 @@ +export = pathToFileURL; +/** + * @param {string} filepath an absolute filesystem path + * @param {{ windows?: boolean }=} options force the platform branch + * @returns {URL} the `file:` URL + */ +declare function pathToFileURL( + filepath: string, + options?: + | { + windows?: boolean; + } + | undefined, +): URL; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/process-browser.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/process-browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11b331b12e043a7549c6ef710a2990ca8faf1720 --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/process-browser.d.ts @@ -0,0 +1,3 @@ +export let versions: Record; +/** @param {Function} fn function */ +export function nextTick(fn: Function, ...args: any[]): void; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/strip-json-comments.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/strip-json-comments.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cef87e3f86e6e179c760ee7581ce330b48c881fa --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/strip-json-comments.d.ts @@ -0,0 +1,24 @@ +export = stripJsonComments; +/** + * Strip comments from JSON string + * @param {string} jsonString JSON string with potential comments + * @param {StripJsonCommentsOptions} options Options + * @returns {string} JSON string without comments + */ +declare function stripJsonComments( + jsonString: string, + { whitespace, trailingCommas }?: StripJsonCommentsOptions, +): string; +declare namespace stripJsonComments { + export { StripJsonCommentsOptions }; +} +type StripJsonCommentsOptions = { + /** + * Replace comments with whitespace + */ + whitespace?: boolean | undefined; + /** + * Strip trailing commas + */ + trailingCommas?: boolean | undefined; +}; diff --git a/e-commerce/node_modules/enhanced-resolve/types/util/url-browser.d.ts b/e-commerce/node_modules/enhanced-resolve/types/util/url-browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9af30a4efad43c79f484f58c2fc7c0bf69d4f45c --- /dev/null +++ b/e-commerce/node_modules/enhanced-resolve/types/util/url-browser.d.ts @@ -0,0 +1 @@ +export let fileURLToPath: typeof import("./fileURLToPath"); diff --git a/e-commerce/node_modules/esbuild/LICENSE.md b/e-commerce/node_modules/esbuild/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..2027e8dcf3787f5aac9fcd835e2b80cb75a39211 --- /dev/null +++ b/e-commerce/node_modules/esbuild/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Wallace + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/e-commerce/node_modules/esbuild/README.md b/e-commerce/node_modules/esbuild/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93863d198004eae1c7b17aef26d829dfca4a314f --- /dev/null +++ b/e-commerce/node_modules/esbuild/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/e-commerce/node_modules/esbuild/bin/esbuild b/e-commerce/node_modules/esbuild/bin/esbuild new file mode 100644 index 0000000000000000000000000000000000000000..60adfebc065e9ae8d975283ed8d01d9ad32e8f6a --- /dev/null +++ b/e-commerce/node_modules/esbuild/bin/esbuild @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bab29b2ca7a9e89b67cf720b77b2d743f9f31f5cf0d5bd74ee8c8de30ced7014 +size 10358936 diff --git a/e-commerce/node_modules/esbuild/install.js b/e-commerce/node_modules/esbuild/install.js new file mode 100644 index 0000000000000000000000000000000000000000..1019e62435fd0258e39ad6db102194d46bd85ce4 --- /dev/null +++ b/e-commerce/node_modules/esbuild/install.js @@ -0,0 +1,289 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd arm64 LE": "@esbuild/netbsd-arm64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64", + "openharmony arm64 LE": "@esbuild/openharmony-arm64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} + +// lib/npm/node-install.ts +var fs2 = require("fs"); +var os2 = require("os"); +var path2 = require("path"); +var zlib = require("zlib"); +var https = require("https"); +var child_process = require("child_process"); +var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; +var toPath = path2.join(__dirname, "bin", "esbuild"); +var isToPathJS = true; +function validateBinaryVersion(...command) { + command.push("--version"); + let stdout; + try { + stdout = child_process.execFileSync(command.shift(), command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: "pipe" + }).toString().trim(); + } catch (err) { + if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { + let os3 = "this version of macOS"; + try { + os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); + } catch { + } + throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. + +The Go compiler (which esbuild relies on) no longer supports ${os3}, +which means the "esbuild" binary executable can't be run. You can either: + + * Update your version of macOS to one that the Go compiler supports + * Use the "esbuild-wasm" package instead of the "esbuild" package + * Build esbuild yourself using an older version of the Go compiler +`); + } + throw err; + } + if (stdout !== versionFromPackageJSON) { + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); + } +} +function isYarn() { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} +function fetch(url) { + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks = []; + res.on("data", (chunk) => chunks.push(chunk)); + res.on("end", () => resolve(Buffer.concat(chunks))); + }).on("error", reject); + }); +} +function extractFileFromTarGzip(buffer, subpath) { + try { + buffer = zlib.unzipSync(buffer); + } catch (err) { + throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); + } + let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += size + 511 & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} +function installUsingNPM(pkg, subpath, binPath) { + const env = { ...process.env, npm_config_global: void 0 }; + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + const installDir = path2.join(esbuildLibDir, "npm-install"); + fs2.mkdirSync(installDir); + try { + fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, + { cwd: installDir, stdio: "pipe", env } + ); + const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); + fs2.renameSync(installedBinPath, binPath); + } finally { + try { + removeRecursive(installDir); + } catch { + } + } +} +function removeRecursive(dir) { + for (const entry of fs2.readdirSync(dir)) { + const entryPath = path2.join(dir, entry); + let stats; + try { + stats = fs2.lstatSync(entryPath); + } catch { + continue; + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs2.unlinkSync(entryPath); + } + fs2.rmdirSync(dir); +} +function applyManualBinaryPathOverride(overridePath) { + const pathString = JSON.stringify(overridePath); + fs2.writeFileSync(toPath, `#!/usr/bin/env node +require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); +`); + const libMain = path2.join(__dirname, "lib", "main.js"); + const code = fs2.readFileSync(libMain, "utf8"); + fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; +${code}`); +} +function maybeOptimizePackage(binPath) { + const { isWASM } = pkgAndSubpathForCurrentPlatform(); + if (os2.platform() !== "win32" && !isYarn() && !isWASM) { + const tempPath = path2.join(__dirname, "bin-esbuild"); + try { + fs2.linkSync(binPath, tempPath); + fs2.renameSync(tempPath, toPath); + isToPathJS = false; + fs2.unlinkSync(tempPath); + } catch { + } + } +} +async function downloadDirectlyFromNPM(pkg, subpath, binPath) { + const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; + console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); + try { + fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); + fs2.chmodSync(binPath, 493); + } catch (e) { + console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); + throw e; + } +} +async function checkAndPreparePackage() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); + return; + } + } + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[esbuild] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by esbuild to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use esbuild. +`); + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[esbuild] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2) { + console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + maybeOptimizePackage(binPath); +} +checkAndPreparePackage().then(() => { + if (isToPathJS) { + validateBinaryVersion(process.execPath, toPath); + } else { + validateBinaryVersion(toPath); + } +}); diff --git a/e-commerce/node_modules/esbuild/lib/main.d.ts b/e-commerce/node_modules/esbuild/lib/main.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e69c39f58b92dda3496b19481468b5057a1084f --- /dev/null +++ b/e-commerce/node_modules/esbuild/lib/main.d.ts @@ -0,0 +1,716 @@ +export type Platform = 'browser' | 'node' | 'neutral' +export type Format = 'iife' | 'cjs' | 'esm' +export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' +export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' +export type Charset = 'ascii' | 'utf8' +export type Drop = 'console' | 'debugger' +export type AbsPaths = 'code' | 'log' | 'metafile' + +interface CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcemap */ + sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' + /** Documentation: https://esbuild.github.io/api/#legal-comments */ + legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' + /** Documentation: https://esbuild.github.io/api/#source-root */ + sourceRoot?: string + /** Documentation: https://esbuild.github.io/api/#sources-content */ + sourcesContent?: boolean + + /** Documentation: https://esbuild.github.io/api/#format */ + format?: Format + /** Documentation: https://esbuild.github.io/api/#global-name */ + globalName?: string + /** Documentation: https://esbuild.github.io/api/#target */ + target?: string | string[] + /** Documentation: https://esbuild.github.io/api/#supported */ + supported?: Record + /** Documentation: https://esbuild.github.io/api/#platform */ + platform?: Platform + + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + reserveProps?: RegExp + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleQuoted?: boolean + /** Documentation: https://esbuild.github.io/api/#mangle-props */ + mangleCache?: Record + /** Documentation: https://esbuild.github.io/api/#drop */ + drop?: Drop[] + /** Documentation: https://esbuild.github.io/api/#drop-labels */ + dropLabels?: string[] + /** Documentation: https://esbuild.github.io/api/#minify */ + minify?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyWhitespace?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifyIdentifiers?: boolean + /** Documentation: https://esbuild.github.io/api/#minify */ + minifySyntax?: boolean + /** Documentation: https://esbuild.github.io/api/#line-limit */ + lineLimit?: number + /** Documentation: https://esbuild.github.io/api/#charset */ + charset?: Charset + /** Documentation: https://esbuild.github.io/api/#tree-shaking */ + treeShaking?: boolean + /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ + ignoreAnnotations?: boolean + + /** Documentation: https://esbuild.github.io/api/#jsx */ + jsx?: 'transform' | 'preserve' | 'automatic' + /** Documentation: https://esbuild.github.io/api/#jsx-factory */ + jsxFactory?: string + /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ + jsxFragment?: string + /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ + jsxImportSource?: string + /** Documentation: https://esbuild.github.io/api/#jsx-development */ + jsxDev?: boolean + /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ + jsxSideEffects?: boolean + + /** Documentation: https://esbuild.github.io/api/#define */ + define?: { [key: string]: string } + /** Documentation: https://esbuild.github.io/api/#pure */ + pure?: string[] + /** Documentation: https://esbuild.github.io/api/#keep-names */ + keepNames?: boolean + + /** Documentation: https://esbuild.github.io/api/#abs-paths */ + absPaths?: AbsPaths[] + /** Documentation: https://esbuild.github.io/api/#color */ + color?: boolean + /** Documentation: https://esbuild.github.io/api/#log-level */ + logLevel?: LogLevel + /** Documentation: https://esbuild.github.io/api/#log-limit */ + logLimit?: number + /** Documentation: https://esbuild.github.io/api/#log-override */ + logOverride?: Record + + /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ + tsconfigRaw?: string | TsconfigRaw +} + +export interface TsconfigRaw { + compilerOptions?: { + alwaysStrict?: boolean + baseUrl?: string + experimentalDecorators?: boolean + importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' + jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' + jsxFactory?: string + jsxFragmentFactory?: string + jsxImportSource?: string + paths?: Record + preserveValueImports?: boolean + strict?: boolean + target?: string + useDefineForClassFields?: boolean + verbatimModuleSyntax?: boolean + } +} + +export interface BuildOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#bundle */ + bundle?: boolean + /** Documentation: https://esbuild.github.io/api/#splitting */ + splitting?: boolean + /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ + preserveSymlinks?: boolean + /** Documentation: https://esbuild.github.io/api/#outfile */ + outfile?: string + /** Documentation: https://esbuild.github.io/api/#metafile */ + metafile?: boolean + /** Documentation: https://esbuild.github.io/api/#outdir */ + outdir?: string + /** Documentation: https://esbuild.github.io/api/#outbase */ + outbase?: string + /** Documentation: https://esbuild.github.io/api/#external */ + external?: string[] + /** Documentation: https://esbuild.github.io/api/#packages */ + packages?: 'bundle' | 'external' + /** Documentation: https://esbuild.github.io/api/#alias */ + alias?: Record + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: { [ext: string]: Loader } + /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ + resolveExtensions?: string[] + /** Documentation: https://esbuild.github.io/api/#main-fields */ + mainFields?: string[] + /** Documentation: https://esbuild.github.io/api/#conditions */ + conditions?: string[] + /** Documentation: https://esbuild.github.io/api/#write */ + write?: boolean + /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ + allowOverwrite?: boolean + /** Documentation: https://esbuild.github.io/api/#tsconfig */ + tsconfig?: string + /** Documentation: https://esbuild.github.io/api/#out-extension */ + outExtension?: { [ext: string]: string } + /** Documentation: https://esbuild.github.io/api/#public-path */ + publicPath?: string + /** Documentation: https://esbuild.github.io/api/#entry-names */ + entryNames?: string + /** Documentation: https://esbuild.github.io/api/#chunk-names */ + chunkNames?: string + /** Documentation: https://esbuild.github.io/api/#asset-names */ + assetNames?: string + /** Documentation: https://esbuild.github.io/api/#inject */ + inject?: string[] + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: { [type: string]: string } + /** Documentation: https://esbuild.github.io/api/#entry-points */ + entryPoints?: (string | { in: string, out: string })[] | Record + /** Documentation: https://esbuild.github.io/api/#stdin */ + stdin?: StdinOptions + /** Documentation: https://esbuild.github.io/plugins/ */ + plugins?: Plugin[] + /** Documentation: https://esbuild.github.io/api/#working-directory */ + absWorkingDir?: string + /** Documentation: https://esbuild.github.io/api/#node-paths */ + nodePaths?: string[]; // The "NODE_PATH" variable from Node.js +} + +export interface StdinOptions { + contents: string | Uint8Array + resolveDir?: string + sourcefile?: string + loader?: Loader +} + +export interface Message { + id: string + pluginName: string + text: string + location: Location | null + notes: Note[] + + /** + * Optional user-specified data that is passed through unmodified. You can + * use this to stash the original error, for example. + */ + detail: any +} + +export interface Note { + text: string + location: Location | null +} + +export interface Location { + file: string + namespace: string + /** 1-based */ + line: number + /** 0-based, in bytes */ + column: number + /** in bytes */ + length: number + lineText: string + suggestion: string +} + +export interface OutputFile { + path: string + contents: Uint8Array + hash: string + /** "contents" as text (changes automatically with "contents") */ + readonly text: string +} + +export interface BuildResult { + errors: Message[] + warnings: Message[] + /** Only when "write: false" */ + outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) + /** Only when "metafile: true" */ + metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) +} + +export interface BuildFailure extends Error { + errors: Message[] + warnings: Message[] +} + +/** Documentation: https://esbuild.github.io/api/#serve-arguments */ +export interface ServeOptions { + port?: number + host?: string + servedir?: string + keyfile?: string + certfile?: string + fallback?: string + cors?: CORSOptions + onRequest?: (args: ServeOnRequestArgs) => void +} + +/** Documentation: https://esbuild.github.io/api/#cors */ +export interface CORSOptions { + origin?: string | string[] +} + +export interface ServeOnRequestArgs { + remoteAddress: string + method: string + path: string + status: number + /** The time to generate the response, not to send it */ + timeInMS: number +} + +/** Documentation: https://esbuild.github.io/api/#serve-return-values */ +export interface ServeResult { + port: number + hosts: string[] +} + +export interface TransformOptions extends CommonOptions { + /** Documentation: https://esbuild.github.io/api/#sourcefile */ + sourcefile?: string + /** Documentation: https://esbuild.github.io/api/#loader */ + loader?: Loader + /** Documentation: https://esbuild.github.io/api/#banner */ + banner?: string + /** Documentation: https://esbuild.github.io/api/#footer */ + footer?: string +} + +export interface TransformResult { + code: string + map: string + warnings: Message[] + /** Only when "mangleCache" is present */ + mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) + /** Only when "legalComments" is "external" */ + legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) +} + +export interface TransformFailure extends Error { + errors: Message[] + warnings: Message[] +} + +export interface Plugin { + name: string + setup: (build: PluginBuild) => (void | Promise) +} + +export interface PluginBuild { + /** Documentation: https://esbuild.github.io/plugins/#build-options */ + initialOptions: BuildOptions + + /** Documentation: https://esbuild.github.io/plugins/#resolve */ + resolve(path: string, options?: ResolveOptions): Promise + + /** Documentation: https://esbuild.github.io/plugins/#on-start */ + onStart(callback: () => + (OnStartResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-end */ + onEnd(callback: (result: BuildResult) => + (OnEndResult | null | void | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ + onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => + (OnResolveResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-load */ + onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => + (OnLoadResult | null | undefined | Promise)): void + + /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ + onDispose(callback: () => void): void + + // This is a full copy of the esbuild library in case you need it + esbuild: { + context: typeof context, + build: typeof build, + buildSync: typeof buildSync, + transform: typeof transform, + transformSync: typeof transformSync, + formatMessages: typeof formatMessages, + formatMessagesSync: typeof formatMessagesSync, + analyzeMetafile: typeof analyzeMetafile, + analyzeMetafileSync: typeof analyzeMetafileSync, + initialize: typeof initialize, + version: typeof version, + } +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ +export interface ResolveOptions { + pluginName?: string + importer?: string + namespace?: string + resolveDir?: string + kind?: ImportKind + pluginData?: any + with?: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ +export interface ResolveResult { + errors: Message[] + warnings: Message[] + + path: string + external: boolean + sideEffects: boolean + namespace: string + suffix: string + pluginData: any +} + +export interface OnStartResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +export interface OnEndResult { + errors?: PartialMessage[] + warnings?: PartialMessage[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ +export interface OnResolveOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ +export interface OnResolveArgs { + path: string + importer: string + namespace: string + resolveDir: string + kind: ImportKind + pluginData: any + with: Record +} + +export type ImportKind = + | 'entry-point' + + // JS + | 'import-statement' + | 'require-call' + | 'dynamic-import' + | 'require-resolve' + + // CSS + | 'import-rule' + | 'composes-from' + | 'url-token' + +/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ +export interface OnResolveResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + path?: string + external?: boolean + sideEffects?: boolean + namespace?: string + suffix?: string + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ +export interface OnLoadOptions { + filter: RegExp + namespace?: string +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ +export interface OnLoadArgs { + path: string + namespace: string + suffix: string + pluginData: any + with: Record +} + +/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ +export interface OnLoadResult { + pluginName?: string + + errors?: PartialMessage[] + warnings?: PartialMessage[] + + contents?: string | Uint8Array + resolveDir?: string + loader?: Loader + pluginData?: any + + watchFiles?: string[] + watchDirs?: string[] +} + +export interface PartialMessage { + id?: string + pluginName?: string + text?: string + location?: Partial | null + notes?: PartialNote[] + detail?: any +} + +export interface PartialNote { + text?: string + location?: Partial | null +} + +/** Documentation: https://esbuild.github.io/api/#metafile */ +export interface Metafile { + inputs: { + [path: string]: { + bytes: number + imports: { + path: string + kind: ImportKind + external?: boolean + original?: string + with?: Record + }[] + format?: 'cjs' | 'esm' + with?: Record + } + } + outputs: { + [path: string]: { + bytes: number + inputs: { + [path: string]: { + bytesInOutput: number + } + } + imports: { + path: string + kind: ImportKind | 'file-loader' + external?: boolean + }[] + exports: string[] + entryPoint?: string + cssBundle?: string + } + } +} + +export interface FormatMessagesOptions { + kind: 'error' | 'warning' + color?: boolean + terminalWidth?: number +} + +export interface AnalyzeMetafileOptions { + color?: boolean + verbose?: boolean +} + +/** Documentation: https://esbuild.github.io/api/#watch-arguments */ +export interface WatchOptions { + delay?: number // In milliseconds +} + +export interface BuildContext { + /** Documentation: https://esbuild.github.io/api/#rebuild */ + rebuild(): Promise> + + /** Documentation: https://esbuild.github.io/api/#watch */ + watch(options?: WatchOptions): Promise + + /** Documentation: https://esbuild.github.io/api/#serve */ + serve(options?: ServeOptions): Promise + + cancel(): Promise + dispose(): Promise +} + +// This is a TypeScript type-level function which replaces any keys in "In" +// that aren't in "Out" with "never". We use this to reject properties with +// typos in object literals. See: https://stackoverflow.com/questions/49580725 +type SameShape = In & { [Key in Exclude]: never } + +/** + * This function invokes the "esbuild" command-line tool for you. It returns a + * promise that either resolves with a "BuildResult" object or rejects with a + * "BuildFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function build(options: SameShape): Promise> + +/** + * This is the advanced long-running form of "build" that supports additional + * features such as watch mode and a local development server. + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function context(options: SameShape): Promise> + +/** + * This function transforms a single JavaScript file. It can be used to minify + * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript + * to older JavaScript. It returns a promise that is either resolved with a + * "TransformResult" object or rejected with a "TransformFailure" object. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> + +/** + * Converts log messages to formatted message strings suitable for printing in + * the terminal. This allows you to reuse the built-in behavior of esbuild's + * log message formatter. This is a batch-oriented API for efficiency. + * + * - Works in node: yes + * - Works in browser: yes + */ +export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise + +/** + * Pretty-prints an analysis of the metafile JSON to a string. This is just for + * convenience to be able to match esbuild's pretty-printing exactly. If you want + * to customize it, you can just inspect the data in the metafile yourself. + * + * - Works in node: yes + * - Works in browser: yes + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise + +/** + * A synchronous version of "build". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#build + */ +export declare function buildSync(options: SameShape): BuildResult + +/** + * A synchronous version of "transform". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#transform + */ +export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult + +/** + * A synchronous version of "formatMessages". + * + * - Works in node: yes + * - Works in browser: no + */ +export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] + +/** + * A synchronous version of "analyzeMetafile". + * + * - Works in node: yes + * - Works in browser: no + * + * Documentation: https://esbuild.github.io/api/#analyze + */ +export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string + +/** + * This configures the browser-based version of esbuild. It is necessary to + * call this first and wait for the returned promise to be resolved before + * making other API calls when using esbuild in the browser. + * + * - Works in node: yes + * - Works in browser: yes ("options" is required) + * + * Documentation: https://esbuild.github.io/api/#browser + */ +export declare function initialize(options: InitializeOptions): Promise + +export interface InitializeOptions { + /** + * The URL of the "esbuild.wasm" file. This must be provided when running + * esbuild in the browser. + */ + wasmURL?: string | URL + + /** + * The result of calling "new WebAssembly.Module(buffer)" where "buffer" + * is a typed array or ArrayBuffer containing the binary code of the + * "esbuild.wasm" file. + * + * You can use this as an alternative to "wasmURL" for environments where it's + * not possible to download the WebAssembly module. + */ + wasmModule?: WebAssembly.Module + + /** + * By default esbuild runs the WebAssembly-based browser API in a web worker + * to avoid blocking the UI thread. This can be disabled by setting "worker" + * to false. + */ + worker?: boolean +} + +export let version: string + +// Call this function to terminate esbuild's child process. The child process +// is not terminated and re-created after each API call because it's more +// efficient to keep it around when there are multiple API calls. +// +// In node this happens automatically before the parent node process exits. So +// you only need to call this if you know you will not make any more esbuild +// API calls and you want to clean up resources. +// +// Unlike node, Deno lacks the necessary APIs to clean up child processes +// automatically. You must manually call stop() in Deno when you're done +// using esbuild or Deno will continue running forever. +// +// Another reason you might want to call this is if you are using esbuild from +// within a Deno test. Deno fails tests that create a child process without +// killing it before the test ends, so you have to call this function (and +// await the returned promise) in every Deno test that uses esbuild. +export declare function stop(): Promise + +// Note: These declarations exist to avoid type errors when you omit "dom" from +// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the +// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do +// with the browser DOM and is present in many non-browser JavaScript runtimes +// (e.g. node and deno). Declaring it here allows esbuild's API to be used in +// these scenarios. +// +// There's an open issue about getting this problem corrected (although these +// declarations will need to remain even if this is fixed for backward +// compatibility with older TypeScript versions): +// +// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 +// +declare global { + namespace WebAssembly { + interface Module { + } + } + interface URL { + } +} diff --git a/e-commerce/node_modules/esbuild/lib/main.js b/e-commerce/node_modules/esbuild/lib/main.js new file mode 100644 index 0000000000000000000000000000000000000000..87aa87b00cf9eb27dcad88b11b2570298cc8c422 --- /dev/null +++ b/e-commerce/node_modules/esbuild/lib/main.js @@ -0,0 +1,2242 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/npm/node.ts +var node_exports = {}; +__export(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform, + transformSync: () => transformSync, + version: () => version +}); +module.exports = __toCommonJS(node_exports); + +// lib/shared/stdio_protocol.ts +function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); +} +function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; +} +var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } +}; +var encodeUTF8; +var decodeUTF8; +var encodeInvariant; +if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; +} else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; +} else { + throw new Error("No UTF-8 codec found"); +} +if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); +function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; +} +function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; +} + +// lib/shared/common.ts +var quote = JSON.stringify; +var buildLogLevelDefault = "warning"; +var transformLogLevelDefault = "silent"; +function validateAndJoinStringArray(values, what) { + const toJoin = []; + for (const value of values) { + validateStringValue(value, what); + if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`); + toJoin.push(value); + } + return toJoin.join(","); +} +var canBeAnything = () => null; +var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; +var mustBeString = (value) => typeof value === "string" ? null : "a string"; +var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; +var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; +var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number"; +var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; +var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; +var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings"; +var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; +var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; +var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; +var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; +var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; +var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; +var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings"; +var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; +var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; +function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; +} +function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } +} +function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; +} +function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; +} +function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); +} +function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; +} +function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`); + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`); + if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`); + if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`); + if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); +} +function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings); + let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings); + let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings); + let external = getFlag(options, keys, "external", mustBeArrayOfStrings); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`); + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`); + if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`); + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; +} +function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; +} +function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.25.12") { + throw new Error(`Cannot start service: Host version "${"0.25.12"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform2, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; +} +function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + const delay = getFlag(options2, keys, "delay", mustBeInteger); + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + if (delay) request2.delay = delay; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeValidPortNumber); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const cors = getFlag(options2, keys, "cors", mustBeObject); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + if (cors) { + const corsKeys = {}; + const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings); + checkForInvalidFlags(cors, corsKeys, `on "cors" object`); + if (Array.isArray(origin)) request2.corsOrigin = origin; + else if (origin !== void 0) request2.corsOrigin = [origin]; + } + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve(response2); + }); + }), + cancel: () => new Promise((resolve) => { + if (didDispose) return resolve(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + }); + }), + dispose: () => new Promise((resolve) => { + if (didDispose) return resolve(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } +} +var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve2, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve2({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; +}; +function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; +} +function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; +} +function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; +} +function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; +} +function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; +} +function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; +} +function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; +} +function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; +} +function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; +} +function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; +} +function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; +} +function jsRegExpToGoRegExp(regexp) { + let result = regexp.source; + if (regexp.flags) result = `(?${regexp.flags})${result}`; + return result; +} + +// lib/npm/node-platform.ts +var fs = require("fs"); +var os = require("os"); +var path = require("path"); +var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; +var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; +var packageDarwin_arm64 = "@esbuild/darwin-arm64"; +var packageDarwin_x64 = "@esbuild/darwin-x64"; +var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" +}; +var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd arm64 LE": "@esbuild/netbsd-arm64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" +}; +var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64", + "openharmony arm64 LE": "@esbuild/openharmony-arm64" +}; +function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; +} +function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); + if (path.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; +} +function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path.dirname(require.resolve("esbuild")); + return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); +} +function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.25.12"}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; +} + +// lib/npm/node.ts +var child_process = require("child_process"); +var crypto = require("crypto"); +var path2 = require("path"); +var fs2 = require("fs"); +var os2 = require("os"); +var tty = require("tty"); +var worker_threads; +if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } +}; +var isTTY = () => tty.isatty(2); +var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs2.readFileSync(tempFile, "utf8"); + try { + fs2.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } +}; +var fsAsync = { + readFile(tempFile, callback) { + try { + fs2.readFile(tempFile, "utf8", (err, contents) => { + try { + fs2.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } +}; +var version = "0.25.12"; +var build = (options) => ensureServiceIsRunning().build(options); +var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); +var transform = (input, options) => ensureServiceIsRunning().transform(input, options); +var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); +var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); +var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; +}; +var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); +}; +var initializeWasCalled = false; +var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); +}; +var defaultWD = process.cwd(); +var longLivedService; +var stopService; +var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.25.12"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs2.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + }); + }), + context: (options) => new Promise((resolve, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + transform: (input, options) => new Promise((resolve, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve(res) + })) + }; + return longLivedService; +}; +var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.12"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); +}; +var randomFileName = () => { + return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); +}; +var workerThreadService = null; +var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.25.12" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; +}; +var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } +}; +if (isInternalWorkerThread) { + startSyncServiceWorker(); +} +var node_default = node_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + analyzeMetafile, + analyzeMetafileSync, + build, + buildSync, + context, + formatMessages, + formatMessagesSync, + initialize, + stop, + transform, + transformSync, + version +}); diff --git a/e-commerce/node_modules/esbuild/package.json b/e-commerce/node_modules/esbuild/package.json new file mode 100644 index 0000000000000000000000000000000000000000..afe58fd661266181a1b32ce5d44198b3c5090f08 --- /dev/null +++ b/e-commerce/node_modules/esbuild/package.json @@ -0,0 +1,49 @@ +{ + "name": "esbuild", + "version": "0.25.12", + "description": "An extremely fast JavaScript and CSS bundler and minifier.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "scripts": { + "postinstall": "node install.js" + }, + "main": "lib/main.js", + "types": "lib/main.d.ts", + "engines": { + "node": ">=18" + }, + "bin": { + "esbuild": "bin/esbuild" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + }, + "license": "MIT" +} diff --git a/e-commerce/node_modules/escalade/dist/index.js b/e-commerce/node_modules/escalade/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ad236c492050394ade5d7d3d1749e5bcfcc8542b --- /dev/null +++ b/e-commerce/node_modules/escalade/dist/index.js @@ -0,0 +1,22 @@ +const { dirname, resolve } = require('path'); +const { readdir, stat } = require('fs'); +const { promisify } = require('util'); + +const toStats = promisify(stat); +const toRead = promisify(readdir); + +module.exports = async function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = await toStats(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = await callback(dir, await toRead(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/e-commerce/node_modules/escalade/dist/index.mjs b/e-commerce/node_modules/escalade/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bf95be03425c909cd4aaef11fdb7ac6fe31e2dd3 --- /dev/null +++ b/e-commerce/node_modules/escalade/dist/index.mjs @@ -0,0 +1,22 @@ +import { dirname, resolve } from 'path'; +import { readdir, stat } from 'fs'; +import { promisify } from 'util'; + +const toStats = promisify(stat); +const toRead = promisify(readdir); + +export default async function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = await toStats(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = await callback(dir, await toRead(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/e-commerce/node_modules/escalade/index.d.mts b/e-commerce/node_modules/escalade/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..550699cf98e1c9b4de9b01128d072c1d8f6bd7e0 --- /dev/null +++ b/e-commerce/node_modules/escalade/index.d.mts @@ -0,0 +1,11 @@ +type Promisable = T | Promise; + +export type Callback = ( + directory: string, + files: string[], +) => Promisable; + +export default function ( + directory: string, + callback: Callback, +): Promise; diff --git a/e-commerce/node_modules/escalade/index.d.ts b/e-commerce/node_modules/escalade/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26c58f2f3165162e35bf72c190d4c70955dbc9ec --- /dev/null +++ b/e-commerce/node_modules/escalade/index.d.ts @@ -0,0 +1,15 @@ +type Promisable = T | Promise; + +declare namespace escalade { + export type Callback = ( + directory: string, + files: string[], + ) => Promisable; +} + +declare function escalade( + directory: string, + callback: escalade.Callback, +): Promise; + +export = escalade; diff --git a/e-commerce/node_modules/escalade/license b/e-commerce/node_modules/escalade/license new file mode 100644 index 0000000000000000000000000000000000000000..fa6089faba3cf381229744c9f21ed3ae9ed5014a --- /dev/null +++ b/e-commerce/node_modules/escalade/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Luke Edwards (lukeed.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/e-commerce/node_modules/escalade/package.json b/e-commerce/node_modules/escalade/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1eed4f93a81e8d9c613bb36e2bf6840472c31ade --- /dev/null +++ b/e-commerce/node_modules/escalade/package.json @@ -0,0 +1,74 @@ +{ + "name": "escalade", + "version": "3.2.0", + "repository": "lukeed/escalade", + "description": "A tiny (183B to 210B) and fast utility to ascend parent directories", + "module": "dist/index.mjs", + "main": "dist/index.js", + "types": "index.d.ts", + "license": "MIT", + "author": { + "name": "Luke Edwards", + "email": "luke.edwards05@gmail.com", + "url": "https://lukeed.com" + }, + "exports": { + ".": [ + { + "import": { + "types": "./index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./index.d.ts", + "default": "./dist/index.js" + } + }, + "./dist/index.js" + ], + "./sync": [ + { + "import": { + "types": "./sync/index.d.mts", + "default": "./sync/index.mjs" + }, + "require": { + "types": "./sync/index.d.ts", + "default": "./sync/index.js" + } + }, + "./sync/index.js" + ] + }, + "files": [ + "*.d.mts", + "*.d.ts", + "dist", + "sync" + ], + "modes": { + "sync": "src/sync.js", + "default": "src/async.js" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "build": "bundt", + "pretest": "npm run build", + "test": "uvu -r esm test -i fixtures" + }, + "keywords": [ + "find", + "parent", + "parents", + "directory", + "search", + "walk" + ], + "devDependencies": { + "bundt": "1.1.1", + "esm": "3.2.25", + "uvu": "0.3.3" + } +} diff --git a/e-commerce/node_modules/escalade/readme.md b/e-commerce/node_modules/escalade/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e07ee0d387a9e5531d4bfa596272ed7b7c8ce124 --- /dev/null +++ b/e-commerce/node_modules/escalade/readme.md @@ -0,0 +1,211 @@ +# escalade [![CI](https://github.com/lukeed/escalade/workflows/CI/badge.svg)](https://github.com/lukeed/escalade/actions) [![licenses](https://licenses.dev/b/npm/escalade)](https://licenses.dev/npm/escalade) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/escalade)](https://codecov.io/gh/lukeed/escalade) + +> A tiny (183B to 210B) and [fast](#benchmarks) utility to ascend parent directories + +With [escalade](https://en.wikipedia.org/wiki/Escalade), you can scale parent directories until you've found what you're looking for.
Given an input file or directory, `escalade` will continue executing your callback function until either: + +1) the callback returns a truthy value +2) `escalade` has reached the system root directory (eg, `/`) + +> **Important:**
Please note that `escalade` only deals with direct ancestry – it will not dive into parents' sibling directories. + +--- + +**Notice:** As of v3.1.0, `escalade` now includes [Deno support](http://deno.land/x/escalade)! Please see [Deno Usage](#deno) below. + +--- + +## Install + +``` +$ npm install --save escalade +``` + + +## Modes + +There are two "versions" of `escalade` available: + +#### "async" +> **Node.js:** >= 8.x
+> **Size (gzip):** 210 bytes
+> **Availability:** [CommonJS](https://unpkg.com/escalade/dist/index.js), [ES Module](https://unpkg.com/escalade/dist/index.mjs) + +This is the primary/default mode. It makes use of `async`/`await` and [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original). + +#### "sync" +> **Node.js:** >= 6.x
+> **Size (gzip):** 183 bytes
+> **Availability:** [CommonJS](https://unpkg.com/escalade/sync/index.js), [ES Module](https://unpkg.com/escalade/sync/index.mjs) + +This is the opt-in mode, ideal for scenarios where `async` usage cannot be supported. + + +## Usage + +***Example Structure*** + +``` +/Users/lukeed + └── oss + ├── license + └── escalade + ├── package.json + └── test + └── fixtures + ├── index.js + └── foobar + └── demo.js +``` + +***Example Usage*** + +```js +//~> demo.js +import { join } from 'path'; +import escalade from 'escalade'; + +const input = join(__dirname, 'demo.js'); +// or: const input = __dirname; + +const pkg = await escalade(input, (dir, names) => { + console.log('~> dir:', dir); + console.log('~> names:', names); + console.log('---'); + + if (names.includes('package.json')) { + // will be resolved into absolute + return 'package.json'; + } +}); + +//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar +//~> names: ['demo.js'] +//--- +//~> dir: /Users/lukeed/oss/escalade/test/fixtures +//~> names: ['index.js', 'foobar'] +//--- +//~> dir: /Users/lukeed/oss/escalade/test +//~> names: ['fixtures'] +//--- +//~> dir: /Users/lukeed/oss/escalade +//~> names: ['package.json', 'test'] +//--- + +console.log(pkg); +//=> /Users/lukeed/oss/escalade/package.json + +// Now search for "missing123.txt" +// (Assume it doesn't exist anywhere!) +const missing = await escalade(input, (dir, names) => { + console.log('~> dir:', dir); + return names.includes('missing123.txt') && 'missing123.txt'; +}); + +//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar +//~> dir: /Users/lukeed/oss/escalade/test/fixtures +//~> dir: /Users/lukeed/oss/escalade/test +//~> dir: /Users/lukeed/oss/escalade +//~> dir: /Users/lukeed/oss +//~> dir: /Users/lukeed +//~> dir: /Users +//~> dir: / + +console.log(missing); +//=> undefined +``` + +> **Note:** To run the above example with "sync" mode, import from `escalade/sync` and remove the `await` keyword. + + +## API + +### escalade(input, callback) +Returns: `string|void` or `Promise` + +When your `callback` locates a file, `escalade` will resolve/return with an absolute path.
+If your `callback` was never satisfied, then `escalade` will resolve/return with nothing (undefined). + +> **Important:**
The `sync` and `async` versions share the same API.
The **only** difference is that `sync` is not Promise-based. + +#### input +Type: `string` + +The path from which to start ascending. + +This may be a file or a directory path.
However, when `input` is a file, `escalade` will begin with its parent directory. + +> **Important:** Unless given an absolute path, `input` will be resolved from `process.cwd()` location. + +#### callback +Type: `Function` + +The callback to execute for each ancestry level. It always is given two arguments: + +1) `dir` - an absolute path of the current parent directory +2) `names` - a list (`string[]`) of contents _relative to_ the `dir` parent + +> **Note:** The `names` list can contain names of files _and_ directories. + +When your callback returns a _falsey_ value, then `escalade` will continue with `dir`'s parent directory, re-invoking your callback with new argument values. + +When your callback returns a string, then `escalade` stops iteration immediately.
+If the string is an absolute path, then it's left as is. Otherwise, the string is resolved into an absolute path _from_ the `dir` that housed the satisfying condition. + +> **Important:** Your `callback` can be a `Promise/AsyncFunction` when using the "async" version of `escalade`. + +## Benchmarks + +> Running on Node.js v10.13.0 + +``` +# Load Time + find-up 3.891ms + escalade 0.485ms + escalade/sync 0.309ms + +# Levels: 6 (target = "foo.txt"): + find-up x 24,856 ops/sec ±6.46% (55 runs sampled) + escalade x 73,084 ops/sec ±4.23% (73 runs sampled) + find-up.sync x 3,663 ops/sec ±1.12% (83 runs sampled) + escalade/sync x 9,360 ops/sec ±0.62% (88 runs sampled) + +# Levels: 12 (target = "package.json"): + find-up x 29,300 ops/sec ±10.68% (70 runs sampled) + escalade x 73,685 ops/sec ± 5.66% (66 runs sampled) + find-up.sync x 1,707 ops/sec ± 0.58% (91 runs sampled) + escalade/sync x 4,667 ops/sec ± 0.68% (94 runs sampled) + +# Levels: 18 (target = "missing123.txt"): + find-up x 21,818 ops/sec ±17.37% (14 runs sampled) + escalade x 67,101 ops/sec ±21.60% (20 runs sampled) + find-up.sync x 1,037 ops/sec ± 2.86% (88 runs sampled) + escalade/sync x 1,248 ops/sec ± 0.50% (93 runs sampled) +``` + +## Deno + +As of v3.1.0, `escalade` is available on the Deno registry. + +Please note that the [API](#api) is identical and that there are still [two modes](#modes) from which to choose: + +```ts +// Choose "async" mode +import escalade from 'https://deno.land/escalade/async.ts'; + +// Choose "sync" mode +import escalade from 'https://deno.land/escalade/sync.ts'; +``` + +> **Important:** The `allow-read` permission is required! + + +## Related + +- [premove](https://github.com/lukeed/premove) - A tiny (247B) utility to remove items recursively +- [totalist](https://github.com/lukeed/totalist) - A tiny (195B to 224B) utility to recursively list all (total) files in a directory +- [mk-dirs](https://github.com/lukeed/mk-dirs) - A tiny (420B) utility to make a directory and its parents, recursively + +## License + +MIT © [Luke Edwards](https://lukeed.com) diff --git a/e-commerce/node_modules/escalade/sync/index.d.mts b/e-commerce/node_modules/escalade/sync/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c023d37b286d1f16630ed054d492c027184dffc0 --- /dev/null +++ b/e-commerce/node_modules/escalade/sync/index.d.mts @@ -0,0 +1,9 @@ +export type Callback = ( + directory: string, + files: string[], +) => string | false | void; + +export default function ( + directory: string, + callback: Callback, +): string | void; diff --git a/e-commerce/node_modules/escalade/sync/index.d.ts b/e-commerce/node_modules/escalade/sync/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d5b5890c38169867e93a5dd6d3e9ed829370243 --- /dev/null +++ b/e-commerce/node_modules/escalade/sync/index.d.ts @@ -0,0 +1,13 @@ +declare namespace escalade { + export type Callback = ( + directory: string, + files: string[], + ) => string | false | void; +} + +declare function escalade( + directory: string, + callback: escalade.Callback, +): string | void; + +export = escalade; diff --git a/e-commerce/node_modules/escalade/sync/index.js b/e-commerce/node_modules/escalade/sync/index.js new file mode 100644 index 0000000000000000000000000000000000000000..902cc46cd9a80b10aa787e067ff1936ada95505d --- /dev/null +++ b/e-commerce/node_modules/escalade/sync/index.js @@ -0,0 +1,18 @@ +const { dirname, resolve } = require('path'); +const { readdirSync, statSync } = require('fs'); + +module.exports = function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = statSync(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = callback(dir, readdirSync(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/e-commerce/node_modules/escalade/sync/index.mjs b/e-commerce/node_modules/escalade/sync/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3cdc5bd1fee04733ea106fd6cdde40ec094880cb --- /dev/null +++ b/e-commerce/node_modules/escalade/sync/index.mjs @@ -0,0 +1,18 @@ +import { dirname, resolve } from 'path'; +import { readdirSync, statSync } from 'fs'; + +export default function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = statSync(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = callback(dir, readdirSync(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/e-commerce/node_modules/fraction.js/LICENSE b/e-commerce/node_modules/fraction.js/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6dd5328fed221e1aeb2a61c0bf61c9e13e664b91 --- /dev/null +++ b/e-commerce/node_modules/fraction.js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Robert Eisele + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/e-commerce/node_modules/fraction.js/README.md b/e-commerce/node_modules/fraction.js/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7d3f31a46fa9ffb17a391abe265330641a90c386 --- /dev/null +++ b/e-commerce/node_modules/fraction.js/README.md @@ -0,0 +1,466 @@ +# Fraction.js - ℚ in JavaScript + +[![NPM Package](https://img.shields.io/npm/v/fraction.js.svg?style=flat)](https://npmjs.org/package/fraction.js "View this project on npm") +[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) + + +Tired of inprecise numbers represented by doubles, which have to store rational and irrational numbers like PI or sqrt(2) the same way? Obviously the following problem is preventable: + +```javascript +1 / 98 * 98 // = 0.9999999999999999 +``` + +If you need more precision or just want a fraction as a result, just include *Fraction.js*: + +```javascript +var Fraction = require('fraction.js'); +// or +import Fraction from 'fraction.js'; +``` + +and give it a trial: + +```javascript +Fraction(1).div(98).mul(98) // = 1 +``` + +Internally, numbers are represented as *numerator / denominator*, which adds just a little overhead. However, the library is written with performance and accuracy in mind, which makes it the perfect basis for [Polynomial.js](https://github.com/infusion/Polynomial.js) and [Math.js](https://github.com/josdejong/mathjs). + +Convert decimal to fraction +=== +The simplest job for fraction.js is to get a fraction out of a decimal: +```javascript +var x = new Fraction(1.88); +var res = x.toFraction(true); // String "1 22/25" +``` + +Examples / Motivation +=== +A simple example might be + +```javascript +var f = new Fraction("9.4'31'"); // 9.4313131313131... +f.mul([-4, 3]).mod("4.'8'"); // 4.88888888888888... +``` +The result is + +```javascript +console.log(f.toFraction()); // -4154 / 1485 +``` +You could of course also access the sign (s), numerator (n) and denominator (d) on your own: +```javascript +f.s * f.n / f.d = -1 * 4154 / 1485 = -2.797306... +``` + +If you would try to calculate it yourself, you would come up with something like: + +```javascript +(9.4313131 * (-4 / 3)) % 4.888888 = -2.797308133... +``` + +Quite okay, but yea - not as accurate as it could be. + + +Laplace Probability +=== +Simple example. What's the probability of throwing a 3, and 1 or 4, and 2 or 4 or 6 with a fair dice? + +P({3}): +```javascript +var p = new Fraction([3].length, 6).toString(); // 0.1(6) +``` + +P({1, 4}): +```javascript +var p = new Fraction([1, 4].length, 6).toString(); // 0.(3) +``` + +P({2, 4, 6}): +```javascript +var p = new Fraction([2, 4, 6].length, 6).toString(); // 0.5 +``` + +Convert degrees/minutes/seconds to precise rational representation: +=== + +57+45/60+17/3600 +```javascript +var deg = 57; // 57° +var min = 45; // 45 Minutes +var sec = 17; // 17 Seconds + +new Fraction(deg).add(min, 60).add(sec, 3600).toString() // -> 57.7547(2) +``` + + +Rational approximation of irrational numbers +=== + +Now it's getting messy ;d To approximate a number like *sqrt(5) - 2* with a numerator and denominator, you can reformat the equation as follows: *pow(n / d + 2, 2) = 5*. + +Then the following algorithm will generate the rational number besides the binary representation. + +```javascript +var x = "/", s = ""; + +var a = new Fraction(0), + b = new Fraction(1); +for (var n = 0; n <= 10; n++) { + + var c = a.add(b).div(2); + + console.log(n + "\t" + a + "\t" + b + "\t" + c + "\t" + x); + + if (c.add(2).pow(2) < 5) { + a = c; + x = "1"; + } else { + b = c; + x = "0"; + } + s+= x; +} +console.log(s) +``` + +The result is + +``` +n a[n] b[n] c[n] x[n] +0 0/1 1/1 1/2 / +1 0/1 1/2 1/4 0 +2 0/1 1/4 1/8 0 +3 1/8 1/4 3/16 1 +4 3/16 1/4 7/32 1 +5 7/32 1/4 15/64 1 +6 15/64 1/4 31/128 1 +7 15/64 31/128 61/256 0 +8 15/64 61/256 121/512 0 +9 15/64 121/512 241/1024 0 +10 241/1024 121/512 483/2048 1 +``` +Thus the approximation after 11 iterations of the bisection method is *483 / 2048* and the binary representation is 0.00111100011 (see [WolframAlpha](http://www.wolframalpha.com/input/?i=sqrt%285%29-2+binary)) + + +I published another example on how to approximate PI with fraction.js on my [blog](http://www.xarg.org/2014/03/precise-calculations-in-javascript/) (Still not the best idea to approximate irrational numbers, but it illustrates the capabilities of Fraction.js perfectly). + + +Get the exact fractional part of a number +--- +```javascript +var f = new Fraction("-6.(3416)"); +console.log("" + f.mod(1).abs()); // 0.(3416) +``` + +Mathematical correct modulo +--- +The behaviour on negative congruences is different to most modulo implementations in computer science. Even the *mod()* function of Fraction.js behaves in the typical way. To solve the problem of having the mathematical correct modulo with Fraction.js you could come up with this: + +```javascript +var a = -1; +var b = 10.99; + +console.log(new Fraction(a) + .mod(b)); // Not correct, usual Modulo + +console.log(new Fraction(a) + .mod(b).add(b).mod(b)); // Correct! Mathematical Modulo +``` + +fmod() impreciseness circumvented +--- +It turns out that Fraction.js outperforms almost any fmod() implementation, including JavaScript itself, [php.js](http://phpjs.org/functions/fmod/), C++, Python, Java and even Wolframalpha due to the fact that numbers like 0.05, 0.1, ... are infinite decimal in base 2. + +The equation *fmod(4.55, 0.05)* gives *0.04999999999999957*, wolframalpha says *1/20*. The correct answer should be **zero**, as 0.05 divides 4.55 without any remainder. + + +Parser +=== + +Any function (see below) as well as the constructor of the *Fraction* class parses its input and reduce it to the smallest term. + +You can pass either Arrays, Objects, Integers, Doubles or Strings. + +Arrays / Objects +--- +```javascript +new Fraction(numerator, denominator); +new Fraction([numerator, denominator]); +new Fraction({n: numerator, d: denominator}); +``` + +Integers +--- +```javascript +new Fraction(123); +``` + +Doubles +--- +```javascript +new Fraction(55.4); +``` + +**Note:** If you pass a double as it is, Fraction.js will perform a number analysis based on Farey Sequences. If you concern performance, cache Fraction.js objects and pass arrays/objects. + +The method is really precise, but too large exact numbers, like 1234567.9991829 will result in a wrong approximation. If you want to keep the number as it is, convert it to a string, as the string parser will not perform any further observations. If you have problems with the approximation, in the file `examples/approx.js` is a different approximation algorithm, which might work better in some more specific use-cases. + + +Strings +--- +```javascript +new Fraction("123.45"); +new Fraction("123/45"); // A rational number represented as two decimals, separated by a slash +new Fraction("123:45"); // A rational number represented as two decimals, separated by a colon +new Fraction("4 123/45"); // A rational number represented as a whole number and a fraction +new Fraction("123.'456'"); // Note the quotes, see below! +new Fraction("123.(456)"); // Note the brackets, see below! +new Fraction("123.45'6'"); // Note the quotes, see below! +new Fraction("123.45(6)"); // Note the brackets, see below! +``` + +Two arguments +--- +```javascript +new Fraction(3, 2); // 3/2 = 1.5 +``` + +Repeating decimal places +--- +*Fraction.js* can easily handle repeating decimal places. For example *1/3* is *0.3333...*. There is only one repeating digit. As you can see in the examples above, you can pass a number like *1/3* as "0.'3'" or "0.(3)", which are synonym. There are no tests to parse something like 0.166666666 to 1/6! If you really want to handle this number, wrap around brackets on your own with the function below for example: 0.1(66666666) + +Assume you want to divide 123.32 / 33.6(567). [WolframAlpha](http://www.wolframalpha.com/input/?i=123.32+%2F+%2812453%2F370%29) states that you'll get a period of 1776 digits. *Fraction.js* comes to the same result. Give it a try: + +```javascript +var f = new Fraction("123.32"); +console.log("Bam: " + f.div("33.6(567)")); +``` + +To automatically make a number like "0.123123123" to something more Fraction.js friendly like "0.(123)", I hacked this little brute force algorithm in a 10 minutes. Improvements are welcome... + +```javascript +function formatDecimal(str) { + + var comma, pre, offset, pad, times, repeat; + + if (-1 === (comma = str.indexOf("."))) + return str; + + pre = str.substr(0, comma + 1); + str = str.substr(comma + 1); + + for (var i = 0; i < str.length; i++) { + + offset = str.substr(0, i); + + for (var j = 0; j < 5; j++) { + + pad = str.substr(i, j + 1); + + times = Math.ceil((str.length - offset.length) / pad.length); + + repeat = new Array(times + 1).join(pad); // Silly String.repeat hack + + if (0 === (offset + repeat).indexOf(str)) { + return pre + offset + "(" + pad + ")"; + } + } + } + return null; +} + +var f, x = formatDecimal("13.0123123123"); // = 13.0(123) +if (x !== null) { + f = new Fraction(x); +} +``` + +Attributes +=== + +The Fraction object allows direct access to the numerator, denominator and sign attributes. It is ensured that only the sign-attribute holds sign information so that a sign comparison is only necessary against this attribute. + +```javascript +var f = new Fraction('-1/2'); +console.log(f.n); // Numerator: 1 +console.log(f.d); // Denominator: 2 +console.log(f.s); // Sign: -1 +``` + + +Functions +=== + +Fraction abs() +--- +Returns the actual number without any sign information + +Fraction neg() +--- +Returns the actual number with flipped sign in order to get the additive inverse + +Fraction add(n) +--- +Returns the sum of the actual number and the parameter n + +Fraction sub(n) +--- +Returns the difference of the actual number and the parameter n + +Fraction mul(n) +--- +Returns the product of the actual number and the parameter n + +Fraction div(n) +--- +Returns the quotient of the actual number and the parameter n + +Fraction pow(exp) +--- +Returns the power of the actual number, raised to an possible rational exponent. If the result becomes non-rational the function returns `null`. + +Fraction mod(n) +--- +Returns the modulus (rest of the division) of the actual object and n (this % n). It's a much more precise [fmod()](#fmod-impreciseness-circumvented) if you like. Please note that *mod()* is just like the modulo operator of most programming languages. If you want a mathematical correct modulo, see [here](#mathematical-correct-modulo). + +Fraction mod() +--- +Returns the modulus (rest of the division) of the actual object (numerator mod denominator) + +Fraction gcd(n) +--- +Returns the fractional greatest common divisor + +Fraction lcm(n) +--- +Returns the fractional least common multiple + +Fraction ceil([places=0-16]) +--- +Returns the ceiling of a rational number with Math.ceil + +Fraction floor([places=0-16]) +--- +Returns the floor of a rational number with Math.floor + +Fraction round([places=0-16]) +--- +Returns the rational number rounded with Math.round + +Fraction roundTo(multiple) +--- +Rounds a fraction to the closest multiple of another fraction. + +Fraction inverse() +--- +Returns the multiplicative inverse of the actual number (n / d becomes d / n) in order to get the reciprocal + +Fraction simplify([eps=0.001]) +--- +Simplifies the rational number under a certain error threshold. Ex. `0.333` will be `1/3` with `eps=0.001` + +boolean equals(n) +--- +Check if two numbers are equal + +int compare(n) +--- +Compare two numbers. +``` +result < 0: n is greater than actual number +result > 0: n is smaller than actual number +result = 0: n is equal to the actual number +``` + +boolean divisible(n) +--- +Check if two numbers are divisible (n divides this) + +double valueOf() +--- +Returns a decimal representation of the fraction + +String toString([decimalPlaces=15]) +--- +Generates an exact string representation of the actual object. For repeated decimal places all digits are collected within brackets, like `1/3 = "0.(3)"`. For all other numbers, up to `decimalPlaces` significant digits are collected - which includes trailing zeros if the number is getting truncated. However, `1/2 = "0.5"` without trailing zeros of course. + +**Note:** As `valueOf()` and `toString()` are provided, `toString()` is only called implicitly in a real string context. Using the plus-operator like `"123" + new Fraction` will call valueOf(), because JavaScript tries to combine two primitives first and concatenates them later, as string will be the more dominant type. `alert(new Fraction)` or `String(new Fraction)` on the other hand will do what you expect. If you really want to have control, you should call `toString()` or `valueOf()` explicitly! + +String toLatex(excludeWhole=false) +--- +Generates an exact LaTeX representation of the actual object. You can see a [live demo](http://www.xarg.org/2014/03/precise-calculations-in-javascript/) on my blog. + +The optional boolean parameter indicates if you want to exclude the whole part. "1 1/3" instead of "4/3" + +String toFraction(excludeWhole=false) +--- +Gets a string representation of the fraction + +The optional boolean parameter indicates if you want to exclude the whole part. "1 1/3" instead of "4/3" + +Array toContinued() +--- +Gets an array of the fraction represented as a continued fraction. The first element always contains the whole part. + +```javascript +var f = new Fraction('88/33'); +var c = f.toContinued(); // [2, 1, 2] +``` + +Fraction clone() +--- +Creates a copy of the actual Fraction object + + +Exceptions +=== +If a really hard error occurs (parsing error, division by zero), *fraction.js* throws exceptions! Please make sure you handle them correctly. + + + +Installation +=== +Installing fraction.js is as easy as cloning this repo or use the following command: + +``` +npm install fraction.js +``` + +Using Fraction.js with the browser +=== +```html + + +``` + +Using Fraction.js with TypeScript +=== +```js +import Fraction from "fraction.js"; +console.log(Fraction("123/456")); +``` + +Coding Style +=== +As every library I publish, fraction.js is also built to be as small as possible after compressing it with Google Closure Compiler in advanced mode. Thus the coding style orientates a little on maxing-out the compression rate. Please make sure you keep this style if you plan to extend the library. + + +Precision +=== +Fraction.js tries to circumvent floating point errors, by having an internal representation of numerator and denominator. As it relies on JavaScript, there is also a limit. The biggest number representable is `Number.MAX_SAFE_INTEGER / 1` and the smallest is `-1 / Number.MAX_SAFE_INTEGER`, with `Number.MAX_SAFE_INTEGER=9007199254740991`. If this is not enough, there is `bigfraction.js` shipped experimentally, which relies on `BigInt` and should become the new Fraction.js eventually. + +Testing +=== +If you plan to enhance the library, make sure you add test cases and all the previous tests are passing. You can test the library with + +``` +npm test +``` + + +Copyright and licensing +=== +Copyright (c) 2023, [Robert Eisele](https://raw.org/) +Licensed under the MIT license. diff --git a/e-commerce/node_modules/fraction.js/bigfraction.js b/e-commerce/node_modules/fraction.js/bigfraction.js new file mode 100644 index 0000000000000000000000000000000000000000..038ca05bf99e8c1da8686bf42dfbd4d4f06e43e2 --- /dev/null +++ b/e-commerce/node_modules/fraction.js/bigfraction.js @@ -0,0 +1,899 @@ +/** + * @license Fraction.js v4.2.1 20/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * let f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + +(function(root) { + + "use strict"; + + // Set Identity function to downgrade BigInt to Number if needed + if (typeof BigInt === 'undefined') BigInt = function(n) { if (isNaN(n)) throw new Error(""); return n; }; + + const C_ONE = BigInt(1); + const C_ZERO = BigInt(0); + const C_TEN = BigInt(10); + const C_TWO = BigInt(2); + const C_FIVE = BigInt(5); + + // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. + // Example: 1/7 = 0.(142857) has 6 repeating decimal places. + // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits + const MAX_CYCLE_LEN = 2000; + + // Parsed data to avoid calling "new" all the time + const P = { + "s": C_ONE, + "n": C_ZERO, + "d": C_ONE + }; + + function assign(n, s) { + + try { + n = BigInt(n); + } catch (e) { + throw InvalidParameter(); + } + return n * s; + } + + // Creates a new Fraction internally without the need of the bulky constructor + function newFraction(n, d) { + + if (d === C_ZERO) { + throw DivisionByZero(); + } + + const f = Object.create(Fraction.prototype); + f["s"] = n < C_ZERO ? -C_ONE : C_ONE; + + n = n < C_ZERO ? -n : n; + + const a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + + const factors = {}; + + let n = num; + let i = C_TWO; + let s = C_FIVE - C_ONE; + + while (s <= n) { + + while (n % i === C_ZERO) { + n/= i; + factors[i] = (factors[i] || C_ZERO) + C_ONE; + } + s+= C_ONE + C_TWO * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || C_ZERO) + C_ONE; + } else { + factors[num] = (factors[num] || C_ZERO) + C_ONE; + } + return factors; + } + + const parse = function(p1, p2) { + + let n = C_ZERO, d = C_ONE, s = C_ONE; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = BigInt(p1); + d = BigInt(p2); + s = n * d; + + if (n % C_ONE !== C_ZERO || d % C_ONE !== C_ZERO) { + throw NonIntegerParameter(); + } + + } else if (typeof p1 === "object") { + if ("d" in p1 && "n" in p1) { + n = BigInt(p1["n"]); + d = BigInt(p1["d"]); + if ("s" in p1) + n*= BigInt(p1["s"]); + } else if (0 in p1) { + n = BigInt(p1[0]); + if (1 in p1) + d = BigInt(p1[1]); + } else if (p1 instanceof BigInt) { + n = BigInt(p1); + } else { + throw InvalidParameter(); + } + s = n * d; + } else if (typeof p1 === "bigint") { + n = p1; + s = p1; + d = C_ONE; + } else if (typeof p1 === "number") { + + if (isNaN(p1)) { + throw InvalidParameter(); + } + + if (p1 < 0) { + s = -C_ONE; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = BigInt(p1); + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + let z = 1; + + let A = 0, B = 1; + let C = 1, D = 1; + + let N = 10000000; + + if (p1 >= 1) { + z = 10 ** Math.floor(1 + Math.log10(p1)); + p1/= z; + } + + // Using Farey Sequences + + while (B <= N && D <= N) { + let M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n = BigInt(n) * BigInt(z); + d = BigInt(d); + + } + + } else if (typeof p1 === "string") { + + let ndx = 0; + + let v = C_ZERO, w = C_ZERO, x = C_ZERO, y = C_ONE, z = C_ONE; + + let match = p1.match(/\d+|./g); + + if (match === null) + throw InvalidParameter(); + + if (match[ndx] === '-') {// Check for minus sign at the beginning + s = -C_ONE; + ndx++; + } else if (match[ndx] === '+') {// Check for plus sign at the beginning + ndx++; + } + + if (match.length === ndx + 1) { // Check if it's just a simple number "1234" + w = assign(match[ndx++], s); + } else if (match[ndx + 1] === '.' || match[ndx] === '.') { // Check if it's a decimal number + + if (match[ndx] !== '.') { // Handle 0.5 and .5 + v = assign(match[ndx++], s); + } + ndx++; + + // Check for decimal places + if (ndx + 1 === match.length || match[ndx + 1] === '(' && match[ndx + 3] === ')' || match[ndx + 1] === "'" && match[ndx + 3] === "'") { + w = assign(match[ndx], s); + y = C_TEN ** BigInt(match[ndx].length); + ndx++; + } + + // Check for repeating places + if (match[ndx] === '(' && match[ndx + 2] === ')' || match[ndx] === "'" && match[ndx + 2] === "'") { + x = assign(match[ndx + 1], s); + z = C_TEN ** BigInt(match[ndx + 1].length) - C_ONE; + ndx+= 3; + } + + } else if (match[ndx + 1] === '/' || match[ndx + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(match[ndx], s); + y = assign(match[ndx + 2], C_ONE); + ndx+= 3; + } else if (match[ndx + 3] === '/' && match[ndx + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(match[ndx], s); + w = assign(match[ndx + 2], s); + y = assign(match[ndx + 4], C_ONE); + ndx+= 5; + } + + if (match.length <= ndx) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + } else { + throw InvalidParameter(); + } + + } else { + throw InvalidParameter(); + } + + if (d === C_ZERO) { + throw DivisionByZero(); + } + + P["s"] = s < C_ZERO ? -C_ONE : C_ONE; + P["n"] = n < C_ZERO ? -n : n; + P["d"] = d < C_ZERO ? -d : d; + }; + + function modpow(b, e, m) { + + let r = C_ONE; + for (; e > C_ZERO; b = (b * b) % m, e >>= C_ONE) { + + if (e & C_ONE) { + r = (r * b) % m; + } + } + return r; + } + + function cycleLen(n, d) { + + for (; d % C_TWO === C_ZERO; + d/= C_TWO) { + } + + for (; d % C_FIVE === C_ZERO; + d/= C_FIVE) { + } + + if (d === C_ONE) // Catch non-cyclic numbers + return C_ZERO; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + let rem = C_TEN % d; + let t = 1; + + for (; rem !== C_ONE; t++) { + rem = rem * C_TEN % d; + + if (t > MAX_CYCLE_LEN) + return C_ZERO; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return BigInt(t); + } + + function cycleStart(n, d, len) { + + let rem1 = C_ONE; + let rem2 = modpow(C_TEN, len, d); + + for (let t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return BigInt(t); + + rem1 = rem1 * C_TEN % d; + rem2 = rem2 * C_TEN % d; + } + return 0; + } + + function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } + } + + /** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ + function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } + } + + var DivisionByZero = function() {return new Error("Division by Zero");}; + var InvalidParameter = function() {return new Error("Invalid argument");}; + var NonIntegerParameter = function() {return new Error("Parameters must be integer");}; + + Fraction.prototype = { + + "s": C_ONE, + "n": C_ZERO, + "d": C_ONE, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], C_ONE); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === C_ZERO && this["n"] === C_ZERO) { + return newFraction(C_ZERO, C_ONE); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some integer exponent + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === C_ONE) { + + if (P['s'] < C_ZERO) { + return newFraction((this['s'] * this["d"]) ** P['n'], this["n"] ** P['n']); + } else { + return newFraction((this['s'] * this["n"]) ** P['n'], this["d"] ** P['n']); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula + // From which follows that only for c=0 the root is non-complex + if (this['s'] < C_ZERO) return null; + + // Now prime factor n and d + let N = factorize(this['n']); + let D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + let n = C_ONE; + let d = C_ONE; + for (let k in N) { + if (k === '1') continue; + if (k === '0') { + n = C_ZERO; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === C_ZERO) { + N[k]/= P['d']; + } else return null; + n*= BigInt(k) ** N[k]; + } + + for (let k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === C_ZERO) { + D[k]/= P['d']; + } else return null; + d*= BigInt(k) ** D[k]; + } + + if (P['s'] < C_ZERO) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + let t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + + return (C_ZERO < t) - (t < C_ZERO); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = C_TEN ** BigInt(places || 0); + + return newFraction(this["s"] * places * this["n"] / this["d"] + + (places * this["n"] % this["d"] > C_ZERO && this["s"] >= C_ZERO ? C_ONE : C_ZERO), + places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = C_TEN ** BigInt(places || 0); + + return newFraction(this["s"] * places * this["n"] / this["d"] - + (places * this["n"] % this["d"] > C_ZERO && this["s"] < C_ZERO ? C_ONE : C_ZERO), + places); + }, + + /** + * Rounds a rational numbers + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = C_TEN ** BigInt(places || 0); + + /* Derivation: + + s >= 0: + round(n / d) = trunc(n / d) + (n % d) / d >= 0.5 ? 1 : 0 + = trunc(n / d) + 2(n % d) >= d ? 1 : 0 + s < 0: + round(n / d) =-trunc(n / d) - (n % d) / d > 0.5 ? 1 : 0 + =-trunc(n / d) - 2(n % d) > d ? 1 : 0 + + =>: + + round(s * n / d) = s * trunc(n / d) + s * (C + 2(n % d) > d ? 1 : 0) + where C = s >= 0 ? 1 : 0, to fix the >= for the positve case. + */ + + return newFraction(this["s"] * places * this["n"] / this["d"] + + this["s"] * ((this["s"] >= C_ZERO ? C_ONE : C_ZERO) + C_TWO * (places * this["n"] % this["d"]) > this["d"] ? C_ONE : C_ZERO), + places); + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + // Best we can do so far + return Number(this["s"] * this["n"]) / Number(this["d"]); + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + let N = this["n"]; + let D = this["d"]; + + function trunc(x) { + return typeof x === 'bigint' ? x : Math.floor(x); + } + + dec = dec || 15; // 15 = decimal places when no repetition + + let cycLen = cycleLen(N, D); // Cycle length + let cycOff = cycleStart(N, D, cycLen); // Cycle start + + let str = this['s'] < C_ZERO ? "-" : ""; + + // Append integer part + str+= trunc(N / D); + + N%= D; + N*= C_TEN; + + if (N) + str+= "."; + + if (cycLen) { + + for (let i = cycOff; i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + str+= "("; + for (let i = cycLen; i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + str+= ")"; + } else { + for (let i = dec; N && i--;) { + str+= trunc(N / D); + N%= D; + N*= C_TEN; + } + } + return str; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction() => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + let n = this["n"]; + let d = this["d"]; + let str = this['s'] < C_ZERO ? "-" : ""; + + if (d === C_ONE) { + str+= n; + } else { + let whole = n / d; + if (excludeWhole && whole > C_ZERO) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + let n = this["n"]; + let d = this["d"]; + let str = this['s'] < C_ZERO ? "-" : ""; + + if (d === C_ONE) { + str+= n; + } else { + let whole = n / d; + if (excludeWhole && whole > C_ZERO) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + let a = this['n']; + let b = this['d']; + let res = []; + + do { + res.push(a / b); + let t = a % b; + a = b; + b = t; + } while (a !== C_ONE); + + return res; + }, + + "simplify": function(eps) { + + eps = eps || 0.001; + + const thisABS = this['abs'](); + const cont = thisABS['toContinued'](); + + for (let i = 1; i < cont.length; i++) { + + let s = newFraction(cont[i - 1], C_ONE); + for (let k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + } + }; + + if (typeof define === "function" && define["amd"]) { + define([], function() { + return Fraction; + }); + } else if (typeof exports === "object") { + Object.defineProperty(exports, "__esModule", { 'value': true }); + Fraction['default'] = Fraction; + Fraction['Fraction'] = Fraction; + module['exports'] = Fraction; + } else { + root['Fraction'] = Fraction; + } + +})(this); diff --git a/e-commerce/node_modules/fraction.js/fraction.cjs b/e-commerce/node_modules/fraction.js/fraction.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0a10d8c9d81503b2d750225d67a3e9dd6bcc329e --- /dev/null +++ b/e-commerce/node_modules/fraction.js/fraction.cjs @@ -0,0 +1,904 @@ +/** + * @license Fraction.js v4.3.7 31/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * var f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + +(function(root) { + + "use strict"; + + // Maximum search depth for cyclic rational numbers. 2000 should be more than enough. + // Example: 1/7 = 0.(142857) has 6 repeating decimal places. + // If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits + var MAX_CYCLE_LEN = 2000; + + // Parsed data to avoid calling "new" all the time + var P = { + "s": 1, + "n": 0, + "d": 1 + }; + + function assign(n, s) { + + if (isNaN(n = parseInt(n, 10))) { + throw InvalidParameter(); + } + return n * s; + } + + // Creates a new Fraction internally without the need of the bulky constructor + function newFraction(n, d) { + + if (d === 0) { + throw DivisionByZero(); + } + + var f = Object.create(Fraction.prototype); + f["s"] = n < 0 ? -1 : 1; + + n = n < 0 ? -n : n; + + var a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + + var factors = {}; + + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + + while (n % i === 0) { + n/= i; + factors[i] = (factors[i] || 0) + 1; + } + s+= 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + return factors; + } + + var parse = function(p1, p2) { + + var n = 0, d = 1, s = 1; + var v = 0, w = 0, x = 0, y = 1, z = 1; + + var A = 0, B = 1; + var C = 1, D = 1; + + var N = 10000000; + var M; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw NonIntegerParameter(); + } + + } else + switch (typeof p1) { + + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) + n*= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) + d = p1[1]; + } else { + throw InvalidParameter(); + } + s = n * d; + break; + } + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1/= z; + } + + // Using Farey Sequences + // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n*= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + break; + } + case "string": + { + B = p1.match(/\d+|./g); + + if (B === null) + throw InvalidParameter(); + + if (B[A] === '-') {// Check for minus sign at the beginning + s = -1; + A++; + } else if (B[A] === '+') {// Check for plus sign at the beginning + A++; + } + + if (B.length === A + 1) { // Check if it's just a simple number "1234" + w = assign(B[A++], s); + } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number + + if (B[A] !== '.') { // Handle 0.5 and .5 + v = assign(B[A++], s); + } + A++; + + // Check for decimal places + if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + // Check for repeating places + if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A+= 3; + } + + } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A+= 3; + } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A+= 5; + } + + if (B.length <= A) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + break; + } + + /* Fall through on error */ + } + default: + throw InvalidParameter(); + } + + if (d === 0) { + throw DivisionByZero(); + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); + }; + + function modpow(b, e, m) { + + var r = 1; + for (; e > 0; b = (b * b) % m, e >>= 1) { + + if (e & 1) { + r = (r * b) % m; + } + } + return r; + } + + + function cycleLen(n, d) { + + for (; d % 2 === 0; + d/= 2) { + } + + for (; d % 5 === 0; + d/= 5) { + } + + if (d === 1) // Catch non-cyclic numbers + return 0; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + + if (t > MAX_CYCLE_LEN) + return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return t; + } + + + function cycleStart(n, d, len) { + + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return t; + + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + return 0; + } + + function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } + }; + + /** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ + function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse variable a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } + } + + var DivisionByZero = function() { return new Error("Division by Zero"); }; + var InvalidParameter = function() { return new Error("Invalid argument"); }; + var NonIntegerParameter = function() { return new Error("Parameters must be integer"); }; + + Fraction.prototype = { + + "s": 1, + "n": 0, + "d": 1, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return new Fraction(NaN); + } + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational numbers + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number to a multiple of another rational number + * + * Ex: new Fraction('0.9').roundTo("1/8") => 7 / 8 + **/ + "roundTo": function(a, b) { + + /* + k * x/y ≤ a/b < (k+1) * x/y + ⇔ k ≤ a/b / (x/y) < (k+1) + ⇔ k = floor(a/b * y/x) + */ + + parse(a, b); + + return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some rational exponent, if possible + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === 1) { + + if (P['s'] < 0) { + return newFraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); + } else { + return newFraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) + // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. + if (this['s'] < 0) return null; + + // Now prime factor n and d + var N = factorize(this['n']); + var D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + var n = 1; + var d = 1; + for (var k in N) { + if (k === '1') continue; + if (k === '0') { + n = 0; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === 0) { + N[k]/= P['d']; + } else return null; + n*= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === 0) { + D[k]/= P['d']; + } else return null; + d*= Math.pow(k, D[k]); + } + + if (P['s'] < 0) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + return (0 < t) - (t < 0); + }, + + "simplify": function(eps) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return this; + } + + eps = eps || 0.001; + + var thisABS = this['abs'](); + var cont = thisABS['toContinued'](); + + for (var i = 1; i < cont.length; i++) { + + var s = newFraction(cont[i - 1], 1); + for (var k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + + return this["s"] * this["n"] / this["d"]; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction(true) => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + var t; + var a = this['n']; + var b = this['d']; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; // 15 = decimal places when no repetation + + var cycLen = cycleLen(N, D); // Cycle length + var cycOff = cycleStart(N, D, cycLen); // Cycle start + + var str = this['s'] < 0 ? "-" : ""; + + str+= N / D | 0; + + N%= D; + N*= 10; + + if (N) + str+= "."; + + if (cycLen) { + + for (var i = cycOff; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= "("; + for (var i = cycLen; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= ")"; + } else { + for (var i = dec; N && i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + } + return str; + } + }; + + if (typeof exports === "object") { + Object.defineProperty(exports, "__esModule", { 'value': true }); + exports['default'] = Fraction; + module['exports'] = Fraction; + } else { + root['Fraction'] = Fraction; + } + +})(this); diff --git a/e-commerce/node_modules/fraction.js/fraction.d.ts b/e-commerce/node_modules/fraction.js/fraction.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e62cfe1b28cfa73aad710117e0dd1c80f788c8fb --- /dev/null +++ b/e-commerce/node_modules/fraction.js/fraction.d.ts @@ -0,0 +1,60 @@ +declare module 'Fraction'; + +export interface NumeratorDenominator { + n: number; + d: number; +} + +type FractionConstructor = { + (fraction: Fraction): Fraction; + (num: number | string): Fraction; + (numerator: number, denominator: number): Fraction; + (numbers: [number | string, number | string]): Fraction; + (fraction: NumeratorDenominator): Fraction; + (firstValue: Fraction | number | string | [number | string, number | string] | NumeratorDenominator, secondValue?: number): Fraction; +}; + +export default class Fraction { + constructor (fraction: Fraction); + constructor (num: number | string); + constructor (numerator: number, denominator: number); + constructor (numbers: [number | string, number | string]); + constructor (fraction: NumeratorDenominator); + constructor (firstValue: Fraction | number | string | [number | string, number | string] | NumeratorDenominator, secondValue?: number); + + s: number; + n: number; + d: number; + + abs(): Fraction; + neg(): Fraction; + + add: FractionConstructor; + sub: FractionConstructor; + mul: FractionConstructor; + div: FractionConstructor; + pow: FractionConstructor; + gcd: FractionConstructor; + lcm: FractionConstructor; + + mod(n?: number | string | Fraction): Fraction; + + ceil(places?: number): Fraction; + floor(places?: number): Fraction; + round(places?: number): Fraction; + + inverse(): Fraction; + + simplify(eps?: number): Fraction; + + equals(n: number | string | Fraction): boolean; + compare(n: number | string | Fraction): number; + divisible(n: number | string | Fraction): boolean; + + valueOf(): number; + toString(decimalPlaces?: number): string; + toLatex(excludeWhole?: boolean): string; + toFraction(excludeWhole?: boolean): string; + toContinued(): number[]; + clone(): Fraction; +} diff --git a/e-commerce/node_modules/fraction.js/fraction.js b/e-commerce/node_modules/fraction.js/fraction.js new file mode 100644 index 0000000000000000000000000000000000000000..b9780e089a8ea08f7986ffdbc9be560ea932516a --- /dev/null +++ b/e-commerce/node_modules/fraction.js/fraction.js @@ -0,0 +1,891 @@ +/** + * @license Fraction.js v4.3.7 31/08/2023 + * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + * + * Copyright (c) 2023, Robert Eisele (robert@raw.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + **/ + + +/** + * + * This class offers the possibility to calculate fractions. + * You can pass a fraction in different formats. Either as array, as double, as string or as an integer. + * + * Array/Object form + * [ 0 => , 1 => ] + * [ n => , d => ] + * + * Integer form + * - Single integer value + * + * Double form + * - Single double value + * + * String form + * 123.456 - a simple double + * 123/456 - a string fraction + * 123.'456' - a double with repeating decimal places + * 123.(456) - synonym + * 123.45'6' - a double with repeating last place + * 123.45(6) - synonym + * + * Example: + * + * var f = new Fraction("9.4'31'"); + * f.mul([-4, 3]).div(4.9); + * + */ + + +// Maximum search depth for cyclic rational numbers. 2000 should be more than enough. +// Example: 1/7 = 0.(142857) has 6 repeating decimal places. +// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits +var MAX_CYCLE_LEN = 2000; + +// Parsed data to avoid calling "new" all the time +var P = { + "s": 1, + "n": 0, + "d": 1 +}; + +function assign(n, s) { + + if (isNaN(n = parseInt(n, 10))) { + throw InvalidParameter(); + } + return n * s; +} + +// Creates a new Fraction internally without the need of the bulky constructor +function newFraction(n, d) { + + if (d === 0) { + throw DivisionByZero(); + } + + var f = Object.create(Fraction.prototype); + f["s"] = n < 0 ? -1 : 1; + + n = n < 0 ? -n : n; + + var a = gcd(n, d); + + f["n"] = n / a; + f["d"] = d / a; + return f; +} + +function factorize(num) { + + var factors = {}; + + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + + while (n % i === 0) { + n/= i; + factors[i] = (factors[i] || 0) + 1; + } + s+= 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) + factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + return factors; +} + +var parse = function(p1, p2) { + + var n = 0, d = 1, s = 1; + var v = 0, w = 0, x = 0, y = 1, z = 1; + + var A = 0, B = 1; + var C = 1, D = 1; + + var N = 10000000; + var M; + + if (p1 === undefined || p1 === null) { + /* void */ + } else if (p2 !== undefined) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw NonIntegerParameter(); + } + + } else + switch (typeof p1) { + + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) + n*= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) + d = p1[1]; + } else { + throw InvalidParameter(); + } + s = n * d; + break; + } + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow + + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1/= z; + } + + // Using Farey Sequences + // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/ + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + break; + + } else { + + if (p1 > M) { + A+= C; + B+= D; + } else { + C+= A; + D+= B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + n*= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + break; + } + case "string": + { + B = p1.match(/\d+|./g); + + if (B === null) + throw InvalidParameter(); + + if (B[A] === '-') {// Check for minus sign at the beginning + s = -1; + A++; + } else if (B[A] === '+') {// Check for plus sign at the beginning + A++; + } + + if (B.length === A + 1) { // Check if it's just a simple number "1234" + w = assign(B[A++], s); + } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number + + if (B[A] !== '.') { // Handle 0.5 and .5 + v = assign(B[A++], s); + } + A++; + + // Check for decimal places + if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + // Check for repeating places + if (B[A] === '(' && B[A + 2] === ')' || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A+= 3; + } + + } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction "123/456" or "123:456" + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A+= 3; + } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction "123 1/2" + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A+= 5; + } + + if (B.length <= A) { // Check for more tokens on the stack + d = y * z; + s = /* void */ + n = x + d * v + z * w; + break; + } + + /* Fall through on error */ + } + default: + throw InvalidParameter(); + } + + if (d === 0) { + throw DivisionByZero(); + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); +}; + +function modpow(b, e, m) { + + var r = 1; + for (; e > 0; b = (b * b) % m, e >>= 1) { + + if (e & 1) { + r = (r * b) % m; + } + } + return r; +} + + +function cycleLen(n, d) { + + for (; d % 2 === 0; + d/= 2) { + } + + for (; d % 5 === 0; + d/= 5) { + } + + if (d === 1) // Catch non-cyclic numbers + return 0; + + // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem: + // 10^(d-1) % d == 1 + // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone, + // as we want to translate the numbers to strings. + + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + + if (t > MAX_CYCLE_LEN) + return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1` + } + return t; +} + + +function cycleStart(n, d, len) { + + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE) + // Solve 10^s == 10^(s+t) (mod d) + + if (rem1 === rem2) + return t; + + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + return 0; +} + +function gcd(a, b) { + + if (!a) + return b; + if (!b) + return a; + + while (1) { + a%= b; + if (!a) + return b; + b%= a; + if (!b) + return a; + } +}; + +/** + * Module constructor + * + * @constructor + * @param {number|Fraction=} a + * @param {number=} b + */ +export default function Fraction(a, b) { + + parse(a, b); + + if (this instanceof Fraction) { + a = gcd(P["d"], P["n"]); // Abuse variable a + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P['s'] * P['n'], P['d']); + } +} + +var DivisionByZero = function() { return new Error("Division by Zero"); }; +var InvalidParameter = function() { return new Error("Invalid argument"); }; +var NonIntegerParameter = function() { return new Error("Parameters must be integer"); }; + +Fraction.prototype = { + + "s": 1, + "n": 0, + "d": 1, + + /** + * Calculates the absolute value + * + * Ex: new Fraction(-4).abs() => 4 + **/ + "abs": function() { + + return newFraction(this["n"], this["d"]); + }, + + /** + * Inverts the sign of the current fraction + * + * Ex: new Fraction(-4).neg() => 4 + **/ + "neg": function() { + + return newFraction(-this["s"] * this["n"], this["d"]); + }, + + /** + * Adds two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30 + **/ + "add": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Subtracts two rational numbers + * + * Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30 + **/ + "sub": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Multiplies two rational numbers + * + * Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111 + **/ + "mul": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["n"], + this["d"] * P["d"] + ); + }, + + /** + * Divides two rational numbers + * + * Ex: new Fraction("-17.(345)").inverse().div(3) + **/ + "div": function(a, b) { + + parse(a, b); + return newFraction( + this["s"] * P["s"] * this["n"] * P["d"], + this["d"] * P["n"] + ); + }, + + /** + * Clones the actual object + * + * Ex: new Fraction("-17.(345)").clone() + **/ + "clone": function() { + return newFraction(this['s'] * this['n'], this['d']); + }, + + /** + * Calculates the modulo of two rational numbers - a more precise fmod + * + * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6) + **/ + "mod": function(a, b) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return new Fraction(NaN); + } + + if (a === undefined) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + if (0 === P["n"] && 0 === this["d"]) { + throw DivisionByZero(); + } + + /* + * First silly attempt, kinda slow + * + return that["sub"]({ + "n": num["n"] * Math.floor((this.n / this.d) / (num.n / num.d)), + "d": num["d"], + "s": this["s"] + });*/ + + /* + * New attempt: a1 / b1 = a2 / b2 * q + r + * => b2 * a1 = a2 * b1 * q + b1 * b2 * r + * => (b2 * a1 % a2 * b1) / (b1 * b2) + */ + return newFraction( + this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), + P["d"] * this["d"] + ); + }, + + /** + * Calculates the fractional gcd of two rational numbers + * + * Ex: new Fraction(5,8).gcd(3,7) => 1/56 + */ + "gcd": function(a, b) { + + parse(a, b); + + // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d) + + return newFraction(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]); + }, + + /** + * Calculates the fractional lcm of two rational numbers + * + * Ex: new Fraction(5,8).lcm(3,7) => 15 + */ + "lcm": function(a, b) { + + parse(a, b); + + // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d) + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + return newFraction(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"])); + }, + + /** + * Calculates the ceil of a rational number + * + * Ex: new Fraction('4.(3)').ceil() => (5 / 1) + **/ + "ceil": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Calculates the floor of a rational number + * + * Ex: new Fraction('4.(3)').floor() => (4 / 1) + **/ + "floor": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number + * + * Ex: new Fraction('4.(3)').round() => (4 / 1) + **/ + "round": function(places) { + + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction(NaN); + } + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + + /** + * Rounds a rational number to a multiple of another rational number + * + * Ex: new Fraction('0.9').roundTo("1/8") => 7 / 8 + **/ + "roundTo": function(a, b) { + + /* + k * x/y ≤ a/b < (k+1) * x/y + ⇔ k ≤ a/b / (x/y) < (k+1) + ⇔ k = floor(a/b * y/x) + */ + + parse(a, b); + + return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']); + }, + + /** + * Gets the inverse of the fraction, means numerator and denominator are exchanged + * + * Ex: new Fraction([-3, 4]).inverse() => -4 / 3 + **/ + "inverse": function() { + + return newFraction(this["s"] * this["d"], this["n"]); + }, + + /** + * Calculates the fraction to some rational exponent, if possible + * + * Ex: new Fraction(-1,2).pow(-3) => -8 + */ + "pow": function(a, b) { + + parse(a, b); + + // Trivial case when exp is an integer + + if (P['d'] === 1) { + + if (P['s'] < 0) { + return newFraction(Math.pow(this['s'] * this["d"], P['n']), Math.pow(this["n"], P['n'])); + } else { + return newFraction(Math.pow(this['s'] * this["n"], P['n']), Math.pow(this["d"], P['n'])); + } + } + + // Negative roots become complex + // (-a/b)^(c/d) = x + // <=> (-1)^(c/d) * (a/b)^(c/d) = x + // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180° + // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index ) + // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case. + if (this['s'] < 0) return null; + + // Now prime factor n and d + var N = factorize(this['n']); + var D = factorize(this['d']); + + // Exponentiate and take root for n and d individually + var n = 1; + var d = 1; + for (var k in N) { + if (k === '1') continue; + if (k === '0') { + n = 0; + break; + } + N[k]*= P['n']; + + if (N[k] % P['d'] === 0) { + N[k]/= P['d']; + } else return null; + n*= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === '1') continue; + D[k]*= P['n']; + + if (D[k] % P['d'] === 0) { + D[k]/= P['d']; + } else return null; + d*= Math.pow(k, D[k]); + } + + if (P['s'] < 0) { + return newFraction(d, n); + } + return newFraction(n, d); + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "equals": function(a, b) { + + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; // Same as compare() === 0 + }, + + /** + * Check if two rational numbers are the same + * + * Ex: new Fraction(19.6).equals([98, 5]); + **/ + "compare": function(a, b) { + + parse(a, b); + var t = (this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]); + return (0 < t) - (t < 0); + }, + + "simplify": function(eps) { + + if (isNaN(this['n']) || isNaN(this['d'])) { + return this; + } + + eps = eps || 0.001; + + var thisABS = this['abs'](); + var cont = thisABS['toContinued'](); + + for (var i = 1; i < cont.length; i++) { + + var s = newFraction(cont[i - 1], 1); + for (var k = i - 2; k >= 0; k--) { + s = s['inverse']()['add'](cont[k]); + } + + if (Math.abs(s['sub'](thisABS).valueOf()) < eps) { + return s['mul'](this['s']); + } + } + return this; + }, + + /** + * Check if two rational numbers are divisible + * + * Ex: new Fraction(19.6).divisible(1.5); + */ + "divisible": function(a, b) { + + parse(a, b); + return !(!(P["n"] * this["d"]) || ((this["n"] * P["d"]) % (P["n"] * this["d"]))); + }, + + /** + * Returns a decimal representation of the fraction + * + * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 + **/ + 'valueOf': function() { + + return this["s"] * this["n"] / this["d"]; + }, + + /** + * Returns a string-fraction representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toFraction(true) => "4 1/3" + **/ + 'toFraction': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + str+= " "; + n%= d; + } + + str+= n; + str+= '/'; + str+= d; + } + return str; + }, + + /** + * Returns a latex representation of a Fraction object + * + * Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}" + **/ + 'toLatex': function(excludeWhole) { + + var whole, str = ""; + var n = this["n"]; + var d = this["d"]; + if (this["s"] < 0) { + str+= '-'; + } + + if (d === 1) { + str+= n; + } else { + + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str+= whole; + n%= d; + } + + str+= "\\frac{"; + str+= n; + str+= '}{'; + str+= d; + str+= '}'; + } + return str; + }, + + /** + * Returns an array of continued fraction elements + * + * Ex: new Fraction("7/8").toContinued() => [0,1,7] + */ + 'toContinued': function() { + + var t; + var a = this['n']; + var b = this['d']; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + + /** + * Creates a string representation of a fraction with all digits + * + * Ex: new Fraction("100.'91823'").toString() => "100.(91823)" + **/ + 'toString': function(dec) { + + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; // 15 = decimal places when no repetation + + var cycLen = cycleLen(N, D); // Cycle length + var cycOff = cycleStart(N, D, cycLen); // Cycle start + + var str = this['s'] < 0 ? "-" : ""; + + str+= N / D | 0; + + N%= D; + N*= 10; + + if (N) + str+= "."; + + if (cycLen) { + + for (var i = cycOff; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= "("; + for (var i = cycLen; i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + str+= ")"; + } else { + for (var i = dec; N && i--;) { + str+= N / D | 0; + N%= D; + N*= 10; + } + } + return str; + } +}; diff --git a/e-commerce/node_modules/fraction.js/fraction.min.js b/e-commerce/node_modules/fraction.js/fraction.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1cfa1516da381d6383b478add72153f5c5d2bd93 --- /dev/null +++ b/e-commerce/node_modules/fraction.js/fraction.min.js @@ -0,0 +1,18 @@ +/* +Fraction.js v4.3.7 31/08/2023 +https://www.xarg.org/2014/03/rational-numbers-in-javascript/ + +Copyright (c) 2023, Robert Eisele (robert@raw.org) +Dual licensed under the MIT or GPL Version 2 licenses. +*/ +(function(B){function x(){return Error("Invalid argument")}function z(){return Error("Division by Zero")}function n(a,c){var b=0,d=1,f=1,l=0,k=0,t=0,y=1,u=1,g=0,h=1,v=1,q=1;if(void 0!==a&&null!==a)if(void 0!==c){if(b=a,d=c,f=b*d,0!==b%1||0!==d%1)throw Error("Parameters must be integer");}else switch(typeof a){case "object":if("d"in a&&"n"in a)b=a.n,d=a.d,"s"in a&&(b*=a.s);else if(0 in a)b=a[0],1 in a&&(d=a[1]);else throw x();f=b*d;break;case "number":0>a&&(f=a,a=-a);if(0===a%1)b=a;else if(0=h&&1E7>=q;)if(b=(g+v)/(h+q),a===b){1E7>=h+q?(b=g+v,d=h+q):q>h?(b=v,d=q):(b=g,d=h);break}else a>b?(g+=v,h+=q):(v+=g,q+=h),1E7f?-1:1;e.n=Math.abs(b);e.d=Math.abs(d)}function r(a,c){if(isNaN(a=parseInt(a,10)))throw x();return a*c} +function m(a,c){if(0===c)throw z();var b=Object.create(p.prototype);b.s=0>a?-1:1;a=0>a?-a:a;var d=w(a,c);b.n=a/d;b.d=c/d;return b}function A(a){for(var c={},b=a,d=2,f=4;f<=b;){for(;0===b%d;)b/=d,c[d]=(c[d]||0)+1;f+=1+2*d++}b!==a?1e.s?m(Math.pow(this.s*this.d,e.n),Math.pow(this.n,e.n)):m(Math.pow(this.s*this.n,e.n),Math.pow(this.d, +e.n));if(0>this.s)return null;var b=A(this.n),d=A(this.d),f=1,l=1,k;for(k in b)if("1"!==k){if("0"===k){f=0;break}b[k]*=e.n;if(0===b[k]%e.d)b[k]/=e.d;else return null;f*=Math.pow(k,b[k])}for(k in d)if("1"!==k){d[k]*=e.n;if(0===d[k]%e.d)d[k]/=e.d;else return null;l*=Math.pow(k,d[k])}return 0>e.s?m(l,f):m(f,l)},equals:function(a,c){n(a,c);return this.s*this.n*e.d===e.s*e.n*this.d},compare:function(a,c){n(a,c);var b=this.s*this.n*e.d-e.s*e.n*this.d;return(0b)},simplify:function(a){if(isNaN(this.n)|| +isNaN(this.d))return this;a=a||.001;for(var c=this.abs(),b=c.toContinued(),d=1;dthis.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b=b+c+" ",d%=f),b=b+d+"/",b+=f);return b}, +toLatex:function(a){var c,b="",d=this.n,f=this.d;0>this.s&&(b+="-");1===f?b+=d:(a&&0<(c=Math.floor(d/f))&&(b+=c,d%=f),b=b+"\\frac{"+d+"}{"+f,b+="}");return b},toContinued:function(){var a=this.n,c=this.d,b=[];if(isNaN(a)||isNaN(c))return b;do{b.push(Math.floor(a/c));var d=a%c;a=c;c=d}while(1!==a);return b},toString:function(a){var c=this.n,b=this.d;if(isNaN(c)||isNaN(b))return"NaN";var d;a:{for(d=b;0===d%2;d/=2);for(;0===d%5;d/=5);if(1===d)d=0;else{for(var f=10%d,l=1;1!==f;l++)if(f=10*f%d,2E3>=1)k&1&&(t=t*l%b);l=t;for(k=0;300>k;k++){if(f===l){l=k;break a}f=10*f%b;l=10*l%b}l=0}f=0>this.s?"-":"";f+=c/b|0;(c=c%b*10)&&(f+=".");if(d){for(a=l;a--;)f+=c/b|0,c%=b,c*=10;f+="(";for(a=d;a--;)f+=c/b|0,c%=b,c*=10;f+=")"}else for(a=a||15;c&&a--;)f+=c/b|0,c%=b,c*=10;return f}};"object"===typeof exports?(Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=p,module.exports=p):B.Fraction=p})(this); \ No newline at end of file diff --git a/e-commerce/node_modules/fraction.js/package.json b/e-commerce/node_modules/fraction.js/package.json new file mode 100644 index 0000000000000000000000000000000000000000..085d287cebf3eaf77c49feccbc28e34eb8167f54 --- /dev/null +++ b/e-commerce/node_modules/fraction.js/package.json @@ -0,0 +1,55 @@ +{ + "name": "fraction.js", + "title": "fraction.js", + "version": "4.3.7", + "homepage": "https://www.xarg.org/2014/03/rational-numbers-in-javascript/", + "bugs": "https://github.com/rawify/Fraction.js/issues", + "description": "A rational number library", + "keywords": [ + "math", + "fraction", + "rational", + "rationals", + "number", + "parser", + "rational numbers" + ], + "author": { + "name": "Robert Eisele", + "email": "robert@raw.org", + "url": "https://raw.org/" + }, + "type": "module", + "main": "fraction.cjs", + "exports": { + ".": { + "import": "./fraction.js", + "require": "./fraction.cjs", + "types": "./fraction.d.ts" + } + }, + "types": "./fraction.d.ts", + "private": false, + "readmeFilename": "README.md", + "directories": { + "example": "examples" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/rawify/Fraction.js.git" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + }, + "engines": { + "node": "*" + }, + "scripts": { + "test": "mocha tests/*.js" + }, + "devDependencies": { + "mocha": "*" + } +} diff --git a/e-commerce/node_modules/get-nonce/CHANGELOG.md b/e-commerce/node_modules/get-nonce/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..b7e1275e199c3800e0c76f9c0c502f31b6afff3e --- /dev/null +++ b/e-commerce/node_modules/get-nonce/CHANGELOG.md @@ -0,0 +1 @@ +# 1.0.0 (2020-04-16) diff --git a/e-commerce/node_modules/get-nonce/LICENSE b/e-commerce/node_modules/get-nonce/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9455bf5c2e38efce322460afa46f7b73e25a425a --- /dev/null +++ b/e-commerce/node_modules/get-nonce/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Anton Korzunov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/e-commerce/node_modules/get-nonce/README.md b/e-commerce/node_modules/get-nonce/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ec23bff206eb75d7cc4889be1172b81746825b83 --- /dev/null +++ b/e-commerce/node_modules/get-nonce/README.md @@ -0,0 +1,54 @@ +# get-nonce + +just returns a **nonce** (number used once). No batteries included in those 46 bytes of this library. + +--- + +- ✅ build in `webpack` support via `__webpack_nonce__` + +# API + +- `getNonce(): string|undefined` - returns the current `nonce` +- `setNonce(newValue)` - set's nonce value + +## Why? + +Why we need a library to access `__webpack_nonce__`? Abstractions! + +"I", as a library author, don't want to "predict" the platform "you" going to use. +"I", as well, want an easier way to test and control `nonce` value. + +Like - `nonce` is supported out of the box only by webpack, what you are going to do? + +This is why this "man-in-the-middle" was created. +Yep, think about `left-pad` :) + +## Webpack + +> https://webpack.js.org/guides/csp/ + +To activate the feature set a **webpack_nonce** variable needs to be included in your entry script. + +``` +__webpack_nonce__ = uuid(); // for example +``` + +Without `webpack` `__webpack_nonce__` is actually just a global variable, +which makes it actually bundler independent, +however "other bundlers" are able to replicate it only setting it as a global variable +(as here in tests) which violates a "secure" nature of `nonce`. + +`get-nonce` is not global. + +## Used in + +- `react-style-singleton` <- `react-remove-scroll` <- `react-focus-on` + +## Inspiration + +- [this issue](https://github.com/theKashey/react-remove-scroll/issues/21) +- [styled-components](https://github.com/styled-components/styled-components/blob/147b0e9a1f10786551b13fd27452fcd5c678d5e0/packages/styled-components/src/utils/nonce.js) + +# Licence + +MIT diff --git a/e-commerce/node_modules/get-nonce/dist/es2015/index.d.ts b/e-commerce/node_modules/get-nonce/dist/es2015/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8b67ce08d1ff0446de8d65386512c0051431d3d --- /dev/null +++ b/e-commerce/node_modules/get-nonce/dist/es2015/index.d.ts @@ -0,0 +1,2 @@ +export declare const setNonce: (nonce: string) => void; +export declare const getNonce: () => string | undefined; diff --git a/e-commerce/node_modules/get-nonce/dist/es2015/index.js b/e-commerce/node_modules/get-nonce/dist/es2015/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7b6f3c25ceb46a25aa38f052ec4177efcdce6707 --- /dev/null +++ b/e-commerce/node_modules/get-nonce/dist/es2015/index.js @@ -0,0 +1,13 @@ +var currentNonce; +export var setNonce = function (nonce) { + currentNonce = nonce; +}; +export var getNonce = function () { + if (currentNonce) { + return currentNonce; + } + if (typeof __webpack_nonce__ !== 'undefined') { + return __webpack_nonce__; + } + return undefined; +}; diff --git a/e-commerce/node_modules/get-nonce/dist/es5/index.d.ts b/e-commerce/node_modules/get-nonce/dist/es5/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8b67ce08d1ff0446de8d65386512c0051431d3d --- /dev/null +++ b/e-commerce/node_modules/get-nonce/dist/es5/index.d.ts @@ -0,0 +1,2 @@ +export declare const setNonce: (nonce: string) => void; +export declare const getNonce: () => string | undefined; diff --git a/e-commerce/node_modules/get-nonce/dist/es5/index.js b/e-commerce/node_modules/get-nonce/dist/es5/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bc2ad2e563cdabe2252f74bc8c1e71c0ceef7459 --- /dev/null +++ b/e-commerce/node_modules/get-nonce/dist/es5/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var currentNonce; +exports.setNonce = function (nonce) { + currentNonce = nonce; +}; +exports.getNonce = function () { + if (currentNonce) { + return currentNonce; + } + if (typeof __webpack_nonce__ !== 'undefined') { + return __webpack_nonce__; + } + return undefined; +}; diff --git a/e-commerce/node_modules/get-nonce/package.json b/e-commerce/node_modules/get-nonce/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4086531f9949fd714eef5e86b085045aa6bf946e --- /dev/null +++ b/e-commerce/node_modules/get-nonce/package.json @@ -0,0 +1,68 @@ +{ + "name": "get-nonce", + "version": "1.0.1", + "description": "returns nonce", + "main": "dist/es5/index.js", + "types": "dist/es5/index.d.ts", + "sideEffects": false, + "repository": "git@github.com:theKashey/get-nonce.git", + "homepage": "https://github.com/theKashey/get-nonce", + "author": "Anton Korzunov ", + "license": "MIT", + "keywords": [ + "webpack", + "nonce", + "__webpack_nonce__" + ], + "devDependencies": { + "@theuiteam/lib-builder": "^0.0.10", + "@size-limit/preset-small-lib": "^2.1.6" + }, + "module": "dist/es2015/index.js", + "engines": { + "node": ">=6" + }, + "scripts": { + "dev": "lib-builder dev", + "test": "jest", + "test:ci": "jest --runInBand --coverage", + "build": "lib-builder build && yarn size:report", + "release": "yarn build && yarn test", + "size": "npx size-limit", + "size:report": "npx size-limit --json > .size.json", + "lint": "lib-builder lint", + "format": "lib-builder format", + "update": "lib-builder update", + "docz:dev": "docz dev", + "docz:build": "docz build", + "prepublish": "yarn build && yarn changelog", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "changelog:rewrite": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" + }, + "files": [ + "dist" + ], + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{ts,tsx}": [ + "prettier --write", + "tslint --fix", + "git add" + ], + "*.{js,css,json,md}": [ + "prettier --write", + "git add" + ] + }, + "prettier": { + "printWidth": 120, + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true + } +} diff --git a/e-commerce/node_modules/get-tsconfig/LICENSE b/e-commerce/node_modules/get-tsconfig/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..51e4fd8646a1cfd17e90dd3b633f24eb8dbb01ac --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Hiroki Osame + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/e-commerce/node_modules/get-tsconfig/README.md b/e-commerce/node_modules/get-tsconfig/README.md new file mode 100644 index 0000000000000000000000000000000000000000..55145ae4a2ac6f6b80f4d1ae407e5dbdd4fa578d --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/README.md @@ -0,0 +1,268 @@ +

+ +

+

+ get-tsconfig +
+ +

+ +Find and parse `tsconfig.json` files. + +### Features +- Zero dependency (not even TypeScript) +- Tested against TypeScript for correctness +- Supports comments & dangling commas in `tsconfig.json` +- Resolves [`extends`](https://www.typescriptlang.org/tsconfig/#extends) +- Fully typed `tsconfig.json` +- Validates and throws parsing errors +- Tiny! `7 kB` Minified + Gzipped + +
+ +

+ + +

+

Already a sponsor? Join the discussion in the Development repo!

+ +## Install + +```bash +npm install get-tsconfig +``` + +## Why? +For TypeScript related tooling to correctly parse `tsconfig.json` file without depending on TypeScript. + +## API + +### getTsconfig(searchPath?, configName?, cache?, includes?) + +Searches for a tsconfig file (defaults to `tsconfig.json`) in the `searchPath` and parses it. (If you already know the tsconfig path, use [`parseTsconfig`](#parsetsconfigtsconfigpath-cache) instead). Returns `null` if a config file cannot be found, or an object containing the path and parsed TSConfig object if found. + +Returns: + +```ts +type TsconfigResult = { + + /** + * The path to the tsconfig.json file + */ + path: string + + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved +} +``` + +#### searchPath +Type: `string` + +Default: `process.cwd()` + +Path to a source file or directory. The directory tree is searched up for a `tsconfig.json` file. Typically a TypeScript/JavaScript file path (e.g. `./src/index.ts`), but a directory path also works if you don't have a specific file. + +#### configName +Type: `string` + +Default: `tsconfig.json` + +The file name of the TypeScript config file. + +#### cache +Type: `Map` + +Default: `new Map()` + +Optional cache for fs operations. + +#### includes +Type: `boolean` + +Default: `false` + +When `true` and `searchPath` is a file path, validates that the found tsconfig applies to the file (via `files`, `include`, and `exclude`). If the file isn't matched, continues searching parent directories. + +By default, `getTsconfig` returns the nearest tsconfig — matching `tsc` CLI behavior ([`findConfigFile()`](https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/compiler/program.ts#L328)). With `includes`, it checks the file is included by `include`/`files` and not excluded by `exclude` before accepting the tsconfig — matching VS Code's TypeScript Language Server behavior ([`isMatchedByConfig()`](https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/server/editorServices.ts#L4486)). + +#### Example + +```ts +import { getTsconfig } from 'get-tsconfig' + +// Searches for tsconfig.json starting in the current directory +console.log(getTsconfig()) + +// Find tsconfig.json from a TypeScript file path +console.log(getTsconfig('./path/to/index.ts')) + +// Find tsconfig.json from a directory file path +console.log(getTsconfig('./path/to/directory')) + +// Explicitly pass in tsconfig.json path +console.log(getTsconfig('./path/to/tsconfig.json')) + +// Search for jsconfig.json - https://code.visualstudio.com/docs/languages/jsconfig +console.log(getTsconfig('.', 'jsconfig.json')) + +// Find the tsconfig that actually applies to a file (Language Server behavior) +// Skips tsconfig files where the file is excluded or not included +console.log(getTsconfig('./src/index.ts', 'tsconfig.json', new Map(), true)) +``` + +--- + +### findTsconfig(searchPath?, configName?, cache?, includes?) + +Searches for a tsconfig file by walking up the directory tree. Returns the path to the found tsconfig file, or `undefined` if not found. + +Supports the same [`includes`](#includes) option as `getTsconfig` to validate that the tsconfig applies to the `searchPath` file. + +#### Example + +```ts +import { findTsconfig } from 'get-tsconfig' + +// Find the tsconfig.json path +findTsconfig() + +// Find the tsconfig that includes the file +findTsconfig('./src/index.ts', 'tsconfig.json', new Map(), true) +``` + +--- + +### parseTsconfig(tsconfigPath, cache?) + +Parse the tsconfig file provided. Used internally by `getTsconfig`. Returns the parsed tsconfig as `TsConfigJsonResolved`. + +#### tsconfigPath +Type: `string` + +Required path to the tsconfig file. + +#### cache +Type: `Map` + +Default: `new Map()` + +Optional cache for fs operations. + +#### Example + +```ts +import { parseTsconfig } from 'get-tsconfig' + +// Must pass in a path to an existing tsconfig.json file +console.log(parseTsconfig('./path/to/tsconfig.custom.json')) +``` + +--- + +### createFilesMatcher(tsconfig: TsconfigResult, caseSensitivePaths?: boolean) + +Given a `tsconfig.json` file, it returns a file-matcher function that determines whether it should apply to a file path. + +```ts +type FileMatcher = (filePath: string) => TsconfigResult['config'] | undefined +``` + +#### tsconfig +Type: `TsconfigResult` + +Pass in the return value from `getTsconfig`, or a `TsconfigResult` object. + +#### caseSensitivePaths +Type: `boolean` + +By default, it uses [`is-fs-case-sensitive`](https://github.com/privatenumber/is-fs-case-sensitive) to detect whether the file-system is case-sensitive. + +Pass in `true` to make it case-sensitive. + +#### Example + +For example, if it's called with a `tsconfig.json` file that has `include`/`exclude`/`files` defined, the file-matcher will return the config for files that match `include`/`files`, and return `undefined` for files that don't match or match `exclude`. + +```ts +const tsconfig = getTsconfig() +const fileMatcher = tsconfig && createFilesMatcher(tsconfig) + +/* + * Returns tsconfig.json if it matches the file, + * undefined if not + */ +const configForFile = fileMatcher?.('/path/to/file.ts') +const distCode = compileTypescript({ + code: sourceCode, + tsconfig: configForFile +}) +``` + +--- + +### createPathsMatcher(tsconfig: TsconfigResult) + +Given a tsconfig with [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) defined, it returns a matcher function. + +The matcher function accepts an [import specifier (the path to resolve)](https://nodejs.org/api/esm.html#terminology), checks it against `compilerOptions.paths`, and returns an array of possible paths to check: +```ts +function pathsMatcher(specifier: string): string[] +``` + +This function only returns possible paths and doesn't actually do any resolution. This helps increase compatibility wtih file/build systems which usually have their own resolvers. + +#### Example + +```ts +import { getTsconfig, createPathsMatcher } from 'get-tsconfig' + +const tsconfig = getTsconfig() +const pathsMatcher = createPathsMatcher(tsconfig) + +const exampleResolver = (request: string) => { + if (pathsMatcher) { + const tryPaths = pathsMatcher(request) + + // Check if paths in `tryPaths` exist + } +} +``` + +## FAQ + +### How can I use TypeScript to parse `tsconfig.json`? +This package is a re-implementation of TypeScript's `tsconfig.json` parser. + +However, if you already have TypeScript as a dependency, you can simply use it's API: + +```ts +import { + sys as tsSys, + findConfigFile, + readConfigFile, + parseJsonConfigFileContent +} from 'typescript' + +// Find tsconfig.json file +const tsconfigPath = findConfigFile(process.cwd(), tsSys.fileExists, 'tsconfig.json') + +// Read tsconfig.json file +const tsconfigFile = readConfigFile(tsconfigPath, tsSys.readFile) + +// Resolve extends +const parsedTsconfig = parseJsonConfigFileContent( + tsconfigFile.config, + tsSys, + path.dirname(tsconfigPath) +) +``` + +## Sponsors +

+ + + +

diff --git a/e-commerce/node_modules/get-tsconfig/dist/index.cjs b/e-commerce/node_modules/get-tsconfig/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..879eb1cecc8c6f65db3e630204a2e47bdf9e5581 --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/dist/index.cjs @@ -0,0 +1,7 @@ +"use strict";var xe=Object.defineProperty;var r=(e,t)=>xe(e,"name",{value:t,configurable:!0});var d=require("node:path"),ce=require("node:fs"),$e=require("node:module"),Be=require("resolve-pkg-maps"),Ie=require("fs"),Ue=require("os"),Re=require("path");function L(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}r(L,"slash");const q=r(e=>{const t=ce[e];return(l,...n)=>{const s=`${e}:${n.join(":")}`;let i=l==null?void 0:l.get(s);return i===void 0&&(i=Reflect.apply(t,ce,n),l==null||l.set(s,i)),i}},"cacheFs"),x=q("existsSync"),Se=q("readFileSync"),Q=q("statSync"),Ne=q("realpathSync"),Pe=r((...[e,t])=>{const l=Ne(e,t);if(typeof l!="string")throw new TypeError(`Unexpected resolved path type for ${l} in ${t}`);return l},"realpath"),O=r((e,t,l)=>{for(;;){const n=d.posix.join(e,t);if(x(l,n))return n;const s=d.dirname(e);if(s===e)return;e=s}},"findUp"),C=/^\.{1,2}(\/.*)?$/,H=r(e=>{const t=L(e);return C.test(t)?t:`./${t}`},"normalizeRelativePath");function We(e,t=!1){const l=e.length;let n=0,s="",i=0,o=16,f=0,u=0,c=0,m=0,v=0;function _(g,j){let y=0,A=0;for(;y=48&&k<=57)A=A*16+k-48;else if(k>=65&&k<=70)A=A*16+k-65+10;else if(k>=97&&k<=102)A=A*16+k-97+10;else break;n++,y++}return y=l){g+=e.substring(j,n),v=2;break}const y=e.charCodeAt(n);if(y===34){g+=e.substring(j,n),n++;break}if(y===92){if(g+=e.substring(j,n),n++,n>=l){v=2;break}switch(e.charCodeAt(n++)){case 34:g+='"';break;case 92:g+="\\";break;case 47:g+="/";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+=` +`;break;case 114:g+="\r";break;case 116:g+=" ";break;case 117:const k=_(4);k>=0?g+=String.fromCharCode(k):v=4;break;default:v=5}j=n;continue}if(y>=0&&y<=31)if(M(y)){g+=e.substring(j,n),v=2;break}else v=6;n++}return g}r(T,"scanString");function w(){if(s="",v=0,i=n,u=f,m=c,n>=l)return i=l,o=17;let g=e.charCodeAt(n);if(ee(g)){do n++,s+=String.fromCharCode(g),g=e.charCodeAt(n);while(ee(g));return o=15}if(M(g))return n++,s+=String.fromCharCode(g),g===13&&e.charCodeAt(n)===10&&(n++,s+=` +`),f++,c=n,o=14;switch(g){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,s=T(),o=10;case 47:const j=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n=12&&g<=15);return g}return r($,"scanNextNonTrivia"),{setPosition:h,getPosition:r(()=>n,"getPosition"),scan:t?$:w,getToken:r(()=>o,"getToken"),getTokenValue:r(()=>s,"getTokenValue"),getTokenOffset:r(()=>i,"getTokenOffset"),getTokenLength:r(()=>n-i,"getTokenLength"),getTokenStartLine:r(()=>u,"getTokenStartLine"),getTokenStartCharacter:r(()=>i-m,"getTokenStartCharacter"),getTokenError:r(()=>v,"getTokenError")}}r(We,"createScanner");function ee(e){return e===32||e===9}r(ee,"isWhiteSpace");function M(e){return e===10||e===13}r(M,"isLineBreak");function R(e){return e>=48&&e<=57}r(R,"isDigit");var ge;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ge||(ge={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const S=200;new Array(S).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>`\r +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>`\r +`+" ".repeat(t));var X;(function(e){e.DEFAULT={allowTrailingComma:!1}})(X||(X={}));function Me(e,t=[],l=X.DEFAULT){let n=null,s=[];const i=[];function o(u){Array.isArray(s)?s.push(u):n!==null&&(s[n]=u)}return r(o,"onValue"),Je(e,{onObjectBegin:r(()=>{const u={};o(u),i.push(s),s=u,n=null},"onObjectBegin"),onObjectProperty:r(u=>{n=u},"onObjectProperty"),onObjectEnd:r(()=>{s=i.pop()},"onObjectEnd"),onArrayBegin:r(()=>{const u=[];o(u),i.push(s),s=u,n=null},"onArrayBegin"),onArrayEnd:r(()=>{s=i.pop()},"onArrayEnd"),onLiteralValue:o,onError:r((u,c,m)=>{t.push({error:u,offset:c,length:m})},"onError")},l),s[0]}r(Me,"parse$1");function Je(e,t,l=X.DEFAULT){const n=We(e,!1),s=[];let i=0;function o(b){return b?()=>i===0&&b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}r(o,"toNoArgVisit");function f(b){return b?F=>i===0&&b(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}r(f,"toOneArgVisit");function u(b){return b?F=>i===0&&b(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}r(u,"toOneArgVisitWithPath");function c(b){return b?()=>{i>0?i++:b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice())===!1&&(i=1)}:()=>!0}r(c,"toBeginVisit");function m(b){return b?()=>{i>0&&i--,i===0&&b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}r(m,"toEndVisit");const v=c(t.onObjectBegin),_=u(t.onObjectProperty),h=m(t.onObjectEnd),D=c(t.onArrayBegin),T=m(t.onArrayEnd),w=u(t.onLiteralValue),p=f(t.onSeparator),$=o(t.onComment),g=f(t.onError),j=l&&l.disallowComments,y=l&&l.allowTrailingComma;function A(){for(;;){const b=n.scan();switch(n.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:j||k(11);break;case 2:k(12);break;case 6:k(16);break}switch(b){case 12:case 13:j?k(10):$();break;case 16:k(1);break;case 15:case 14:break;default:return b}}}r(A,"scanNext");function k(b,F=[],W=[]){if(g(b),F.length+W.length>0){let I=n.getToken();for(;I!==17;){if(F.indexOf(I)!==-1){A();break}else if(W.indexOf(I)!==-1)break;I=A()}}}r(k,"handleError");function P(b){const F=n.getTokenValue();return b?w(F):(_(F),s.push(F)),A(),!0}r(P,"parseString");function J(){switch(n.getToken()){case 11:const b=n.getTokenValue();let F=Number(b);isNaN(F)&&(k(2),F=0),w(F);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return!1}return A(),!0}r(J,"parseLiteral");function V(){return n.getToken()!==10?(k(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(p(":"),A(),U()||k(4,[],[2,5])):k(5,[],[2,5]),s.pop(),!0)}r(V,"parseProperty");function z(){v(),A();let b=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(b||k(4,[],[]),p(","),A(),n.getToken()===2&&y)break}else b&&k(6,[],[]);V()||k(4,[],[2,5]),b=!0}return h(),n.getToken()!==2?k(7,[2],[]):A(),!0}r(z,"parseObject");function G(){D(),A();let b=!0,F=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(F||k(4,[],[]),p(","),A(),n.getToken()===4&&y)break}else F&&k(6,[],[]);b?(s.push(0),b=!1):s[s.length-1]++,U()||k(4,[],[4,5]),F=!0}return T(),b||s.pop(),n.getToken()!==4?k(8,[4],[]):A(),!0}r(G,"parseArray");function U(){switch(n.getToken()){case 3:return G();case 1:return z();case 10:return P(!0);default:return J()}}return r(U,"parseValue"),A(),n.getToken()===17?l.allowEmptyContent?!0:(k(4,[],[]),!1):U()?(n.getToken()!==17&&k(9,[],[]),!0):(k(4,[],[]),!1)}r(Je,"visit");var ke;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ke||(ke={}));var de;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(de||(de={}));const Ve=Me;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));const me=r((e,t)=>Ve(Se(t,e,"utf8")),"readJsonc"),ne=Symbol("implicitBaseUrl"),E="${configDir}",ze=r(()=>{const{findPnpApi:e}=$e;return e&&e(process.cwd())},"getPnpApi"),te=r((e,t,l,n)=>{const s=`resolveFromPackageJsonPath:${e}:${t}:${l}`;if(n!=null&&n.has(s))return n.get(s);const i=me(e,n);if(!i)return;let o=t||"tsconfig.json";if(!l&&i.exports)try{const[f]=Be.resolveExports(i.exports,t,["require","types"]);o=f}catch{return!1}else!t&&i.tsconfig&&(o=i.tsconfig);return o=d.join(e,"..",o),n==null||n.set(s,o),o},"resolveFromPackageJsonPath"),se="package.json",le="tsconfig.json",Ge=r((e,t,l)=>{var n;let s=e;if(e===".."&&(s=d.join(s,le)),e[0]==="."&&(s=d.resolve(t,s)),d.isAbsolute(s)){if(x(l,s)){if(Q(l,s).isFile())return s}else if(!s.endsWith(".json")){const T=`${s}.json`;if(x(l,T))return T}return}const[i,...o]=e.split("/"),f=i[0]==="@"?`${i}/${o.shift()}`:i,u=o.join("/"),c=ze();if(c){const{resolveRequest:T}=c;try{if(f===e){const w=T(d.join(f,se),t);if(w){const p=te(w,u,!1,l);if(p&&x(l,p))return p}}else{let w;try{w=T(e,t,{extensions:[".json"]})}catch{w=T(d.join(e,le),t)}if(w)return w}}catch{}}const m=O(d.resolve(t),d.join("node_modules",f),l);if(!m||!((n=Q(l,m))!=null&&n.isDirectory()))return;const v=Pe(l,m),_=d.join(v,se);if(x(l,_)){const T=te(_,u,!1,l);if(T===!1)return;if(T&&x(l,T)&&Q(l,T).isFile())return T}const h=d.join(v,u),D=h.endsWith(".json");if(!D){const T=`${h}.json`;if(x(l,T))return T}if(x(l,h)){if(Q(l,h).isDirectory()){const T=d.join(h,se);if(x(l,T)){const p=te(T,"",!0,l);if(p&&x(l,p))return p}const w=d.join(h,le);if(x(l,w))return w}else if(D)return h}},"resolveExtendsPath"),oe=r((e,t)=>H(d.relative(e,t)),"pathRelative"),ve=["files","include","exclude"],N=r((e,t,l)=>{const n=d.join(t,l),s=d.relative(e,n);return L(s)||"./"},"resolveAndRelativize"),qe=r((e,t,l)=>{const n=d.relative(e,t);if(!n)return l;const s=l.startsWith("./")?l.slice(2):l;return L(`${n}/${s}`)},"prefixPattern"),Qe=r((e,t,l,n)=>{const s=Ge(e,t,n);if(!s)throw new Error(`File '${e}' not found.`);if(l.has(s))throw new Error(`Circularity detected while resolving configuration: ${s}`);l.add(s);const i=d.dirname(s),o=pe(s,n,l,!0);delete o.references;const{compilerOptions:f}=o;if(f){const{baseUrl:u}=f;u&&!u.startsWith(E)&&(f.baseUrl=N(t,i,u));const{outDir:c}=f;c&&!c.startsWith(E)&&(f.outDir=N(t,i,c));const{declarationDir:m}=f;m&&!m.startsWith(E)&&(f.declarationDir=N(t,i,m));const{rootDir:v}=f;v&&!v.startsWith(E)&&(f.rootDir=N(t,i,v));const{rootDirs:_}=f;_&&(f.rootDirs=_.map(D=>D.startsWith(E)?D:N(t,i,D)));const{typeRoots:h}=f;h&&(f.typeRoots=h.map(D=>D.startsWith(E)?D:N(t,i,D)))}for(const u of ve){const c=o[u];c&&(o[u]=c.map(m=>m.startsWith(E)?m:qe(t,i,m)))}return o},"resolveExtends"),be=["outDir","declarationDir"],pe=r((e,t,l=new Set,n=!1)=>{let s;try{s=me(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof s!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const i=d.dirname(e);if(s.compilerOptions){const{compilerOptions:o}=s;o.paths&&!o.baseUrl&&(o[ne]=i)}if(s.extends){const o=Array.isArray(s.extends)?s.extends:[s.extends];delete s.extends;for(const f of o.reverse()){const u=Qe(f,i,new Set(l),t),c={...u,...s,compilerOptions:{...u.compilerOptions,...s.compilerOptions}};u.watchOptions&&(c.watchOptions={...u.watchOptions,...s.watchOptions}),s=c}}if(s.compilerOptions){const{compilerOptions:o}=s,f=["baseUrl","rootDir"];for(const u of f){const c=o[u];if(c&&!c.startsWith(E)){const m=d.resolve(i,c),v=oe(i,m);o[u]=v}}for(const u of be){let c=o[u];c&&(!n&&!Array.isArray(s.exclude)&&(s.exclude=be.map(m=>o[m]).filter(Boolean)),c.startsWith(E)||(c=H(c)),o[u]=c)}}else s.compilerOptions={};if(s.include&&(s.include=s.include.map(L)),s.files&&(s.files=s.files.map(o=>o.startsWith(E)?o:H(o))),s.watchOptions){const{watchOptions:o}=s;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(f=>L(d.resolve(i,f)))),o.excludeFiles&&(o.excludeFiles=o.excludeFiles.map(f=>L(d.resolve(i,f)))),o.watchFile&&(o.watchFile=o.watchFile.toLowerCase()),o.watchDirectory&&(o.watchDirectory=o.watchDirectory.toLowerCase()),o.fallbackPolling&&(o.fallbackPolling=o.fallbackPolling.toLowerCase())}return s},"_parseTsconfig"),Y=r((e,t)=>{if(e.startsWith(E))return L(d.join(t,e.slice(E.length)))},"interpolateConfigDir"),He=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Xe=r(e=>{var t,l,n,s,i,o,f,u,c,m,v,_,h,D,T,w,p,$,g,j,y,A,k,P,J,V,z,G,U,b,F,W,I;if(e.strict){const a=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const B of a)e[B]===void 0&&(e[B]=!0)}if(e.composite&&((t=e.declaration)!=null||(e.declaration=!0),(l=e.incremental)!=null||(e.incremental=!0)),e.target){let a=e.target.toLowerCase();a==="es2015"&&(a="es6"),e.target=a,a==="esnext"&&((n=e.module)!=null||(e.module="es6"),(s=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0)),(a==="es6"||a==="es2016"||a==="es2017"||a==="es2018"||a==="es2019"||a==="es2020"||a==="es2021"||a==="es2022"||a==="es2023"||a==="es2024")&&((i=e.module)!=null||(e.module="es6")),(a==="es2022"||a==="es2023"||a==="es2024")&&((o=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0))}if(e.module){let a=e.module.toLowerCase();if(a==="es2015"&&(a="es6"),e.module=a,(a==="es6"||a==="es2020"||a==="es2022"||a==="esnext"||a==="none"||a==="system"||a==="umd"||a==="amd")&&((f=e.moduleResolution)!=null||(e.moduleResolution="classic")),a==="system"&&((u=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),(a==="node16"||a==="node18"||a==="node20"||a==="nodenext"||a==="preserve")&&((c=e.esModuleInterop)!=null||(e.esModuleInterop=!0),(m=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),(a==="node16"||a==="node18"||a==="node20"||a==="nodenext")&&((v=e.moduleDetection)!=null||(e.moduleDetection="force")),a==="node16"&&((_=e.target)!=null||(e.target="es2022"),(h=e.moduleResolution)!=null||(e.moduleResolution="node16")),a==="node18"&&((D=e.target)!=null||(e.target="es2022"),(T=e.moduleResolution)!=null||(e.moduleResolution="node16")),a==="node20"&&((w=e.target)!=null||(e.target="es2023"),(p=e.moduleResolution)!=null||(e.moduleResolution="node16"),($=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0)),a==="nodenext"&&((g=e.target)!=null||(e.target="esnext"),(j=e.moduleResolution)!=null||(e.moduleResolution="nodenext"),(y=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0)),a==="node16"||a==="node18"||a==="node20"||a==="nodenext"){const B=e.target;(B==="es3"||B==="es2022"||B==="es2023"||B==="es2024"||B==="esnext")&&((A=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0))}a==="preserve"&&((k=e.moduleResolution)!=null||(e.moduleResolution="bundler"))}if(e.moduleResolution){let a=e.moduleResolution.toLowerCase();a==="node"&&(a="node10"),e.moduleResolution=a,(a==="node16"||a==="nodenext"||a==="bundler")&&((P=e.resolvePackageJsonExports)!=null||(e.resolvePackageJsonExports=!0),(J=e.resolvePackageJsonImports)!=null||(e.resolvePackageJsonImports=!0)),a==="bundler"&&((V=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0),(z=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0))}e.jsx&&(e.jsx=e.jsx.toLowerCase()),e.moduleDetection&&(e.moduleDetection=e.moduleDetection.toLowerCase()),e.importsNotUsedAsValues&&(e.importsNotUsedAsValues=e.importsNotUsedAsValues.toLowerCase()),e.newLine&&(e.newLine=e.newLine.toLowerCase()),e.esModuleInterop&&((G=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&((U=e.isolatedModules)!=null||(e.isolatedModules=!0),(b=e.preserveConstEnums)!=null||(e.preserveConstEnums=!0)),e.isolatedModules&&((F=e.preserveConstEnums)!=null||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&((W=e.allowImportingTsExtensions)!=null||(e.allowImportingTsExtensions=!0)),e.lib&&(e.lib=e.lib.map(a=>a.toLowerCase())),e.checkJs&&((I=e.allowJs)!=null||(e.allowJs=!0))},"normalizeCompilerOptions"),ie=r((e,t=new Map)=>{const l=d.resolve(e),n=pe(l,t),s=d.dirname(l),{compilerOptions:i}=n;if(i){for(const f of He){const u=i[f];if(u){const c=Y(u,s);i[f]=c?oe(s,c):u}}for(const f of["rootDirs","typeRoots"]){const u=i[f];u&&(i[f]=u.map(c=>{const m=Y(c,s);return m?oe(s,m):H(c)}))}const{paths:o}=i;if(o)for(const f of Object.keys(o))o[f]=o[f].map(u=>{var c;return(c=Y(u,s))!=null?c:u});Xe(i)}for(const o of ve){const f=n[o];f&&(n[o]=f.map(u=>{var c;return(c=Y(u,s))!=null?c:u}))}return n},"parseTsconfig");var Ye=Object.defineProperty,Z=r((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"s");const Te=Z(e=>{let t="";for(let l=0;l{const l=Re.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(l,""),!t.existsSync(Te(l))}finally{try{t.unlinkSync(l)}catch{}}},"checkDirectoryCaseWithWrite"),Ze=Z((e,t,l)=>{try{return Ae(e,l)}catch(n){if(t===void 0)return Ae(Ue.tmpdir(),l);throw n}},"checkDirectoryCaseWithFallback"),Ke=Z((e,t=Ie,l=!0)=>{const n=e!=null?e:process.cwd();if(l&&re.has(n))return re.get(n);let s;const i=Te(n);return i!==n&&t.existsSync(n)?s=!t.existsSync(i):s=Ze(n,e,t),l&&re.set(n,s),s},"isFsCaseSensitive"),{join:Oe}=d.posix,_e=r((e,t)=>{const l=Oe(e,t);return e.startsWith("//")&&!l.startsWith("//")?`/${l}`:l},"pathJoin"),ue={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Ce=r(e=>{const t=[...ue.ts],l=[...ue.cts],n=[...ue.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),l.push(".cjs"),n.push(".mjs")),[...t,...l,...n]},"getSupportedExtensions"),en=r(e=>{const t=[];if(!e)return t;const{outDir:l,declarationDir:n}=e;return l&&t.push(l),n&&t.push(n),t},"getDefaultExcludeSpec"),ye=r(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),nn=["node_modules","bower_components","jspm_packages"],fe=`(?!(${nn.join("|")})(/|$))`,tn=/(?:^|\/)[^.*?]+$/,je="**/*",K="[^/]",ae="[^./]",Fe=process.platform==="win32",De=r(({config:e,path:t},l=Ke())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!d.isAbsolute(t))throw new Error("The tsconfig path must be absolute");Fe&&(t=L(t));const n=d.dirname(t),{files:s,include:i,exclude:o,compilerOptions:f}=e,u=r(w=>d.isAbsolute(w)?w:_e(n,w),"resolvePattern"),c=s==null?void 0:s.map(u),m=Ce(f),v=l?"":"i",h=(o||en(f)).map(w=>{const p=u(w),$=ye(p).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${K}*`).replaceAll(String.raw`\?`,K);return new RegExp(`^${$}($|/)`,v)}),D=s||i?i:[je],T=D?D.map(w=>{let p=u(w);tn.test(p)&&(p=_e(p,je));const $=ye(p).replaceAll(String.raw`/\*\*`,`(/${fe}${ae}${K}*)*?`).replaceAll(/(\/)?\\\*/g,(g,j)=>{const y=`(${ae}|(\\.(?!min\\.js$))?)*`;return j?`/${fe}${ae}${y}`:y}).replaceAll(/(\/)?\\\?/g,(g,j)=>{const y=K;return j?`/${fe}${y}`:y});return new RegExp(`^${$}$`,v)}):void 0;return w=>{if(!d.isAbsolute(w))throw new Error("filePath must be absolute");if(Fe&&(w=L(w)),c!=null&&c.includes(w))return e;if(!(!m.some(p=>w.endsWith(p))||h.some(p=>p.test(w)))&&T&&T.some(p=>p.test(w)))return e}},"createFilesMatcher"),he=r((e,t,l)=>{const n=d.resolve(e);let s=L(e);for(;;){const i=O(s,t,l);if(!i)return;const o=d.resolve(i),f=ie(o,l),u={path:L(o),config:f};if(De(u)(n))return u;const m=d.dirname(i),v=d.dirname(m);if(v===m)return;s=v}},"findConfigApplicable"),Le=r((e=process.cwd(),t="tsconfig.json",l=new Map,n=!1)=>{var s;return n?(s=he(e,t,l))==null?void 0:s.path:O(L(e),t,l)},"findTsconfig"),sn=r((e=process.cwd(),t="tsconfig.json",l=new Map,n=!1)=>{var s;if(!n){const i=Le(e,t,l);if(!i)return null;const o=ie(i,l);return{path:i,config:o}}return(s=he(e,t,l))!=null?s:null},"getTsconfig"),ln=/\*/g,Ee=r((e,t)=>{const l=e.match(ln);if(l&&l.length>1)throw new Error(t)},"assertStarCount"),on=r(e=>{if(e.includes("*")){const[t,l]=e.split("*");return{prefix:t,suffix:l}}return e},"parsePattern"),rn=r(({prefix:e,suffix:t},l)=>l.startsWith(e)&&l.endsWith(t),"isPatternMatch"),un=r((e,t,l)=>Object.entries(e).map(([n,s])=>(Ee(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:on(n),substitutions:s.map(i=>{if(Ee(i,`Substitution '${i}' in pattern '${n}' can have at most one '*' character.`),!t&&!C.test(i)&&!d.isAbsolute(i))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return d.resolve(l,i)})})),"parsePaths"),fn=r(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:l,paths:n}=t;if(!l&&!n)return null;const s=ne in t&&t[ne],i=d.resolve(d.dirname(e.path),l||s||"."),o=n?un(n,l,i):[];return f=>{if(C.test(f))return[];const u=[];for(const _ of o){if(_.pattern===f)return _.substitutions.map(L);typeof _.pattern!="string"&&u.push(_)}let c,m=-1;for(const _ of u)rn(_.pattern,f)&&_.pattern.prefix.length>m&&(m=_.pattern.prefix.length,c=_);if(!c)return l?[L(d.join(i,f))]:[];const v=f.slice(c.pattern.prefix.length,f.length-c.pattern.suffix.length);return c.substitutions.map(_=>L(_.replace("*",v)))}},"createPathsMatcher");exports.createFilesMatcher=De,exports.createPathsMatcher=fn,exports.findTsconfig=Le,exports.getTsconfig=sn,exports.parseTsconfig=ie; diff --git a/e-commerce/node_modules/get-tsconfig/dist/index.d.cts b/e-commerce/node_modules/get-tsconfig/dist/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..f7f2f21111c3c1320cda2cdca2d14375ef224c76 --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/dist/index.d.cts @@ -0,0 +1,2116 @@ +/** +Returns a boolean for whether the given type is `any`. + +@link https://stackoverflow.com/a/49928360/1490091 + +Useful in type utilities, such as disallowing `any`s to be passed to a function. + +@example +``` +import type {IsAny} from 'type-fest'; + +const typedObject = {a: 1, b: 2} as const; +const anyObject: any = {a: 1, b: 2}; + +function get extends true ? {} : Record), K extends keyof O = keyof O>(obj: O, key: K) { + return obj[key]; +} + +const typedA = get(typedObject, 'a'); +//=> 1 + +const anyA = get(anyObject, 'a'); +//=> any +``` + +@category Type Guard +@category Utilities +*/ +type IsAny = 0 extends 1 & NoInfer ? true : false; + +/** +Returns a boolean for whether the given key is an optional key of type. + +This is useful when writing utility types or schema validators that need to differentiate `optional` keys. + +@example +``` +import type {IsOptionalKeyOf} from 'type-fest'; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +interface Admin { + name: string; + surname?: string; +} + +type T1 = IsOptionalKeyOf; +//=> true + +type T2 = IsOptionalKeyOf; +//=> false + +type T3 = IsOptionalKeyOf; +//=> boolean + +type T4 = IsOptionalKeyOf; +//=> false + +type T5 = IsOptionalKeyOf; +//=> boolean +``` + +@category Type Guard +@category Utilities +*/ +type IsOptionalKeyOf = + IsAny extends true ? never + : Key extends keyof Type + ? Type extends Record + ? false + : true + : false; + +/** +Extract all optional keys from the given type. + +This is useful when you want to create a new type that contains different type values for the optional keys only. + +@example +``` +import type {OptionalKeysOf, Except} from 'type-fest'; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +const REMOVE_FIELD = Symbol('remove field symbol'); +type UpdateOperation = Except, OptionalKeysOf> & { + [Key in OptionalKeysOf]?: Entity[Key] | typeof REMOVE_FIELD; +}; + +const update1: UpdateOperation = { + name: 'Alice' +}; + +const update2: UpdateOperation = { + name: 'Bob', + luckyNumber: REMOVE_FIELD +}; +``` + +@category Utilities +*/ +type OptionalKeysOf = + Type extends unknown // For distributing `Type` + ? (keyof {[Key in keyof Type as + IsOptionalKeyOf extends false + ? never + : Key + ]: never + }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf` is always assignable to `keyof Type` + : never; // Should never happen + +/** +Extract all required keys from the given type. + +This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc... + +@example +``` +import type {RequiredKeysOf} from 'type-fest'; + +declare function createValidation = RequiredKeysOf>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +const validator1 = createValidation('name', value => value.length < 25); +const validator2 = createValidation('surname', value => value.length < 25); +``` + +@category Utilities +*/ +type RequiredKeysOf = + Type extends unknown // For distributing `Type` + ? Exclude> + : never; // Should never happen + +/** +Returns a boolean for whether the given type is `never`. + +@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919 +@link https://stackoverflow.com/a/53984913/10292952 +@link https://www.zhenghao.io/posts/ts-never + +Useful in type utilities, such as checking if something does not occur. + +@example +``` +import type {IsNever, And} from 'type-fest'; + +// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts +type AreStringsEqual = + And< + IsNever> extends true ? true : false, + IsNever> extends true ? true : false + >; + +type EndIfEqual = + AreStringsEqual extends true + ? never + : void; + +function endIfEqual(input: I, output: O): EndIfEqual { + if (input === output) { + process.exit(0); + } +} + +endIfEqual('abc', 'abc'); +//=> never + +endIfEqual('abc', '123'); +//=> void +``` + +@category Type Guard +@category Utilities +*/ +type IsNever = [T] extends [never] ? true : false; + +/** +An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`. + +Use-cases: +- You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If, 'is any', 'not any'>`. + +Note: +- Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If` will return `'Y' | 'N'`. +- Returns the else branch if the given type is `never`. For example, `If` will return `'N'`. + +@example +``` +import {If} from 'type-fest'; + +type A = If; +//=> 'yes' + +type B = If; +//=> 'no' + +type C = If; +//=> 'yes' | 'no' + +type D = If; +//=> 'yes' | 'no' + +type E = If; +//=> 'no' +``` + +@example +``` +import {If, IsAny, IsNever} from 'type-fest'; + +type A = If, 'is any', 'not any'>; +//=> 'not any' + +type B = If, 'is never', 'not never'>; +//=> 'is never' +``` + +@example +``` +import {If, IsEqual} from 'type-fest'; + +type IfEqual = If, IfBranch, ElseBranch>; + +type A = IfEqual; +//=> 'equal' + +type B = IfEqual; +//=> 'not equal' +``` + +@category Type Guard +@category Utilities +*/ +type If = + IsNever extends true + ? ElseBranch + : Type extends true + ? IfBranch + : ElseBranch; + +/** +Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. + +@example +``` +import type {Simplify} from 'type-fest'; + +type PositionProps = { + top: number; + left: number; +}; + +type SizeProps = { + width: number; + height: number; +}; + +// In your editor, hovering over `Props` will show a flattened object with all the properties. +type Props = Simplify; +``` + +Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface. + +If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify` if you can't re-declare the `value`. + +@example +``` +import type {Simplify} from 'type-fest'; + +interface SomeInterface { + foo: number; + bar?: string; + baz: number | undefined; +} + +type SomeType = { + foo: number; + bar?: string; + baz: number | undefined; +}; + +const literal = {foo: 123, bar: 'hello', baz: 456}; +const someType: SomeType = literal; +const someInterface: SomeInterface = literal; + +function fn(object: Record): void {} + +fn(literal); // Good: literal object type is sealed +fn(someType); // Good: type is sealed +fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened +fn(someInterface as Simplify); // Good: transform an `interface` into a `type` +``` + +@link https://github.com/microsoft/TypeScript/issues/15300 +@see SimplifyDeep +@category Object +*/ +type Simplify = {[KeyType in keyof T]: T[KeyType]} & {}; + +/** +Returns a boolean for whether the two given types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 + +Use-cases: +- If you want to make a conditional branch based on the result of a comparison of two types. + +@example +``` +import type {IsEqual} from 'type-fest'; + +// This type returns a boolean for whether the given array includes the given item. +// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. +type Includes = + Value extends readonly [Value[0], ...infer rest] + ? IsEqual extends true + ? true + : Includes + : false; +``` + +@category Type Guard +@category Utilities +*/ +type IsEqual = + [A, B] extends [infer AA, infer BB] + ? [AA] extends [never] + ? [BB] extends [never] + ? true + : false + : [BB] extends [never] + ? false + : _IsEqual + : false; + +// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`. +type _IsEqual = + (() => G extends A & G | G ? 1 : 2) extends + (() => G extends B & G | G ? 1 : 2) + ? true + : false; + +/** +Omit any index signatures from the given object type, leaving only explicitly defined properties. + +This is the counterpart of `PickIndexSignature`. + +Use-cases: +- Remove overly permissive signatures from third-party types. + +This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747). + +It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`. + +(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.) + +``` +const indexed: Record = {}; // Allowed + +const keyed: Record<'foo', unknown> = {}; // Error +// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar +``` + +Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another: + +``` +type Indexed = {} extends Record + ? '✅ `{}` is assignable to `Record`' + : '❌ `{}` is NOT assignable to `Record`'; +// => '✅ `{}` is assignable to `Record`' + +type Keyed = {} extends Record<'foo' | 'bar', unknown> + ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`" + : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"; +// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`" +``` + +Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`... + +``` +import type {OmitIndexSignature} from 'type-fest'; + +type OmitIndexSignature = { + [KeyType in keyof ObjectType // Map each key of `ObjectType`... + ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature == Foo`. +}; +``` + +...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record`)... + +``` +import type {OmitIndexSignature} from 'type-fest'; + +type OmitIndexSignature = { + [KeyType in keyof ObjectType + // Is `{}` assignable to `Record`? + as {} extends Record + ? ... // ✅ `{}` is assignable to `Record` + : ... // ❌ `{}` is NOT assignable to `Record` + ]: ObjectType[KeyType]; +}; +``` + +If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it. + +@example +``` +import type {OmitIndexSignature} from 'type-fest'; + +interface Example { + // These index signatures will be removed. + [x: string]: any + [x: number]: any + [x: symbol]: any + [x: `head-${string}`]: string + [x: `${string}-tail`]: string + [x: `head-${string}-tail`]: string + [x: `${bigint}`]: string + [x: `embedded-${number}`]: string + + // These explicitly defined keys will remain. + foo: 'bar'; + qux?: 'baz'; +} + +type ExampleWithoutIndexSignatures = OmitIndexSignature; +// => { foo: 'bar'; qux?: 'baz' | undefined; } +``` + +@see PickIndexSignature +@category Object +*/ +type OmitIndexSignature = { + [KeyType in keyof ObjectType as {} extends Record + ? never + : KeyType]: ObjectType[KeyType]; +}; + +/** +Pick only index signatures from the given object type, leaving out all explicitly defined properties. + +This is the counterpart of `OmitIndexSignature`. + +@example +``` +import type {PickIndexSignature} from 'type-fest'; + +declare const symbolKey: unique symbol; + +type Example = { + // These index signatures will remain. + [x: string]: unknown; + [x: number]: unknown; + [x: symbol]: unknown; + [x: `head-${string}`]: string; + [x: `${string}-tail`]: string; + [x: `head-${string}-tail`]: string; + [x: `${bigint}`]: string; + [x: `embedded-${number}`]: string; + + // These explicitly defined keys will be removed. + ['kebab-case-key']: string; + [symbolKey]: string; + foo: 'bar'; + qux?: 'baz'; +}; + +type ExampleIndexSignature = PickIndexSignature; +// { +// [x: string]: unknown; +// [x: number]: unknown; +// [x: symbol]: unknown; +// [x: `head-${string}`]: string; +// [x: `${string}-tail`]: string; +// [x: `head-${string}-tail`]: string; +// [x: `${bigint}`]: string; +// [x: `embedded-${number}`]: string; +// } +``` + +@see OmitIndexSignature +@category Object +*/ +type PickIndexSignature = { + [KeyType in keyof ObjectType as {} extends Record + ? KeyType + : never]: ObjectType[KeyType]; +}; + +// Merges two objects without worrying about index signatures. +type SimpleMerge = { + [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; +} & Source; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import type {Merge} from 'type-fest'; + +interface Foo { + [x: string]: unknown; + [x: number]: unknown; + foo: string; + bar: symbol; +} + +type Bar = { + [x: number]: number; + [x: symbol]: unknown; + bar: Date; + baz: boolean; +}; + +export type FooBar = Merge; +// => { +// [x: string]: unknown; +// [x: number]: number; +// [x: symbol]: unknown; +// foo: string; +// bar: Date; +// baz: boolean; +// } +``` + +@category Object +*/ +type Merge = +Simplify< + SimpleMerge, PickIndexSignature> + & SimpleMerge, OmitIndexSignature> +>; + +/** +Merges user specified options with default options. + +@example +``` +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; +type SpecifiedOptions = {leavesOnly: true}; + +type Result = ApplyDefaultOptions; +//=> {maxRecursionDepth: 10; leavesOnly: true} +``` + +@example +``` +// Complains if default values are not provided for optional options + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10}; +type SpecifiedOptions = {}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~~~~ +// Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'. +``` + +@example +``` +// Complains if an option's default type does not conform to the expected type + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'}; +type SpecifiedOptions = {}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~~~~ +// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. +``` + +@example +``` +// Complains if an option's specified type does not conform to the expected type + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; +type SpecifiedOptions = {leavesOnly: 'yes'}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~ +// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. +``` +*/ +type ApplyDefaultOptions< + Options extends object, + Defaults extends Simplify, RequiredKeysOf> & Partial, never>>>, + SpecifiedOptions extends Options, +> = + If, Defaults, + If, Defaults, + Simplify ? undefined extends SpecifiedOptions[Key] ? never : Key : Key + ]: SpecifiedOptions[Key] + }> & Required>>>; + +/** +Filter out keys from an object. + +Returns `never` if `Exclude` is strictly equal to `Key`. +Returns `never` if `Key` extends `Exclude`. +Returns `Key` otherwise. + +@example +``` +type Filtered = Filter<'foo', 'foo'>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', string>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', 'foo'>; +//=> 'bar' +``` + +@see {Except} +*/ +type Filter = IsEqual extends true ? never : (KeyType extends ExcludeType ? never : KeyType); + +type ExceptOptions = { + /** + Disallow assigning non-specified properties. + + Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`. + + @default false + */ + requireExactProps?: boolean; +}; + +type DefaultExceptOptions = { + requireExactProps: false; +}; + +/** +Create a type from an object type without certain keys. + +We recommend setting the `requireExactProps` option to `true`. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import type {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type FooWithoutA = Except; +//=> {b: string} + +const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; +//=> errors: 'a' does not exist in type '{ b: string; }' + +type FooWithoutB = Except; +//=> {a: number} & Partial> + +const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; +//=> errors at 'b': Type 'string' is not assignable to type 'undefined'. + +// The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures. + +// Consider the following example: + +type UserData = { + [metadata: string]: string; + email: string; + name: string; + role: 'admin' | 'user'; +}; + +// `Omit` clearly doesn't behave as expected in this case: +type PostPayload = Omit; +//=> type PostPayload = { [x: string]: string; [x: number]: string; } + +// In situations like this, `Except` works better. +// It simply removes the `email` key while preserving all the other keys. +type PostPayload = Except; +//=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; } +``` + +@category Object +*/ +type Except = + _Except>; + +type _Except> = { + [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; +} & (Options['requireExactProps'] extends true + ? Partial> + : {}); + +declare namespace TsConfigJson { + namespace CompilerOptions { + type JSX = + | 'preserve' + | 'react' + | 'react-jsx' + | 'react-jsxdev' + | 'react-native'; + + type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ES2020' + | 'ES2022' + | 'ESNext' + | 'Node16' + | 'Node18' + | 'Node20' + | 'NodeNext' + | 'Preserve' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'es2020' + | 'es2022' + | 'esnext' + | 'node16' + | 'node18' + | 'node20' + | 'nodenext' + | 'preserve' + | 'none'; + + type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ES2021' + | 'ES2022' + | 'ES2023' + | 'ES2024' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'es2021' + | 'es2022' + | 'es2023' + | 'es2024' + | 'esnext'; + + type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.ArrayBuffer' + | 'ES2017.Date' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncGenerator' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Intl' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.BigInt' + | 'ES2020.Date' + | 'ES2020.Intl' + | 'ES2020.Number' + | 'ES2020.Promise' + | 'ES2020.SharedMemory' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ES2021' + | 'ES2021.Intl' + | 'ES2021.Promise' + | 'ES2021.String' + | 'ES2021.WeakRef' + | 'ES2022' + | 'ES2022.Array' + | 'ES2022.Error' + | 'ES2022.Intl' + | 'ES2022.Object' + | 'ES2022.RegExp' + | 'ES2022.SharedMemory' + | 'ES2022.String' + | 'ES2023' + | 'ES2023.Array' + | 'ES2023.Collection' + | 'ES2023.Intl' + | 'ES2024' + | 'ES2024.ArrayBuffer' + | 'ES2024.Collection' + | 'ES2024.Object' + | 'ES2024.Promise' + | 'ES2024.Regexp' + | 'ES2024.SharedMemory' + | 'ES2024.String' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Collection' + | 'ESNext.Decorators' + | 'ESNext.Disposable' + | 'ESNext.Error' + | 'ESNext.Intl' + | 'ESNext.Iterator' + | 'ESNext.Object' + | 'ESNext.Promise' + | 'ESNext.Regexp' + | 'ESNext.String' + | 'ESNext.Symbol' + | 'ESNext.WeakRef' + | 'DOM' + | 'DOM.AsyncIterable' + | 'DOM.Iterable' + | 'Decorators' + | 'Decorators.Legacy' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.AsyncIterable' + | 'WebWorker.ImportScripts' + | 'WebWorker.Iterable' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.arraybuffer' + | 'es2017.date' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asyncgenerator' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.intl' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.bigint' + | 'es2020.date' + | 'es2020.intl' + | 'es2020.number' + | 'es2020.promise' + | 'es2020.sharedmemory' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'es2021' + | 'es2021.intl' + | 'es2021.promise' + | 'es2021.string' + | 'es2021.weakref' + | 'es2022' + | 'es2022.array' + | 'es2022.error' + | 'es2022.intl' + | 'es2022.object' + | 'es2022.regexp' + | 'es2022.sharedmemory' + | 'es2022.string' + | 'es2023' + | 'es2023.array' + | 'es2023.collection' + | 'es2023.intl' + | 'es2024' + | 'es2024.arraybuffer' + | 'es2024.collection' + | 'es2024.object' + | 'es2024.promise' + | 'es2024.regexp' + | 'es2024.sharedmemory' + | 'es2024.string' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.collection' + | 'esnext.decorators' + | 'esnext.disposable' + | 'esnext.error' + | 'esnext.intl' + | 'esnext.iterator' + | 'esnext.object' + | 'esnext.promise' + | 'esnext.regexp' + | 'esnext.string' + | 'esnext.symbol' + | 'esnext.weakref' + | 'dom' + | 'dom.asynciterable' + | 'dom.iterable' + | 'decorators' + | 'decorators.legacy' + | 'scripthost' + | 'webworker' + | 'webworker.asynciterable' + | 'webworker.importscripts' + | 'webworker.iterable'; + + type Plugin = { + /** + Plugin name. + */ + name: string; + }; + + type ImportsNotUsedAsValues = + | 'remove' + | 'preserve' + | 'error'; + + type FallbackPolling = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedInterval' + | 'priorityInterval' + | 'dynamicPriority' + | 'fixedChunkSize'; + + type WatchDirectory = + | 'useFsEvents' + | 'fixedPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedChunkSizePolling'; + + type WatchFile = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'useFsEvents' + | 'useFsEventsOnParentDirectory' + | 'fixedChunkSizePolling'; + + type ModuleResolution = + | 'classic' + | 'node' + | 'node10' + | 'node16' + | 'nodenext' + | 'bundler' + // Pascal-cased alternatives + | 'Classic' + | 'Node' + | 'Node10' + | 'Node16' + | 'NodeNext' + | 'Bundler'; + + type ModuleDetection = + | 'auto' + | 'legacy' + | 'force'; + + type IgnoreDeprecations = '5.0'; + } + + type CompilerOptions = { + /** + The character set of the input files. + + @default 'utf8' + @deprecated This option will be removed in TypeScript 5.5. + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Reduce the number of projects loaded automatically by TypeScript. + + @default false + */ + disableReferencedProjectLoad?: boolean; + + /** + Enforces using indexed accessors for keys declared using an indexed type. + + @default false + */ + noPropertyAccessFromIndexSignature?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Differentiate between undefined and not present when type checking. + + @default false + */ + exactOptionalPropertyTypes?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify what JSX code is generated. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. + + @default 'React.Fragment' + */ + jsxFragmentFactory?: string; + + /** + Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. + + @default 'react' + */ + jsxImportSource?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: CompilerOptions.ModuleResolution; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + @default 'LF' + */ + newLine?: CompilerOptions.NewLine; + + /** + Disable full type checking (only critical parse and emit errors will be reported). + + @default false + */ + noCheck?: boolean; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. + + @default false + */ + rewriteRelativeImportExtensions?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Require sufficient annotation on exports so other tools can trivially generate declaration files. + + @default false + */ + isolatedDeclarations?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Default catch clause variables as `unknown` instead of `any`. + + @default false + */ + useUnknownInCatchVariables?: boolean; + + /** + Watch input files. + + @default false + @deprecated Use watchOptions instead. + */ + watch?: boolean; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + + @deprecated Use watchOptions.fallbackPolling instead. + */ + fallbackPolling?: CompilerOptions.FallbackPolling; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchDirectory instead. + */ + watchDirectory?: CompilerOptions.WatchDirectory; + + /** + Specify the strategy for watching individual files. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchFile instead. + */ + watchFile?: CompilerOptions.WatchFile; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Add `undefined` to a type when accessed using an index. + + @default false + */ + noUncheckedIndexedAccess?: boolean; + + /** + Report error if failed to find a source file for a side effect import. + + @default false + */ + noUncheckedSideEffectImports?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Ensure overriding members in derived classes are marked with an override modifier. + + @default false + */ + noImplicitOverride?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default true + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Emit a v8 CPU profile of the compiler run for debugging. + + @default 'profile.cpuprofile' + */ + generateCpuProfile?: string; + + /** + Generates an event trace and a list of types. + */ + generateTrace?: boolean; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + @default false + */ + importHelpers?: boolean; + + /** + Specify emit/checking behavior for imports that are only used for types. + + @default 'remove' + @deprecated Use `verbatimModuleSyntax` instead. + */ + importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + @default false + */ + checkJs?: boolean; + + /** + Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`. + + @default false + */ + strictBuiltinIteratorReturn?: boolean; + + /** + Disable bivariant parameter checking for function types. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + @default false + */ + resolveJsonModule?: boolean; + + /** + Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. + + @default false + */ + assumeChangesOnlyAffectDirectDependencies?: boolean; + + /** + Output more detailed compiler performance information after building. + + @default false + */ + extendedDiagnostics?: boolean; + + /** + Print names of files that are part of the compilation and then stop processing. + + @default false + */ + listFilesOnly?: boolean; + + /** + Disable preferring source files instead of declaration files when referencing composite projects. + + @default true if composite, false otherwise + */ + disableSourceOfProjectReferenceRedirect?: boolean; + + /** + Opt a project out of multi-project reference checking when editing. + + @default false + */ + disableSolutionSearching?: boolean; + + /** + Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. + + @default false + */ + explainFiles?: boolean; + + /** + Preserve unused imported values in the JavaScript output that would otherwise be removed. + + @default true + @deprecated Use `verbatimModuleSyntax` instead. + */ + preserveValueImports?: boolean; + + /** + List of file name suffixes to search when resolving a module. + */ + moduleSuffixes?: string[]; + + /** + Control what method is used to detect module-format JS files. + + @default 'auto' + */ + moduleDetection?: CompilerOptions.ModuleDetection; + + /** + Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx. + + @default false + */ + allowImportingTsExtensions?: boolean; + + /** + Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules. + + @default false + */ + resolvePackageJsonExports?: boolean; + + /** + Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json. + + @default false + */ + resolvePackageJsonImports?: boolean; + + /** + Suppress errors for file formats that TypeScript does not understand. + + @default false + */ + allowArbitraryExtensions?: boolean; + + /** + List of additional conditions that should succeed when TypeScript resolves from package.json. + */ + customConditions?: string[]; + + /** + Anything that uses the type modifier is dropped entirely. + + @default false + */ + verbatimModuleSyntax?: boolean; + + /** + Suppress deprecation warnings + */ + ignoreDeprecations?: CompilerOptions.IgnoreDeprecations; + + /** + Do not allow runtime constructs that are not part of ECMAScript. + + @default false + */ + erasableSyntaxOnly?: boolean; + + /** + Enable lib replacement. + + @default true + */ + libReplacement?: boolean; + }; + + namespace WatchOptions { + type WatchFileKind = + | 'FixedPollingInterval' + | 'PriorityPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling' + | 'UseFsEvents' + | 'UseFsEventsOnParentDirectory'; + + type WatchDirectoryKind = + | 'UseFsEvents' + | 'FixedPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling'; + + type PollingWatchKind = + | 'FixedInterval' + | 'PriorityInterval' + | 'DynamicPriority' + | 'FixedChunkSize'; + } + + type WatchOptions = { + + /** + Specify the strategy for watching individual files. + + @default 'UseFsEvents' + */ + watchFile?: WatchOptions.WatchFileKind | Lowercase; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'UseFsEvents' + */ + watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + */ + fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase; + + /** + Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively. + */ + synchronousWatchDirectory?: boolean; + + /** + Specifies a list of directories to exclude from watch. + */ + excludeDirectories?: string[]; + + /** + Specifies a list of files to exclude from watch. + */ + excludeFiles?: string[]; + }; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + type TypeAcquisition = { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + + /** + Disable infering what types should be added based on filenames in a project. + */ + disableFilenameBasedTypeAcquisition?: boolean; + }; + + type References = { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + @deprecated This option will be removed in TypeScript 5.5. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + }; +} + +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category File +*/ +type TsConfigJson = { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Instructs the TypeScript compiler how to watch files. + */ + watchOptions?: TsConfigJson.WatchOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + */ + extends?: string | string[]; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + */ + include?: string[]; + + /** + Referenced projects. + */ + references?: TsConfigJson.References[]; +}; + +type TsConfigJsonResolved = Except; +type TsConfigResult = { + /** + * The path to the tsconfig.json file + */ + path: string; + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved; +}; +type PathsMatcher = (specifier: string) => string[]; +type Cache = Map; + +/** + * Searches for a tsconfig file by walking up the directory tree. + * + * @param searchPath Path to a source file or directory to search from (default: `process.cwd()`). + * @param configName Config file name (default: `tsconfig.json`). + * @param cache Cache for previous results (default: new `Map()`). + * @param includes When true, validates that the tsconfig applies to the + * `searchPath` file via `include`/`exclude`/`files`. See {@link getTsconfig} + * for details. Default: `false`. + * @returns The path to the found tsconfig file, or `undefined` if not found. + */ +declare const findTsconfig: (searchPath?: string, configName?: string, cache?: Cache, includes?: boolean) => string | undefined; +/** + * Finds and reads a tsconfig file by walking up the directory tree. + * + * By default, returns the nearest tsconfig found (matching `tsc` CLI behavior). + * + * When `includes` is true and `searchPath` is a file path, validates + * that the found tsconfig applies to the file (via `files`, `include`, and + * `exclude`). If the file isn't matched, continues searching parent directories. + * This matches VS Code's TypeScript Language Server behavior. + * + * Reference: + * - `tsc` CLI uses `findConfigFile()` which returns the nearest tsconfig without validation: + * https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/compiler/program.ts#L328 + * - Language Server uses `isMatchedByConfig()` to verify the file belongs to the project: + * https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/server/editorServices.ts#L4486 + * + * @param searchPath Path to a source file or directory to search from (default: `process.cwd()`). + * @param configName Config file name (default: `tsconfig.json`). + * @param cache Cache for previous results (default: new `Map()`). + * @param includes When true, validates that the tsconfig applies to the + * `searchPath` file via `include`/`exclude`/`files`. Default: `false`. + * @returns The tsconfig file path and parsed contents, or `null` if not found. + */ +declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Cache, includes?: boolean) => TsConfigResult | null; + +/** + * Parses a tsconfig file at a given path + * + * @param tsconfigPath - Path to the tsconfig file. + * @param cache - Cache for storing parsed tsconfig results (default: new `Map()`). + * @returns The parsed and resolved tsconfig JSON. + */ +declare const parseTsconfig: (tsconfigPath: string, cache?: Cache) => TsConfigJsonResolved; + +/** + * Reference: + * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465 + */ +declare const createPathsMatcher: (tsconfig: TsConfigResult) => PathsMatcher | null; + +type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined); +declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher; + +export { type Cache, type FileMatcher, type PathsMatcher, TsConfigJson, type TsConfigJsonResolved, type TsConfigResult, createFilesMatcher, createPathsMatcher, findTsconfig, getTsconfig, parseTsconfig }; diff --git a/e-commerce/node_modules/get-tsconfig/dist/index.d.mts b/e-commerce/node_modules/get-tsconfig/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f7f2f21111c3c1320cda2cdca2d14375ef224c76 --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/dist/index.d.mts @@ -0,0 +1,2116 @@ +/** +Returns a boolean for whether the given type is `any`. + +@link https://stackoverflow.com/a/49928360/1490091 + +Useful in type utilities, such as disallowing `any`s to be passed to a function. + +@example +``` +import type {IsAny} from 'type-fest'; + +const typedObject = {a: 1, b: 2} as const; +const anyObject: any = {a: 1, b: 2}; + +function get extends true ? {} : Record), K extends keyof O = keyof O>(obj: O, key: K) { + return obj[key]; +} + +const typedA = get(typedObject, 'a'); +//=> 1 + +const anyA = get(anyObject, 'a'); +//=> any +``` + +@category Type Guard +@category Utilities +*/ +type IsAny = 0 extends 1 & NoInfer ? true : false; + +/** +Returns a boolean for whether the given key is an optional key of type. + +This is useful when writing utility types or schema validators that need to differentiate `optional` keys. + +@example +``` +import type {IsOptionalKeyOf} from 'type-fest'; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +interface Admin { + name: string; + surname?: string; +} + +type T1 = IsOptionalKeyOf; +//=> true + +type T2 = IsOptionalKeyOf; +//=> false + +type T3 = IsOptionalKeyOf; +//=> boolean + +type T4 = IsOptionalKeyOf; +//=> false + +type T5 = IsOptionalKeyOf; +//=> boolean +``` + +@category Type Guard +@category Utilities +*/ +type IsOptionalKeyOf = + IsAny extends true ? never + : Key extends keyof Type + ? Type extends Record + ? false + : true + : false; + +/** +Extract all optional keys from the given type. + +This is useful when you want to create a new type that contains different type values for the optional keys only. + +@example +``` +import type {OptionalKeysOf, Except} from 'type-fest'; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +const REMOVE_FIELD = Symbol('remove field symbol'); +type UpdateOperation = Except, OptionalKeysOf> & { + [Key in OptionalKeysOf]?: Entity[Key] | typeof REMOVE_FIELD; +}; + +const update1: UpdateOperation = { + name: 'Alice' +}; + +const update2: UpdateOperation = { + name: 'Bob', + luckyNumber: REMOVE_FIELD +}; +``` + +@category Utilities +*/ +type OptionalKeysOf = + Type extends unknown // For distributing `Type` + ? (keyof {[Key in keyof Type as + IsOptionalKeyOf extends false + ? never + : Key + ]: never + }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf` is always assignable to `keyof Type` + : never; // Should never happen + +/** +Extract all required keys from the given type. + +This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc... + +@example +``` +import type {RequiredKeysOf} from 'type-fest'; + +declare function createValidation = RequiredKeysOf>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn; + +interface User { + name: string; + surname: string; + + luckyNumber?: number; +} + +const validator1 = createValidation('name', value => value.length < 25); +const validator2 = createValidation('surname', value => value.length < 25); +``` + +@category Utilities +*/ +type RequiredKeysOf = + Type extends unknown // For distributing `Type` + ? Exclude> + : never; // Should never happen + +/** +Returns a boolean for whether the given type is `never`. + +@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919 +@link https://stackoverflow.com/a/53984913/10292952 +@link https://www.zhenghao.io/posts/ts-never + +Useful in type utilities, such as checking if something does not occur. + +@example +``` +import type {IsNever, And} from 'type-fest'; + +// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts +type AreStringsEqual = + And< + IsNever> extends true ? true : false, + IsNever> extends true ? true : false + >; + +type EndIfEqual = + AreStringsEqual extends true + ? never + : void; + +function endIfEqual(input: I, output: O): EndIfEqual { + if (input === output) { + process.exit(0); + } +} + +endIfEqual('abc', 'abc'); +//=> never + +endIfEqual('abc', '123'); +//=> void +``` + +@category Type Guard +@category Utilities +*/ +type IsNever = [T] extends [never] ? true : false; + +/** +An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`. + +Use-cases: +- You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If, 'is any', 'not any'>`. + +Note: +- Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If` will return `'Y' | 'N'`. +- Returns the else branch if the given type is `never`. For example, `If` will return `'N'`. + +@example +``` +import {If} from 'type-fest'; + +type A = If; +//=> 'yes' + +type B = If; +//=> 'no' + +type C = If; +//=> 'yes' | 'no' + +type D = If; +//=> 'yes' | 'no' + +type E = If; +//=> 'no' +``` + +@example +``` +import {If, IsAny, IsNever} from 'type-fest'; + +type A = If, 'is any', 'not any'>; +//=> 'not any' + +type B = If, 'is never', 'not never'>; +//=> 'is never' +``` + +@example +``` +import {If, IsEqual} from 'type-fest'; + +type IfEqual = If, IfBranch, ElseBranch>; + +type A = IfEqual; +//=> 'equal' + +type B = IfEqual; +//=> 'not equal' +``` + +@category Type Guard +@category Utilities +*/ +type If = + IsNever extends true + ? ElseBranch + : Type extends true + ? IfBranch + : ElseBranch; + +/** +Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. + +@example +``` +import type {Simplify} from 'type-fest'; + +type PositionProps = { + top: number; + left: number; +}; + +type SizeProps = { + width: number; + height: number; +}; + +// In your editor, hovering over `Props` will show a flattened object with all the properties. +type Props = Simplify; +``` + +Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface. + +If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify` if you can't re-declare the `value`. + +@example +``` +import type {Simplify} from 'type-fest'; + +interface SomeInterface { + foo: number; + bar?: string; + baz: number | undefined; +} + +type SomeType = { + foo: number; + bar?: string; + baz: number | undefined; +}; + +const literal = {foo: 123, bar: 'hello', baz: 456}; +const someType: SomeType = literal; +const someInterface: SomeInterface = literal; + +function fn(object: Record): void {} + +fn(literal); // Good: literal object type is sealed +fn(someType); // Good: type is sealed +fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened +fn(someInterface as Simplify); // Good: transform an `interface` into a `type` +``` + +@link https://github.com/microsoft/TypeScript/issues/15300 +@see SimplifyDeep +@category Object +*/ +type Simplify = {[KeyType in keyof T]: T[KeyType]} & {}; + +/** +Returns a boolean for whether the two given types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 + +Use-cases: +- If you want to make a conditional branch based on the result of a comparison of two types. + +@example +``` +import type {IsEqual} from 'type-fest'; + +// This type returns a boolean for whether the given array includes the given item. +// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. +type Includes = + Value extends readonly [Value[0], ...infer rest] + ? IsEqual extends true + ? true + : Includes + : false; +``` + +@category Type Guard +@category Utilities +*/ +type IsEqual = + [A, B] extends [infer AA, infer BB] + ? [AA] extends [never] + ? [BB] extends [never] + ? true + : false + : [BB] extends [never] + ? false + : _IsEqual + : false; + +// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`. +type _IsEqual = + (() => G extends A & G | G ? 1 : 2) extends + (() => G extends B & G | G ? 1 : 2) + ? true + : false; + +/** +Omit any index signatures from the given object type, leaving only explicitly defined properties. + +This is the counterpart of `PickIndexSignature`. + +Use-cases: +- Remove overly permissive signatures from third-party types. + +This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747). + +It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`. + +(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.) + +``` +const indexed: Record = {}; // Allowed + +const keyed: Record<'foo', unknown> = {}; // Error +// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar +``` + +Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another: + +``` +type Indexed = {} extends Record + ? '✅ `{}` is assignable to `Record`' + : '❌ `{}` is NOT assignable to `Record`'; +// => '✅ `{}` is assignable to `Record`' + +type Keyed = {} extends Record<'foo' | 'bar', unknown> + ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`" + : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"; +// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`" +``` + +Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`... + +``` +import type {OmitIndexSignature} from 'type-fest'; + +type OmitIndexSignature = { + [KeyType in keyof ObjectType // Map each key of `ObjectType`... + ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature == Foo`. +}; +``` + +...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record`)... + +``` +import type {OmitIndexSignature} from 'type-fest'; + +type OmitIndexSignature = { + [KeyType in keyof ObjectType + // Is `{}` assignable to `Record`? + as {} extends Record + ? ... // ✅ `{}` is assignable to `Record` + : ... // ❌ `{}` is NOT assignable to `Record` + ]: ObjectType[KeyType]; +}; +``` + +If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it. + +@example +``` +import type {OmitIndexSignature} from 'type-fest'; + +interface Example { + // These index signatures will be removed. + [x: string]: any + [x: number]: any + [x: symbol]: any + [x: `head-${string}`]: string + [x: `${string}-tail`]: string + [x: `head-${string}-tail`]: string + [x: `${bigint}`]: string + [x: `embedded-${number}`]: string + + // These explicitly defined keys will remain. + foo: 'bar'; + qux?: 'baz'; +} + +type ExampleWithoutIndexSignatures = OmitIndexSignature; +// => { foo: 'bar'; qux?: 'baz' | undefined; } +``` + +@see PickIndexSignature +@category Object +*/ +type OmitIndexSignature = { + [KeyType in keyof ObjectType as {} extends Record + ? never + : KeyType]: ObjectType[KeyType]; +}; + +/** +Pick only index signatures from the given object type, leaving out all explicitly defined properties. + +This is the counterpart of `OmitIndexSignature`. + +@example +``` +import type {PickIndexSignature} from 'type-fest'; + +declare const symbolKey: unique symbol; + +type Example = { + // These index signatures will remain. + [x: string]: unknown; + [x: number]: unknown; + [x: symbol]: unknown; + [x: `head-${string}`]: string; + [x: `${string}-tail`]: string; + [x: `head-${string}-tail`]: string; + [x: `${bigint}`]: string; + [x: `embedded-${number}`]: string; + + // These explicitly defined keys will be removed. + ['kebab-case-key']: string; + [symbolKey]: string; + foo: 'bar'; + qux?: 'baz'; +}; + +type ExampleIndexSignature = PickIndexSignature; +// { +// [x: string]: unknown; +// [x: number]: unknown; +// [x: symbol]: unknown; +// [x: `head-${string}`]: string; +// [x: `${string}-tail`]: string; +// [x: `head-${string}-tail`]: string; +// [x: `${bigint}`]: string; +// [x: `embedded-${number}`]: string; +// } +``` + +@see OmitIndexSignature +@category Object +*/ +type PickIndexSignature = { + [KeyType in keyof ObjectType as {} extends Record + ? KeyType + : never]: ObjectType[KeyType]; +}; + +// Merges two objects without worrying about index signatures. +type SimpleMerge = { + [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; +} & Source; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import type {Merge} from 'type-fest'; + +interface Foo { + [x: string]: unknown; + [x: number]: unknown; + foo: string; + bar: symbol; +} + +type Bar = { + [x: number]: number; + [x: symbol]: unknown; + bar: Date; + baz: boolean; +}; + +export type FooBar = Merge; +// => { +// [x: string]: unknown; +// [x: number]: number; +// [x: symbol]: unknown; +// foo: string; +// bar: Date; +// baz: boolean; +// } +``` + +@category Object +*/ +type Merge = +Simplify< + SimpleMerge, PickIndexSignature> + & SimpleMerge, OmitIndexSignature> +>; + +/** +Merges user specified options with default options. + +@example +``` +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; +type SpecifiedOptions = {leavesOnly: true}; + +type Result = ApplyDefaultOptions; +//=> {maxRecursionDepth: 10; leavesOnly: true} +``` + +@example +``` +// Complains if default values are not provided for optional options + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10}; +type SpecifiedOptions = {}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~~~~ +// Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'. +``` + +@example +``` +// Complains if an option's default type does not conform to the expected type + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'}; +type SpecifiedOptions = {}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~~~~ +// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. +``` + +@example +``` +// Complains if an option's specified type does not conform to the expected type + +type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean}; +type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false}; +type SpecifiedOptions = {leavesOnly: 'yes'}; + +type Result = ApplyDefaultOptions; +// ~~~~~~~~~~~~~~~~ +// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'. +``` +*/ +type ApplyDefaultOptions< + Options extends object, + Defaults extends Simplify, RequiredKeysOf> & Partial, never>>>, + SpecifiedOptions extends Options, +> = + If, Defaults, + If, Defaults, + Simplify ? undefined extends SpecifiedOptions[Key] ? never : Key : Key + ]: SpecifiedOptions[Key] + }> & Required>>>; + +/** +Filter out keys from an object. + +Returns `never` if `Exclude` is strictly equal to `Key`. +Returns `never` if `Key` extends `Exclude`. +Returns `Key` otherwise. + +@example +``` +type Filtered = Filter<'foo', 'foo'>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', string>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', 'foo'>; +//=> 'bar' +``` + +@see {Except} +*/ +type Filter = IsEqual extends true ? never : (KeyType extends ExcludeType ? never : KeyType); + +type ExceptOptions = { + /** + Disallow assigning non-specified properties. + + Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`. + + @default false + */ + requireExactProps?: boolean; +}; + +type DefaultExceptOptions = { + requireExactProps: false; +}; + +/** +Create a type from an object type without certain keys. + +We recommend setting the `requireExactProps` option to `true`. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import type {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type FooWithoutA = Except; +//=> {b: string} + +const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; +//=> errors: 'a' does not exist in type '{ b: string; }' + +type FooWithoutB = Except; +//=> {a: number} & Partial> + +const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; +//=> errors at 'b': Type 'string' is not assignable to type 'undefined'. + +// The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures. + +// Consider the following example: + +type UserData = { + [metadata: string]: string; + email: string; + name: string; + role: 'admin' | 'user'; +}; + +// `Omit` clearly doesn't behave as expected in this case: +type PostPayload = Omit; +//=> type PostPayload = { [x: string]: string; [x: number]: string; } + +// In situations like this, `Except` works better. +// It simply removes the `email` key while preserving all the other keys. +type PostPayload = Except; +//=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; } +``` + +@category Object +*/ +type Except = + _Except>; + +type _Except> = { + [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; +} & (Options['requireExactProps'] extends true + ? Partial> + : {}); + +declare namespace TsConfigJson { + namespace CompilerOptions { + type JSX = + | 'preserve' + | 'react' + | 'react-jsx' + | 'react-jsxdev' + | 'react-native'; + + type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ES2020' + | 'ES2022' + | 'ESNext' + | 'Node16' + | 'Node18' + | 'Node20' + | 'NodeNext' + | 'Preserve' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'es2020' + | 'es2022' + | 'esnext' + | 'node16' + | 'node18' + | 'node20' + | 'nodenext' + | 'preserve' + | 'none'; + + type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ES2021' + | 'ES2022' + | 'ES2023' + | 'ES2024' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'es2021' + | 'es2022' + | 'es2023' + | 'es2024' + | 'esnext'; + + type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.ArrayBuffer' + | 'ES2017.Date' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncGenerator' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Intl' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.BigInt' + | 'ES2020.Date' + | 'ES2020.Intl' + | 'ES2020.Number' + | 'ES2020.Promise' + | 'ES2020.SharedMemory' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ES2021' + | 'ES2021.Intl' + | 'ES2021.Promise' + | 'ES2021.String' + | 'ES2021.WeakRef' + | 'ES2022' + | 'ES2022.Array' + | 'ES2022.Error' + | 'ES2022.Intl' + | 'ES2022.Object' + | 'ES2022.RegExp' + | 'ES2022.SharedMemory' + | 'ES2022.String' + | 'ES2023' + | 'ES2023.Array' + | 'ES2023.Collection' + | 'ES2023.Intl' + | 'ES2024' + | 'ES2024.ArrayBuffer' + | 'ES2024.Collection' + | 'ES2024.Object' + | 'ES2024.Promise' + | 'ES2024.Regexp' + | 'ES2024.SharedMemory' + | 'ES2024.String' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Collection' + | 'ESNext.Decorators' + | 'ESNext.Disposable' + | 'ESNext.Error' + | 'ESNext.Intl' + | 'ESNext.Iterator' + | 'ESNext.Object' + | 'ESNext.Promise' + | 'ESNext.Regexp' + | 'ESNext.String' + | 'ESNext.Symbol' + | 'ESNext.WeakRef' + | 'DOM' + | 'DOM.AsyncIterable' + | 'DOM.Iterable' + | 'Decorators' + | 'Decorators.Legacy' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.AsyncIterable' + | 'WebWorker.ImportScripts' + | 'WebWorker.Iterable' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.arraybuffer' + | 'es2017.date' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asyncgenerator' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.intl' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.bigint' + | 'es2020.date' + | 'es2020.intl' + | 'es2020.number' + | 'es2020.promise' + | 'es2020.sharedmemory' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'es2021' + | 'es2021.intl' + | 'es2021.promise' + | 'es2021.string' + | 'es2021.weakref' + | 'es2022' + | 'es2022.array' + | 'es2022.error' + | 'es2022.intl' + | 'es2022.object' + | 'es2022.regexp' + | 'es2022.sharedmemory' + | 'es2022.string' + | 'es2023' + | 'es2023.array' + | 'es2023.collection' + | 'es2023.intl' + | 'es2024' + | 'es2024.arraybuffer' + | 'es2024.collection' + | 'es2024.object' + | 'es2024.promise' + | 'es2024.regexp' + | 'es2024.sharedmemory' + | 'es2024.string' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.collection' + | 'esnext.decorators' + | 'esnext.disposable' + | 'esnext.error' + | 'esnext.intl' + | 'esnext.iterator' + | 'esnext.object' + | 'esnext.promise' + | 'esnext.regexp' + | 'esnext.string' + | 'esnext.symbol' + | 'esnext.weakref' + | 'dom' + | 'dom.asynciterable' + | 'dom.iterable' + | 'decorators' + | 'decorators.legacy' + | 'scripthost' + | 'webworker' + | 'webworker.asynciterable' + | 'webworker.importscripts' + | 'webworker.iterable'; + + type Plugin = { + /** + Plugin name. + */ + name: string; + }; + + type ImportsNotUsedAsValues = + | 'remove' + | 'preserve' + | 'error'; + + type FallbackPolling = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedInterval' + | 'priorityInterval' + | 'dynamicPriority' + | 'fixedChunkSize'; + + type WatchDirectory = + | 'useFsEvents' + | 'fixedPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedChunkSizePolling'; + + type WatchFile = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'useFsEvents' + | 'useFsEventsOnParentDirectory' + | 'fixedChunkSizePolling'; + + type ModuleResolution = + | 'classic' + | 'node' + | 'node10' + | 'node16' + | 'nodenext' + | 'bundler' + // Pascal-cased alternatives + | 'Classic' + | 'Node' + | 'Node10' + | 'Node16' + | 'NodeNext' + | 'Bundler'; + + type ModuleDetection = + | 'auto' + | 'legacy' + | 'force'; + + type IgnoreDeprecations = '5.0'; + } + + type CompilerOptions = { + /** + The character set of the input files. + + @default 'utf8' + @deprecated This option will be removed in TypeScript 5.5. + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Reduce the number of projects loaded automatically by TypeScript. + + @default false + */ + disableReferencedProjectLoad?: boolean; + + /** + Enforces using indexed accessors for keys declared using an indexed type. + + @default false + */ + noPropertyAccessFromIndexSignature?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Differentiate between undefined and not present when type checking. + + @default false + */ + exactOptionalPropertyTypes?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify what JSX code is generated. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. + + @default 'React.Fragment' + */ + jsxFragmentFactory?: string; + + /** + Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. + + @default 'react' + */ + jsxImportSource?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: CompilerOptions.ModuleResolution; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + @default 'LF' + */ + newLine?: CompilerOptions.NewLine; + + /** + Disable full type checking (only critical parse and emit errors will be reported). + + @default false + */ + noCheck?: boolean; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. + + @default false + */ + rewriteRelativeImportExtensions?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Require sufficient annotation on exports so other tools can trivially generate declaration files. + + @default false + */ + isolatedDeclarations?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Default catch clause variables as `unknown` instead of `any`. + + @default false + */ + useUnknownInCatchVariables?: boolean; + + /** + Watch input files. + + @default false + @deprecated Use watchOptions instead. + */ + watch?: boolean; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + + @deprecated Use watchOptions.fallbackPolling instead. + */ + fallbackPolling?: CompilerOptions.FallbackPolling; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchDirectory instead. + */ + watchDirectory?: CompilerOptions.WatchDirectory; + + /** + Specify the strategy for watching individual files. + + @default 'useFsEvents' + @deprecated Use watchOptions.watchFile instead. + */ + watchFile?: CompilerOptions.WatchFile; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Add `undefined` to a type when accessed using an index. + + @default false + */ + noUncheckedIndexedAccess?: boolean; + + /** + Report error if failed to find a source file for a side effect import. + + @default false + */ + noUncheckedSideEffectImports?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Ensure overriding members in derived classes are marked with an override modifier. + + @default false + */ + noImplicitOverride?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default true + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Emit a v8 CPU profile of the compiler run for debugging. + + @default 'profile.cpuprofile' + */ + generateCpuProfile?: string; + + /** + Generates an event trace and a list of types. + */ + generateTrace?: boolean; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + @default false + */ + importHelpers?: boolean; + + /** + Specify emit/checking behavior for imports that are only used for types. + + @default 'remove' + @deprecated Use `verbatimModuleSyntax` instead. + */ + importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + @default false + */ + checkJs?: boolean; + + /** + Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`. + + @default false + */ + strictBuiltinIteratorReturn?: boolean; + + /** + Disable bivariant parameter checking for function types. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + @default false + @deprecated This option will be removed in TypeScript 5.5. + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + @default false + */ + resolveJsonModule?: boolean; + + /** + Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. + + @default false + */ + assumeChangesOnlyAffectDirectDependencies?: boolean; + + /** + Output more detailed compiler performance information after building. + + @default false + */ + extendedDiagnostics?: boolean; + + /** + Print names of files that are part of the compilation and then stop processing. + + @default false + */ + listFilesOnly?: boolean; + + /** + Disable preferring source files instead of declaration files when referencing composite projects. + + @default true if composite, false otherwise + */ + disableSourceOfProjectReferenceRedirect?: boolean; + + /** + Opt a project out of multi-project reference checking when editing. + + @default false + */ + disableSolutionSearching?: boolean; + + /** + Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. + + @default false + */ + explainFiles?: boolean; + + /** + Preserve unused imported values in the JavaScript output that would otherwise be removed. + + @default true + @deprecated Use `verbatimModuleSyntax` instead. + */ + preserveValueImports?: boolean; + + /** + List of file name suffixes to search when resolving a module. + */ + moduleSuffixes?: string[]; + + /** + Control what method is used to detect module-format JS files. + + @default 'auto' + */ + moduleDetection?: CompilerOptions.ModuleDetection; + + /** + Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx. + + @default false + */ + allowImportingTsExtensions?: boolean; + + /** + Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules. + + @default false + */ + resolvePackageJsonExports?: boolean; + + /** + Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json. + + @default false + */ + resolvePackageJsonImports?: boolean; + + /** + Suppress errors for file formats that TypeScript does not understand. + + @default false + */ + allowArbitraryExtensions?: boolean; + + /** + List of additional conditions that should succeed when TypeScript resolves from package.json. + */ + customConditions?: string[]; + + /** + Anything that uses the type modifier is dropped entirely. + + @default false + */ + verbatimModuleSyntax?: boolean; + + /** + Suppress deprecation warnings + */ + ignoreDeprecations?: CompilerOptions.IgnoreDeprecations; + + /** + Do not allow runtime constructs that are not part of ECMAScript. + + @default false + */ + erasableSyntaxOnly?: boolean; + + /** + Enable lib replacement. + + @default true + */ + libReplacement?: boolean; + }; + + namespace WatchOptions { + type WatchFileKind = + | 'FixedPollingInterval' + | 'PriorityPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling' + | 'UseFsEvents' + | 'UseFsEventsOnParentDirectory'; + + type WatchDirectoryKind = + | 'UseFsEvents' + | 'FixedPollingInterval' + | 'DynamicPriorityPolling' + | 'FixedChunkSizePolling'; + + type PollingWatchKind = + | 'FixedInterval' + | 'PriorityInterval' + | 'DynamicPriority' + | 'FixedChunkSize'; + } + + type WatchOptions = { + + /** + Specify the strategy for watching individual files. + + @default 'UseFsEvents' + */ + watchFile?: WatchOptions.WatchFileKind | Lowercase; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + @default 'UseFsEvents' + */ + watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + */ + fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase; + + /** + Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively. + */ + synchronousWatchDirectory?: boolean; + + /** + Specifies a list of directories to exclude from watch. + */ + excludeDirectories?: string[]; + + /** + Specifies a list of files to exclude from watch. + */ + excludeFiles?: string[]; + }; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + type TypeAcquisition = { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + + /** + Disable infering what types should be added based on filenames in a project. + */ + disableFilenameBasedTypeAcquisition?: boolean; + }; + + type References = { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + @deprecated This option will be removed in TypeScript 5.5. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + }; +} + +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category File +*/ +type TsConfigJson = { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Instructs the TypeScript compiler how to watch files. + */ + watchOptions?: TsConfigJson.WatchOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + */ + extends?: string | string[]; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + */ + include?: string[]; + + /** + Referenced projects. + */ + references?: TsConfigJson.References[]; +}; + +type TsConfigJsonResolved = Except; +type TsConfigResult = { + /** + * The path to the tsconfig.json file + */ + path: string; + /** + * The resolved tsconfig.json file + */ + config: TsConfigJsonResolved; +}; +type PathsMatcher = (specifier: string) => string[]; +type Cache = Map; + +/** + * Searches for a tsconfig file by walking up the directory tree. + * + * @param searchPath Path to a source file or directory to search from (default: `process.cwd()`). + * @param configName Config file name (default: `tsconfig.json`). + * @param cache Cache for previous results (default: new `Map()`). + * @param includes When true, validates that the tsconfig applies to the + * `searchPath` file via `include`/`exclude`/`files`. See {@link getTsconfig} + * for details. Default: `false`. + * @returns The path to the found tsconfig file, or `undefined` if not found. + */ +declare const findTsconfig: (searchPath?: string, configName?: string, cache?: Cache, includes?: boolean) => string | undefined; +/** + * Finds and reads a tsconfig file by walking up the directory tree. + * + * By default, returns the nearest tsconfig found (matching `tsc` CLI behavior). + * + * When `includes` is true and `searchPath` is a file path, validates + * that the found tsconfig applies to the file (via `files`, `include`, and + * `exclude`). If the file isn't matched, continues searching parent directories. + * This matches VS Code's TypeScript Language Server behavior. + * + * Reference: + * - `tsc` CLI uses `findConfigFile()` which returns the nearest tsconfig without validation: + * https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/compiler/program.ts#L328 + * - Language Server uses `isMatchedByConfig()` to verify the file belongs to the project: + * https://github.com/microsoft/TypeScript/blob/b19a9da2a3b8/src/server/editorServices.ts#L4486 + * + * @param searchPath Path to a source file or directory to search from (default: `process.cwd()`). + * @param configName Config file name (default: `tsconfig.json`). + * @param cache Cache for previous results (default: new `Map()`). + * @param includes When true, validates that the tsconfig applies to the + * `searchPath` file via `include`/`exclude`/`files`. Default: `false`. + * @returns The tsconfig file path and parsed contents, or `null` if not found. + */ +declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Cache, includes?: boolean) => TsConfigResult | null; + +/** + * Parses a tsconfig file at a given path + * + * @param tsconfigPath - Path to the tsconfig file. + * @param cache - Cache for storing parsed tsconfig results (default: new `Map()`). + * @returns The parsed and resolved tsconfig JSON. + */ +declare const parseTsconfig: (tsconfigPath: string, cache?: Cache) => TsConfigJsonResolved; + +/** + * Reference: + * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465 + */ +declare const createPathsMatcher: (tsconfig: TsConfigResult) => PathsMatcher | null; + +type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined); +declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher; + +export { type Cache, type FileMatcher, type PathsMatcher, TsConfigJson, type TsConfigJsonResolved, type TsConfigResult, createFilesMatcher, createPathsMatcher, findTsconfig, getTsconfig, parseTsconfig }; diff --git a/e-commerce/node_modules/get-tsconfig/dist/index.mjs b/e-commerce/node_modules/get-tsconfig/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1a6beb53936f9903953dac2523e40218ae0e37d7 --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/dist/index.mjs @@ -0,0 +1,7 @@ +var xe=Object.defineProperty;var r=(e,t)=>xe(e,"name",{value:t,configurable:!0});import m from"node:path";import ce from"node:fs";import $e from"node:module";import{resolveExports as Be}from"resolve-pkg-maps";import Ie from"fs";import Ue from"os";import Re from"path";function L(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}r(L,"slash");const Q=r(e=>{const t=ce[e];return(l,...n)=>{const s=`${e}:${n.join(":")}`;let i=l==null?void 0:l.get(s);return i===void 0&&(i=Reflect.apply(t,ce,n),l==null||l.set(s,i)),i}},"cacheFs"),x=Q("existsSync"),Se=Q("readFileSync"),H=Q("statSync"),Ne=Q("realpathSync"),Pe=r((...[e,t])=>{const l=Ne(e,t);if(typeof l!="string")throw new TypeError(`Unexpected resolved path type for ${l} in ${t}`);return l},"realpath"),O=r((e,t,l)=>{for(;;){const n=m.posix.join(e,t);if(x(l,n))return n;const s=m.dirname(e);if(s===e)return;e=s}},"findUp"),C=/^\.{1,2}(\/.*)?$/,X=r(e=>{const t=L(e);return C.test(t)?t:`./${t}`},"normalizeRelativePath");function We(e,t=!1){const l=e.length;let n=0,s="",i=0,o=16,f=0,u=0,c=0,w=0,p=0;function _(g,j){let y=0,A=0;for(;y=48&&k<=57)A=A*16+k-48;else if(k>=65&&k<=70)A=A*16+k-65+10;else if(k>=97&&k<=102)A=A*16+k-97+10;else break;n++,y++}return y=l){g+=e.substring(j,n),p=2;break}const y=e.charCodeAt(n);if(y===34){g+=e.substring(j,n),n++;break}if(y===92){if(g+=e.substring(j,n),n++,n>=l){p=2;break}switch(e.charCodeAt(n++)){case 34:g+='"';break;case 92:g+="\\";break;case 47:g+="/";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+=` +`;break;case 114:g+="\r";break;case 116:g+=" ";break;case 117:const k=_(4);k>=0?g+=String.fromCharCode(k):p=4;break;default:p=5}j=n;continue}if(y>=0&&y<=31)if(J(y)){g+=e.substring(j,n),p=2;break}else p=6;n++}return g}r(T,"scanString");function d(){if(s="",p=0,i=n,u=f,w=c,n>=l)return i=l,o=17;let g=e.charCodeAt(n);if(ee(g)){do n++,s+=String.fromCharCode(g),g=e.charCodeAt(n);while(ee(g));return o=15}if(J(g))return n++,s+=String.fromCharCode(g),g===13&&e.charCodeAt(n)===10&&(n++,s+=` +`),f++,c=n,o=14;switch(g){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,s=T(),o=10;case 47:const j=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n=12&&g<=15);return g}return r($,"scanNextNonTrivia"),{setPosition:h,getPosition:r(()=>n,"getPosition"),scan:t?$:d,getToken:r(()=>o,"getToken"),getTokenValue:r(()=>s,"getTokenValue"),getTokenOffset:r(()=>i,"getTokenOffset"),getTokenLength:r(()=>n-i,"getTokenLength"),getTokenStartLine:r(()=>u,"getTokenStartLine"),getTokenStartCharacter:r(()=>i-w,"getTokenStartCharacter"),getTokenError:r(()=>p,"getTokenError")}}r(We,"createScanner");function ee(e){return e===32||e===9}r(ee,"isWhiteSpace");function J(e){return e===10||e===13}r(J,"isLineBreak");function R(e){return e>=48&&e<=57}r(R,"isDigit");var ge;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ge||(ge={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const S=200;new Array(S).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>`\r +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>` +`+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(S).fill(0).map((e,t)=>`\r +`+" ".repeat(t));var Y;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Y||(Y={}));function Je(e,t=[],l=Y.DEFAULT){let n=null,s=[];const i=[];function o(u){Array.isArray(s)?s.push(u):n!==null&&(s[n]=u)}return r(o,"onValue"),Me(e,{onObjectBegin:r(()=>{const u={};o(u),i.push(s),s=u,n=null},"onObjectBegin"),onObjectProperty:r(u=>{n=u},"onObjectProperty"),onObjectEnd:r(()=>{s=i.pop()},"onObjectEnd"),onArrayBegin:r(()=>{const u=[];o(u),i.push(s),s=u,n=null},"onArrayBegin"),onArrayEnd:r(()=>{s=i.pop()},"onArrayEnd"),onLiteralValue:o,onError:r((u,c,w)=>{t.push({error:u,offset:c,length:w})},"onError")},l),s[0]}r(Je,"parse$1");function Me(e,t,l=Y.DEFAULT){const n=We(e,!1),s=[];let i=0;function o(b){return b?()=>i===0&&b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}r(o,"toNoArgVisit");function f(b){return b?F=>i===0&&b(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}r(f,"toOneArgVisit");function u(b){return b?F=>i===0&&b(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice()):()=>!0}r(u,"toOneArgVisitWithPath");function c(b){return b?()=>{i>0?i++:b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>s.slice())===!1&&(i=1)}:()=>!0}r(c,"toBeginVisit");function w(b){return b?()=>{i>0&&i--,i===0&&b(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}r(w,"toEndVisit");const p=c(t.onObjectBegin),_=u(t.onObjectProperty),h=w(t.onObjectEnd),D=c(t.onArrayBegin),T=w(t.onArrayEnd),d=u(t.onLiteralValue),v=f(t.onSeparator),$=o(t.onComment),g=f(t.onError),j=l&&l.disallowComments,y=l&&l.allowTrailingComma;function A(){for(;;){const b=n.scan();switch(n.getTokenError()){case 4:k(14);break;case 5:k(15);break;case 3:k(13);break;case 1:j||k(11);break;case 2:k(12);break;case 6:k(16);break}switch(b){case 12:case 13:j?k(10):$();break;case 16:k(1);break;case 15:case 14:break;default:return b}}}r(A,"scanNext");function k(b,F=[],W=[]){if(g(b),F.length+W.length>0){let I=n.getToken();for(;I!==17;){if(F.indexOf(I)!==-1){A();break}else if(W.indexOf(I)!==-1)break;I=A()}}}r(k,"handleError");function P(b){const F=n.getTokenValue();return b?d(F):(_(F),s.push(F)),A(),!0}r(P,"parseString");function M(){switch(n.getToken()){case 11:const b=n.getTokenValue();let F=Number(b);isNaN(F)&&(k(2),F=0),d(F);break;case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return A(),!0}r(M,"parseLiteral");function V(){return n.getToken()!==10?(k(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(v(":"),A(),U()||k(4,[],[2,5])):k(5,[],[2,5]),s.pop(),!0)}r(V,"parseProperty");function z(){p(),A();let b=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(b||k(4,[],[]),v(","),A(),n.getToken()===2&&y)break}else b&&k(6,[],[]);V()||k(4,[],[2,5]),b=!0}return h(),n.getToken()!==2?k(7,[2],[]):A(),!0}r(z,"parseObject");function G(){D(),A();let b=!0,F=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(F||k(4,[],[]),v(","),A(),n.getToken()===4&&y)break}else F&&k(6,[],[]);b?(s.push(0),b=!1):s[s.length-1]++,U()||k(4,[],[4,5]),F=!0}return T(),b||s.pop(),n.getToken()!==4?k(8,[4],[]):A(),!0}r(G,"parseArray");function U(){switch(n.getToken()){case 3:return G();case 1:return z();case 10:return P(!0);default:return M()}}return r(U,"parseValue"),A(),n.getToken()===17?l.allowEmptyContent?!0:(k(4,[],[]),!1):U()?(n.getToken()!==17&&k(9,[],[]),!0):(k(4,[],[]),!1)}r(Me,"visit");var ke;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ke||(ke={}));var me;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(me||(me={}));const Ve=Je;var de;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(de||(de={}));const we=r((e,t)=>Ve(Se(t,e,"utf8")),"readJsonc"),ne=Symbol("implicitBaseUrl"),E="${configDir}",ze=r(()=>{const{findPnpApi:e}=$e;return e&&e(process.cwd())},"getPnpApi"),te=r((e,t,l,n)=>{const s=`resolveFromPackageJsonPath:${e}:${t}:${l}`;if(n!=null&&n.has(s))return n.get(s);const i=we(e,n);if(!i)return;let o=t||"tsconfig.json";if(!l&&i.exports)try{const[f]=Be(i.exports,t,["require","types"]);o=f}catch{return!1}else!t&&i.tsconfig&&(o=i.tsconfig);return o=m.join(e,"..",o),n==null||n.set(s,o),o},"resolveFromPackageJsonPath"),se="package.json",le="tsconfig.json",Ge=r((e,t,l)=>{var n;let s=e;if(e===".."&&(s=m.join(s,le)),e[0]==="."&&(s=m.resolve(t,s)),m.isAbsolute(s)){if(x(l,s)){if(H(l,s).isFile())return s}else if(!s.endsWith(".json")){const T=`${s}.json`;if(x(l,T))return T}return}const[i,...o]=e.split("/"),f=i[0]==="@"?`${i}/${o.shift()}`:i,u=o.join("/"),c=ze();if(c){const{resolveRequest:T}=c;try{if(f===e){const d=T(m.join(f,se),t);if(d){const v=te(d,u,!1,l);if(v&&x(l,v))return v}}else{let d;try{d=T(e,t,{extensions:[".json"]})}catch{d=T(m.join(e,le),t)}if(d)return d}}catch{}}const w=O(m.resolve(t),m.join("node_modules",f),l);if(!w||!((n=H(l,w))!=null&&n.isDirectory()))return;const p=Pe(l,w),_=m.join(p,se);if(x(l,_)){const T=te(_,u,!1,l);if(T===!1)return;if(T&&x(l,T)&&H(l,T).isFile())return T}const h=m.join(p,u),D=h.endsWith(".json");if(!D){const T=`${h}.json`;if(x(l,T))return T}if(x(l,h)){if(H(l,h).isDirectory()){const T=m.join(h,se);if(x(l,T)){const v=te(T,"",!0,l);if(v&&x(l,v))return v}const d=m.join(h,le);if(x(l,d))return d}else if(D)return h}},"resolveExtendsPath"),oe=r((e,t)=>X(m.relative(e,t)),"pathRelative"),pe=["files","include","exclude"],N=r((e,t,l)=>{const n=m.join(t,l),s=m.relative(e,n);return L(s)||"./"},"resolveAndRelativize"),Qe=r((e,t,l)=>{const n=m.relative(e,t);if(!n)return l;const s=l.startsWith("./")?l.slice(2):l;return L(`${n}/${s}`)},"prefixPattern"),He=r((e,t,l,n)=>{const s=Ge(e,t,n);if(!s)throw new Error(`File '${e}' not found.`);if(l.has(s))throw new Error(`Circularity detected while resolving configuration: ${s}`);l.add(s);const i=m.dirname(s),o=ve(s,n,l,!0);delete o.references;const{compilerOptions:f}=o;if(f){const{baseUrl:u}=f;u&&!u.startsWith(E)&&(f.baseUrl=N(t,i,u));const{outDir:c}=f;c&&!c.startsWith(E)&&(f.outDir=N(t,i,c));const{declarationDir:w}=f;w&&!w.startsWith(E)&&(f.declarationDir=N(t,i,w));const{rootDir:p}=f;p&&!p.startsWith(E)&&(f.rootDir=N(t,i,p));const{rootDirs:_}=f;_&&(f.rootDirs=_.map(D=>D.startsWith(E)?D:N(t,i,D)));const{typeRoots:h}=f;h&&(f.typeRoots=h.map(D=>D.startsWith(E)?D:N(t,i,D)))}for(const u of pe){const c=o[u];c&&(o[u]=c.map(w=>w.startsWith(E)?w:Qe(t,i,w)))}return o},"resolveExtends"),be=["outDir","declarationDir"],ve=r((e,t,l=new Set,n=!1)=>{let s;try{s=we(e,t)||{}}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof s!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const i=m.dirname(e);if(s.compilerOptions){const{compilerOptions:o}=s;o.paths&&!o.baseUrl&&(o[ne]=i)}if(s.extends){const o=Array.isArray(s.extends)?s.extends:[s.extends];delete s.extends;for(const f of o.reverse()){const u=He(f,i,new Set(l),t),c={...u,...s,compilerOptions:{...u.compilerOptions,...s.compilerOptions}};u.watchOptions&&(c.watchOptions={...u.watchOptions,...s.watchOptions}),s=c}}if(s.compilerOptions){const{compilerOptions:o}=s,f=["baseUrl","rootDir"];for(const u of f){const c=o[u];if(c&&!c.startsWith(E)){const w=m.resolve(i,c),p=oe(i,w);o[u]=p}}for(const u of be){let c=o[u];c&&(!n&&!Array.isArray(s.exclude)&&(s.exclude=be.map(w=>o[w]).filter(Boolean)),c.startsWith(E)||(c=X(c)),o[u]=c)}}else s.compilerOptions={};if(s.include&&(s.include=s.include.map(L)),s.files&&(s.files=s.files.map(o=>o.startsWith(E)?o:X(o))),s.watchOptions){const{watchOptions:o}=s;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(f=>L(m.resolve(i,f)))),o.excludeFiles&&(o.excludeFiles=o.excludeFiles.map(f=>L(m.resolve(i,f)))),o.watchFile&&(o.watchFile=o.watchFile.toLowerCase()),o.watchDirectory&&(o.watchDirectory=o.watchDirectory.toLowerCase()),o.fallbackPolling&&(o.fallbackPolling=o.fallbackPolling.toLowerCase())}return s},"_parseTsconfig"),Z=r((e,t)=>{if(e.startsWith(E))return L(m.join(t,e.slice(E.length)))},"interpolateConfigDir"),Xe=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Ye=r(e=>{var t,l,n,s,i,o,f,u,c,w,p,_,h,D,T,d,v,$,g,j,y,A,k,P,M,V,z,G,U,b,F,W,I;if(e.strict){const a=["noImplicitAny","noImplicitThis","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","alwaysStrict","useUnknownInCatchVariables"];for(const B of a)e[B]===void 0&&(e[B]=!0)}if(e.composite&&((t=e.declaration)!=null||(e.declaration=!0),(l=e.incremental)!=null||(e.incremental=!0)),e.target){let a=e.target.toLowerCase();a==="es2015"&&(a="es6"),e.target=a,a==="esnext"&&((n=e.module)!=null||(e.module="es6"),(s=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0)),(a==="es6"||a==="es2016"||a==="es2017"||a==="es2018"||a==="es2019"||a==="es2020"||a==="es2021"||a==="es2022"||a==="es2023"||a==="es2024")&&((i=e.module)!=null||(e.module="es6")),(a==="es2022"||a==="es2023"||a==="es2024")&&((o=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0))}if(e.module){let a=e.module.toLowerCase();if(a==="es2015"&&(a="es6"),e.module=a,(a==="es6"||a==="es2020"||a==="es2022"||a==="esnext"||a==="none"||a==="system"||a==="umd"||a==="amd")&&((f=e.moduleResolution)!=null||(e.moduleResolution="classic")),a==="system"&&((u=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),(a==="node16"||a==="node18"||a==="node20"||a==="nodenext"||a==="preserve")&&((c=e.esModuleInterop)!=null||(e.esModuleInterop=!0),(w=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),(a==="node16"||a==="node18"||a==="node20"||a==="nodenext")&&((p=e.moduleDetection)!=null||(e.moduleDetection="force")),a==="node16"&&((_=e.target)!=null||(e.target="es2022"),(h=e.moduleResolution)!=null||(e.moduleResolution="node16")),a==="node18"&&((D=e.target)!=null||(e.target="es2022"),(T=e.moduleResolution)!=null||(e.moduleResolution="node16")),a==="node20"&&((d=e.target)!=null||(e.target="es2023"),(v=e.moduleResolution)!=null||(e.moduleResolution="node16"),($=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0)),a==="nodenext"&&((g=e.target)!=null||(e.target="esnext"),(j=e.moduleResolution)!=null||(e.moduleResolution="nodenext"),(y=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0)),a==="node16"||a==="node18"||a==="node20"||a==="nodenext"){const B=e.target;(B==="es3"||B==="es2022"||B==="es2023"||B==="es2024"||B==="esnext")&&((A=e.useDefineForClassFields)!=null||(e.useDefineForClassFields=!0))}a==="preserve"&&((k=e.moduleResolution)!=null||(e.moduleResolution="bundler"))}if(e.moduleResolution){let a=e.moduleResolution.toLowerCase();a==="node"&&(a="node10"),e.moduleResolution=a,(a==="node16"||a==="nodenext"||a==="bundler")&&((P=e.resolvePackageJsonExports)!=null||(e.resolvePackageJsonExports=!0),(M=e.resolvePackageJsonImports)!=null||(e.resolvePackageJsonImports=!0)),a==="bundler"&&((V=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0),(z=e.resolveJsonModule)!=null||(e.resolveJsonModule=!0))}e.jsx&&(e.jsx=e.jsx.toLowerCase()),e.moduleDetection&&(e.moduleDetection=e.moduleDetection.toLowerCase()),e.importsNotUsedAsValues&&(e.importsNotUsedAsValues=e.importsNotUsedAsValues.toLowerCase()),e.newLine&&(e.newLine=e.newLine.toLowerCase()),e.esModuleInterop&&((G=e.allowSyntheticDefaultImports)!=null||(e.allowSyntheticDefaultImports=!0)),e.verbatimModuleSyntax&&((U=e.isolatedModules)!=null||(e.isolatedModules=!0),(b=e.preserveConstEnums)!=null||(e.preserveConstEnums=!0)),e.isolatedModules&&((F=e.preserveConstEnums)!=null||(e.preserveConstEnums=!0)),e.rewriteRelativeImportExtensions&&((W=e.allowImportingTsExtensions)!=null||(e.allowImportingTsExtensions=!0)),e.lib&&(e.lib=e.lib.map(a=>a.toLowerCase())),e.checkJs&&((I=e.allowJs)!=null||(e.allowJs=!0))},"normalizeCompilerOptions"),ie=r((e,t=new Map)=>{const l=m.resolve(e),n=ve(l,t),s=m.dirname(l),{compilerOptions:i}=n;if(i){for(const f of Xe){const u=i[f];if(u){const c=Z(u,s);i[f]=c?oe(s,c):u}}for(const f of["rootDirs","typeRoots"]){const u=i[f];u&&(i[f]=u.map(c=>{const w=Z(c,s);return w?oe(s,w):X(c)}))}const{paths:o}=i;if(o)for(const f of Object.keys(o))o[f]=o[f].map(u=>{var c;return(c=Z(u,s))!=null?c:u});Ye(i)}for(const o of pe){const f=n[o];f&&(n[o]=f.map(u=>{var c;return(c=Z(u,s))!=null?c:u}))}return n},"parseTsconfig");var Ze=Object.defineProperty,q=r((e,t)=>Ze(e,"name",{value:t,configurable:!0}),"s");const Te=q(e=>{let t="";for(let l=0;l{const l=Re.join(e,`.is-fs-case-sensitive-test-${process.pid}`);try{return t.writeFileSync(l,""),!t.existsSync(Te(l))}finally{try{t.unlinkSync(l)}catch{}}},"checkDirectoryCaseWithWrite"),qe=q((e,t,l)=>{try{return Ae(e,l)}catch(n){if(t===void 0)return Ae(Ue.tmpdir(),l);throw n}},"checkDirectoryCaseWithFallback"),Ke=q((e,t=Ie,l=!0)=>{const n=e!=null?e:process.cwd();if(l&&re.has(n))return re.get(n);let s;const i=Te(n);return i!==n&&t.existsSync(n)?s=!t.existsSync(i):s=qe(n,e,t),l&&re.set(n,s),s},"isFsCaseSensitive"),{join:Oe}=m.posix,_e=r((e,t)=>{const l=Oe(e,t);return e.startsWith("//")&&!l.startsWith("//")?`/${l}`:l},"pathJoin"),ue={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Ce=r(e=>{const t=[...ue.ts],l=[...ue.cts],n=[...ue.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),l.push(".cjs"),n.push(".mjs")),[...t,...l,...n]},"getSupportedExtensions"),en=r(e=>{const t=[];if(!e)return t;const{outDir:l,declarationDir:n}=e;return l&&t.push(l),n&&t.push(n),t},"getDefaultExcludeSpec"),ye=r(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),nn=["node_modules","bower_components","jspm_packages"],fe=`(?!(${nn.join("|")})(/|$))`,tn=/(?:^|\/)[^.*?]+$/,je="**/*",K="[^/]",ae="[^./]",Fe=process.platform==="win32",De=r(({config:e,path:t},l=Ke())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!m.isAbsolute(t))throw new Error("The tsconfig path must be absolute");Fe&&(t=L(t));const n=m.dirname(t),{files:s,include:i,exclude:o,compilerOptions:f}=e,u=r(d=>m.isAbsolute(d)?d:_e(n,d),"resolvePattern"),c=s==null?void 0:s.map(u),w=Ce(f),p=l?"":"i",h=(o||en(f)).map(d=>{const v=u(d),$=ye(v).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${K}*`).replaceAll(String.raw`\?`,K);return new RegExp(`^${$}($|/)`,p)}),D=s||i?i:[je],T=D?D.map(d=>{let v=u(d);tn.test(v)&&(v=_e(v,je));const $=ye(v).replaceAll(String.raw`/\*\*`,`(/${fe}${ae}${K}*)*?`).replaceAll(/(\/)?\\\*/g,(g,j)=>{const y=`(${ae}|(\\.(?!min\\.js$))?)*`;return j?`/${fe}${ae}${y}`:y}).replaceAll(/(\/)?\\\?/g,(g,j)=>{const y=K;return j?`/${fe}${y}`:y});return new RegExp(`^${$}$`,p)}):void 0;return d=>{if(!m.isAbsolute(d))throw new Error("filePath must be absolute");if(Fe&&(d=L(d)),c!=null&&c.includes(d))return e;if(!(!w.some(v=>d.endsWith(v))||h.some(v=>v.test(d)))&&T&&T.some(v=>v.test(d)))return e}},"createFilesMatcher"),he=r((e,t,l)=>{const n=m.resolve(e);let s=L(e);for(;;){const i=O(s,t,l);if(!i)return;const o=m.resolve(i),f=ie(o,l),u={path:L(o),config:f};if(De(u)(n))return u;const w=m.dirname(i),p=m.dirname(w);if(p===w)return;s=p}},"findConfigApplicable"),Le=r((e=process.cwd(),t="tsconfig.json",l=new Map,n=!1)=>{var s;return n?(s=he(e,t,l))==null?void 0:s.path:O(L(e),t,l)},"findTsconfig"),sn=r((e=process.cwd(),t="tsconfig.json",l=new Map,n=!1)=>{var s;if(!n){const i=Le(e,t,l);if(!i)return null;const o=ie(i,l);return{path:i,config:o}}return(s=he(e,t,l))!=null?s:null},"getTsconfig"),ln=/\*/g,Ee=r((e,t)=>{const l=e.match(ln);if(l&&l.length>1)throw new Error(t)},"assertStarCount"),on=r(e=>{if(e.includes("*")){const[t,l]=e.split("*");return{prefix:t,suffix:l}}return e},"parsePattern"),rn=r(({prefix:e,suffix:t},l)=>l.startsWith(e)&&l.endsWith(t),"isPatternMatch"),un=r((e,t,l)=>Object.entries(e).map(([n,s])=>(Ee(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:on(n),substitutions:s.map(i=>{if(Ee(i,`Substitution '${i}' in pattern '${n}' can have at most one '*' character.`),!t&&!C.test(i)&&!m.isAbsolute(i))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return m.resolve(l,i)})})),"parsePaths"),fn=r(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:l,paths:n}=t;if(!l&&!n)return null;const s=ne in t&&t[ne],i=m.resolve(m.dirname(e.path),l||s||"."),o=n?un(n,l,i):[];return f=>{if(C.test(f))return[];const u=[];for(const _ of o){if(_.pattern===f)return _.substitutions.map(L);typeof _.pattern!="string"&&u.push(_)}let c,w=-1;for(const _ of u)rn(_.pattern,f)&&_.pattern.prefix.length>w&&(w=_.pattern.prefix.length,c=_);if(!c)return l?[L(m.join(i,f))]:[];const p=f.slice(c.pattern.prefix.length,f.length-c.pattern.suffix.length);return c.substitutions.map(_=>L(_.replace("*",p)))}},"createPathsMatcher");export{De as createFilesMatcher,fn as createPathsMatcher,Le as findTsconfig,sn as getTsconfig,ie as parseTsconfig}; diff --git a/e-commerce/node_modules/get-tsconfig/package.json b/e-commerce/node_modules/get-tsconfig/package.json new file mode 100644 index 0000000000000000000000000000000000000000..68bf2d9e88bf7657e78273416cfc3de7116911ba --- /dev/null +++ b/e-commerce/node_modules/get-tsconfig/package.json @@ -0,0 +1,46 @@ +{ + "name": "get-tsconfig", + "version": "4.14.3", + "description": "Find and parse the tsconfig.json file from a directory path", + "keywords": [ + "get-tsconfig", + "get", + "typescript", + "tsconfig", + "tsconfig.json" + ], + "license": "MIT", + "repository": "privatenumber/get-tsconfig", + "funding": "https://github.com/privatenumber/get-tsconfig?sponsor=1", + "author": { + "name": "Hiroki Osame", + "email": "hiroki.osame@gmail.com" + }, + "files": [ + "dist" + ], + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.cts", + "exports": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + } + }, + "imports": { + "#get-tsconfig": { + "types": "./src/index.ts", + "development": "./src/index.ts", + "default": "./dist/index.mjs" + } + }, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + } +} \ No newline at end of file diff --git a/e-commerce/node_modules/graceful-fs/LICENSE b/e-commerce/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e906a25acfb5ee2f955bd39101a207e3458463bd --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +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/e-commerce/node_modules/graceful-fs/README.md b/e-commerce/node_modules/graceful-fs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..82d6e4daf0cdb8543cca8ce644e6b6dfa61b86f8 --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/README.md @@ -0,0 +1,143 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFile('some-file-or-whatever', (err, data) => { + // Do stuff here. +}) +``` + +## Sync methods + +This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync +methods. If you use sync methods which open file descriptors then you are +responsible for dealing with any errors. + +This is a known limitation, not a bug. + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/e-commerce/node_modules/graceful-fs/clone.js b/e-commerce/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000000000000000000000000000000000000..dff3cc8c504b4cf14054b5d7bbc64b1696bc9fec --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/clone.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/e-commerce/node_modules/graceful-fs/graceful-fs.js b/e-commerce/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000000000000000000000000000000000000..8d5b89e4fa7fdbaebf58556cc044d2a912bce5de --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,448 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} diff --git a/e-commerce/node_modules/graceful-fs/legacy-streams.js b/e-commerce/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000000000000000000000000000000000000..d617b50fc0832dcce4ba05f7a7200938438ead90 --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/e-commerce/node_modules/graceful-fs/package.json b/e-commerce/node_modules/graceful-fs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..87babf0248563c1767d58126c403954bf3e9e024 --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/package.json @@ -0,0 +1,53 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^16.3.4" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "tap": { + "reporter": "classic" + } +} diff --git a/e-commerce/node_modules/graceful-fs/polyfills.js b/e-commerce/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000000000000000000000000000000000000..453f1a9e702d1aaf9a34cb8460f30073dc83bcf5 --- /dev/null +++ b/e-commerce/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,355 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/e-commerce/node_modules/icu-minify/LICENSE b/e-commerce/node_modules/icu-minify/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..118a41c4ade24a7712b4c8e7d7a72851f03c3d94 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jan Amann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/e-commerce/node_modules/icu-minify/README.md b/e-commerce/node_modules/icu-minify/README.md new file mode 100644 index 0000000000000000000000000000000000000000..af0981955030e3c302dcc0acec204b6382eecea9 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/README.md @@ -0,0 +1,36 @@ +# `icu-minify` + +ICU message format compiler with a 650 bytes runtime ✨ + +## Features + +1. **Build-time compilation** ⚡ + Converts ICU messages to a compact JSON intermediate representation +2. **Minimal runtime** 📦 + 650 bytes (minified + compressed) with zero runtime dependencies +3. **Full ICU support** 🌍 + `{arguments}`, `plural`, `select`, `selectordinal`, `date`, `time`, `number` and `` + +## Usage + +```ts +import compile from 'icu-minify/compile'; +import format from 'icu-minify/format'; + +// At build time +const compiled = compile('Hello {name}!'); + +// ["Hello ", ["name"], "!"] +console.log(compiled); + +// At runtime +format(compiled, 'en', {name: 'World'}); +``` + +## Acknowledgments + +This library is heavily inspired by [`icu-to-json`](https://github.com/jantimon/icu-to-json) and [`@lingui/message-utils`](https://github.com/lingui/js-lingui/tree/main/packages/message-utils), which similarly use an array-based intermediate representation for compiled messages. + +## Design + +For detailed design rationale, motivation, tradeoffs, and implementation details, see [RFC: Ahead-of-time compilation of ICU messages](../../rfcs/002-icu-message-precompilation.md). diff --git a/e-commerce/node_modules/icu-minify/compile.d.ts b/e-commerce/node_modules/icu-minify/compile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..addfa2cdac47bada0f50db6d874b0d33f0b1bba8 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/compile.d.ts @@ -0,0 +1,2 @@ +// Needed for projects with `moduleResolution: 'node'` +export {default} from './dist/types/compile.d.ts'; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/development/compile.js b/e-commerce/node_modules/icu-minify/dist/esm/development/compile.js new file mode 100644 index 0000000000000000000000000000000000000000..45f8945f4b4ccd7d4934e1c356477e77b93f0482 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/development/compile.js @@ -0,0 +1,149 @@ +import { parse, TYPE } from '@formatjs/icu-messageformat-parser'; +import { T as TYPE_POUND, a as TYPE_NUMBER, b as TYPE_DATE, c as TYPE_TIME, d as TYPE_SELECT, e as TYPE_SELECTORDINAL, f as TYPE_PLURAL } from './types-Dl2aHte_.js'; + +function compile(message) { + const ast = parse(message); + const compiled = compileNodes(ast); + if (compiled.length === 0) { + return ''; + } + if (compiled.length === 1 && typeof compiled[0] === 'string') { + return compiled[0]; + } + return compiled; +} +function compileNodes(nodes) { + const result = []; + for (const node of nodes) { + const compiled = compileNode(node); + if (typeof compiled === 'string' && result.length > 0 && typeof result[result.length - 1] === 'string') { + result[result.length - 1] += compiled; + } else { + result.push(compiled); + } + } + return result; +} +function compileNodesToNode(nodes) { + const compiled = compileNodes(nodes); + if (compiled.length === 0) { + return ''; + } + if (compiled.length === 1) { + const node = compiled[0]; + // Only unwrap strings and pound signs, not array-based nodes (tags, typed nodes) + // This preserves structure for formatBranch to correctly identify single nodes vs arrays + if (typeof node === 'string' || node === TYPE_POUND) { + return node; + } + } + return compiled; +} +function compileNode(node) { + switch (node.type) { + case TYPE.literal: + return node.value; + case TYPE.argument: + return [node.value]; + case TYPE.number: + return compileNumber(node); + case TYPE.date: + return compileDate(node); + case TYPE.time: + return compileTime(node); + case TYPE.select: + return compileSelect(node); + case TYPE.plural: + return compilePlural(node); + case TYPE.pound: + return TYPE_POUND; + case TYPE.tag: + return compileTag(node); + default: + throw new Error(`Unknown AST node type: ${node.type}`); + } +} +function compileNumber(node) { + const result = [node.value, TYPE_NUMBER]; + const style = compileNumberStyle(node.style); + if (style !== undefined) { + result.push(style); + } + return result; +} +function compileNumberStyle(style) { + if (!style) { + return undefined; + } + if (typeof style === 'string') { + return style; + } + if ('parsedOptions' in style) { + const opts = style.parsedOptions; + return Object.keys(opts).length > 0 ? opts : undefined; + } + return undefined; +} +function compileDate(node) { + const result = [node.value, TYPE_DATE]; + const style = compileDateTimeStyle(node.style); + if (style !== undefined) { + result.push(style); + } + return result; +} +function compileTime(node) { + const result = [node.value, TYPE_TIME]; + const style = compileDateTimeStyle(node.style); + if (style !== undefined) { + result.push(style); + } + return result; +} +function compileDateTimeStyle(style) { + if (!style) { + return undefined; + } + if (typeof style === 'string') { + return style; + } + if ('parsedOptions' in style) { + const opts = style.parsedOptions; + return Object.keys(opts).length > 0 ? opts : undefined; + } + return undefined; +} +function compileSelect(node) { + const options = Object.create(null); + for (const [key, option] of Object.entries(node.options)) { + options[key] = compileNodesToNode(option.value); + } + return [node.value, TYPE_SELECT, options]; +} + +// Plural offset is not supported +function compilePlural(node) { + if (node.offset) { + throw new Error('Plural offsets are not supported'); + } + const options = Object.create(null); + for (const [key, option] of Object.entries(node.options)) { + options[key] = compileNodesToNode(option.value); + } + return [node.value, node.pluralType === 'ordinal' ? TYPE_SELECTORDINAL : TYPE_PLURAL, options]; +} +function compileTag(node) { + const children = compileNodes(node.children); + const result = [node.value]; + + // Tags have no type number - detected at runtime by typeof node[1] !== 'number' + // Empty tags get an empty string child to distinguish from simple arguments + if (children.length === 0) { + result.push(''); + } else { + result.push(...children); + } + return result; +} + +export { compile as default }; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/development/format.js b/e-commerce/node_modules/icu-minify/dist/esm/development/format.js new file mode 100644 index 0000000000000000000000000000000000000000..c6dc6e9358f6aeaacc7a35112692796dcfeda161 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/development/format.js @@ -0,0 +1,217 @@ +import { T as TYPE_POUND, c as TYPE_TIME, b as TYPE_DATE, a as TYPE_NUMBER, e as TYPE_SELECTORDINAL, f as TYPE_PLURAL, d as TYPE_SELECT } from './types-Dl2aHte_.js'; + +// Re-export CompiledMessage type for consumers + +// Could potentially share this with `use-intl` if we had a shared package for both + +function format(message, locale, values = {}, options) { + // Hot path for plain strings + if (typeof message === 'string') { + return message; + } + const result = formatNodes(message, locale, values, options, undefined); + return optimizeResult(result); +} +function formatNodes(nodes, locale, values, options, pluralCtx) { + const result = []; + for (const node of nodes) { + const formatted = formatNode(node, locale, values, options, pluralCtx); + if (Array.isArray(formatted)) { + result.push(...formatted); + } else { + result.push(formatted); + } + } + return result; +} +function formatNode(node, locale, values, options, rawPluralCtx) { + if (typeof node === 'string') { + return node; + } + if (node === TYPE_POUND) { + if (!rawPluralCtx) { + throw new Error('# used outside of plural context'); + } + const pluralCtx = rawPluralCtx; + return options.formatters.getNumberFormat(pluralCtx.locale).format(pluralCtx.value); + } + const [name, type, ...rest] = node; + + // Simple argument: ["name"] + if (type === undefined) { + const value = getValue(values, name); + { + if (typeof value === 'boolean') { + throw new Error(`Invalid value for argument "${name}": Boolean values are not supported and should be converted to strings if needed.`); + } + if (value instanceof Date) { + throw new Error(`Invalid value for argument "${name}": Date values are not supported for plain parameters. Use date formatting instead (e.g. {${name}, date}).`); + } + } + return String(value); + } + + // Tag: ["tagName", child1, child2, ...] - detected by non-number or pound marker + if (typeof type !== 'number' || type === TYPE_POUND) { + return formatTag(name, [type, ...rest], locale, values, options, rawPluralCtx); + } + + // Typed nodes: ["name", TYPE, ...] + switch (type) { + case TYPE_SELECT: + return formatSelect(name, rest[0], locale, values, options, rawPluralCtx); + case TYPE_PLURAL: + return formatPlural(name, rest[0], locale, values, options, 'cardinal'); + case TYPE_SELECTORDINAL: + return formatPlural(name, rest[0], locale, values, options, 'ordinal'); + case TYPE_NUMBER: + return formatNumberValue(name, rest[0], locale, values, options); + case TYPE_DATE: + return formatDateTimeValue(name, rest[0], locale, values, options, 'date'); + case TYPE_TIME: + return formatDateTimeValue(name, rest[0], locale, values, options, 'time'); + default: + { + throw new Error(`Unknown compiled node type: ${type}`); + } + } +} +function getValue(values, name) { + if (!(name in values)) { + throw new Error(`Missing value for argument "${name}"`); + } + return values[name]; +} +function formatSelect(name, options, locale, values, formatOptions, pluralCtx) { + const value = String(getValue(values, name)); + const branch = options[value] ?? options.other; + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (branch === undefined) { + throw new Error(`No matching branch for select "${name}" with value "${value}"`); + } + return formatBranch(branch, locale, values, formatOptions, pluralCtx); +} +function formatPlural(name, options, locale, values, formatOptions, pluralType) { + const rawValue = getValue(values, name); + if (typeof rawValue !== 'number') { + throw new Error(`Expected number for plural argument "${name}", got ${typeof rawValue}`); + } + const value = rawValue; + const exactKey = `=${value}`; + if (exactKey in options) { + return formatBranch(options[exactKey], locale, values, formatOptions, { + value, + locale + }); + } + const category = formatOptions.formatters.getPluralRules(locale, { + type: pluralType + }).select(value); + const branch = options[category] ?? options.other; + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (branch === undefined) { + throw new Error(`No matching branch for plural "${name}" with category "${category}"`); + } + return formatBranch(branch, locale, values, formatOptions, { + value, + locale + }); +} +function formatBranch(branch, locale, values, formatOptions, pluralCtx) { + if (typeof branch === 'string') { + return branch; + } + if (branch === TYPE_POUND) { + return formatNode(branch, locale, values, formatOptions, pluralCtx); + } + // Branch is an array - either a single complex node wrapped in array, or multiple nodes + // formatNodes handles both correctly via formatNode's tag detection + return formatNodes(branch, locale, values, formatOptions, pluralCtx); +} +function formatNumberValue(name, style, locale, values, formatOptions) { + const rawValue = getValue(values, name); + if (typeof rawValue !== 'number') { + throw new Error(`Expected number for argument "${name}", got ${typeof rawValue}`); + } + const value = rawValue; + const opts = getNumberFormatOptions(style, formatOptions); + return formatOptions.formatters.getNumberFormat(locale, opts).format(value); +} +function formatDateTimeValue(name, style, locale, values, formatOptions, type) { + const rawValue = getValue(values, name); + if (!(rawValue instanceof Date)) { + throw new Error(`Expected Date for argument "${name}", got ${typeof rawValue}`); + } + const date = rawValue; + const baseOpts = getDateTimeFormatOptions(style, type, formatOptions); + + // Global time zone is used as default, but format-specific one takes precedence + const opts = { + ...baseOpts, + timeZone: baseOpts?.timeZone ?? formatOptions.timeZone + }; + return formatOptions.formatters.getDateTimeFormat(locale, opts).format(date); +} +function getNumberFormatOptions(style, formatOptions) { + if (!style) return undefined; + if (typeof style === 'string') { + if (formatOptions.formats?.number?.[style]) { + return formatOptions.formats.number[style]; + } + { + throw new Error(`Missing number format "${style}"`); + } + } + return style; +} +function getDateTimeFormatOptions(style, type, formatOptions) { + if (!style) return undefined; + if (typeof style === 'string') { + const resolved = formatOptions.formats?.dateTime?.[style]; + if (!resolved) { + throw new Error(`Missing ${type} format "${style}"`); + } + return resolved; + } + return style; +} +function formatTag(name, children, locale, values, formatOptions, pluralCtx) { + const rawHandler = getValue(values, name); + if (typeof rawHandler !== 'function') { + throw new Error(`Expected function for tag handler "${name}"`); + } + const handler = rawHandler; + const formattedChildren = formatNodes(children, locale, values, formatOptions, pluralCtx); + const optimized = optimizeResult(formattedChildren); + const childArray = Array.isArray(optimized) ? optimized : [optimized]; + return handler(childArray); +} +function optimizeResult(result) { + if (result.length === 0) { + return ''; + } + const merged = []; + let currentString = ''; + for (const item of result) { + if (typeof item === 'string') { + currentString += item; + } else { + if (currentString) { + merged.push(currentString); + currentString = ''; + } + merged.push(item); + } + } + if (currentString) { + merged.push(currentString); + } + if (merged.length === 1) { + return merged[0]; + } + return merged; +} + +export { format as default }; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/development/types-Dl2aHte_.js b/e-commerce/node_modules/icu-minify/dist/esm/development/types-Dl2aHte_.js new file mode 100644 index 0000000000000000000000000000000000000000..312317fba96bf8536c59330ec54ff851ce4f350e --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/development/types-Dl2aHte_.js @@ -0,0 +1,30 @@ +const TYPE_POUND = 0; +const TYPE_SELECT = 1; +const TYPE_PLURAL = 2; +const TYPE_SELECTORDINAL = 3; +const TYPE_NUMBER = 4; +const TYPE_DATE = 5; +const TYPE_TIME = 6; + +// Plain text literal + +// Simple argument reference: ["name"] + +// Pound sign (#) - represents the number in plural contexts + +// Select: ["name", TYPE_SELECT, {options}] + +// Plural: ["name", TYPE_PLURAL, {options}] + +// Select ordinal: ["name", TYPE_SELECTORDINAL, {options}] + +// Number format: ["name", TYPE_NUMBER, style?] + +// Date format: ["name", TYPE_DATE, style?] + +// Time format: ["name", TYPE_TIME, style?] + +// Tags have no type constant - detected at runtime by +// format: ["tagName", child1, child2, ...] + +export { TYPE_POUND as T, TYPE_NUMBER as a, TYPE_DATE as b, TYPE_TIME as c, TYPE_SELECT as d, TYPE_SELECTORDINAL as e, TYPE_PLURAL as f }; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/production/compile.js b/e-commerce/node_modules/icu-minify/dist/esm/production/compile.js new file mode 100644 index 0000000000000000000000000000000000000000..24d34d1c947665c13e9a207685a293d3734388bc --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/production/compile.js @@ -0,0 +1 @@ +import{parse as t,TYPE as e}from"@formatjs/icu-messageformat-parser";import{T as n,a as r,b as s,c as o,d as u,e as c,f as i}from"./types-DqTLNw7x.js";function a(e){const n=f(t(e));return 0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}function f(t){const e=[];for(const n of t){const t=p(n);"string"==typeof t&&e.length>0&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t)}return e}function l(t){const e=f(t);if(0===e.length)return"";if(1===e.length){const t=e[0];if("string"==typeof t||t===n)return t}return e}function p(t){switch(t.type){case e.literal:return t.value;case e.argument:return[t.value];case e.number:return function(t){const e=[t.value,r],n=function(t){if(!t)return;if("string"==typeof t)return t;if("parsedOptions"in t){const e=t.parsedOptions;return Object.keys(e).length>0?e:void 0}return}(t.style);void 0!==n&&e.push(n);return e}(t);case e.date:return function(t){const e=[t.value,s],n=g(t.style);void 0!==n&&e.push(n);return e}(t);case e.time:return function(t){const e=[t.value,o],n=g(t.style);void 0!==n&&e.push(n);return e}(t);case e.select:return function(t){const e=Object.create(null);for(const[n,r]of Object.entries(t.options))e[n]=l(r.value);return[t.value,u,e]}(t);case e.plural:return function(t){const e=Object.create(null);for(const[n,r]of Object.entries(t.options))e[n]=l(r.value);return[t.value,"ordinal"===t.pluralType?c:i,e]}(t);case e.pound:return n;case e.tag:return function(t){const e=f(t.children),n=[t.value];0===e.length?n.push(""):n.push(...e);return n}(t);default:throw new Error(`Unknown AST node type: ${t.type}`)}}function g(t){if(t){if("string"==typeof t)return t;if("parsedOptions"in t){const e=t.parsedOptions;return Object.keys(e).length>0?e:void 0}}}export{a as default}; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/production/format.js b/e-commerce/node_modules/icu-minify/dist/esm/production/format.js new file mode 100644 index 0000000000000000000000000000000000000000..ae22f6c0ffd52eb6b1fa8621f7c39c1d427e882c --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/production/format.js @@ -0,0 +1 @@ +import{T as t,c as r,b as n,a as e,e as o,f as u,d as s}from"./types-DqTLNw7x.js";function f(t,r,n={},e){if("string"==typeof t)return t;return g(i(t,r,n,e,void 0))}function i(t,r,n,e,o){const u=[];for(const s of t){const t=a(s,r,n,e,o);Array.isArray(t)?u.push(...t):u.push(t)}return u}function a(f,a,y,d,h){if("string"==typeof f)return f;if(f===t){const t=h;return d.formatters.getNumberFormat(t.locale).format(t.value)}const[b,v,...A]=f;if(void 0===v){const t=c(y,b);return String(t)}if("number"!=typeof v||v===t)return function(t,r,n,e,o,u){const s=c(e,t),f=s,a=i(r,n,e,o,u),m=g(a),l=Array.isArray(m)?m:[m];return f(l)}(b,[v,...A],a,y,d,h);switch(v){case s:return function(t,r,n,e,o,u){const s=String(c(e,t)),f=r[s]??r.other;return l(f,n,e,o,u)}(b,A[0],a,y,d,h);case u:return m(b,A[0],a,y,d,"cardinal");case o:return m(b,A[0],a,y,d,"ordinal");case e:return function(t,r,n,e,o){const u=c(e,t),s=u,f=function(t,r){if(!t)return;if("string"==typeof t)return r.formats?.number?.[t]?r.formats.number[t]:void 0;return t}(r,o);return o.formatters.getNumberFormat(n,f).format(s)}(b,A[0],a,y,d);case n:return p(b,A[0],a,y,d,"date");case r:return p(b,A[0],a,y,d,"time");default:return""}}function c(t,r){return t[r]}function m(t,r,n,e,o,u){const s=c(e,t),f=`=${s}`;if(f in r)return l(r[f],n,e,o,{value:s,locale:n});return l(r[o.formatters.getPluralRules(n,{type:u}).select(s)]??r.other,n,e,o,{value:s,locale:n})}function l(r,n,e,o,u){return"string"==typeof r?r:r===t?a(r,n,e,o,u):i(r,n,e,o,u)}function p(t,r,n,e,o,u){const s=c(e,t),f=function(t,r,n){if(!t)return;if("string"==typeof t){const r=n.formats?.dateTime?.[t];return r}return t}(r,0,o),i={...f,timeZone:f?.timeZone??o.timeZone};return o.formatters.getDateTimeFormat(n,i).format(s)}function g(t){if(0===t.length)return"";const r=[];let n="";for(const e of t)"string"==typeof e?n+=e:(n&&(r.push(n),n=""),r.push(e));return n&&r.push(n),1===r.length?r[0]:r}export{f as default}; diff --git a/e-commerce/node_modules/icu-minify/dist/esm/production/types-DqTLNw7x.js b/e-commerce/node_modules/icu-minify/dist/esm/production/types-DqTLNw7x.js new file mode 100644 index 0000000000000000000000000000000000000000..e3b8cf0d5963de9b01ff87449220a5b685bab5b7 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/esm/production/types-DqTLNw7x.js @@ -0,0 +1 @@ +const a=0,s=1,c=2,e=3,o=4,t=5,b=6;export{a as T,o as a,t as b,b as c,s as d,e,c as f}; diff --git a/e-commerce/node_modules/icu-minify/dist/types/compile.d.ts b/e-commerce/node_modules/icu-minify/dist/types/compile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cfb3be7ef914498f36d82bbd57332eb1bf2dccaa --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/types/compile.d.ts @@ -0,0 +1,2 @@ +import { type CompiledMessage } from './types.js'; +export default function compile(message: string): CompiledMessage; diff --git a/e-commerce/node_modules/icu-minify/dist/types/format.d.ts b/e-commerce/node_modules/icu-minify/dist/types/format.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8436913ddad136008662d4fe793672f850707dfd --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/types/format.d.ts @@ -0,0 +1,17 @@ +import { type CompiledMessage } from './types.js'; +export type { CompiledMessage } from './types.js'; +export type FormatValues = Record) => RichTextElement)>; +export type Formats = { + dateTime?: Record; + number?: Record; +}; +export type FormatOptions = { + formats?: Formats; + formatters: { + getDateTimeFormat(...args: ConstructorParameters): Intl.DateTimeFormat; + getNumberFormat(...args: ConstructorParameters): Intl.NumberFormat; + getPluralRules(...args: ConstructorParameters): Intl.PluralRules; + }; + timeZone?: string; +}; +export default function format(message: CompiledMessage, locale: string, values: FormatValues | undefined, options: FormatOptions): string | RichTextElement | Array; diff --git a/e-commerce/node_modules/icu-minify/dist/types/types.d.ts b/e-commerce/node_modules/icu-minify/dist/types/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad852b5f052df1f463db40aa4995c867cfeaa68a --- /dev/null +++ b/e-commerce/node_modules/icu-minify/dist/types/types.d.ts @@ -0,0 +1,29 @@ +export declare const TYPE_POUND = 0; +export declare const TYPE_SELECT = 1; +export declare const TYPE_PLURAL = 2; +export declare const TYPE_SELECTORDINAL = 3; +export declare const TYPE_NUMBER = 4; +export declare const TYPE_DATE = 5; +export declare const TYPE_TIME = 6; +export type NumberStyleOptions = Intl.NumberFormatOptions; +export type NumberStyle = string | NumberStyleOptions; +export type DateTimeStyleOptions = Intl.DateTimeFormatOptions; +export type DateTimeStyle = string | DateTimeStyleOptions; +export type PluralOptions = Record; +export type SelectOptions = Record; +export type CompiledPlainTextNode = string; +export type CompiledSimpleArgNode = [string]; +export type CompiledPoundNode = typeof TYPE_POUND; +export type CompiledSelectNode = [string, typeof TYPE_SELECT, SelectOptions]; +export type CompiledPluralNode = [string, typeof TYPE_PLURAL, PluralOptions]; +export type CompiledSelectOrdinalNode = [ + string, + typeof TYPE_SELECTORDINAL, + PluralOptions +]; +export type CompiledNumberNode = [string, typeof TYPE_NUMBER, NumberStyle?]; +export type CompiledDateNode = [string, typeof TYPE_DATE, DateTimeStyle?]; +export type CompiledTimeNode = [string, typeof TYPE_TIME, DateTimeStyle?]; +export type CompiledTagNode = [string, unknown, ...Array]; +export type CompiledNode = CompiledPlainTextNode | CompiledSimpleArgNode | CompiledPoundNode | CompiledSelectNode | CompiledPluralNode | CompiledSelectOrdinalNode | CompiledNumberNode | CompiledDateNode | CompiledTimeNode | CompiledTagNode; +export type CompiledMessage = string | Array; diff --git a/e-commerce/node_modules/icu-minify/format.d.ts b/e-commerce/node_modules/icu-minify/format.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0032de2f1e7a0d24df0ec60fbeaae7de79505054 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/format.d.ts @@ -0,0 +1,2 @@ +// Needed for projects with `moduleResolution: 'node'` +export {default} from './dist/types/format.d.ts'; diff --git a/e-commerce/node_modules/icu-minify/package.json b/e-commerce/node_modules/icu-minify/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d65866598a04df655fb9e74385e2fc996829fa22 --- /dev/null +++ b/e-commerce/node_modules/icu-minify/package.json @@ -0,0 +1,59 @@ +{ + "name": "icu-minify", + "version": "4.14.9", + "sideEffects": false, + "author": "Jan Amann ", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/amannn" + } + ], + "description": "ICU message format compiler with a <1KB runtime bundle footprint", + "license": "MIT", + "homepage": "https://next-intl.dev", + "repository": { + "type": "git", + "url": "git+https://github.com/amannn/next-intl.git" + }, + "scripts": { + "build": "rm -rf dist && rollup -c", + "test": "TZ=Europe/Berlin vitest", + "lint": "pnpm run lint:source && pnpm run lint:package", + "lint:source": "eslint src test && tsc --noEmit && pnpm run lint:prettier", + "lint:package": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm", + "lint:prettier": "prettier src --check", + "prepublishOnly": "turbo build", + "size": "size-limit" + }, + "type": "module", + "exports": { + "./compile": { + "types": "./dist/types/compile.d.ts", + "development": "./dist/esm/development/compile.js", + "default": "./dist/esm/production/compile.js" + }, + "./format": { + "types": "./dist/types/format.d.ts", + "development": "./dist/esm/development/format.js", + "default": "./dist/esm/production/format.js" + } + }, + "files": [ + "dist", + "compile.d.ts", + "format.d.ts" + ], + "keywords": [ + "icu", + "messageformat", + "i18n", + "internationalization", + "compiler", + "minify" + ], + "dependencies": { + "@formatjs/icu-messageformat-parser": "^3.4.0" + }, + "gitHead": "b9fc98a814957b9c97894c7b57151215ac39afa6" +} diff --git a/e-commerce/node_modules/intl-messageformat/LICENSE.md b/e-commerce/node_modules/intl-messageformat/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..a9e40cb107846bae9c032344d548950a3890ad0a --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/LICENSE.md @@ -0,0 +1,33 @@ +Copyright (c) 2023, Oath Inc. + +Licensed under the terms of the New BSD license. See below for terms. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +- Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +- Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +- Neither the name of Oath Inc. nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of Oath Inc. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/e-commerce/node_modules/intl-messageformat/README.md b/e-commerce/node_modules/intl-messageformat/README.md new file mode 100644 index 0000000000000000000000000000000000000000..59b67ea84bf5b2583ae06b2dacf2f10ed27b21bf --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/README.md @@ -0,0 +1,3 @@ +# Intl MessageFormat + +We've migrated the docs to https://formatjs.github.io/docs/intl-messageformat. diff --git a/e-commerce/node_modules/intl-messageformat/index.d.ts b/e-commerce/node_modules/intl-messageformat/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a19dbde29ae58e19ef32020f77a1d930ba8b664 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/index.d.ts @@ -0,0 +1,143 @@ +import { MessageFormatElement, ParserOptions, parse } from "@formatjs/icu-messageformat-parser"; +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/intl-messageformat/formatters.d.ts +declare global { + namespace FormatjsIntl { + interface Message {} + interface IntlConfig {} + interface Formats {} + } +} +type Format = Source extends keyof FormatjsIntl.Formats ? FormatjsIntl.Formats[Source] : string; +export interface Formats { + number: Record, NumberFormatOptions>; + date: Record, Intl.DateTimeFormatOptions>; + time: Record, Intl.DateTimeFormatOptions>; +} +export interface FormatterCache { + number: Record; + dateTime: Record; + pluralRules: Record; +} +export interface Formatters { + getNumberFormat(locals?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat; + getDateTimeFormat(...args: ConstructorParameters): Intl.DateTimeFormat; + getPluralRules(...args: ConstructorParameters): Intl.PluralRules; +} +export declare enum PART_TYPE { + literal = 0, + object = 1 +} +export interface LiteralPart { + type: PART_TYPE.literal; + value: string; +} +export interface ObjectPart { + type: PART_TYPE.object; + value: T; +} +export type MessageFormatPart = LiteralPart | ObjectPart; +export type PrimitiveType = string | number | bigint | boolean | null | undefined | Date; +export declare function isFormatXMLElementFn(el: PrimitiveType | T | FormatXMLElementFn): el is FormatXMLElementFn; +export declare function formatToParts(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record>, currentPluralValue?: number, originalMessage?: string): MessageFormatPart[]; +export type FormatXMLElementFn = (parts: Array) => R; +//#endregion +//#region packages/intl-messageformat/core.d.ts +export interface Options extends Omit { + formatters?: Formatters; +} +export declare class IntlMessageFormat { + private readonly ast; + private readonly locales; + private readonly resolvedLocale?; + private readonly formatters; + private readonly formats; + private readonly message; + private readonly formatterCache; + constructor(message: string | MessageFormatElement[], locales?: string | string[], overrideFormats?: Partial, opts?: Options); + format: (values?: Record>) => string | T | (string | T)[]; + formatToParts: (values?: Record>) => MessageFormatPart[]; + resolvedOptions: () => { + locale: string; + }; + getAst: () => MessageFormatElement[]; + private static memoizedDefaultLocale; + static get defaultLocale(): string; + static resolveLocale: (locales: string | string[]) => Intl.Locale | undefined; + static __parse: typeof parse | undefined; + static formats: Formats; +} +//#endregion +//#region packages/intl-messageformat/error.d.ts +export declare enum ErrorCode { + MISSING_VALUE = "MISSING_VALUE", + INVALID_VALUE = "INVALID_VALUE", + MISSING_INTL_API = "MISSING_INTL_API" +} +export declare class FormatError extends Error { + readonly code: ErrorCode; + /** + * Original message we're trying to format + * `undefined` if we're only dealing w/ AST + * + * @type {(string | undefined)} + * @memberof FormatError + */ + readonly originalMessage: string | undefined; + constructor(msg: string, code: ErrorCode, originalMessage?: string); + toString(): string; +} +export declare class InvalidValueError extends FormatError { + constructor(variableId: string, value: any, options: string[], originalMessage?: string); +} +export declare class InvalidValueTypeError extends FormatError { + constructor(value: any, type: string, originalMessage?: string); +} +export declare class MissingValueError extends FormatError { + constructor(variableId: string, originalMessage?: string); +} +//#endregion +export { IntlMessageFormat as default }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/index.js b/e-commerce/node_modules/intl-messageformat/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cac8e3c7f0d8bd1be79b8fad13214c7951cca442 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/index.js @@ -0,0 +1,327 @@ +import { memoize, strategies } from "@formatjs/fast-memoize"; +import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTagElement, isTimeElement, parse } from "@formatjs/icu-messageformat-parser"; +//#region packages/intl-messageformat/error.ts +let ErrorCode = /* @__PURE__ */ function(ErrorCode) { + ErrorCode["MISSING_VALUE"] = "MISSING_VALUE"; + ErrorCode["INVALID_VALUE"] = "INVALID_VALUE"; + ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API"; + return ErrorCode; +}({}); +var FormatError = class extends Error { + constructor(msg, code, originalMessage) { + super(msg); + this.code = code; + this.originalMessage = originalMessage; + } + toString() { + return `[formatjs Error: ${this.code}] ${this.message}`; + } +}; +var InvalidValueError = class extends FormatError { + constructor(variableId, value, options, originalMessage) { + super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, "INVALID_VALUE", originalMessage); + } +}; +var InvalidValueTypeError = class extends FormatError { + constructor(value, type, originalMessage) { + super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage); + } +}; +var MissingValueError = class extends FormatError { + constructor(variableId, originalMessage) { + super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage); + } +}; +//#endregion +//#region packages/intl-messageformat/formatters.ts +let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) { + PART_TYPE[PART_TYPE["literal"] = 0] = "literal"; + PART_TYPE[PART_TYPE["object"] = 1] = "object"; + return PART_TYPE; +}({}); +function mergeLiteral(parts) { + if (parts.length < 2) return parts; + return parts.reduce((all, part) => { + const lastPart = all[all.length - 1]; + if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part); + else lastPart.value += part.value; + return all; + }, []); +} +function isFormatXMLElementFn(el) { + return typeof el === "function"; +} +function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { + if (els.length === 1 && isLiteralElement(els[0])) return [{ + type: 0, + value: els[0].value + }]; + const result = []; + for (const el of els) { + if (isLiteralElement(el)) { + result.push({ + type: 0, + value: el.value + }); + continue; + } + if (isPoundElement(el)) { + if (typeof currentPluralValue === "number") result.push({ + type: 0, + value: formatters.getNumberFormat(locales).format(currentPluralValue) + }); + continue; + } + const { value: varName } = el; + if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage); + let value = values[varName]; + if (isArgumentElement(el)) { + if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : ""; + result.push({ + type: typeof value === "string" ? 0 : 1, + value + }); + continue; + } + if (isDateElement(el)) { + const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; + result.push({ + type: 0, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isTimeElement(el)) { + const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; + result.push({ + type: 0, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isNumberElement(el)) { + const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; + if (style && style.scale) { + const scale = style.scale || 1; + if (typeof value === "bigint") { + if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`); + value = value * BigInt(scale); + } else value = value * scale; + } + result.push({ + type: 0, + value: formatters.getNumberFormat(locales, style).format(value) + }); + continue; + } + if (isTagElement(el)) { + const { children, value } = el; + const formatFn = values[value]; + if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage); + let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value)); + if (!Array.isArray(chunks)) chunks = [chunks]; + result.push(...chunks.map((c) => { + return { + type: typeof c === "string" ? 0 : 1, + value: c + }; + })); + } + if (isSelectElement(el)) { + const key = value; + const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other; + if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + result.push(...formatToParts(opt.value, locales, formatters, formats, values)); + continue; + } + if (isPluralElement(el)) { + const exactKey = `=${value}`; + let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0; + if (!opt) { + if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment. +Try polyfilling it using "@formatjs/intl-pluralrules" +`, "MISSING_INTL_API", originalMessage); + const numericValue = typeof value === "bigint" ? Number(value) : value; + const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue - (el.offset || 0)); + opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other; + } + if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + const numericValue = typeof value === "bigint" ? Number(value) : value; + result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0))); + continue; + } + } + return mergeLiteral(result); +} +//#endregion +//#region packages/intl-messageformat/core.ts +function mergeConfig(c1, c2) { + if (!c2) return c1; + return { + ...c1, + ...c2, + ...Object.keys(c1).reduce((all, k) => { + all[k] = { + ...c1[k], + ...c2[k] + }; + return all; + }, {}) + }; +} +function mergeConfigs(defaultConfig, configs) { + if (!configs) return defaultConfig; + return Object.keys(defaultConfig).reduce((all, k) => { + all[k] = mergeConfig(defaultConfig[k], configs[k]); + return all; + }, { ...defaultConfig }); +} +function createFastMemoizeCache(store) { + return { create() { + return { + get(key) { + return store[key]; + }, + set(key, value) { + store[key] = value; + } + }; + } }; +} +function createDefaultFormatters(cache = { + number: {}, + dateTime: {}, + pluralRules: {} +}) { + return { + getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), { + cache: createFastMemoizeCache(cache.number), + strategy: strategies.variadic + }), + getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), { + cache: createFastMemoizeCache(cache.dateTime), + strategy: strategies.variadic + }), + getPluralRules: memoize((...args) => new Intl.PluralRules(...args), { + cache: createFastMemoizeCache(cache.pluralRules), + strategy: strategies.variadic + }) + }; +} +var IntlMessageFormat = class IntlMessageFormat { + constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts) { + this.formatterCache = { + number: {}, + dateTime: {}, + pluralRules: {} + }; + this.format = (values) => { + const parts = this.formatToParts(values); + if (parts.length === 1) return parts[0].value; + const result = parts.reduce((all, part) => { + if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value); + else all[all.length - 1] += part.value; + return all; + }, []); + if (result.length <= 1) return result[0] || ""; + return result; + }; + this.formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message); + this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }); + this.getAst = () => this.ast; + this.locales = locales; + this.resolvedLocale = IntlMessageFormat.resolveLocale(locales); + if (typeof message === "string") { + this.message = message; + if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); + const { ...parseOpts } = opts || {}; + this.ast = IntlMessageFormat.__parse(message, { + ...parseOpts, + locale: this.resolvedLocale + }); + } else this.ast = message; + if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); + this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats); + this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); + } + static { + this.memoizedDefaultLocale = null; + } + static get defaultLocale() { + if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; + return IntlMessageFormat.memoizedDefaultLocale; + } + static { + this.resolveLocale = (locales) => { + if (typeof Intl.Locale === "undefined") return; + const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); + if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]); + return new Intl.Locale(typeof locales === "string" ? locales : locales[0]); + }; + } + static { + this.__parse = parse; + } + static { + this.formats = { + number: { + integer: { maximumFractionDigits: 0 }, + currency: { style: "currency" }, + percent: { style: "percent" } + }, + date: { + short: { + month: "numeric", + day: "numeric", + year: "2-digit" + }, + medium: { + month: "short", + day: "numeric", + year: "numeric" + }, + long: { + month: "long", + day: "numeric", + year: "numeric" + }, + full: { + weekday: "long", + month: "long", + day: "numeric", + year: "numeric" + } + }, + time: { + short: { + hour: "numeric", + minute: "numeric" + }, + medium: { + hour: "numeric", + minute: "numeric", + second: "numeric" + }, + long: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + }, + full: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + } + } + }; + } +}; +//#endregion +//#region packages/intl-messageformat/index.ts +var intl_messageformat_default = IntlMessageFormat; +//#endregion +export { ErrorCode, FormatError, IntlMessageFormat, InvalidValueError, InvalidValueTypeError, MissingValueError, PART_TYPE, intl_messageformat_default as default, formatToParts, isFormatXMLElementFn }; + +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/index.js.map b/e-commerce/node_modules/intl-messageformat/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..89676a0ee9ef896d02bfb621b357f643db264a39 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":[],"sources":["../error.ts","../formatters.ts","../core.ts","../index.ts"],"sourcesContent":["export enum ErrorCode {\n // When we have a placeholder but no value to format\n MISSING_VALUE = 'MISSING_VALUE',\n // When value supplied is invalid\n INVALID_VALUE = 'INVALID_VALUE',\n // When we need specific Intl API but it's not available\n MISSING_INTL_API = 'MISSING_INTL_API',\n}\n\nexport class FormatError extends Error {\n public readonly code: ErrorCode\n /**\n * Original message we're trying to format\n * `undefined` if we're only dealing w/ AST\n *\n * @type {(string | undefined)}\n * @memberof FormatError\n */\n public readonly originalMessage: string | undefined\n constructor(msg: string, code: ErrorCode, originalMessage?: string) {\n super(msg)\n this.code = code\n this.originalMessage = originalMessage\n }\n public toString() {\n return `[formatjs Error: ${this.code}] ${this.message}`\n }\n}\n\nexport class InvalidValueError extends FormatError {\n constructor(\n variableId: string,\n value: any,\n options: string[],\n originalMessage?: string\n ) {\n super(\n `Invalid values for \"${variableId}\": \"${value}\". Options are \"${Object.keys(\n options\n ).join('\", \"')}\"`,\n ErrorCode.INVALID_VALUE,\n originalMessage\n )\n }\n}\n\nexport class InvalidValueTypeError extends FormatError {\n constructor(value: any, type: string, originalMessage?: string) {\n super(\n `Value for \"${value}\" must be of type ${type}`,\n ErrorCode.INVALID_VALUE,\n originalMessage\n )\n }\n}\n\nexport class MissingValueError extends FormatError {\n constructor(variableId: string, originalMessage?: string) {\n super(\n `The intl string context variable \"${variableId}\" was not provided to the string \"${originalMessage}\"`,\n ErrorCode.MISSING_VALUE,\n originalMessage\n )\n }\n}\n","import {type NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {\n type ExtendedNumberFormatOptions,\n isArgumentElement,\n isDateElement,\n isDateTimeSkeleton,\n isLiteralElement,\n isNumberElement,\n isNumberSkeleton,\n isPluralElement,\n isPoundElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type MessageFormatElement,\n} from '@formatjs/icu-messageformat-parser'\nimport {\n ErrorCode,\n FormatError,\n InvalidValueError,\n InvalidValueTypeError,\n MissingValueError,\n} from '#packages/intl-messageformat/error.js'\n\ndeclare global {\n namespace FormatjsIntl {\n interface Message {}\n interface IntlConfig {}\n interface Formats {}\n }\n}\n\ntype Format = Source extends keyof FormatjsIntl.Formats\n ? FormatjsIntl.Formats[Source]\n : string\n\nexport interface Formats {\n number: Record, NumberFormatOptions>\n date: Record, Intl.DateTimeFormatOptions>\n time: Record, Intl.DateTimeFormatOptions>\n}\n\nexport interface FormatterCache {\n number: Record\n dateTime: Record\n pluralRules: Record\n}\n\nexport interface Formatters {\n getNumberFormat(\n locals?: string | string[],\n opts?: NumberFormatOptions\n ): Intl.NumberFormat\n getDateTimeFormat(\n ...args: ConstructorParameters\n ): Intl.DateTimeFormat\n getPluralRules(\n ...args: ConstructorParameters\n ): Intl.PluralRules\n}\n\nexport enum PART_TYPE {\n literal,\n object,\n}\n\nexport interface LiteralPart {\n type: PART_TYPE.literal\n value: string\n}\n\nexport interface ObjectPart {\n type: PART_TYPE.object\n value: T\n}\n\nexport type MessageFormatPart = LiteralPart | ObjectPart\n\nexport type PrimitiveType =\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | Date\n\nfunction mergeLiteral(\n parts: MessageFormatPart[]\n): MessageFormatPart[] {\n if (parts.length < 2) {\n return parts\n }\n return parts.reduce((all, part) => {\n const lastPart = all[all.length - 1]\n if (\n !lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal\n ) {\n all.push(part)\n } else {\n lastPart.value += part.value\n }\n return all\n }, [] as MessageFormatPart[])\n}\n\nexport function isFormatXMLElementFn(\n el: PrimitiveType | T | FormatXMLElementFn\n): el is FormatXMLElementFn {\n return typeof el === 'function'\n}\n\n// TODO(skeleton): add skeleton support\nexport function formatToParts(\n els: MessageFormatElement[],\n locales: string | string[],\n formatters: Formatters,\n formats: Formats,\n values?: Record>,\n currentPluralValue?: number,\n // For debugging\n originalMessage?: string\n): MessageFormatPart[] {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ]\n }\n const result: MessageFormatPart[] = []\n for (const el of els) {\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n })\n continue\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n })\n }\n continue\n }\n\n const {value: varName} = el\n\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage)\n }\n\n let value = values[varName]\n if (isArgumentElement(el)) {\n if (\n !value ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'bigint'\n ) {\n value =\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'bigint'\n ? String(value)\n : ''\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value,\n } as ObjectPart)\n continue\n }\n\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n const style =\n typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value as number),\n })\n continue\n }\n if (isTimeElement(el)) {\n const style =\n typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value as number),\n })\n continue\n }\n if (isNumberElement(el)) {\n const style =\n typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined\n\n if (style && (style as ExtendedNumberFormatOptions).scale) {\n const scale = (style as ExtendedNumberFormatOptions).scale || 1\n // Handle bigint scale multiplication\n // BigInt can only be multiplied by BigInt\n if (typeof value === 'bigint') {\n // Check if scale is a safe integer that can be converted to BigInt\n if (!Number.isInteger(scale)) {\n throw new TypeError(\n `Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`\n )\n }\n value = value * BigInt(scale)\n } else {\n value = (value as number) * scale\n }\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value as number | bigint),\n })\n continue\n }\n if (isTagElement(el)) {\n const {children, value} = el\n const formatFn = values[value]\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value, 'function', originalMessage)\n }\n const parts = formatToParts(\n children,\n locales,\n formatters,\n formats,\n values,\n currentPluralValue\n )\n let chunks = formatFn(parts.map(p => p.value))\n if (!Array.isArray(chunks)) {\n chunks = [chunks]\n }\n result.push(\n ...chunks.map((c): MessageFormatPart => {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n } as MessageFormatPart\n })\n )\n }\n if (isSelectElement(el)) {\n // GH #4490: Use hasOwnProperty to avoid prototype chain issues with keys like \"constructor\"\n const key = value as string\n const opt =\n (Object.prototype.hasOwnProperty.call(el.options, key)\n ? el.options[key]\n : undefined) || el.options.other\n if (!opt) {\n throw new InvalidValueError(\n el.value,\n value,\n Object.keys(el.options),\n originalMessage\n )\n }\n result.push(\n ...formatToParts(opt.value, locales, formatters, formats, values)\n )\n continue\n }\n if (isPluralElement(el)) {\n // GH #4490: Use hasOwnProperty to avoid prototype chain issues\n const exactKey = `=${value}`\n let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey)\n ? el.options[exactKey]\n : undefined\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\n `Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n`,\n ErrorCode.MISSING_INTL_API,\n originalMessage\n )\n }\n // Convert bigint to number for PluralRules (which only accepts number)\n const numericValue =\n typeof value === 'bigint' ? Number(value) : (value as number)\n const rule = formatters\n .getPluralRules(locales, {type: el.pluralType})\n .select(numericValue - (el.offset || 0))\n opt =\n (Object.prototype.hasOwnProperty.call(el.options, rule)\n ? el.options[rule]\n : undefined) || el.options.other\n }\n if (!opt) {\n throw new InvalidValueError(\n el.value,\n value,\n Object.keys(el.options),\n originalMessage\n )\n }\n // Convert bigint to number for currentPluralValue\n const numericValue =\n typeof value === 'bigint' ? Number(value) : (value as number)\n result.push(\n ...formatToParts(\n opt.value,\n locales,\n formatters,\n formats,\n values,\n numericValue - (el.offset || 0)\n )\n )\n continue\n }\n }\n return mergeLiteral(result)\n}\n\nexport type FormatXMLElementFn = (\n parts: Array\n) => R\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\nimport {type Cache, memoize, strategies} from '@formatjs/fast-memoize'\nimport {\n type MessageFormatElement,\n parse,\n type ParserOptions,\n} from '@formatjs/icu-messageformat-parser'\nimport {\n type Formats,\n type FormatterCache,\n type Formatters,\n formatToParts,\n type FormatXMLElementFn,\n type MessageFormatPart,\n PART_TYPE,\n type PrimitiveType,\n} from '#packages/intl-messageformat/formatters.js'\n\n// -- MessageFormat --------------------------------------------------------\n\nfunction mergeConfig(c1: Record, c2?: Record) {\n if (!c2) {\n return c1\n }\n return {\n ...c1,\n ...c2,\n ...Object.keys(c1).reduce((all: Record, k) => {\n all[k] = {\n ...c1[k],\n ...c2[k],\n }\n return all\n }, {}),\n }\n}\n\nfunction mergeConfigs(\n defaultConfig: Formats,\n configs?: Partial\n): Formats {\n if (!configs) {\n return defaultConfig\n }\n\n return (Object.keys(defaultConfig) as Array).reduce(\n (all: Formats, k: keyof Formats) => {\n all[k] = mergeConfig(defaultConfig[k], configs[k])\n return all\n },\n {...defaultConfig}\n )\n}\n\nexport interface Options extends Omit {\n formatters?: Formatters\n}\n\nfunction createFastMemoizeCache(\n store: Record\n): Cache {\n return {\n create() {\n return {\n get(key) {\n return store[key]\n },\n set(key, value) {\n store[key] = value\n },\n }\n },\n }\n}\n\nfunction createDefaultFormatters(\n cache: FormatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }\n): Formatters {\n return {\n getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n }\n}\n\nexport class IntlMessageFormat {\n private readonly ast: MessageFormatElement[]\n private readonly locales: string | string[]\n private readonly resolvedLocale?: Intl.Locale\n private readonly formatters: Formatters\n private readonly formats: Formats\n private readonly message: string | undefined\n private readonly formatterCache: FormatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }\n constructor(\n message: string | MessageFormatElement[],\n locales: string | string[] = IntlMessageFormat.defaultLocale,\n overrideFormats?: Partial,\n opts?: Options\n ) {\n // Defined first because it's used to build the format pattern.\n this.locales = locales\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales)\n\n if (typeof message === 'string') {\n this.message = message\n if (!IntlMessageFormat.__parse) {\n throw new TypeError(\n 'IntlMessageFormat.__parse must be set to process `message` of type `string`'\n )\n }\n const {...parseOpts} = opts || {}\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, {\n ...parseOpts,\n locale: this.resolvedLocale,\n })\n } else {\n this.ast = message\n }\n\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.')\n }\n\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats)\n\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache)\n }\n\n format = (\n values?: Record>\n ): string | T | (string | T)[] => {\n const parts = this.formatToParts(values)\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value\n }\n const result = parts.reduce(\n (all, part) => {\n if (\n !all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string'\n ) {\n all.push(part.value)\n } else {\n all[all.length - 1] += part.value\n }\n return all\n },\n [] as Array\n )\n\n if (result.length <= 1) {\n return result[0] || ''\n }\n return result\n }\n formatToParts = (\n values?: Record>\n ): MessageFormatPart[] =>\n formatToParts(\n this.ast,\n this.locales,\n this.formatters,\n this.formats,\n values,\n undefined,\n this.message\n )\n resolvedOptions = (): {\n locale: string\n } => ({\n locale:\n this.resolvedLocale?.toString() ||\n Intl.NumberFormat.supportedLocalesOf(this.locales)[0],\n })\n getAst = (): MessageFormatElement[] => this.ast\n private static memoizedDefaultLocale: string | null = null\n\n static get defaultLocale(): string {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale\n }\n\n return IntlMessageFormat.memoizedDefaultLocale\n }\n static resolveLocale = (\n locales: string | string[]\n ): Intl.Locale | undefined => {\n if (typeof Intl.Locale === 'undefined') {\n return\n }\n const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales)\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0])\n }\n\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0])\n }\n static __parse: typeof parse | undefined = parse\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n static formats: Formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n\n percent: {\n style: 'percent',\n },\n },\n\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n }\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\nimport {IntlMessageFormat} from '#packages/intl-messageformat/core.js'\nexport * from '#packages/intl-messageformat/core.js'\nexport * from '#packages/intl-messageformat/error.js'\nexport * from '#packages/intl-messageformat/formatters.js'\nexport {IntlMessageFormat}\nexport default IntlMessageFormat\n"],"mappings":"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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/intl-messageformat.iife.js b/e-commerce/node_modules/intl-messageformat/intl-messageformat.iife.js new file mode 100644 index 0000000000000000000000000000000000000000..5d9896dd7cd7e10c7d13c678b063e9bb6dec699c --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/intl-messageformat.iife.js @@ -0,0 +1,2810 @@ +//#region node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js +function memoize(fn, options) { + const cache = options && options.cache ? options.cache : cacheDefault; + const serializer = options && options.serializer ? options.serializer : serializerDefault; + return (options && options.strategy ? options.strategy : strategyDefault)(fn, { + cache, + serializer + }); +} +function isPrimitive(value) { + return value == null || typeof value === "number" || typeof value === "boolean"; +} +function monadic(fn, cache, serializer, arg) { + const cacheKey = isPrimitive(arg) ? arg : serializer(arg); + let computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn.call(this, arg); + cache.set(cacheKey, computedValue); + } + return computedValue; +} +function variadic(fn, cache, serializer) { + const args = Array.prototype.slice.call(arguments, 3); + const cacheKey = serializer(args); + let computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn.apply(this, args); + cache.set(cacheKey, computedValue); + } + return computedValue; +} +function assemble(fn, context, strategy, cache, serialize) { + return strategy.bind(context, fn, cache, serialize); +} +function strategyDefault(fn, options) { + const strategy = fn.length === 1 ? monadic : variadic; + return assemble(fn, this, strategy, options.cache.create(), options.serializer); +} +function strategyVariadic(fn, options) { + return assemble(fn, this, variadic, options.cache.create(), options.serializer); +} +function strategyMonadic(fn, options) { + return assemble(fn, this, monadic, options.cache.create(), options.serializer); +} +const serializerDefault = function() { + return JSON.stringify(arguments); +}; +var ObjectWithoutPrototypeCache = class { + constructor() { + this.cache = Object.create(null); + } + get(key) { + return this.cache[key]; + } + set(key, value) { + this.cache[key] = value; + } +}; +const cacheDefault = { create: function create() { + return new ObjectWithoutPrototypeCache(); +} }; +const strategies = { + variadic: strategyVariadic, + monadic: strategyMonadic +}; +//#endregion +//#region node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/index.js +/** +* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js +* with some tweaks +*/ +const DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; +/** +* Parse Date time skeleton into Intl.DateTimeFormatOptions +* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +* @public +* @param skeleton skeleton string +*/ +function parseDateTimeSkeleton(skeleton) { + const result = {}; + skeleton.replace(DATE_TIME_REGEX, (match) => { + const len = match.length; + switch (match[0]) { + case "G": + result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; + break; + case "y": + result.year = len === 2 ? "2-digit" : "numeric"; + break; + case "Y": + case "u": + case "U": + case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); + case "q": + case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported"); + case "M": + case "L": + result.month = [ + "numeric", + "2-digit", + "short", + "long", + "narrow" + ][len - 1]; + break; + case "w": + case "W": throw new RangeError("`w/W` (week) patterns are not supported"); + case "d": + result.day = ["numeric", "2-digit"][len - 1]; + break; + case "D": + case "F": + case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); + case "E": + result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; + break; + case "e": + if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); + result.weekday = [ + "short", + "long", + "narrow", + "short" + ][len - 3]; + break; + case "c": + if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); + result.weekday = [ + "short", + "long", + "narrow", + "short" + ][len - 3]; + break; + case "a": + result.hour12 = true; + break; + case "b": + case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); + case "h": + result.hourCycle = "h12"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "H": + result.hourCycle = "h23"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "K": + result.hourCycle = "h11"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "k": + result.hourCycle = "h24"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "j": + case "J": + case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); + case "m": + result.minute = ["numeric", "2-digit"][len - 1]; + break; + case "s": + result.second = ["numeric", "2-digit"][len - 1]; + break; + case "S": + case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); + case "z": + result.timeZoneName = len < 4 ? "short" : "long"; + break; + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); + } + return ""; + }); + return result; +} +const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function parseNumberSkeletonFromString(skeleton) { + if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty"); + const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0); + const tokens = []; + for (const stringToken of stringTokens) { + let stemAndOptions = stringToken.split("/"); + if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton"); + const [stem, ...options] = stemAndOptions; + for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton"); + tokens.push({ + stem, + options + }); + } + return tokens; +} +function icuUnitToEcma(unit) { + return unit.replace(/^(.*?)-/, ""); +} +const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; +const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; +const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; +const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; +function parseSignificantPrecision(str) { + const result = {}; + if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision"; + else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision"; + str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) { + if (typeof g2 !== "string") { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length; + } else if (g2 === "+") result.minimumSignificantDigits = g1.length; + else if (g1[0] === "#") result.maximumSignificantDigits = g1.length; + else { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0); + } + return ""; + }); + return result; +} +function parseSign(str) { + switch (str) { + case "sign-auto": return { signDisplay: "auto" }; + case "sign-accounting": + case "()": return { currencySign: "accounting" }; + case "sign-always": + case "+!": return { signDisplay: "always" }; + case "sign-accounting-always": + case "()!": return { + signDisplay: "always", + currencySign: "accounting" + }; + case "sign-except-zero": + case "+?": return { signDisplay: "exceptZero" }; + case "sign-accounting-except-zero": + case "()?": return { + signDisplay: "exceptZero", + currencySign: "accounting" + }; + case "sign-never": + case "+_": return { signDisplay: "never" }; + } +} +function parseConciseScientificAndEngineeringStem(stem) { + let result; + if (stem[0] === "E" && stem[1] === "E") { + result = { notation: "engineering" }; + stem = stem.slice(2); + } else if (stem[0] === "E") { + result = { notation: "scientific" }; + stem = stem.slice(1); + } + if (result) { + const signDisplay = stem.slice(0, 2); + if (signDisplay === "+!") { + result.signDisplay = "always"; + stem = stem.slice(2); + } else if (signDisplay === "+?") { + result.signDisplay = "exceptZero"; + stem = stem.slice(2); + } + if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation"); + result.minimumIntegerDigits = stem.length; + } + return result; +} +function parseNotationOptions(opt) { + const result = {}; + const signOpts = parseSign(opt); + if (signOpts) return signOpts; + return result; +} +/** +* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options +*/ +function parseNumberSkeleton(tokens) { + let result = {}; + for (const token of tokens) { + switch (token.stem) { + case "percent": + case "%": + result.style = "percent"; + continue; + case "%x100": + result.style = "percent"; + result.scale = 100; + continue; + case "currency": + result.style = "currency"; + result.currency = token.options[0]; + continue; + case "group-off": + case ",_": + result.useGrouping = false; + continue; + case "precision-integer": + case ".": + result.maximumFractionDigits = 0; + continue; + case "measure-unit": + case "unit": + result.style = "unit"; + result.unit = icuUnitToEcma(token.options[0]); + continue; + case "compact-short": + case "K": + result.notation = "compact"; + result.compactDisplay = "short"; + continue; + case "compact-long": + case "KK": + result.notation = "compact"; + result.compactDisplay = "long"; + continue; + case "scientific": + result = { + ...result, + notation: "scientific", + ...token.options.reduce((all, opt) => ({ + ...all, + ...parseNotationOptions(opt) + }), {}) + }; + continue; + case "engineering": + result = { + ...result, + notation: "engineering", + ...token.options.reduce((all, opt) => ({ + ...all, + ...parseNotationOptions(opt) + }), {}) + }; + continue; + case "notation-simple": + result.notation = "standard"; + continue; + case "unit-width-narrow": + result.currencyDisplay = "narrowSymbol"; + result.unitDisplay = "narrow"; + continue; + case "unit-width-short": + result.currencyDisplay = "code"; + result.unitDisplay = "short"; + continue; + case "unit-width-full-name": + result.currencyDisplay = "name"; + result.unitDisplay = "long"; + continue; + case "unit-width-iso-code": + result.currencyDisplay = "symbol"; + continue; + case "scale": + result.scale = parseFloat(token.options[0]); + continue; + case "rounding-mode-floor": + result.roundingMode = "floor"; + continue; + case "rounding-mode-ceiling": + result.roundingMode = "ceil"; + continue; + case "rounding-mode-down": + result.roundingMode = "trunc"; + continue; + case "rounding-mode-up": + result.roundingMode = "expand"; + continue; + case "rounding-mode-half-even": + result.roundingMode = "halfEven"; + continue; + case "rounding-mode-half-down": + result.roundingMode = "halfTrunc"; + continue; + case "rounding-mode-half-up": + result.roundingMode = "halfExpand"; + continue; + case "integer-width": + if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); + token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) { + if (g1) result.minimumIntegerDigits = g2.length; + else if (g3 && g4) throw new Error("We currently do not support maximum integer digits"); + else if (g5) throw new Error("We currently do not support exact integer digits"); + return ""; + }); + continue; + } + if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { + result.minimumIntegerDigits = token.stem.length; + continue; + } + if (FRACTION_PRECISION_REGEX.test(token.stem)) { + if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); + token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) { + if (g2 === "*") result.minimumFractionDigits = g1.length; + else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length; + else if (g4 && g5) { + result.minimumFractionDigits = g4.length; + result.maximumFractionDigits = g4.length + g5.length; + } else { + result.minimumFractionDigits = g1.length; + result.maximumFractionDigits = g1.length; + } + return ""; + }); + const opt = token.options[0]; + if (opt === "w") result = { + ...result, + trailingZeroDisplay: "stripIfInteger" + }; + else if (opt) result = { + ...result, + ...parseSignificantPrecision(opt) + }; + continue; + } + if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { + result = { + ...result, + ...parseSignificantPrecision(token.stem) + }; + continue; + } + const signOpts = parseSign(token.stem); + if (signOpts) result = { + ...result, + ...signOpts + }; + const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); + if (conciseScientificAndEngineeringOpts) result = { + ...result, + ...conciseScientificAndEngineeringOpts + }; + } + return result; +} +//#endregion +//#region node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/index.js +let ErrorKind = /* @__PURE__ */ function(ErrorKind) { + /** Argument is unclosed (e.g. `{0`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; + /** Argument is empty (e.g. `{}`). */ + ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; + /** Argument is malformed (e.g. `{foo!}``) */ + ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; + /** Expect an argument type (e.g. `{foo,}`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; + /** Unsupported argument type (e.g. `{foo,foo}`) */ + ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; + /** Expect an argument style (e.g. `{foo, number, }`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; + /** The number skeleton is invalid. */ + ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; + /** The date time skeleton is invalid. */ + ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; + /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ + ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; + /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ + ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; + /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ + ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; + /** Missing select argument options (e.g. `{foo, select}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; + /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; + /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ + ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; + /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; + /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; + /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; + /** + * Expecting a message fragment after the `plural` or `selectordinal` selector + * (e.g. `{foo, plural, one}`) + */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; + /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ + ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; + /** + * Duplicate selectors in `plural` or `selectordinal` argument. + * (e.g. {foo, plural, one {#} one {#}}) + */ + ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; + /** Duplicate selectors in `select` argument. + * (e.g. {foo, select, apple {apple} apple {apple}}) + */ + ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; + /** Plural or select argument option must have `other` clause. */ + ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; + /** The tag is malformed. (e.g. `foo) */ + ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG"; + /** The tag name is invalid. (e.g. `<123>foo`) */ + ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; + /** The closing tag does not match the opening tag. (e.g. `foo`) */ + ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; + /** The opening tag has unmatched closing tag. (e.g. `foo`) */ + ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; + return ErrorKind; +}({}); +/** +* Type Guards +*/ +function isLiteralElement(el) { + return el.type === 0; +} +function isArgumentElement(el) { + return el.type === 1; +} +function isNumberElement(el) { + return el.type === 2; +} +function isDateElement(el) { + return el.type === 3; +} +function isTimeElement(el) { + return el.type === 4; +} +function isSelectElement(el) { + return el.type === 5; +} +function isPluralElement(el) { + return el.type === 6; +} +function isPoundElement(el) { + return el.type === 7; +} +function isTagElement(el) { + return el.type === 8; +} +function isNumberSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 0); +} +function isDateTimeSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 1); +} +const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; +const timeData = { + "001": ["H", "h"], + "419": [ + "h", + "H", + "hB", + "hb" + ], + "AC": [ + "H", + "h", + "hb", + "hB" + ], + "AD": ["H", "hB"], + "AE": [ + "h", + "hB", + "hb", + "H" + ], + "AF": [ + "H", + "hb", + "hB", + "h" + ], + "AG": [ + "h", + "hb", + "H", + "hB" + ], + "AI": [ + "H", + "h", + "hb", + "hB" + ], + "AL": [ + "h", + "H", + "hB" + ], + "AM": ["H", "hB"], + "AO": ["H", "hB"], + "AR": [ + "h", + "H", + "hB", + "hb" + ], + "AS": ["h", "H"], + "AT": ["H", "hB"], + "AU": [ + "h", + "hb", + "H", + "hB" + ], + "AW": ["H", "hB"], + "AX": ["H"], + "AZ": [ + "H", + "hB", + "h" + ], + "BA": [ + "H", + "hB", + "h" + ], + "BB": [ + "h", + "hb", + "H", + "hB" + ], + "BD": [ + "h", + "hB", + "H" + ], + "BE": ["H", "hB"], + "BF": ["H", "hB"], + "BG": [ + "H", + "hB", + "h" + ], + "BH": [ + "h", + "hB", + "hb", + "H" + ], + "BI": ["H", "h"], + "BJ": ["H", "hB"], + "BL": ["H", "hB"], + "BM": [ + "h", + "hb", + "H", + "hB" + ], + "BN": [ + "hb", + "hB", + "h", + "H" + ], + "BO": [ + "h", + "H", + "hB", + "hb" + ], + "BQ": ["H"], + "BR": ["H", "hB"], + "BS": [ + "h", + "hb", + "H", + "hB" + ], + "BT": ["h", "H"], + "BW": [ + "H", + "h", + "hb", + "hB" + ], + "BY": ["H", "h"], + "BZ": [ + "H", + "h", + "hb", + "hB" + ], + "CA": [ + "h", + "hb", + "H", + "hB" + ], + "CC": [ + "H", + "h", + "hb", + "hB" + ], + "CD": ["hB", "H"], + "CF": [ + "H", + "h", + "hB" + ], + "CG": ["H", "hB"], + "CH": [ + "H", + "hB", + "h" + ], + "CI": ["H", "hB"], + "CK": [ + "H", + "h", + "hb", + "hB" + ], + "CL": [ + "h", + "H", + "hB", + "hb" + ], + "CM": [ + "H", + "h", + "hB" + ], + "CN": [ + "H", + "hB", + "hb", + "h" + ], + "CO": [ + "h", + "H", + "hB", + "hb" + ], + "CP": ["H"], + "CR": [ + "h", + "H", + "hB", + "hb" + ], + "CU": [ + "h", + "H", + "hB", + "hb" + ], + "CV": ["H", "hB"], + "CW": ["H", "hB"], + "CX": [ + "H", + "h", + "hb", + "hB" + ], + "CY": [ + "h", + "H", + "hb", + "hB" + ], + "CZ": ["H"], + "DE": ["H", "hB"], + "DG": [ + "H", + "h", + "hb", + "hB" + ], + "DJ": ["h", "H"], + "DK": ["H"], + "DM": [ + "h", + "hb", + "H", + "hB" + ], + "DO": [ + "h", + "H", + "hB", + "hb" + ], + "DZ": [ + "h", + "hB", + "hb", + "H" + ], + "EA": [ + "H", + "h", + "hB", + "hb" + ], + "EC": [ + "h", + "H", + "hB", + "hb" + ], + "EE": ["H", "hB"], + "EG": [ + "h", + "hB", + "hb", + "H" + ], + "EH": [ + "h", + "hB", + "hb", + "H" + ], + "ER": ["h", "H"], + "ES": [ + "H", + "hB", + "h", + "hb" + ], + "ET": [ + "hB", + "hb", + "h", + "H" + ], + "FI": ["H"], + "FJ": [ + "h", + "hb", + "H", + "hB" + ], + "FK": [ + "H", + "h", + "hb", + "hB" + ], + "FM": [ + "h", + "hb", + "H", + "hB" + ], + "FO": ["H", "h"], + "FR": ["H", "hB"], + "GA": ["H", "hB"], + "GB": [ + "H", + "h", + "hb", + "hB" + ], + "GD": [ + "h", + "hb", + "H", + "hB" + ], + "GE": [ + "H", + "hB", + "h" + ], + "GF": ["H", "hB"], + "GG": [ + "H", + "h", + "hb", + "hB" + ], + "GH": ["h", "H"], + "GI": [ + "H", + "h", + "hb", + "hB" + ], + "GL": ["H", "h"], + "GM": [ + "h", + "hb", + "H", + "hB" + ], + "GN": ["H", "hB"], + "GP": ["H", "hB"], + "GQ": [ + "H", + "hB", + "h", + "hb" + ], + "GR": [ + "h", + "H", + "hb", + "hB" + ], + "GS": [ + "H", + "h", + "hb", + "hB" + ], + "GT": [ + "h", + "H", + "hB", + "hb" + ], + "GU": [ + "h", + "hb", + "H", + "hB" + ], + "GW": ["H", "hB"], + "GY": [ + "h", + "hb", + "H", + "hB" + ], + "HK": [ + "h", + "hB", + "hb", + "H" + ], + "HN": [ + "h", + "H", + "hB", + "hb" + ], + "HR": ["H", "hB"], + "HU": ["H", "h"], + "IC": [ + "H", + "h", + "hB", + "hb" + ], + "ID": ["H"], + "IE": [ + "H", + "h", + "hb", + "hB" + ], + "IL": ["H", "hB"], + "IM": [ + "H", + "h", + "hb", + "hB" + ], + "IN": ["h", "H"], + "IO": [ + "H", + "h", + "hb", + "hB" + ], + "IQ": [ + "h", + "hB", + "hb", + "H" + ], + "IR": ["hB", "H"], + "IS": ["H"], + "IT": ["H", "hB"], + "JE": [ + "H", + "h", + "hb", + "hB" + ], + "JM": [ + "h", + "hb", + "H", + "hB" + ], + "JO": [ + "h", + "hB", + "hb", + "H" + ], + "JP": [ + "H", + "K", + "h" + ], + "KE": [ + "hB", + "hb", + "H", + "h" + ], + "KG": [ + "H", + "h", + "hB", + "hb" + ], + "KH": [ + "hB", + "h", + "H", + "hb" + ], + "KI": [ + "h", + "hb", + "H", + "hB" + ], + "KM": [ + "H", + "h", + "hB", + "hb" + ], + "KN": [ + "h", + "hb", + "H", + "hB" + ], + "KP": [ + "h", + "H", + "hB", + "hb" + ], + "KR": [ + "h", + "H", + "hB", + "hb" + ], + "KW": [ + "h", + "hB", + "hb", + "H" + ], + "KY": [ + "h", + "hb", + "H", + "hB" + ], + "KZ": ["H", "hB"], + "LA": [ + "H", + "hb", + "hB", + "h" + ], + "LB": [ + "h", + "hB", + "hb", + "H" + ], + "LC": [ + "h", + "hb", + "H", + "hB" + ], + "LI": [ + "H", + "hB", + "h" + ], + "LK": [ + "H", + "h", + "hB", + "hb" + ], + "LR": [ + "h", + "hb", + "H", + "hB" + ], + "LS": ["h", "H"], + "LT": [ + "H", + "h", + "hb", + "hB" + ], + "LU": [ + "H", + "h", + "hB" + ], + "LV": [ + "H", + "hB", + "hb", + "h" + ], + "LY": [ + "h", + "hB", + "hb", + "H" + ], + "MA": [ + "H", + "h", + "hB", + "hb" + ], + "MC": ["H", "hB"], + "MD": ["H", "hB"], + "ME": [ + "H", + "hB", + "h" + ], + "MF": ["H", "hB"], + "MG": ["H", "h"], + "MH": [ + "h", + "hb", + "H", + "hB" + ], + "MK": [ + "H", + "h", + "hb", + "hB" + ], + "ML": ["H"], + "MM": [ + "hB", + "hb", + "H", + "h" + ], + "MN": [ + "H", + "h", + "hb", + "hB" + ], + "MO": [ + "h", + "hB", + "hb", + "H" + ], + "MP": [ + "h", + "hb", + "H", + "hB" + ], + "MQ": ["H", "hB"], + "MR": [ + "h", + "hB", + "hb", + "H" + ], + "MS": [ + "H", + "h", + "hb", + "hB" + ], + "MT": ["H", "h"], + "MU": ["H", "h"], + "MV": ["H", "h"], + "MW": [ + "h", + "hb", + "H", + "hB" + ], + "MX": [ + "h", + "H", + "hB", + "hb" + ], + "MY": [ + "hb", + "hB", + "h", + "H" + ], + "MZ": ["H", "hB"], + "NA": [ + "h", + "H", + "hB", + "hb" + ], + "NC": ["H", "hB"], + "NE": ["H"], + "NF": [ + "H", + "h", + "hb", + "hB" + ], + "NG": [ + "H", + "h", + "hb", + "hB" + ], + "NI": [ + "h", + "H", + "hB", + "hb" + ], + "NL": ["H", "hB"], + "NO": ["H", "h"], + "NP": [ + "H", + "h", + "hB" + ], + "NR": [ + "H", + "h", + "hb", + "hB" + ], + "NU": [ + "H", + "h", + "hb", + "hB" + ], + "NZ": [ + "h", + "hb", + "H", + "hB" + ], + "OM": [ + "h", + "hB", + "hb", + "H" + ], + "PA": [ + "h", + "H", + "hB", + "hb" + ], + "PE": [ + "h", + "H", + "hB", + "hb" + ], + "PF": [ + "H", + "h", + "hB" + ], + "PG": ["h", "H"], + "PH": [ + "h", + "hB", + "hb", + "H" + ], + "PK": [ + "h", + "hB", + "H" + ], + "PL": ["H", "h"], + "PM": ["H", "hB"], + "PN": [ + "H", + "h", + "hb", + "hB" + ], + "PR": [ + "h", + "H", + "hB", + "hb" + ], + "PS": [ + "h", + "hB", + "hb", + "H" + ], + "PT": ["H", "hB"], + "PW": ["h", "H"], + "PY": [ + "h", + "H", + "hB", + "hb" + ], + "QA": [ + "h", + "hB", + "hb", + "H" + ], + "RE": ["H", "hB"], + "RO": ["H", "hB"], + "RS": [ + "H", + "hB", + "h" + ], + "RU": ["H"], + "RW": ["H", "h"], + "SA": [ + "h", + "hB", + "hb", + "H" + ], + "SB": [ + "h", + "hb", + "H", + "hB" + ], + "SC": [ + "H", + "h", + "hB" + ], + "SD": [ + "h", + "hB", + "hb", + "H" + ], + "SE": ["H"], + "SG": [ + "h", + "hb", + "H", + "hB" + ], + "SH": [ + "H", + "h", + "hb", + "hB" + ], + "SI": ["H", "hB"], + "SJ": ["H"], + "SK": ["H"], + "SL": [ + "h", + "hb", + "H", + "hB" + ], + "SM": [ + "H", + "h", + "hB" + ], + "SN": [ + "H", + "h", + "hB" + ], + "SO": ["h", "H"], + "SR": ["H", "hB"], + "SS": [ + "h", + "hb", + "H", + "hB" + ], + "ST": ["H", "hB"], + "SV": [ + "h", + "H", + "hB", + "hb" + ], + "SX": [ + "H", + "h", + "hb", + "hB" + ], + "SY": [ + "h", + "hB", + "hb", + "H" + ], + "SZ": [ + "h", + "hb", + "H", + "hB" + ], + "TA": [ + "H", + "h", + "hb", + "hB" + ], + "TC": [ + "h", + "hb", + "H", + "hB" + ], + "TD": [ + "h", + "H", + "hB" + ], + "TF": [ + "H", + "h", + "hB" + ], + "TG": ["H", "hB"], + "TH": ["H", "h"], + "TJ": ["H", "h"], + "TL": [ + "H", + "hB", + "hb", + "h" + ], + "TM": ["H", "h"], + "TN": [ + "h", + "hB", + "hb", + "H" + ], + "TO": ["h", "H"], + "TR": ["H", "hB"], + "TT": [ + "h", + "hb", + "H", + "hB" + ], + "TW": [ + "hB", + "hb", + "h", + "H" + ], + "TZ": [ + "hB", + "hb", + "H", + "h" + ], + "UA": [ + "H", + "hB", + "h" + ], + "UG": [ + "hB", + "hb", + "H", + "h" + ], + "UM": [ + "h", + "hb", + "H", + "hB" + ], + "US": [ + "h", + "hb", + "H", + "hB" + ], + "UY": [ + "h", + "H", + "hB", + "hb" + ], + "UZ": [ + "H", + "hB", + "h" + ], + "VA": [ + "H", + "h", + "hB" + ], + "VC": [ + "h", + "hb", + "H", + "hB" + ], + "VE": [ + "h", + "H", + "hB", + "hb" + ], + "VG": [ + "h", + "hb", + "H", + "hB" + ], + "VI": [ + "h", + "hb", + "H", + "hB" + ], + "VN": ["H", "h"], + "VU": ["h", "H"], + "WF": ["H", "hB"], + "WS": ["h", "H"], + "XK": [ + "H", + "hB", + "h" + ], + "YE": [ + "h", + "hB", + "hb", + "H" + ], + "YT": ["H", "hB"], + "ZA": [ + "H", + "h", + "hb", + "hB" + ], + "ZM": [ + "h", + "hb", + "H", + "hB" + ], + "ZW": ["H", "h"], + "af-ZA": [ + "H", + "h", + "hB", + "hb" + ], + "ar-001": [ + "h", + "hB", + "hb", + "H" + ], + "ca-ES": [ + "H", + "h", + "hB" + ], + "en-001": [ + "h", + "hb", + "H", + "hB" + ], + "en-HK": [ + "h", + "hb", + "H", + "hB" + ], + "en-IL": [ + "H", + "h", + "hb", + "hB" + ], + "en-MY": [ + "h", + "hb", + "H", + "hB" + ], + "es-BR": [ + "H", + "h", + "hB", + "hb" + ], + "es-ES": [ + "H", + "h", + "hB", + "hb" + ], + "es-GQ": [ + "H", + "h", + "hB", + "hb" + ], + "fr-CA": [ + "H", + "h", + "hB" + ], + "gl-ES": [ + "H", + "h", + "hB" + ], + "gu-IN": [ + "hB", + "hb", + "h", + "H" + ], + "hi-IN": [ + "hB", + "h", + "H" + ], + "it-CH": [ + "H", + "h", + "hB" + ], + "it-IT": [ + "H", + "h", + "hB" + ], + "kn-IN": [ + "hB", + "h", + "H" + ], + "ku-SY": ["H", "hB"], + "ml-IN": [ + "hB", + "h", + "H" + ], + "mr-IN": [ + "hB", + "hb", + "h", + "H" + ], + "pa-IN": [ + "hB", + "hb", + "h", + "H" + ], + "ta-IN": [ + "hB", + "h", + "hb", + "H" + ], + "te-IN": [ + "hB", + "h", + "H" + ], + "zu-ZA": [ + "H", + "hB", + "hb", + "h" + ] +}; +/** +* Returns the best matching date time pattern if a date time skeleton +* pattern is provided with a locale. Follows the Unicode specification: +* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns +* @param skeleton date time skeleton pattern that possibly includes j, J or C +* @param locale +*/ +function getBestPattern(skeleton, locale) { + let skeletonCopy = ""; + for (let patternPos = 0; patternPos < skeleton.length; patternPos++) { + const patternChar = skeleton.charAt(patternPos); + if (patternChar === "j") { + let extraLength = 0; + while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) { + extraLength++; + patternPos++; + } + let hourLen = 1 + (extraLength & 1); + let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); + let dayPeriodChar = "a"; + let hourChar = getDefaultHourSymbolFromLocale(locale); + if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0; + while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar; + while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy; + } else if (patternChar === "J") skeletonCopy += "H"; + else skeletonCopy += patternChar; + } + return skeletonCopy; +} +/** +* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) +* of the given `locale` to the corresponding time pattern. +* @param locale +*/ +function getDefaultHourSymbolFromLocale(locale) { + let hourCycle = locale.hourCycle; + if (hourCycle === void 0) { + const localeWithHourCycles = locale; + hourCycle = localeWithHourCycles.getHourCycles?.()[0] ?? localeWithHourCycles.hourCycles?.[0]; + } + if (hourCycle) switch (hourCycle) { + case "h24": return "k"; + case "h23": return "H"; + case "h12": return "h"; + case "h11": return "K"; + default: throw new Error("Invalid hourCycle"); + } + const languageTag = locale.language; + let regionTag; + if (languageTag !== "root") regionTag = locale.maximize().region; + return (timeData[`${languageTag}-${regionTag}`] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0].charAt(0); +} +const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`); +const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`); +function createLocation(start, end) { + return { + start, + end + }; +} +const hasNativeFromEntries = !!Object.fromEntries; +const hasTrimStart = !!String.prototype.trimStart; +const hasTrimEnd = !!String.prototype.trimEnd; +const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) { + const obj = {}; + for (const [k, v] of entries) obj[k] = v; + return obj; +}; +const trimStart = hasTrimStart ? function trimStart(s) { + return s.trimStart(); +} : function trimStart(s) { + return s.replace(SPACE_SEPARATOR_START_REGEX, ""); +}; +const trimEnd = hasTrimEnd ? function trimEnd(s) { + return s.trimEnd(); +} : function trimEnd(s) { + return s.replace(SPACE_SEPARATOR_END_REGEX, ""); +}; +const IDENTIFIER_PREFIX_RE = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); +function matchIdentifierAtIndex(s, index) { + IDENTIFIER_PREFIX_RE.lastIndex = index; + return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? ""; +} +function plainTopLevelEndPosition(message) { + if (message.length === 0) return null; + let line = 1; + let column = 1; + for (let offset = 0; offset < message.length;) { + const code = message.charCodeAt(offset); + switch (code) { + case 35: + case 39: + case 60: + case 123: + case 125: return null; + } + if (code === 10) { + line++; + column = 1; + offset++; + } else { + column++; + if (code >= 55296 && code <= 56319 && offset + 1 < message.length) { + const next = message.charCodeAt(offset + 1); + offset += next >= 56320 && next <= 57343 ? 2 : 1; + } else offset++; + } + } + return { + offset: message.length, + line, + column + }; +} +var Parser = class { + constructor(message, options = {}) { + this.message = message; + this.position = { + offset: 0, + line: 1, + column: 1 + }; + this.ignoreTag = !!options.ignoreTag; + this.locale = options.locale; + this.requiresOtherClause = !!options.requiresOtherClause; + this.shouldParseSkeletons = !!options.shouldParseSkeletons; + } + parse() { + if (this.offset() !== 0) throw Error("parser can only be used once"); + if (this.message.length > 0) { + const firstCode = this.message.charCodeAt(0); + if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) { + const plainEndPosition = plainTopLevelEndPosition(this.message); + if (plainEndPosition) { + const start = this.clonePosition(); + this.position = plainEndPosition; + return { + val: [{ + type: 0, + value: this.message, + location: createLocation(start, this.clonePosition()) + }], + err: null + }; + } + } + } + return this.parseMessage(0, "", false); + } + parseMessage(nestingLevel, parentArgType, expectingCloseTag) { + let elements = []; + while (!this.isEOF()) { + const char = this.char(); + if (char === 123) { + const result = this.parseArgument(nestingLevel, expectingCloseTag); + if (result.err) return result; + elements.push(result.val); + } else if (char === 125 && nestingLevel > 0) break; + else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { + const position = this.clonePosition(); + this.bump(); + elements.push({ + type: 7, + location: createLocation(position, this.clonePosition()) + }); + } else if (char === 60 && !this.ignoreTag && this.peek() === 47) { + if (expectingCloseTag) break; + else return this.error(26, createLocation(this.clonePosition(), this.clonePosition())); + } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { + const result = this.parseTag(nestingLevel, parentArgType); + if (result.err) return result; + elements.push(result.val); + } else { + const result = this.parseLiteral(nestingLevel, parentArgType); + if (result.err) return result; + elements.push(result.val); + } + } + return { + val: elements, + err: null + }; + } + /** + * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the + * [custom element name][] except that a dash is NOT always mandatory and uppercase letters + * are accepted: + * + * ``` + * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "" + * tagName ::= [a-z] (PENChar)* + * PENChar ::= + * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | + * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | + * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] + * ``` + * + * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name + * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do + * since other tag-based engines like React allow it + */ + parseTag(nestingLevel, parentArgType) { + const startPosition = this.clonePosition(); + this.bump(); + const tagName = this.parseTagName(); + this.bumpSpace(); + if (this.bumpIf("/>")) return { + val: { + type: 0, + value: `<${tagName}/>`, + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + else if (this.bumpIf(">")) { + const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); + if (childrenResult.err) return childrenResult; + const children = childrenResult.val; + const endTagStartPosition = this.clonePosition(); + if (this.bumpIf("")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); + return { + val: { + type: 8, + value: tagName, + children, + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + } else return this.error(27, createLocation(startPosition, this.clonePosition())); + } else return this.error(23, createLocation(startPosition, this.clonePosition())); + } + /** + * This method assumes that the caller has peeked ahead for the first tag character. + */ + parseTagName() { + const startOffset = this.offset(); + this.bump(); + while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump(); + return this.message.slice(startOffset, this.offset()); + } + parseLiteral(nestingLevel, parentArgType) { + const start = this.clonePosition(); + let value = ""; + while (true) { + const parseQuoteResult = this.tryParseQuote(parentArgType); + if (parseQuoteResult) { + value += parseQuoteResult; + continue; + } + const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); + if (parseUnquotedResult) { + value += parseUnquotedResult; + continue; + } + const parseLeftAngleResult = this.tryParseLeftAngleBracket(); + if (parseLeftAngleResult) { + value += parseLeftAngleResult; + continue; + } + break; + } + const location = createLocation(start, this.clonePosition()); + return { + val: { + type: 0, + value, + location + }, + err: null + }; + } + tryParseLeftAngleBracket() { + if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) { + this.bump(); + return "<"; + } + return null; + } + /** + * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes + * a character that requires quoting (that is, "only where needed"), and works the same in + * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. + */ + tryParseQuote(parentArgType) { + if (this.isEOF() || this.char() !== 39) return null; + switch (this.peek()) { + case 39: + this.bump(); + this.bump(); + return "'"; + case 123: + case 60: + case 62: + case 125: break; + case 35: + if (parentArgType === "plural" || parentArgType === "selectordinal") break; + return null; + default: return null; + } + this.bump(); + const codePoints = [this.char()]; + this.bump(); + while (!this.isEOF()) { + const ch = this.char(); + if (ch === 39) { + if (this.peek() === 39) { + codePoints.push(39); + this.bump(); + } else { + this.bump(); + break; + } + } else codePoints.push(ch); + this.bump(); + } + return String.fromCodePoint(...codePoints); + } + tryParseUnquoted(nestingLevel, parentArgType) { + if (this.isEOF()) return null; + const ch = this.char(); + if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null; + else { + this.bump(); + return String.fromCodePoint(ch); + } + } + parseArgument(nestingLevel, expectingCloseTag) { + const openingBracePosition = this.clonePosition(); + this.bump(); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + if (this.char() === 125) { + this.bump(); + return this.error(2, createLocation(openingBracePosition, this.clonePosition())); + } + let value = this.parseIdentifierIfPossible().value; + if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition())); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + switch (this.char()) { + case 125: + this.bump(); + return { + val: { + type: 1, + value, + location: createLocation(openingBracePosition, this.clonePosition()) + }, + err: null + }; + case 44: + this.bump(); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); + default: return this.error(3, createLocation(openingBracePosition, this.clonePosition())); + } + } + /** + * Advance the parser until the end of the identifier, if it is currently on + * an identifier character. Return an empty string otherwise. + */ + parseIdentifierIfPossible() { + const startingPosition = this.clonePosition(); + const startOffset = this.offset(); + const value = matchIdentifierAtIndex(this.message, startOffset); + const endOffset = startOffset + value.length; + this.bumpTo(endOffset); + return { + value, + location: createLocation(startingPosition, this.clonePosition()) + }; + } + parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) { + let typeStartPosition = this.clonePosition(); + let argType = this.parseIdentifierIfPossible().value; + let typeEndPosition = this.clonePosition(); + switch (argType) { + case "": return this.error(4, createLocation(typeStartPosition, typeEndPosition)); + case "number": + case "date": + case "time": { + this.bumpSpace(); + let styleAndLocation = null; + if (this.bumpIf(",")) { + this.bumpSpace(); + const styleStartPosition = this.clonePosition(); + const result = this.parseSimpleArgStyleIfPossible(); + if (result.err) return result; + const style = trimEnd(result.val); + if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition())); + styleAndLocation = { + style, + styleLocation: createLocation(styleStartPosition, this.clonePosition()) + }; + } + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + const location = createLocation(openingBracePosition, this.clonePosition()); + if (styleAndLocation && styleAndLocation.style.startsWith("::")) { + let skeleton = trimStart(styleAndLocation.style.slice(2)); + if (argType === "number") { + const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); + if (result.err) return result; + return { + val: { + type: 2, + value, + location, + style: result.val + }, + err: null + }; + } else { + if (skeleton.length === 0) return this.error(10, location); + let dateTimePattern = skeleton; + if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale); + const style = { + type: 1, + pattern: dateTimePattern, + location: styleAndLocation.styleLocation, + parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} + }; + return { + val: { + type: argType === "date" ? 3 : 4, + value, + location, + style + }, + err: null + }; + } + } + return { + val: { + type: argType === "number" ? 2 : argType === "date" ? 3 : 4, + value, + location, + style: styleAndLocation?.style ?? null + }, + err: null + }; + } + case "plural": + case "selectordinal": + case "select": { + const typeEndPosition = this.clonePosition(); + this.bumpSpace(); + if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { ...typeEndPosition })); + this.bumpSpace(); + let identifierAndLocation = this.parseIdentifierIfPossible(); + let pluralOffset = 0; + if (argType !== "select" && identifierAndLocation.value === "offset") { + if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition())); + this.bumpSpace(); + const result = this.tryParseDecimalInteger(13, 14); + if (result.err) return result; + this.bumpSpace(); + identifierAndLocation = this.parseIdentifierIfPossible(); + pluralOffset = result.val; + } + const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); + if (optionsResult.err) return optionsResult; + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + const location = createLocation(openingBracePosition, this.clonePosition()); + if (argType === "select") return { + val: { + type: 5, + value, + options: fromEntries(optionsResult.val), + location + }, + err: null + }; + else return { + val: { + type: 6, + value, + options: fromEntries(optionsResult.val), + offset: pluralOffset, + pluralType: argType === "plural" ? "cardinal" : "ordinal", + location + }, + err: null + }; + } + default: return this.error(5, createLocation(typeStartPosition, typeEndPosition)); + } + } + tryParseArgumentClose(openingBracePosition) { + if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + this.bump(); + return { + val: true, + err: null + }; + } + /** + * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 + */ + parseSimpleArgStyleIfPossible() { + let nestedBraces = 0; + const startPosition = this.clonePosition(); + while (!this.isEOF()) switch (this.char()) { + case 39: { + this.bump(); + let apostrophePosition = this.clonePosition(); + if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition())); + this.bump(); + break; + } + case 123: + nestedBraces += 1; + this.bump(); + break; + case 125: + if (nestedBraces > 0) nestedBraces -= 1; + else return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + break; + default: this.bump(); + } + return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + } + parseNumberSkeletonFromString(skeleton, location) { + let tokens = []; + try { + tokens = parseNumberSkeletonFromString(skeleton); + } catch { + return this.error(7, location); + } + return { + val: { + type: 0, + tokens, + location, + parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} + }, + err: null + }; + } + /** + * @param nesting_level The current nesting level of messages. + * This can be positive when parsing message fragment in select or plural argument options. + * @param parent_arg_type The parent argument's type. + * @param parsed_first_identifier If provided, this is the first identifier-like selector of + * the argument. It is a by-product of a previous parsing attempt. + * @param expecting_close_tag If true, this message is directly or indirectly nested inside + * between a pair of opening and closing tags. The nested message will not parse beyond + * the closing tag boundary. + */ + tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { + let hasOtherClause = false; + const options = []; + const parsedSelectors = /* @__PURE__ */ new Set(); + let { value: selector, location: selectorLocation } = parsedFirstIdentifier; + while (true) { + if (selector.length === 0) { + const startPosition = this.clonePosition(); + if (parentArgType !== "select" && this.bumpIf("=")) { + const result = this.tryParseDecimalInteger(16, 19); + if (result.err) return result; + selectorLocation = createLocation(startPosition, this.clonePosition()); + selector = this.message.slice(startPosition.offset, this.offset()); + } else break; + } + if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation); + if (selector === "other") hasOtherClause = true; + this.bumpSpace(); + const openingBracePosition = this.clonePosition(); + if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition())); + const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); + if (fragmentResult.err) return fragmentResult; + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + options.push([selector, { + value: fragmentResult.val, + location: createLocation(openingBracePosition, this.clonePosition()) + }]); + parsedSelectors.add(selector); + this.bumpSpace(); + ({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible()); + } + if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition())); + if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition())); + return { + val: options, + err: null + }; + } + tryParseDecimalInteger(expectNumberError, invalidNumberError) { + let sign = 1; + const startingPosition = this.clonePosition(); + if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1; + let hasDigits = false; + let decimal = 0; + while (!this.isEOF()) { + const ch = this.char(); + if (ch >= 48 && ch <= 57) { + hasDigits = true; + decimal = decimal * 10 + (ch - 48); + this.bump(); + } else break; + } + const location = createLocation(startingPosition, this.clonePosition()); + if (!hasDigits) return this.error(expectNumberError, location); + decimal *= sign; + if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location); + return { + val: decimal, + err: null + }; + } + offset() { + return this.position.offset; + } + isEOF() { + return this.offset() === this.message.length; + } + clonePosition() { + return { + offset: this.position.offset, + line: this.position.line, + column: this.position.column + }; + } + /** + * Return the code point at the current position of the parser. + * Throws if the index is out of bound. + */ + char() { + const offset = this.position.offset; + if (offset >= this.message.length) throw Error("out of bound"); + const code = this.message.codePointAt(offset); + if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`); + return code; + } + error(kind, location) { + return { + val: null, + err: { + kind, + message: this.message, + location + } + }; + } + /** Bump the parser to the next UTF-16 code unit. */ + bump() { + if (this.isEOF()) return; + const code = this.char(); + if (code === 10) { + this.position.line += 1; + this.position.column = 1; + this.position.offset += 1; + } else { + this.position.column += 1; + this.position.offset += code < 65536 ? 1 : 2; + } + } + /** + * If the substring starting at the current position of the parser has + * the given prefix, then bump the parser to the character immediately + * following the prefix and return true. Otherwise, don't bump the parser + * and return false. + */ + bumpIf(prefix) { + if (this.message.startsWith(prefix, this.offset())) { + for (let i = 0; i < prefix.length; i++) this.bump(); + return true; + } + return false; + } + /** + * Bump the parser until the pattern character is found and return `true`. + * Otherwise bump to the end of the file and return `false`. + */ + bumpUntil(pattern) { + const currentOffset = this.offset(); + const index = this.message.indexOf(pattern, currentOffset); + if (index >= 0) { + this.bumpTo(index); + return true; + } else { + this.bumpTo(this.message.length); + return false; + } + } + /** + * Bump the parser to the target offset. + * If target offset is beyond the end of the input, bump the parser to the end of the input. + */ + bumpTo(targetOffset) { + if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`); + targetOffset = Math.min(targetOffset, this.message.length); + while (true) { + const offset = this.offset(); + if (offset === targetOffset) break; + if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`); + this.bump(); + if (this.isEOF()) break; + } + } + /** advance the parser through all whitespace to the next non-whitespace code unit. */ + bumpSpace() { + while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump(); + } + /** + * Peek at the *next* Unicode codepoint in the input without advancing the parser. + * If the input has been exhausted, then this returns null. + */ + peek() { + if (this.isEOF()) return null; + const code = this.char(); + const offset = this.offset(); + return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null; + } +}; +/** +* This check if codepoint is alphabet (lower & uppercase) +* @param codepoint +* @returns +*/ +function _isAlpha(codepoint) { + return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; +} +function _isAlphaOrSlash(codepoint) { + return _isAlpha(codepoint) || codepoint === 47; +} +/** See `parseTag` function docs. */ +function _isPotentialElementNameChar(c) { + return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039; +} +/** +* Code point equivalent of regex `\p{White_Space}`. +* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt +*/ +function _isWhiteSpace(c) { + return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233; +} +function pruneLocation(els) { + els.forEach((el) => { + delete el.location; + if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) { + delete el.options[k].location; + pruneLocation(el.options[k].value); + } + else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location; + else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location; + else if (isTagElement(el)) pruneLocation(el.children); + }); +} +function parse(message, opts = {}) { + opts = { + shouldParseSkeletons: true, + requiresOtherClause: true, + ...opts + }; + const result = new Parser(message, opts).parse(); + if (result.err) { + const error = SyntaxError(ErrorKind[result.err.kind]); + error.location = result.err.location; + error.originalMessage = result.err.message; + throw error; + } + if (!opts?.captureLocation) pruneLocation(result.val); + return result.val; +} +//#endregion +//#region packages/intl-messageformat/error.ts +let ErrorCode = /* @__PURE__ */ function(ErrorCode) { + ErrorCode["MISSING_VALUE"] = "MISSING_VALUE"; + ErrorCode["INVALID_VALUE"] = "INVALID_VALUE"; + ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API"; + return ErrorCode; +}({}); +var FormatError = class extends Error { + constructor(msg, code, originalMessage) { + super(msg); + this.code = code; + this.originalMessage = originalMessage; + } + toString() { + return `[formatjs Error: ${this.code}] ${this.message}`; + } +}; +var InvalidValueError = class extends FormatError { + constructor(variableId, value, options, originalMessage) { + super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, "INVALID_VALUE", originalMessage); + } +}; +var InvalidValueTypeError = class extends FormatError { + constructor(value, type, originalMessage) { + super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage); + } +}; +var MissingValueError = class extends FormatError { + constructor(variableId, originalMessage) { + super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage); + } +}; +//#endregion +//#region packages/intl-messageformat/formatters.ts +let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) { + PART_TYPE[PART_TYPE["literal"] = 0] = "literal"; + PART_TYPE[PART_TYPE["object"] = 1] = "object"; + return PART_TYPE; +}({}); +function mergeLiteral(parts) { + if (parts.length < 2) return parts; + return parts.reduce((all, part) => { + const lastPart = all[all.length - 1]; + if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part); + else lastPart.value += part.value; + return all; + }, []); +} +function isFormatXMLElementFn(el) { + return typeof el === "function"; +} +function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { + if (els.length === 1 && isLiteralElement(els[0])) return [{ + type: 0, + value: els[0].value + }]; + const result = []; + for (const el of els) { + if (isLiteralElement(el)) { + result.push({ + type: 0, + value: el.value + }); + continue; + } + if (isPoundElement(el)) { + if (typeof currentPluralValue === "number") result.push({ + type: 0, + value: formatters.getNumberFormat(locales).format(currentPluralValue) + }); + continue; + } + const { value: varName } = el; + if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage); + let value = values[varName]; + if (isArgumentElement(el)) { + if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : ""; + result.push({ + type: typeof value === "string" ? 0 : 1, + value + }); + continue; + } + if (isDateElement(el)) { + const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; + result.push({ + type: 0, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isTimeElement(el)) { + const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; + result.push({ + type: 0, + value: formatters.getDateTimeFormat(locales, style).format(value) + }); + continue; + } + if (isNumberElement(el)) { + const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; + if (style && style.scale) { + const scale = style.scale || 1; + if (typeof value === "bigint") { + if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`); + value = value * BigInt(scale); + } else value = value * scale; + } + result.push({ + type: 0, + value: formatters.getNumberFormat(locales, style).format(value) + }); + continue; + } + if (isTagElement(el)) { + const { children, value } = el; + const formatFn = values[value]; + if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage); + let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value)); + if (!Array.isArray(chunks)) chunks = [chunks]; + result.push(...chunks.map((c) => { + return { + type: typeof c === "string" ? 0 : 1, + value: c + }; + })); + } + if (isSelectElement(el)) { + const key = value; + const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other; + if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + result.push(...formatToParts(opt.value, locales, formatters, formats, values)); + continue; + } + if (isPluralElement(el)) { + const exactKey = `=${value}`; + let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0; + if (!opt) { + if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment. +Try polyfilling it using "@formatjs/intl-pluralrules" +`, "MISSING_INTL_API", originalMessage); + const numericValue = typeof value === "bigint" ? Number(value) : value; + const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue - (el.offset || 0)); + opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other; + } + if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); + const numericValue = typeof value === "bigint" ? Number(value) : value; + result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0))); + continue; + } + } + return mergeLiteral(result); +} +//#endregion +//#region packages/intl-messageformat/core.ts +function mergeConfig(c1, c2) { + if (!c2) return c1; + return { + ...c1, + ...c2, + ...Object.keys(c1).reduce((all, k) => { + all[k] = { + ...c1[k], + ...c2[k] + }; + return all; + }, {}) + }; +} +function mergeConfigs(defaultConfig, configs) { + if (!configs) return defaultConfig; + return Object.keys(defaultConfig).reduce((all, k) => { + all[k] = mergeConfig(defaultConfig[k], configs[k]); + return all; + }, { ...defaultConfig }); +} +function createFastMemoizeCache(store) { + return { create() { + return { + get(key) { + return store[key]; + }, + set(key, value) { + store[key] = value; + } + }; + } }; +} +function createDefaultFormatters(cache = { + number: {}, + dateTime: {}, + pluralRules: {} +}) { + return { + getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), { + cache: createFastMemoizeCache(cache.number), + strategy: strategies.variadic + }), + getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), { + cache: createFastMemoizeCache(cache.dateTime), + strategy: strategies.variadic + }), + getPluralRules: memoize((...args) => new Intl.PluralRules(...args), { + cache: createFastMemoizeCache(cache.pluralRules), + strategy: strategies.variadic + }) + }; +} +var IntlMessageFormat = class IntlMessageFormat { + constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts) { + this.formatterCache = { + number: {}, + dateTime: {}, + pluralRules: {} + }; + this.format = (values) => { + const parts = this.formatToParts(values); + if (parts.length === 1) return parts[0].value; + const result = parts.reduce((all, part) => { + if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value); + else all[all.length - 1] += part.value; + return all; + }, []); + if (result.length <= 1) return result[0] || ""; + return result; + }; + this.formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message); + this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }); + this.getAst = () => this.ast; + this.locales = locales; + this.resolvedLocale = IntlMessageFormat.resolveLocale(locales); + if (typeof message === "string") { + this.message = message; + if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); + const { ...parseOpts } = opts || {}; + this.ast = IntlMessageFormat.__parse(message, { + ...parseOpts, + locale: this.resolvedLocale + }); + } else this.ast = message; + if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); + this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats); + this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); + } + static { + this.memoizedDefaultLocale = null; + } + static get defaultLocale() { + if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; + return IntlMessageFormat.memoizedDefaultLocale; + } + static { + this.resolveLocale = (locales) => { + if (typeof Intl.Locale === "undefined") return; + const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); + if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]); + return new Intl.Locale(typeof locales === "string" ? locales : locales[0]); + }; + } + static { + this.__parse = parse; + } + static { + this.formats = { + number: { + integer: { maximumFractionDigits: 0 }, + currency: { style: "currency" }, + percent: { style: "percent" } + }, + date: { + short: { + month: "numeric", + day: "numeric", + year: "2-digit" + }, + medium: { + month: "short", + day: "numeric", + year: "numeric" + }, + long: { + month: "long", + day: "numeric", + year: "numeric" + }, + full: { + weekday: "long", + month: "long", + day: "numeric", + year: "numeric" + } + }, + time: { + short: { + hour: "numeric", + minute: "numeric" + }, + medium: { + hour: "numeric", + minute: "numeric", + second: "numeric" + }, + long: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + }, + full: { + hour: "numeric", + minute: "numeric", + second: "numeric", + timeZoneName: "short" + } + } + }; + } +}; +//#endregion +//#region packages/intl-messageformat/index.ts +var intl_messageformat_default = IntlMessageFormat; +//#endregion +export { ErrorCode, FormatError, IntlMessageFormat, InvalidValueError, InvalidValueTypeError, MissingValueError, PART_TYPE, intl_messageformat_default as default, formatToParts, isFormatXMLElementFn }; + +//# sourceMappingURL=intl-messageformat.iife.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..479ee16faa726e67271b765e8c71a28f6063993e --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2023 FormatJS + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/README.md b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5376dbf12de1d866cef9730cef2a4aa173b0ba14 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/README.md @@ -0,0 +1,38 @@ +# MessageFormat Parser + +Hand-written ICU MessageFormat parser with compatible output as +[`intl-messageformat-parser`](https://www.npmjs.com/package/intl-messageformat-parser) +but 6 - 10 times as fast. + +## Benchmarks + +### JavaScript/TypeScript Parser + +``` +$ bazel run //packages/icu-messageformat-parser/benchmark:benchmark +complex_msg AST length 2599 +normal_msg AST length 400 +simple_msg AST length 79 +string_msg AST length 36 + +complex_msg: 21.39 µs (48,112 ops/sec) +normal_msg: 3.10 µs (337,642 ops/sec) +simple_msg: 0.54 µs (1,910,194 ops/sec) +string_msg: 0.15 µs (7,461,955 ops/sec) +``` + +### Rust Parser (WASM) + +The Rust parser (optimized build) is **2.3-3.5x faster** than the JavaScript parser: + +``` +$ bazel run -c opt //crates/icu_messageformat_parser:parser_bench -- --bench --output-format bencher +complex_msg: 9.43 µs (2.27x faster than JS) +normal_msg: 1.18 µs (2.63x faster than JS) +simple_msg: 153 ns (3.55x faster than JS) +string_msg: 59 ns (2.47x faster than JS) +``` + +The Rust parser is also faster than the SWC ICU MessageFormat parser in this +benchmark, ranging from 6% faster on `normal_msg` to 2.14x faster on +`string_msg`. diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.d.ts b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d8d4e28cc9f498c35db1e94fdf3cdcdbe52fe71 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.d.ts @@ -0,0 +1,393 @@ +import { NumberSkeletonToken } from "@formatjs/icu-skeleton-parser"; +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/icu-messageformat-parser/types.d.ts +export interface ExtendedNumberFormatOptions extends NumberFormatOptions { + scale?: number; +} +export declare enum TYPE { + /** + * Raw text + */ + literal = 0, + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + argument = 1, + /** + * Variable w/ number format + */ + number = 2, + /** + * Variable w/ date format + */ + date = 3, + /** + * Variable w/ time format + */ + time = 4, + /** + * Variable w/ select format + */ + select = 5, + /** + * Variable w/ plural format + */ + plural = 6, + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + pound = 7, + /** + * XML-like tag + */ + tag = 8 +} +export declare enum SKELETON_TYPE { + number = 0, + dateTime = 1 +} +export interface LocationDetails { + offset: number; + line: number; + column: number; +} +export interface Location { + start: LocationDetails; + end: LocationDetails; +} +export interface BaseElement { + type: T; + value: string; + location?: Location; +} +export type LiteralElement = BaseElement; +export type ArgumentElement = BaseElement; +export interface TagElement extends BaseElement { + children: MessageFormatElement[]; +} +export interface SimpleFormatElement extends BaseElement { + style?: string | S | null; +} +export type NumberElement = SimpleFormatElement; +export type DateElement = SimpleFormatElement; +export type TimeElement = SimpleFormatElement; +export type ValidPluralRule = "zero" | "one" | "two" | "few" | "many" | "other" | string; +export interface PluralOrSelectOption { + value: MessageFormatElement[]; + location?: Location; +} +export interface SelectElement extends BaseElement { + options: Record; +} +export interface PluralElement extends BaseElement { + options: Record; + offset: number; + pluralType: Intl.PluralRulesOptions["type"]; +} +export interface PoundElement { + type: TYPE.pound; + location?: Location; +} +export type MessageFormatElement = ArgumentElement | DateElement | LiteralElement | NumberElement | PluralElement | PoundElement | SelectElement | TagElement | TimeElement; +export interface NumberSkeleton { + type: SKELETON_TYPE.number; + tokens: NumberSkeletonToken[]; + location?: Location; + parsedOptions: ExtendedNumberFormatOptions; +} +export interface DateTimeSkeleton { + type: SKELETON_TYPE.dateTime; + pattern: string; + location?: Location; + parsedOptions: Intl.DateTimeFormatOptions; +} +export type Skeleton = NumberSkeleton | DateTimeSkeleton; +/** + * Type Guards + */ +export declare function isLiteralElement(el: MessageFormatElement): el is LiteralElement; +export declare function isArgumentElement(el: MessageFormatElement): el is ArgumentElement; +export declare function isNumberElement(el: MessageFormatElement): el is NumberElement; +export declare function isDateElement(el: MessageFormatElement): el is DateElement; +export declare function isTimeElement(el: MessageFormatElement): el is TimeElement; +export declare function isSelectElement(el: MessageFormatElement): el is SelectElement; +export declare function isPluralElement(el: MessageFormatElement): el is PluralElement; +export declare function isPoundElement(el: MessageFormatElement): el is PoundElement; +export declare function isTagElement(el: MessageFormatElement): el is TagElement; +export declare function isNumberSkeleton(el: NumberElement["style"] | Skeleton): el is NumberSkeleton; +export declare function isDateTimeSkeleton(el?: DateElement["style"] | TimeElement["style"] | Skeleton): el is DateTimeSkeleton; +export declare function createLiteralElement(value: string): LiteralElement; +export declare function createNumberElement(value: string, style?: string | null): NumberElement; +//#endregion +//#region packages/icu-messageformat-parser/error.d.ts +interface ParserError { + kind: ErrorKind; + message: string; + location: Location; +} +declare enum ErrorKind { + /** Argument is unclosed (e.g. `{0`) */ + EXPECT_ARGUMENT_CLOSING_BRACE = 1, + /** Argument is empty (e.g. `{}`). */ + EMPTY_ARGUMENT = 2, + /** Argument is malformed (e.g. `{foo!}``) */ + MALFORMED_ARGUMENT = 3, + /** Expect an argument type (e.g. `{foo,}`) */ + EXPECT_ARGUMENT_TYPE = 4, + /** Unsupported argument type (e.g. `{foo,foo}`) */ + INVALID_ARGUMENT_TYPE = 5, + /** Expect an argument style (e.g. `{foo, number, }`) */ + EXPECT_ARGUMENT_STYLE = 6, + /** The number skeleton is invalid. */ + INVALID_NUMBER_SKELETON = 7, + /** The date time skeleton is invalid. */ + INVALID_DATE_TIME_SKELETON = 8, + /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ + EXPECT_NUMBER_SKELETON = 9, + /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ + EXPECT_DATE_TIME_SKELETON = 10, + /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ + UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11, + /** Missing select argument options (e.g. `{foo, select}`) */ + EXPECT_SELECT_ARGUMENT_OPTIONS = 12, + /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ + EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13, + /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ + INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14, + /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ + EXPECT_SELECT_ARGUMENT_SELECTOR = 15, + /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ + EXPECT_PLURAL_ARGUMENT_SELECTOR = 16, + /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ + EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17, + /** + * Expecting a message fragment after the `plural` or `selectordinal` selector + * (e.g. `{foo, plural, one}`) + */ + EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18, + /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ + INVALID_PLURAL_ARGUMENT_SELECTOR = 19, + /** + * Duplicate selectors in `plural` or `selectordinal` argument. + * (e.g. {foo, plural, one {#} one {#}}) + */ + DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20, + /** Duplicate selectors in `select` argument. + * (e.g. {foo, select, apple {apple} apple {apple}}) + */ + DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21, + /** Plural or select argument option must have `other` clause. */ + MISSING_OTHER_CLAUSE = 22, + /** The tag is malformed. (e.g. `foo) */ + INVALID_TAG = 23, + /** The tag name is invalid. (e.g. `<123>foo`) */ + INVALID_TAG_NAME = 25, + /** The closing tag does not match the opening tag. (e.g. `foo`) */ + UNMATCHED_CLOSING_TAG = 26, + /** The opening tag has unmatched closing tag. (e.g. `foo`) */ + UNCLOSED_TAG = 27 +} +//#endregion +//#region packages/icu-messageformat-parser/parser.d.ts +interface ParserOptions { + /** + * Whether to treat HTML/XML tags as string literal + * instead of parsing them as tag token. + * When this is false we only allow simple tags without + * any attributes + */ + ignoreTag?: boolean; + /** + * Should `select`, `selectordinal`, and `plural` arguments always include + * the `other` case clause. + */ + requiresOtherClause?: boolean; + /** + * Whether to parse number/datetime skeleton + * into Intl.NumberFormatOptions and Intl.DateTimeFormatOptions, respectively. + */ + shouldParseSkeletons?: boolean; + /** + * Capture location info in AST + * Default is false + */ + captureLocation?: boolean; + /** + * Instance of Intl.Locale to resolve locale-dependent skeleton + */ + locale?: Intl.Locale; +} +type Result = { + val: T; + err: null; +} | { + val: null; + err: E; +}; +declare class Parser { + private message; + private position; + private locale?; + private ignoreTag; + private requiresOtherClause; + private shouldParseSkeletons?; + constructor(message: string, options?: ParserOptions); + parse(): Result; + private parseMessage; + /** + * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the + * [custom element name][] except that a dash is NOT always mandatory and uppercase letters + * are accepted: + * + * ``` + * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "" + * tagName ::= [a-z] (PENChar)* + * PENChar ::= + * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | + * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | + * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] + * ``` + * + * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name + * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do + * since other tag-based engines like React allow it + */ + private parseTag; + /** + * This method assumes that the caller has peeked ahead for the first tag character. + */ + private parseTagName; + private parseLiteral; + tryParseLeftAngleBracket(): string | null; + /** + * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes + * a character that requires quoting (that is, "only where needed"), and works the same in + * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. + */ + private tryParseQuote; + private tryParseUnquoted; + private parseArgument; + /** + * Advance the parser until the end of the identifier, if it is currently on + * an identifier character. Return an empty string otherwise. + */ + private parseIdentifierIfPossible; + private parseArgumentOptions; + private tryParseArgumentClose; + /** + * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 + */ + private parseSimpleArgStyleIfPossible; + private parseNumberSkeletonFromString; + /** + * @param nesting_level The current nesting level of messages. + * This can be positive when parsing message fragment in select or plural argument options. + * @param parent_arg_type The parent argument's type. + * @param parsed_first_identifier If provided, this is the first identifier-like selector of + * the argument. It is a by-product of a previous parsing attempt. + * @param expecting_close_tag If true, this message is directly or indirectly nested inside + * between a pair of opening and closing tags. The nested message will not parse beyond + * the closing tag boundary. + */ + private tryParsePluralOrSelectOptions; + private tryParseDecimalInteger; + private offset; + private isEOF; + private clonePosition; + /** + * Return the code point at the current position of the parser. + * Throws if the index is out of bound. + */ + private char; + private error; + /** Bump the parser to the next UTF-16 code unit. */ + private bump; + /** + * If the substring starting at the current position of the parser has + * the given prefix, then bump the parser to the character immediately + * following the prefix and return true. Otherwise, don't bump the parser + * and return false. + */ + private bumpIf; + /** + * Bump the parser until the pattern character is found and return `true`. + * Otherwise bump to the end of the file and return `false`. + */ + private bumpUntil; + /** + * Bump the parser to the target offset. + * If target offset is beyond the end of the input, bump the parser to the end of the input. + */ + private bumpTo; + /** advance the parser through all whitespace to the next non-whitespace code unit. */ + private bumpSpace; + /** + * Peek at the *next* Unicode codepoint in the input without advancing the parser. + * If the input has been exhausted, then this returns null. + */ + private peek; +} +//#endregion +//#region packages/icu-messageformat-parser/manipulator.d.ts +interface IsStructurallySameResult { + error?: Error; + success: boolean; +} +/** + * Check if 2 ASTs are structurally the same. This primarily means that + * they have the same variables with the same type + * @param a + * @param b + * @returns + */ +export declare function isStructurallySame(a: MessageFormatElement[], b: MessageFormatElement[]): IsStructurallySameResult; +//#endregion +//#region packages/icu-messageformat-parser/index.d.ts +export declare function parse(message: string, opts?: ParserOptions): MessageFormatElement[]; +export declare const _Parser: typeof Parser; +//#endregion +export type { ParserOptions }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7f951eede5324664301400da3ec72286d81a8f0e --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js @@ -0,0 +1,2178 @@ +import { parseDateTimeSkeleton, parseNumberSkeleton, parseNumberSkeletonFromString } from "@formatjs/icu-skeleton-parser"; +//#region packages/icu-messageformat-parser/error.ts +let ErrorKind = /* @__PURE__ */ function(ErrorKind) { + /** Argument is unclosed (e.g. `{0`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; + /** Argument is empty (e.g. `{}`). */ + ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; + /** Argument is malformed (e.g. `{foo!}``) */ + ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; + /** Expect an argument type (e.g. `{foo,}`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; + /** Unsupported argument type (e.g. `{foo,foo}`) */ + ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; + /** Expect an argument style (e.g. `{foo, number, }`) */ + ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; + /** The number skeleton is invalid. */ + ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; + /** The date time skeleton is invalid. */ + ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; + /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ + ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; + /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ + ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; + /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ + ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; + /** Missing select argument options (e.g. `{foo, select}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; + /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; + /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ + ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; + /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; + /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; + /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ + ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; + /** + * Expecting a message fragment after the `plural` or `selectordinal` selector + * (e.g. `{foo, plural, one}`) + */ + ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; + /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ + ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; + /** + * Duplicate selectors in `plural` or `selectordinal` argument. + * (e.g. {foo, plural, one {#} one {#}}) + */ + ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; + /** Duplicate selectors in `select` argument. + * (e.g. {foo, select, apple {apple} apple {apple}}) + */ + ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; + /** Plural or select argument option must have `other` clause. */ + ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; + /** The tag is malformed. (e.g. `foo) */ + ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG"; + /** The tag name is invalid. (e.g. `<123>foo`) */ + ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; + /** The closing tag does not match the opening tag. (e.g. `foo`) */ + ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; + /** The opening tag has unmatched closing tag. (e.g. `foo`) */ + ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; + return ErrorKind; +}({}); +//#endregion +//#region packages/icu-messageformat-parser/types.ts +let TYPE = /* @__PURE__ */ function(TYPE) { + /** + * Raw text + */ + TYPE[TYPE["literal"] = 0] = "literal"; + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + TYPE[TYPE["argument"] = 1] = "argument"; + /** + * Variable w/ number format + */ + TYPE[TYPE["number"] = 2] = "number"; + /** + * Variable w/ date format + */ + TYPE[TYPE["date"] = 3] = "date"; + /** + * Variable w/ time format + */ + TYPE[TYPE["time"] = 4] = "time"; + /** + * Variable w/ select format + */ + TYPE[TYPE["select"] = 5] = "select"; + /** + * Variable w/ plural format + */ + TYPE[TYPE["plural"] = 6] = "plural"; + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + TYPE[TYPE["pound"] = 7] = "pound"; + /** + * XML-like tag + */ + TYPE[TYPE["tag"] = 8] = "tag"; + return TYPE; +}({}); +let SKELETON_TYPE = /* @__PURE__ */ function(SKELETON_TYPE) { + SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number"; + SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime"; + return SKELETON_TYPE; +}({}); +/** +* Type Guards +*/ +function isLiteralElement(el) { + return el.type === 0; +} +function isArgumentElement(el) { + return el.type === 1; +} +function isNumberElement(el) { + return el.type === 2; +} +function isDateElement(el) { + return el.type === 3; +} +function isTimeElement(el) { + return el.type === 4; +} +function isSelectElement(el) { + return el.type === 5; +} +function isPluralElement(el) { + return el.type === 6; +} +function isPoundElement(el) { + return el.type === 7; +} +function isTagElement(el) { + return el.type === 8; +} +function isNumberSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 0); +} +function isDateTimeSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 1); +} +function createLiteralElement(value) { + return { + type: 0, + value + }; +} +function createNumberElement(value, style) { + return { + type: 2, + value, + style + }; +} +//#endregion +//#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js +const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; +//#endregion +//#region node_modules/.aspect_rules_js/@formatjs_generated+cldr.core@0.0.0/node_modules/@formatjs_generated/cldr.core/time-data.js +const timeData = { + "001": ["H", "h"], + "419": [ + "h", + "H", + "hB", + "hb" + ], + "AC": [ + "H", + "h", + "hb", + "hB" + ], + "AD": ["H", "hB"], + "AE": [ + "h", + "hB", + "hb", + "H" + ], + "AF": [ + "H", + "hb", + "hB", + "h" + ], + "AG": [ + "h", + "hb", + "H", + "hB" + ], + "AI": [ + "H", + "h", + "hb", + "hB" + ], + "AL": [ + "h", + "H", + "hB" + ], + "AM": ["H", "hB"], + "AO": ["H", "hB"], + "AR": [ + "h", + "H", + "hB", + "hb" + ], + "AS": ["h", "H"], + "AT": ["H", "hB"], + "AU": [ + "h", + "hb", + "H", + "hB" + ], + "AW": ["H", "hB"], + "AX": ["H"], + "AZ": [ + "H", + "hB", + "h" + ], + "BA": [ + "H", + "hB", + "h" + ], + "BB": [ + "h", + "hb", + "H", + "hB" + ], + "BD": [ + "h", + "hB", + "H" + ], + "BE": ["H", "hB"], + "BF": ["H", "hB"], + "BG": [ + "H", + "hB", + "h" + ], + "BH": [ + "h", + "hB", + "hb", + "H" + ], + "BI": ["H", "h"], + "BJ": ["H", "hB"], + "BL": ["H", "hB"], + "BM": [ + "h", + "hb", + "H", + "hB" + ], + "BN": [ + "hb", + "hB", + "h", + "H" + ], + "BO": [ + "h", + "H", + "hB", + "hb" + ], + "BQ": ["H"], + "BR": ["H", "hB"], + "BS": [ + "h", + "hb", + "H", + "hB" + ], + "BT": ["h", "H"], + "BW": [ + "H", + "h", + "hb", + "hB" + ], + "BY": ["H", "h"], + "BZ": [ + "H", + "h", + "hb", + "hB" + ], + "CA": [ + "h", + "hb", + "H", + "hB" + ], + "CC": [ + "H", + "h", + "hb", + "hB" + ], + "CD": ["hB", "H"], + "CF": [ + "H", + "h", + "hB" + ], + "CG": ["H", "hB"], + "CH": [ + "H", + "hB", + "h" + ], + "CI": ["H", "hB"], + "CK": [ + "H", + "h", + "hb", + "hB" + ], + "CL": [ + "h", + "H", + "hB", + "hb" + ], + "CM": [ + "H", + "h", + "hB" + ], + "CN": [ + "H", + "hB", + "hb", + "h" + ], + "CO": [ + "h", + "H", + "hB", + "hb" + ], + "CP": ["H"], + "CR": [ + "h", + "H", + "hB", + "hb" + ], + "CU": [ + "h", + "H", + "hB", + "hb" + ], + "CV": ["H", "hB"], + "CW": ["H", "hB"], + "CX": [ + "H", + "h", + "hb", + "hB" + ], + "CY": [ + "h", + "H", + "hb", + "hB" + ], + "CZ": ["H"], + "DE": ["H", "hB"], + "DG": [ + "H", + "h", + "hb", + "hB" + ], + "DJ": ["h", "H"], + "DK": ["H"], + "DM": [ + "h", + "hb", + "H", + "hB" + ], + "DO": [ + "h", + "H", + "hB", + "hb" + ], + "DZ": [ + "h", + "hB", + "hb", + "H" + ], + "EA": [ + "H", + "h", + "hB", + "hb" + ], + "EC": [ + "h", + "H", + "hB", + "hb" + ], + "EE": ["H", "hB"], + "EG": [ + "h", + "hB", + "hb", + "H" + ], + "EH": [ + "h", + "hB", + "hb", + "H" + ], + "ER": ["h", "H"], + "ES": [ + "H", + "hB", + "h", + "hb" + ], + "ET": [ + "hB", + "hb", + "h", + "H" + ], + "FI": ["H"], + "FJ": [ + "h", + "hb", + "H", + "hB" + ], + "FK": [ + "H", + "h", + "hb", + "hB" + ], + "FM": [ + "h", + "hb", + "H", + "hB" + ], + "FO": ["H", "h"], + "FR": ["H", "hB"], + "GA": ["H", "hB"], + "GB": [ + "H", + "h", + "hb", + "hB" + ], + "GD": [ + "h", + "hb", + "H", + "hB" + ], + "GE": [ + "H", + "hB", + "h" + ], + "GF": ["H", "hB"], + "GG": [ + "H", + "h", + "hb", + "hB" + ], + "GH": ["h", "H"], + "GI": [ + "H", + "h", + "hb", + "hB" + ], + "GL": ["H", "h"], + "GM": [ + "h", + "hb", + "H", + "hB" + ], + "GN": ["H", "hB"], + "GP": ["H", "hB"], + "GQ": [ + "H", + "hB", + "h", + "hb" + ], + "GR": [ + "h", + "H", + "hb", + "hB" + ], + "GS": [ + "H", + "h", + "hb", + "hB" + ], + "GT": [ + "h", + "H", + "hB", + "hb" + ], + "GU": [ + "h", + "hb", + "H", + "hB" + ], + "GW": ["H", "hB"], + "GY": [ + "h", + "hb", + "H", + "hB" + ], + "HK": [ + "h", + "hB", + "hb", + "H" + ], + "HN": [ + "h", + "H", + "hB", + "hb" + ], + "HR": ["H", "hB"], + "HU": ["H", "h"], + "IC": [ + "H", + "h", + "hB", + "hb" + ], + "ID": ["H"], + "IE": [ + "H", + "h", + "hb", + "hB" + ], + "IL": ["H", "hB"], + "IM": [ + "H", + "h", + "hb", + "hB" + ], + "IN": ["h", "H"], + "IO": [ + "H", + "h", + "hb", + "hB" + ], + "IQ": [ + "h", + "hB", + "hb", + "H" + ], + "IR": ["hB", "H"], + "IS": ["H"], + "IT": ["H", "hB"], + "JE": [ + "H", + "h", + "hb", + "hB" + ], + "JM": [ + "h", + "hb", + "H", + "hB" + ], + "JO": [ + "h", + "hB", + "hb", + "H" + ], + "JP": [ + "H", + "K", + "h" + ], + "KE": [ + "hB", + "hb", + "H", + "h" + ], + "KG": [ + "H", + "h", + "hB", + "hb" + ], + "KH": [ + "hB", + "h", + "H", + "hb" + ], + "KI": [ + "h", + "hb", + "H", + "hB" + ], + "KM": [ + "H", + "h", + "hB", + "hb" + ], + "KN": [ + "h", + "hb", + "H", + "hB" + ], + "KP": [ + "h", + "H", + "hB", + "hb" + ], + "KR": [ + "h", + "H", + "hB", + "hb" + ], + "KW": [ + "h", + "hB", + "hb", + "H" + ], + "KY": [ + "h", + "hb", + "H", + "hB" + ], + "KZ": ["H", "hB"], + "LA": [ + "H", + "hb", + "hB", + "h" + ], + "LB": [ + "h", + "hB", + "hb", + "H" + ], + "LC": [ + "h", + "hb", + "H", + "hB" + ], + "LI": [ + "H", + "hB", + "h" + ], + "LK": [ + "H", + "h", + "hB", + "hb" + ], + "LR": [ + "h", + "hb", + "H", + "hB" + ], + "LS": ["h", "H"], + "LT": [ + "H", + "h", + "hb", + "hB" + ], + "LU": [ + "H", + "h", + "hB" + ], + "LV": [ + "H", + "hB", + "hb", + "h" + ], + "LY": [ + "h", + "hB", + "hb", + "H" + ], + "MA": [ + "H", + "h", + "hB", + "hb" + ], + "MC": ["H", "hB"], + "MD": ["H", "hB"], + "ME": [ + "H", + "hB", + "h" + ], + "MF": ["H", "hB"], + "MG": ["H", "h"], + "MH": [ + "h", + "hb", + "H", + "hB" + ], + "MK": [ + "H", + "h", + "hb", + "hB" + ], + "ML": ["H"], + "MM": [ + "hB", + "hb", + "H", + "h" + ], + "MN": [ + "H", + "h", + "hb", + "hB" + ], + "MO": [ + "h", + "hB", + "hb", + "H" + ], + "MP": [ + "h", + "hb", + "H", + "hB" + ], + "MQ": ["H", "hB"], + "MR": [ + "h", + "hB", + "hb", + "H" + ], + "MS": [ + "H", + "h", + "hb", + "hB" + ], + "MT": ["H", "h"], + "MU": ["H", "h"], + "MV": ["H", "h"], + "MW": [ + "h", + "hb", + "H", + "hB" + ], + "MX": [ + "h", + "H", + "hB", + "hb" + ], + "MY": [ + "hb", + "hB", + "h", + "H" + ], + "MZ": ["H", "hB"], + "NA": [ + "h", + "H", + "hB", + "hb" + ], + "NC": ["H", "hB"], + "NE": ["H"], + "NF": [ + "H", + "h", + "hb", + "hB" + ], + "NG": [ + "H", + "h", + "hb", + "hB" + ], + "NI": [ + "h", + "H", + "hB", + "hb" + ], + "NL": ["H", "hB"], + "NO": ["H", "h"], + "NP": [ + "H", + "h", + "hB" + ], + "NR": [ + "H", + "h", + "hb", + "hB" + ], + "NU": [ + "H", + "h", + "hb", + "hB" + ], + "NZ": [ + "h", + "hb", + "H", + "hB" + ], + "OM": [ + "h", + "hB", + "hb", + "H" + ], + "PA": [ + "h", + "H", + "hB", + "hb" + ], + "PE": [ + "h", + "H", + "hB", + "hb" + ], + "PF": [ + "H", + "h", + "hB" + ], + "PG": ["h", "H"], + "PH": [ + "h", + "hB", + "hb", + "H" + ], + "PK": [ + "h", + "hB", + "H" + ], + "PL": ["H", "h"], + "PM": ["H", "hB"], + "PN": [ + "H", + "h", + "hb", + "hB" + ], + "PR": [ + "h", + "H", + "hB", + "hb" + ], + "PS": [ + "h", + "hB", + "hb", + "H" + ], + "PT": ["H", "hB"], + "PW": ["h", "H"], + "PY": [ + "h", + "H", + "hB", + "hb" + ], + "QA": [ + "h", + "hB", + "hb", + "H" + ], + "RE": ["H", "hB"], + "RO": ["H", "hB"], + "RS": [ + "H", + "hB", + "h" + ], + "RU": ["H"], + "RW": ["H", "h"], + "SA": [ + "h", + "hB", + "hb", + "H" + ], + "SB": [ + "h", + "hb", + "H", + "hB" + ], + "SC": [ + "H", + "h", + "hB" + ], + "SD": [ + "h", + "hB", + "hb", + "H" + ], + "SE": ["H"], + "SG": [ + "h", + "hb", + "H", + "hB" + ], + "SH": [ + "H", + "h", + "hb", + "hB" + ], + "SI": ["H", "hB"], + "SJ": ["H"], + "SK": ["H"], + "SL": [ + "h", + "hb", + "H", + "hB" + ], + "SM": [ + "H", + "h", + "hB" + ], + "SN": [ + "H", + "h", + "hB" + ], + "SO": ["h", "H"], + "SR": ["H", "hB"], + "SS": [ + "h", + "hb", + "H", + "hB" + ], + "ST": ["H", "hB"], + "SV": [ + "h", + "H", + "hB", + "hb" + ], + "SX": [ + "H", + "h", + "hb", + "hB" + ], + "SY": [ + "h", + "hB", + "hb", + "H" + ], + "SZ": [ + "h", + "hb", + "H", + "hB" + ], + "TA": [ + "H", + "h", + "hb", + "hB" + ], + "TC": [ + "h", + "hb", + "H", + "hB" + ], + "TD": [ + "h", + "H", + "hB" + ], + "TF": [ + "H", + "h", + "hB" + ], + "TG": ["H", "hB"], + "TH": ["H", "h"], + "TJ": ["H", "h"], + "TL": [ + "H", + "hB", + "hb", + "h" + ], + "TM": ["H", "h"], + "TN": [ + "h", + "hB", + "hb", + "H" + ], + "TO": ["h", "H"], + "TR": ["H", "hB"], + "TT": [ + "h", + "hb", + "H", + "hB" + ], + "TW": [ + "hB", + "hb", + "h", + "H" + ], + "TZ": [ + "hB", + "hb", + "H", + "h" + ], + "UA": [ + "H", + "hB", + "h" + ], + "UG": [ + "hB", + "hb", + "H", + "h" + ], + "UM": [ + "h", + "hb", + "H", + "hB" + ], + "US": [ + "h", + "hb", + "H", + "hB" + ], + "UY": [ + "h", + "H", + "hB", + "hb" + ], + "UZ": [ + "H", + "hB", + "h" + ], + "VA": [ + "H", + "h", + "hB" + ], + "VC": [ + "h", + "hb", + "H", + "hB" + ], + "VE": [ + "h", + "H", + "hB", + "hb" + ], + "VG": [ + "h", + "hb", + "H", + "hB" + ], + "VI": [ + "h", + "hb", + "H", + "hB" + ], + "VN": ["H", "h"], + "VU": ["h", "H"], + "WF": ["H", "hB"], + "WS": ["h", "H"], + "XK": [ + "H", + "hB", + "h" + ], + "YE": [ + "h", + "hB", + "hb", + "H" + ], + "YT": ["H", "hB"], + "ZA": [ + "H", + "h", + "hb", + "hB" + ], + "ZM": [ + "h", + "hb", + "H", + "hB" + ], + "ZW": ["H", "h"], + "af-ZA": [ + "H", + "h", + "hB", + "hb" + ], + "ar-001": [ + "h", + "hB", + "hb", + "H" + ], + "ca-ES": [ + "H", + "h", + "hB" + ], + "en-001": [ + "h", + "hb", + "H", + "hB" + ], + "en-HK": [ + "h", + "hb", + "H", + "hB" + ], + "en-IL": [ + "H", + "h", + "hb", + "hB" + ], + "en-MY": [ + "h", + "hb", + "H", + "hB" + ], + "es-BR": [ + "H", + "h", + "hB", + "hb" + ], + "es-ES": [ + "H", + "h", + "hB", + "hb" + ], + "es-GQ": [ + "H", + "h", + "hB", + "hb" + ], + "fr-CA": [ + "H", + "h", + "hB" + ], + "gl-ES": [ + "H", + "h", + "hB" + ], + "gu-IN": [ + "hB", + "hb", + "h", + "H" + ], + "hi-IN": [ + "hB", + "h", + "H" + ], + "it-CH": [ + "H", + "h", + "hB" + ], + "it-IT": [ + "H", + "h", + "hB" + ], + "kn-IN": [ + "hB", + "h", + "H" + ], + "ku-SY": ["H", "hB"], + "ml-IN": [ + "hB", + "h", + "H" + ], + "mr-IN": [ + "hB", + "hb", + "h", + "H" + ], + "pa-IN": [ + "hB", + "hb", + "h", + "H" + ], + "ta-IN": [ + "hB", + "h", + "hb", + "H" + ], + "te-IN": [ + "hB", + "h", + "H" + ], + "zu-ZA": [ + "H", + "hB", + "hb", + "h" + ] +}; +//#endregion +//#region packages/icu-messageformat-parser/date-time-pattern-generator.ts +/** +* Returns the best matching date time pattern if a date time skeleton +* pattern is provided with a locale. Follows the Unicode specification: +* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns +* @param skeleton date time skeleton pattern that possibly includes j, J or C +* @param locale +*/ +function getBestPattern(skeleton, locale) { + let skeletonCopy = ""; + for (let patternPos = 0; patternPos < skeleton.length; patternPos++) { + const patternChar = skeleton.charAt(patternPos); + if (patternChar === "j") { + let extraLength = 0; + while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) { + extraLength++; + patternPos++; + } + let hourLen = 1 + (extraLength & 1); + let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); + let dayPeriodChar = "a"; + let hourChar = getDefaultHourSymbolFromLocale(locale); + if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0; + while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar; + while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy; + } else if (patternChar === "J") skeletonCopy += "H"; + else skeletonCopy += patternChar; + } + return skeletonCopy; +} +/** +* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) +* of the given `locale` to the corresponding time pattern. +* @param locale +*/ +function getDefaultHourSymbolFromLocale(locale) { + let hourCycle = locale.hourCycle; + if (hourCycle === void 0) { + const localeWithHourCycles = locale; + hourCycle = localeWithHourCycles.getHourCycles?.()[0] ?? localeWithHourCycles.hourCycles?.[0]; + } + if (hourCycle) switch (hourCycle) { + case "h24": return "k"; + case "h23": return "H"; + case "h12": return "h"; + case "h11": return "K"; + default: throw new Error("Invalid hourCycle"); + } + const languageTag = locale.language; + let regionTag; + if (languageTag !== "root") regionTag = locale.maximize().region; + return (timeData[`${languageTag}-${regionTag}`] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0].charAt(0); +} +//#endregion +//#region packages/icu-messageformat-parser/parser.ts +const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`); +const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`); +function createLocation(start, end) { + return { + start, + end + }; +} +const hasNativeFromEntries = !!Object.fromEntries; +const hasTrimStart = !!String.prototype.trimStart; +const hasTrimEnd = !!String.prototype.trimEnd; +const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) { + const obj = {}; + for (const [k, v] of entries) obj[k] = v; + return obj; +}; +const trimStart = hasTrimStart ? function trimStart(s) { + return s.trimStart(); +} : function trimStart(s) { + return s.replace(SPACE_SEPARATOR_START_REGEX, ""); +}; +const trimEnd = hasTrimEnd ? function trimEnd(s) { + return s.trimEnd(); +} : function trimEnd(s) { + return s.replace(SPACE_SEPARATOR_END_REGEX, ""); +}; +const IDENTIFIER_PREFIX_RE = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); +function matchIdentifierAtIndex(s, index) { + IDENTIFIER_PREFIX_RE.lastIndex = index; + return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? ""; +} +function plainTopLevelEndPosition(message) { + if (message.length === 0) return null; + let line = 1; + let column = 1; + for (let offset = 0; offset < message.length;) { + const code = message.charCodeAt(offset); + switch (code) { + case 35: + case 39: + case 60: + case 123: + case 125: return null; + } + if (code === 10) { + line++; + column = 1; + offset++; + } else { + column++; + if (code >= 55296 && code <= 56319 && offset + 1 < message.length) { + const next = message.charCodeAt(offset + 1); + offset += next >= 56320 && next <= 57343 ? 2 : 1; + } else offset++; + } + } + return { + offset: message.length, + line, + column + }; +} +var Parser = class { + constructor(message, options = {}) { + this.message = message; + this.position = { + offset: 0, + line: 1, + column: 1 + }; + this.ignoreTag = !!options.ignoreTag; + this.locale = options.locale; + this.requiresOtherClause = !!options.requiresOtherClause; + this.shouldParseSkeletons = !!options.shouldParseSkeletons; + } + parse() { + if (this.offset() !== 0) throw Error("parser can only be used once"); + if (this.message.length > 0) { + const firstCode = this.message.charCodeAt(0); + if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) { + const plainEndPosition = plainTopLevelEndPosition(this.message); + if (plainEndPosition) { + const start = this.clonePosition(); + this.position = plainEndPosition; + return { + val: [{ + type: 0, + value: this.message, + location: createLocation(start, this.clonePosition()) + }], + err: null + }; + } + } + } + return this.parseMessage(0, "", false); + } + parseMessage(nestingLevel, parentArgType, expectingCloseTag) { + let elements = []; + while (!this.isEOF()) { + const char = this.char(); + if (char === 123) { + const result = this.parseArgument(nestingLevel, expectingCloseTag); + if (result.err) return result; + elements.push(result.val); + } else if (char === 125 && nestingLevel > 0) break; + else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { + const position = this.clonePosition(); + this.bump(); + elements.push({ + type: 7, + location: createLocation(position, this.clonePosition()) + }); + } else if (char === 60 && !this.ignoreTag && this.peek() === 47) { + if (expectingCloseTag) break; + else return this.error(26, createLocation(this.clonePosition(), this.clonePosition())); + } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { + const result = this.parseTag(nestingLevel, parentArgType); + if (result.err) return result; + elements.push(result.val); + } else { + const result = this.parseLiteral(nestingLevel, parentArgType); + if (result.err) return result; + elements.push(result.val); + } + } + return { + val: elements, + err: null + }; + } + /** + * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the + * [custom element name][] except that a dash is NOT always mandatory and uppercase letters + * are accepted: + * + * ``` + * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "" + * tagName ::= [a-z] (PENChar)* + * PENChar ::= + * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | + * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | + * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] + * ``` + * + * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name + * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do + * since other tag-based engines like React allow it + */ + parseTag(nestingLevel, parentArgType) { + const startPosition = this.clonePosition(); + this.bump(); + const tagName = this.parseTagName(); + this.bumpSpace(); + if (this.bumpIf("/>")) return { + val: { + type: 0, + value: `<${tagName}/>`, + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + else if (this.bumpIf(">")) { + const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); + if (childrenResult.err) return childrenResult; + const children = childrenResult.val; + const endTagStartPosition = this.clonePosition(); + if (this.bumpIf("")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); + return { + val: { + type: 8, + value: tagName, + children, + location: createLocation(startPosition, this.clonePosition()) + }, + err: null + }; + } else return this.error(27, createLocation(startPosition, this.clonePosition())); + } else return this.error(23, createLocation(startPosition, this.clonePosition())); + } + /** + * This method assumes that the caller has peeked ahead for the first tag character. + */ + parseTagName() { + const startOffset = this.offset(); + this.bump(); + while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump(); + return this.message.slice(startOffset, this.offset()); + } + parseLiteral(nestingLevel, parentArgType) { + const start = this.clonePosition(); + let value = ""; + while (true) { + const parseQuoteResult = this.tryParseQuote(parentArgType); + if (parseQuoteResult) { + value += parseQuoteResult; + continue; + } + const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); + if (parseUnquotedResult) { + value += parseUnquotedResult; + continue; + } + const parseLeftAngleResult = this.tryParseLeftAngleBracket(); + if (parseLeftAngleResult) { + value += parseLeftAngleResult; + continue; + } + break; + } + const location = createLocation(start, this.clonePosition()); + return { + val: { + type: 0, + value, + location + }, + err: null + }; + } + tryParseLeftAngleBracket() { + if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) { + this.bump(); + return "<"; + } + return null; + } + /** + * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes + * a character that requires quoting (that is, "only where needed"), and works the same in + * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. + */ + tryParseQuote(parentArgType) { + if (this.isEOF() || this.char() !== 39) return null; + switch (this.peek()) { + case 39: + this.bump(); + this.bump(); + return "'"; + case 123: + case 60: + case 62: + case 125: break; + case 35: + if (parentArgType === "plural" || parentArgType === "selectordinal") break; + return null; + default: return null; + } + this.bump(); + const codePoints = [this.char()]; + this.bump(); + while (!this.isEOF()) { + const ch = this.char(); + if (ch === 39) { + if (this.peek() === 39) { + codePoints.push(39); + this.bump(); + } else { + this.bump(); + break; + } + } else codePoints.push(ch); + this.bump(); + } + return String.fromCodePoint(...codePoints); + } + tryParseUnquoted(nestingLevel, parentArgType) { + if (this.isEOF()) return null; + const ch = this.char(); + if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null; + else { + this.bump(); + return String.fromCodePoint(ch); + } + } + parseArgument(nestingLevel, expectingCloseTag) { + const openingBracePosition = this.clonePosition(); + this.bump(); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + if (this.char() === 125) { + this.bump(); + return this.error(2, createLocation(openingBracePosition, this.clonePosition())); + } + let value = this.parseIdentifierIfPossible().value; + if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition())); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + switch (this.char()) { + case 125: + this.bump(); + return { + val: { + type: 1, + value, + location: createLocation(openingBracePosition, this.clonePosition()) + }, + err: null + }; + case 44: + this.bump(); + this.bumpSpace(); + if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); + default: return this.error(3, createLocation(openingBracePosition, this.clonePosition())); + } + } + /** + * Advance the parser until the end of the identifier, if it is currently on + * an identifier character. Return an empty string otherwise. + */ + parseIdentifierIfPossible() { + const startingPosition = this.clonePosition(); + const startOffset = this.offset(); + const value = matchIdentifierAtIndex(this.message, startOffset); + const endOffset = startOffset + value.length; + this.bumpTo(endOffset); + return { + value, + location: createLocation(startingPosition, this.clonePosition()) + }; + } + parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) { + let typeStartPosition = this.clonePosition(); + let argType = this.parseIdentifierIfPossible().value; + let typeEndPosition = this.clonePosition(); + switch (argType) { + case "": return this.error(4, createLocation(typeStartPosition, typeEndPosition)); + case "number": + case "date": + case "time": { + this.bumpSpace(); + let styleAndLocation = null; + if (this.bumpIf(",")) { + this.bumpSpace(); + const styleStartPosition = this.clonePosition(); + const result = this.parseSimpleArgStyleIfPossible(); + if (result.err) return result; + const style = trimEnd(result.val); + if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition())); + styleAndLocation = { + style, + styleLocation: createLocation(styleStartPosition, this.clonePosition()) + }; + } + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + const location = createLocation(openingBracePosition, this.clonePosition()); + if (styleAndLocation && styleAndLocation.style.startsWith("::")) { + let skeleton = trimStart(styleAndLocation.style.slice(2)); + if (argType === "number") { + const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); + if (result.err) return result; + return { + val: { + type: 2, + value, + location, + style: result.val + }, + err: null + }; + } else { + if (skeleton.length === 0) return this.error(10, location); + let dateTimePattern = skeleton; + if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale); + const style = { + type: 1, + pattern: dateTimePattern, + location: styleAndLocation.styleLocation, + parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} + }; + return { + val: { + type: argType === "date" ? 3 : 4, + value, + location, + style + }, + err: null + }; + } + } + return { + val: { + type: argType === "number" ? 2 : argType === "date" ? 3 : 4, + value, + location, + style: styleAndLocation?.style ?? null + }, + err: null + }; + } + case "plural": + case "selectordinal": + case "select": { + const typeEndPosition = this.clonePosition(); + this.bumpSpace(); + if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { ...typeEndPosition })); + this.bumpSpace(); + let identifierAndLocation = this.parseIdentifierIfPossible(); + let pluralOffset = 0; + if (argType !== "select" && identifierAndLocation.value === "offset") { + if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition())); + this.bumpSpace(); + const result = this.tryParseDecimalInteger(13, 14); + if (result.err) return result; + this.bumpSpace(); + identifierAndLocation = this.parseIdentifierIfPossible(); + pluralOffset = result.val; + } + const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); + if (optionsResult.err) return optionsResult; + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + const location = createLocation(openingBracePosition, this.clonePosition()); + if (argType === "select") return { + val: { + type: 5, + value, + options: fromEntries(optionsResult.val), + location + }, + err: null + }; + else return { + val: { + type: 6, + value, + options: fromEntries(optionsResult.val), + offset: pluralOffset, + pluralType: argType === "plural" ? "cardinal" : "ordinal", + location + }, + err: null + }; + } + default: return this.error(5, createLocation(typeStartPosition, typeEndPosition)); + } + } + tryParseArgumentClose(openingBracePosition) { + if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); + this.bump(); + return { + val: true, + err: null + }; + } + /** + * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 + */ + parseSimpleArgStyleIfPossible() { + let nestedBraces = 0; + const startPosition = this.clonePosition(); + while (!this.isEOF()) switch (this.char()) { + case 39: { + this.bump(); + let apostrophePosition = this.clonePosition(); + if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition())); + this.bump(); + break; + } + case 123: + nestedBraces += 1; + this.bump(); + break; + case 125: + if (nestedBraces > 0) nestedBraces -= 1; + else return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + break; + default: this.bump(); + } + return { + val: this.message.slice(startPosition.offset, this.offset()), + err: null + }; + } + parseNumberSkeletonFromString(skeleton, location) { + let tokens = []; + try { + tokens = parseNumberSkeletonFromString(skeleton); + } catch { + return this.error(7, location); + } + return { + val: { + type: 0, + tokens, + location, + parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} + }, + err: null + }; + } + /** + * @param nesting_level The current nesting level of messages. + * This can be positive when parsing message fragment in select or plural argument options. + * @param parent_arg_type The parent argument's type. + * @param parsed_first_identifier If provided, this is the first identifier-like selector of + * the argument. It is a by-product of a previous parsing attempt. + * @param expecting_close_tag If true, this message is directly or indirectly nested inside + * between a pair of opening and closing tags. The nested message will not parse beyond + * the closing tag boundary. + */ + tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { + let hasOtherClause = false; + const options = []; + const parsedSelectors = /* @__PURE__ */ new Set(); + let { value: selector, location: selectorLocation } = parsedFirstIdentifier; + while (true) { + if (selector.length === 0) { + const startPosition = this.clonePosition(); + if (parentArgType !== "select" && this.bumpIf("=")) { + const result = this.tryParseDecimalInteger(16, 19); + if (result.err) return result; + selectorLocation = createLocation(startPosition, this.clonePosition()); + selector = this.message.slice(startPosition.offset, this.offset()); + } else break; + } + if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation); + if (selector === "other") hasOtherClause = true; + this.bumpSpace(); + const openingBracePosition = this.clonePosition(); + if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition())); + const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); + if (fragmentResult.err) return fragmentResult; + const argCloseResult = this.tryParseArgumentClose(openingBracePosition); + if (argCloseResult.err) return argCloseResult; + options.push([selector, { + value: fragmentResult.val, + location: createLocation(openingBracePosition, this.clonePosition()) + }]); + parsedSelectors.add(selector); + this.bumpSpace(); + ({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible()); + } + if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition())); + if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition())); + return { + val: options, + err: null + }; + } + tryParseDecimalInteger(expectNumberError, invalidNumberError) { + let sign = 1; + const startingPosition = this.clonePosition(); + if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1; + let hasDigits = false; + let decimal = 0; + while (!this.isEOF()) { + const ch = this.char(); + if (ch >= 48 && ch <= 57) { + hasDigits = true; + decimal = decimal * 10 + (ch - 48); + this.bump(); + } else break; + } + const location = createLocation(startingPosition, this.clonePosition()); + if (!hasDigits) return this.error(expectNumberError, location); + decimal *= sign; + if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location); + return { + val: decimal, + err: null + }; + } + offset() { + return this.position.offset; + } + isEOF() { + return this.offset() === this.message.length; + } + clonePosition() { + return { + offset: this.position.offset, + line: this.position.line, + column: this.position.column + }; + } + /** + * Return the code point at the current position of the parser. + * Throws if the index is out of bound. + */ + char() { + const offset = this.position.offset; + if (offset >= this.message.length) throw Error("out of bound"); + const code = this.message.codePointAt(offset); + if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`); + return code; + } + error(kind, location) { + return { + val: null, + err: { + kind, + message: this.message, + location + } + }; + } + /** Bump the parser to the next UTF-16 code unit. */ + bump() { + if (this.isEOF()) return; + const code = this.char(); + if (code === 10) { + this.position.line += 1; + this.position.column = 1; + this.position.offset += 1; + } else { + this.position.column += 1; + this.position.offset += code < 65536 ? 1 : 2; + } + } + /** + * If the substring starting at the current position of the parser has + * the given prefix, then bump the parser to the character immediately + * following the prefix and return true. Otherwise, don't bump the parser + * and return false. + */ + bumpIf(prefix) { + if (this.message.startsWith(prefix, this.offset())) { + for (let i = 0; i < prefix.length; i++) this.bump(); + return true; + } + return false; + } + /** + * Bump the parser until the pattern character is found and return `true`. + * Otherwise bump to the end of the file and return `false`. + */ + bumpUntil(pattern) { + const currentOffset = this.offset(); + const index = this.message.indexOf(pattern, currentOffset); + if (index >= 0) { + this.bumpTo(index); + return true; + } else { + this.bumpTo(this.message.length); + return false; + } + } + /** + * Bump the parser to the target offset. + * If target offset is beyond the end of the input, bump the parser to the end of the input. + */ + bumpTo(targetOffset) { + if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`); + targetOffset = Math.min(targetOffset, this.message.length); + while (true) { + const offset = this.offset(); + if (offset === targetOffset) break; + if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`); + this.bump(); + if (this.isEOF()) break; + } + } + /** advance the parser through all whitespace to the next non-whitespace code unit. */ + bumpSpace() { + while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump(); + } + /** + * Peek at the *next* Unicode codepoint in the input without advancing the parser. + * If the input has been exhausted, then this returns null. + */ + peek() { + if (this.isEOF()) return null; + const code = this.char(); + const offset = this.offset(); + return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null; + } +}; +/** +* This check if codepoint is alphabet (lower & uppercase) +* @param codepoint +* @returns +*/ +function _isAlpha(codepoint) { + return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; +} +function _isAlphaOrSlash(codepoint) { + return _isAlpha(codepoint) || codepoint === 47; +} +/** See `parseTag` function docs. */ +function _isPotentialElementNameChar(c) { + return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039; +} +/** +* Code point equivalent of regex `\p{White_Space}`. +* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt +*/ +function _isWhiteSpace(c) { + return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233; +} +//#endregion +//#region packages/icu-messageformat-parser/manipulator.ts +/** +* Collect all variables in an AST to Record +* @param ast AST to collect variables from +* @param vars Record of variable name to variable type +*/ +function collectVariables(ast, vars = /* @__PURE__ */ new Map()) { + ast.forEach((el) => { + if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el)) { + if (vars.has(el.value)) { + const existingType = vars.get(el.value); + if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error(`Variable ${el.value} has conflicting types`); + } else vars.set(el.value, el.type); + } + if (isPluralElement(el) || isSelectElement(el)) { + vars.set(el.value, el.type); + Object.keys(el.options).forEach((k) => { + collectVariables(el.options[k].value, vars); + }); + } + if (isTagElement(el)) { + vars.set(el.value, el.type); + collectVariables(el.children, vars); + } + }); +} +/** +* Check if 2 ASTs are structurally the same. This primarily means that +* they have the same variables with the same type +* @param a +* @param b +* @returns +*/ +function isStructurallySame(a, b) { + const aVars = /* @__PURE__ */ new Map(); + const bVars = /* @__PURE__ */ new Map(); + collectVariables(a, aVars); + collectVariables(b, bVars); + if (aVars.size !== bVars.size) return { + success: false, + error: /* @__PURE__ */ new Error(`Different number of variables: [${Array.from(aVars.keys()).join(", ")}] vs [${Array.from(bVars.keys()).join(", ")}]`) + }; + return Array.from(aVars.entries()).reduce((result, [key, type]) => { + if (!result.success) return result; + const bType = bVars.get(key); + if (bType == null) return { + success: false, + error: /* @__PURE__ */ new Error(`Missing variable ${key} in message`) + }; + if (bType !== type) return { + success: false, + error: /* @__PURE__ */ new Error(`Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`) + }; + return result; + }, { success: true }); +} +//#endregion +//#region packages/icu-messageformat-parser/index.ts +function pruneLocation(els) { + els.forEach((el) => { + delete el.location; + if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) { + delete el.options[k].location; + pruneLocation(el.options[k].value); + } + else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location; + else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location; + else if (isTagElement(el)) pruneLocation(el.children); + }); +} +function parse(message, opts = {}) { + opts = { + shouldParseSkeletons: true, + requiresOtherClause: true, + ...opts + }; + const result = new Parser(message, opts).parse(); + if (result.err) { + const error = SyntaxError(ErrorKind[result.err.kind]); + error.location = result.err.location; + error.originalMessage = result.err.message; + throw error; + } + if (!opts?.captureLocation) pruneLocation(result.val); + return result.val; +} +const _Parser = Parser; +//#endregion +export { SKELETON_TYPE, TYPE, _Parser, createLiteralElement, createNumberElement, isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isStructurallySame, isTagElement, isTimeElement, parse }; + +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js.map b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..362c6e43d4ceed6d9eed0344940d31d0b329eead --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":[],"sources":["../error.ts","../types.ts","../../../node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js","../../../node_modules/.aspect_rules_js/@formatjs_generated+cldr.core@0.0.0/node_modules/@formatjs_generated/cldr.core/time-data.js","../date-time-pattern-generator.ts","../parser.ts","../manipulator.ts","../index.ts"],"sourcesContent":["import {type Location} from '#packages/icu-messageformat-parser/types.js'\n\nexport interface ParserError {\n kind: ErrorKind\n message: string\n location: Location\n}\n\nexport enum ErrorKind {\n /** Argument is unclosed (e.g. `{0`) */\n EXPECT_ARGUMENT_CLOSING_BRACE = 1,\n /** Argument is empty (e.g. `{}`). */\n EMPTY_ARGUMENT = 2,\n /** Argument is malformed (e.g. `{foo!}``) */\n MALFORMED_ARGUMENT = 3,\n /** Expect an argument type (e.g. `{foo,}`) */\n EXPECT_ARGUMENT_TYPE = 4,\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n INVALID_ARGUMENT_TYPE = 5,\n /** Expect an argument style (e.g. `{foo, number, }`) */\n EXPECT_ARGUMENT_STYLE = 6,\n /** The number skeleton is invalid. */\n INVALID_NUMBER_SKELETON = 7,\n /** The date time skeleton is invalid. */\n INVALID_DATE_TIME_SKELETON = 8,\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n EXPECT_NUMBER_SKELETON = 9,\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n EXPECT_DATE_TIME_SKELETON = 10,\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11,\n /** Missing select argument options (e.g. `{foo, select}`) */\n EXPECT_SELECT_ARGUMENT_OPTIONS = 12,\n\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13,\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14,\n\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n EXPECT_SELECT_ARGUMENT_SELECTOR = 15,\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n EXPECT_PLURAL_ARGUMENT_SELECTOR = 16,\n\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17,\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18,\n\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n INVALID_PLURAL_ARGUMENT_SELECTOR = 19,\n\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20,\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21,\n\n /** Plural or select argument option must have `other` clause. */\n MISSING_OTHER_CLAUSE = 22,\n\n /** The tag is malformed. (e.g. `foo) */\n INVALID_TAG = 23,\n /** The tag name is invalid. (e.g. `<123>foo`) */\n INVALID_TAG_NAME = 25,\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n UNMATCHED_CLOSING_TAG = 26,\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n UNCLOSED_TAG = 27,\n}\n","import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {type NumberSkeletonToken} from '@formatjs/icu-skeleton-parser'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\n\nexport enum TYPE {\n /**\n * Raw text\n */\n literal,\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n argument,\n /**\n * Variable w/ number format\n */\n number,\n /**\n * Variable w/ date format\n */\n date,\n /**\n * Variable w/ time format\n */\n time,\n /**\n * Variable w/ select format\n */\n select,\n /**\n * Variable w/ plural format\n */\n plural,\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n pound,\n /**\n * XML-like tag\n */\n tag,\n}\n\nexport enum SKELETON_TYPE {\n number,\n dateTime,\n}\n\nexport interface LocationDetails {\n offset: number\n line: number\n column: number\n}\nexport interface Location {\n start: LocationDetails\n end: LocationDetails\n}\n\nexport interface BaseElement {\n type: T\n value: string\n location?: Location\n}\n\nexport type LiteralElement = BaseElement\nexport type ArgumentElement = BaseElement\nexport interface TagElement extends BaseElement {\n children: MessageFormatElement[]\n}\n\nexport interface SimpleFormatElement<\n T extends TYPE,\n S extends Skeleton,\n> extends BaseElement {\n style?: string | S | null\n}\n\nexport type NumberElement = SimpleFormatElement\nexport type DateElement = SimpleFormatElement\nexport type TimeElement = SimpleFormatElement\n\nexport type ValidPluralRule =\n | 'zero'\n | 'one'\n | 'two'\n | 'few'\n | 'many'\n | 'other'\n | string\n\nexport interface PluralOrSelectOption {\n value: MessageFormatElement[]\n location?: Location\n}\n\nexport interface SelectElement extends BaseElement {\n options: Record\n}\n\nexport interface PluralElement extends BaseElement {\n options: Record\n offset: number\n pluralType: Intl.PluralRulesOptions['type']\n}\n\nexport interface PoundElement {\n type: TYPE.pound\n location?: Location\n}\n\nexport type MessageFormatElement =\n | ArgumentElement\n | DateElement\n | LiteralElement\n | NumberElement\n | PluralElement\n | PoundElement\n | SelectElement\n | TagElement\n | TimeElement\n\nexport interface NumberSkeleton {\n type: SKELETON_TYPE.number\n tokens: NumberSkeletonToken[]\n location?: Location\n parsedOptions: ExtendedNumberFormatOptions\n}\n\nexport interface DateTimeSkeleton {\n type: SKELETON_TYPE.dateTime\n pattern: string\n location?: Location\n parsedOptions: Intl.DateTimeFormatOptions\n}\n\nexport type Skeleton = NumberSkeleton | DateTimeSkeleton\n\n/**\n * Type Guards\n */\nexport function isLiteralElement(\n el: MessageFormatElement\n): el is LiteralElement {\n return el.type === TYPE.literal\n}\nexport function isArgumentElement(\n el: MessageFormatElement\n): el is ArgumentElement {\n return el.type === TYPE.argument\n}\nexport function isNumberElement(el: MessageFormatElement): el is NumberElement {\n return el.type === TYPE.number\n}\nexport function isDateElement(el: MessageFormatElement): el is DateElement {\n return el.type === TYPE.date\n}\nexport function isTimeElement(el: MessageFormatElement): el is TimeElement {\n return el.type === TYPE.time\n}\nexport function isSelectElement(el: MessageFormatElement): el is SelectElement {\n return el.type === TYPE.select\n}\nexport function isPluralElement(el: MessageFormatElement): el is PluralElement {\n return el.type === TYPE.plural\n}\nexport function isPoundElement(el: MessageFormatElement): el is PoundElement {\n return el.type === TYPE.pound\n}\nexport function isTagElement(el: MessageFormatElement): el is TagElement {\n return el.type === TYPE.tag\n}\nexport function isNumberSkeleton(\n el: NumberElement['style'] | Skeleton\n): el is NumberSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number)\n}\nexport function isDateTimeSkeleton(\n el?: DateElement['style'] | TimeElement['style'] | Skeleton\n): el is DateTimeSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime)\n}\n\nexport function createLiteralElement(value: string): LiteralElement {\n return {\n type: TYPE.literal,\n value,\n }\n}\n\nexport function createNumberElement(\n value: string,\n style?: string | null\n): NumberElement {\n return {\n type: TYPE.number,\n value,\n style,\n }\n}\n","// @generated from regex-gen.ts\nexport const SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport const WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","// @generated from time-data-gen.ts\n// prettier-ignore\nexport const timeData = {\n\t\"001\": [\"H\", \"h\"],\n\t\"419\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"AC\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"AD\": [\"H\", \"hB\"],\n\t\"AE\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"AF\": [\n\t\t\"H\",\n\t\t\"hb\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"AG\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"AI\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"AL\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"AM\": [\"H\", \"hB\"],\n\t\"AO\": [\"H\", \"hB\"],\n\t\"AR\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"AS\": [\"h\", \"H\"],\n\t\"AT\": [\"H\", \"hB\"],\n\t\"AU\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"AW\": [\"H\", \"hB\"],\n\t\"AX\": [\"H\"],\n\t\"AZ\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"BA\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"BB\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"BD\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"H\"\n\t],\n\t\"BE\": [\"H\", \"hB\"],\n\t\"BF\": [\"H\", \"hB\"],\n\t\"BG\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"BH\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"BI\": [\"H\", \"h\"],\n\t\"BJ\": [\"H\", \"hB\"],\n\t\"BL\": [\"H\", \"hB\"],\n\t\"BM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"BN\": [\n\t\t\"hb\",\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"BO\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"BQ\": [\"H\"],\n\t\"BR\": [\"H\", \"hB\"],\n\t\"BS\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"BT\": [\"h\", \"H\"],\n\t\"BW\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"BY\": [\"H\", \"h\"],\n\t\"BZ\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"CA\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"CC\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"CD\": [\"hB\", \"H\"],\n\t\"CF\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"CG\": [\"H\", \"hB\"],\n\t\"CH\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"CI\": [\"H\", \"hB\"],\n\t\"CK\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"CL\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"CM\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"CN\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\"\n\t],\n\t\"CO\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"CP\": [\"H\"],\n\t\"CR\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"CU\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"CV\": [\"H\", \"hB\"],\n\t\"CW\": [\"H\", \"hB\"],\n\t\"CX\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"CY\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"CZ\": [\"H\"],\n\t\"DE\": [\"H\", \"hB\"],\n\t\"DG\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"DJ\": [\"h\", \"H\"],\n\t\"DK\": [\"H\"],\n\t\"DM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"DO\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"DZ\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"EA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"EC\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"EE\": [\"H\", \"hB\"],\n\t\"EG\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"EH\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"ER\": [\"h\", \"H\"],\n\t\"ES\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"hb\"\n\t],\n\t\"ET\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"FI\": [\"H\"],\n\t\"FJ\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"FK\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"FM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"FO\": [\"H\", \"h\"],\n\t\"FR\": [\"H\", \"hB\"],\n\t\"GA\": [\"H\", \"hB\"],\n\t\"GB\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"GD\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"GE\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"GF\": [\"H\", \"hB\"],\n\t\"GG\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"GH\": [\"h\", \"H\"],\n\t\"GI\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"GL\": [\"H\", \"h\"],\n\t\"GM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"GN\": [\"H\", \"hB\"],\n\t\"GP\": [\"H\", \"hB\"],\n\t\"GQ\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"hb\"\n\t],\n\t\"GR\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"GS\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"GT\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"GU\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"GW\": [\"H\", \"hB\"],\n\t\"GY\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"HK\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"HN\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"HR\": [\"H\", \"hB\"],\n\t\"HU\": [\"H\", \"h\"],\n\t\"IC\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"ID\": [\"H\"],\n\t\"IE\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"IL\": [\"H\", \"hB\"],\n\t\"IM\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"IN\": [\"h\", \"H\"],\n\t\"IO\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"IQ\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"IR\": [\"hB\", \"H\"],\n\t\"IS\": [\"H\"],\n\t\"IT\": [\"H\", \"hB\"],\n\t\"JE\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"JM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"JO\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"JP\": [\n\t\t\"H\",\n\t\t\"K\",\n\t\t\"h\"\n\t],\n\t\"KE\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"h\"\n\t],\n\t\"KG\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"KH\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hb\"\n\t],\n\t\"KI\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"KM\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"KN\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"KP\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"KR\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"KW\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"KY\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"KZ\": [\"H\", \"hB\"],\n\t\"LA\": [\n\t\t\"H\",\n\t\t\"hb\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"LB\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"LC\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"LI\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"LK\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"LR\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"LS\": [\"h\", \"H\"],\n\t\"LT\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"LU\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"LV\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\"\n\t],\n\t\"LY\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"MA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"MC\": [\"H\", \"hB\"],\n\t\"MD\": [\"H\", \"hB\"],\n\t\"ME\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"MF\": [\"H\", \"hB\"],\n\t\"MG\": [\"H\", \"h\"],\n\t\"MH\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"MK\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"ML\": [\"H\"],\n\t\"MM\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"h\"\n\t],\n\t\"MN\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"MO\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"MP\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"MQ\": [\"H\", \"hB\"],\n\t\"MR\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"MS\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"MT\": [\"H\", \"h\"],\n\t\"MU\": [\"H\", \"h\"],\n\t\"MV\": [\"H\", \"h\"],\n\t\"MW\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"MX\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"MY\": [\n\t\t\"hb\",\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"MZ\": [\"H\", \"hB\"],\n\t\"NA\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"NC\": [\"H\", \"hB\"],\n\t\"NE\": [\"H\"],\n\t\"NF\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"NG\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"NI\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"NL\": [\"H\", \"hB\"],\n\t\"NO\": [\"H\", \"h\"],\n\t\"NP\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"NR\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"NU\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"NZ\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"OM\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"PA\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"PE\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"PF\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"PG\": [\"h\", \"H\"],\n\t\"PH\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"PK\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"H\"\n\t],\n\t\"PL\": [\"H\", \"h\"],\n\t\"PM\": [\"H\", \"hB\"],\n\t\"PN\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"PR\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"PS\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"PT\": [\"H\", \"hB\"],\n\t\"PW\": [\"h\", \"H\"],\n\t\"PY\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"QA\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"RE\": [\"H\", \"hB\"],\n\t\"RO\": [\"H\", \"hB\"],\n\t\"RS\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"RU\": [\"H\"],\n\t\"RW\": [\"H\", \"h\"],\n\t\"SA\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"SB\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"SC\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"SD\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"SE\": [\"H\"],\n\t\"SG\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"SH\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"SI\": [\"H\", \"hB\"],\n\t\"SJ\": [\"H\"],\n\t\"SK\": [\"H\"],\n\t\"SL\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"SM\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"SN\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"SO\": [\"h\", \"H\"],\n\t\"SR\": [\"H\", \"hB\"],\n\t\"SS\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"ST\": [\"H\", \"hB\"],\n\t\"SV\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"SX\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"SY\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"SZ\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"TA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"TC\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"TD\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"TF\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"TG\": [\"H\", \"hB\"],\n\t\"TH\": [\"H\", \"h\"],\n\t\"TJ\": [\"H\", \"h\"],\n\t\"TL\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\"\n\t],\n\t\"TM\": [\"H\", \"h\"],\n\t\"TN\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"TO\": [\"h\", \"H\"],\n\t\"TR\": [\"H\", \"hB\"],\n\t\"TT\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"TW\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"TZ\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"h\"\n\t],\n\t\"UA\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"UG\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"h\"\n\t],\n\t\"UM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"US\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"UY\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"UZ\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"VA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"VC\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"VE\": [\n\t\t\"h\",\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"VG\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"VI\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"VN\": [\"H\", \"h\"],\n\t\"VU\": [\"h\", \"H\"],\n\t\"WF\": [\"H\", \"hB\"],\n\t\"WS\": [\"h\", \"H\"],\n\t\"XK\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"h\"\n\t],\n\t\"YE\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"YT\": [\"H\", \"hB\"],\n\t\"ZA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"ZM\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"ZW\": [\"H\", \"h\"],\n\t\"af-ZA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"ar-001\": [\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"ca-ES\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"en-001\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"en-HK\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"en-IL\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"hB\"\n\t],\n\t\"en-MY\": [\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\",\n\t\t\"hB\"\n\t],\n\t\"es-BR\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"es-ES\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"es-GQ\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\",\n\t\t\"hb\"\n\t],\n\t\"fr-CA\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"gl-ES\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"gu-IN\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"hi-IN\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"it-CH\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"it-IT\": [\n\t\t\"H\",\n\t\t\"h\",\n\t\t\"hB\"\n\t],\n\t\"kn-IN\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"ku-SY\": [\"H\", \"hB\"],\n\t\"ml-IN\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"mr-IN\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"pa-IN\": [\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"ta-IN\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"hb\",\n\t\t\"H\"\n\t],\n\t\"te-IN\": [\n\t\t\"hB\",\n\t\t\"h\",\n\t\t\"H\"\n\t],\n\t\"zu-ZA\": [\n\t\t\"H\",\n\t\t\"hB\",\n\t\t\"hb\",\n\t\t\"h\"\n\t]\n};\n","import {timeData} from '@formatjs_generated/cldr.core/time-data.js'\n\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton: string, locale: Intl.Locale): string {\n let skeletonCopy = ''\n for (let patternPos = 0; patternPos < skeleton.length; patternPos++) {\n const patternChar = skeleton.charAt(patternPos)\n\n if (patternChar === 'j') {\n let extraLength = 0\n while (\n patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar\n ) {\n extraLength++\n patternPos++\n }\n\n let hourLen = 1 + (extraLength & 1)\n let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1)\n let dayPeriodChar = 'a'\n let hourChar = getDefaultHourSymbolFromLocale(locale)\n\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0\n }\n\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy\n }\n } else if (patternChar === 'J') {\n skeletonCopy += 'H'\n } else {\n skeletonCopy += patternChar\n }\n }\n\n return skeletonCopy\n}\n\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale: Intl.Locale): string {\n let hourCycle: string | undefined = locale.hourCycle\n\n if (hourCycle === undefined) {\n const localeWithHourCycles = locale as Intl.Locale & {\n getHourCycles?: () => string[]\n hourCycles?: string[]\n }\n hourCycle =\n localeWithHourCycles.getHourCycles?.()[0] ??\n localeWithHourCycles.hourCycles?.[0]\n }\n\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k'\n case 'h23':\n return 'H'\n case 'h12':\n return 'h'\n case 'h11':\n return 'K'\n default:\n throw new Error('Invalid hourCycle')\n }\n }\n\n // TODO: Once hourCycle is fully supported remove the following with data generation\n const languageTag = locale.language\n let regionTag: string | undefined\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region\n }\n const hourCycles =\n timeData[`${languageTag}-${regionTag}`] ||\n timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[`${languageTag}-001`] ||\n timeData['001']\n return hourCycles[0].charAt(0)\n}\n","import {\n ErrorKind,\n type ParserError,\n} from '#packages/icu-messageformat-parser/error.js'\nimport {\n type DateTimeSkeleton,\n type LiteralElement,\n type Location,\n type MessageFormatElement,\n type NumberSkeleton,\n type PluralOrSelectOption,\n SKELETON_TYPE,\n type TagElement,\n TYPE,\n} from '#packages/icu-messageformat-parser/types.js'\nimport {SPACE_SEPARATOR_REGEX} from '@formatjs_generated/unicode/icu-messageformat-parser-regex.js'\nimport {\n type NumberSkeletonToken,\n parseNumberSkeleton,\n parseNumberSkeletonFromString,\n parseDateTimeSkeleton,\n} from '@formatjs/icu-skeleton-parser'\nimport {getBestPattern} from '#packages/icu-messageformat-parser/date-time-pattern-generator.js'\n\nconst SPACE_SEPARATOR_START_REGEX = new RegExp(\n `^${SPACE_SEPARATOR_REGEX.source}*`\n)\nconst SPACE_SEPARATOR_END_REGEX = new RegExp(\n `${SPACE_SEPARATOR_REGEX.source}*$`\n)\n\nexport interface Position {\n /** Offset in terms of UTF-16 *code unit*. */\n offset: number\n line: number\n /** Column offset in terms of unicode *code point*. */\n column: number\n}\n\nexport interface ParserOptions {\n /**\n * Whether to treat HTML/XML tags as string literal\n * instead of parsing them as tag token.\n * When this is false we only allow simple tags without\n * any attributes\n */\n ignoreTag?: boolean\n /**\n * Should `select`, `selectordinal`, and `plural` arguments always include\n * the `other` case clause.\n */\n requiresOtherClause?: boolean\n /**\n * Whether to parse number/datetime skeleton\n * into Intl.NumberFormatOptions and Intl.DateTimeFormatOptions, respectively.\n */\n shouldParseSkeletons?: boolean\n /**\n * Capture location info in AST\n * Default is false\n */\n captureLocation?: boolean\n /**\n * Instance of Intl.Locale to resolve locale-dependent skeleton\n */\n locale?: Intl.Locale\n}\n\nexport type Result = {val: T; err: null} | {val: null; err: E}\ntype ArgType =\n | 'number'\n | 'date'\n | 'time'\n | 'select'\n | 'plural'\n | 'selectordinal'\n | ''\n\nfunction createLocation(start: Position, end: Position): Location {\n return {start, end}\n}\n\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nconst hasNativeFromEntries = !!(Object as any).fromEntries\nconst hasTrimStart = !!(String.prototype as any).trimStart\nconst hasTrimEnd = !!(String.prototype as any).trimEnd\n\nconst fromEntries: (\n entries: readonly (readonly [string, T])[]\n) => {[k: string]: T} =\n // native\n hasNativeFromEntries\n ? (Object as any).fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n const obj: Record = {}\n for (const [k, v] of entries) {\n obj[k] = v\n }\n return obj\n }\n\nconst trimStart: (s: string) => string = hasTrimStart\n ? // Native\n function trimStart(s) {\n return (s as any).trimStart()\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '')\n }\n\nconst trimEnd: (s: string) => string = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return (s as any).trimEnd()\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '')\n }\n\n// #endregion\n\nconst IDENTIFIER_PREFIX_RE = new RegExp(\n '([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)',\n 'yu'\n)\n\nfunction matchIdentifierAtIndex(s: string, index: number): string {\n IDENTIFIER_PREFIX_RE.lastIndex = index\n const match = IDENTIFIER_PREFIX_RE.exec(s)!\n return match[1] ?? ''\n}\n\nfunction plainTopLevelEndPosition(message: string): Position | null {\n if (message.length === 0) {\n return null\n }\n let line = 1\n let column = 1\n for (let offset = 0; offset < message.length;) {\n const code = message.charCodeAt(offset)\n switch (code) {\n case 35: // #\n case 39: // '\n case 60: // <\n case 123: // {\n case 125: // }\n return null\n }\n if (code === 10 /* '\\n' */) {\n line++\n column = 1\n offset++\n } else {\n column++\n if (code >= 0xd800 && code <= 0xdbff && offset + 1 < message.length) {\n const next = message.charCodeAt(offset + 1)\n offset += next >= 0xdc00 && next <= 0xdfff ? 2 : 1\n } else {\n offset++\n }\n }\n }\n return {offset: message.length, line, column}\n}\n\nexport class Parser {\n private message: string\n private position: Position\n private locale?: Intl.Locale\n\n private ignoreTag: boolean\n private requiresOtherClause: boolean\n private shouldParseSkeletons?: boolean\n\n constructor(message: string, options: ParserOptions = {}) {\n this.message = message\n this.position = {offset: 0, line: 1, column: 1}\n this.ignoreTag = !!options.ignoreTag\n this.locale = options.locale\n this.requiresOtherClause = !!options.requiresOtherClause\n this.shouldParseSkeletons = !!options.shouldParseSkeletons\n }\n\n parse(): Result {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once')\n }\n if (this.message.length > 0) {\n const firstCode = this.message.charCodeAt(0)\n if (\n firstCode !== 35 /* # */ &&\n firstCode !== 39 /* ' */ &&\n firstCode !== 60 /* < */ &&\n firstCode !== 123 /* { */ &&\n firstCode !== 125 /* } */\n ) {\n const plainEndPosition = plainTopLevelEndPosition(this.message)\n if (plainEndPosition) {\n const start = this.clonePosition()\n this.position = plainEndPosition\n return {\n val: [\n {\n type: TYPE.literal,\n value: this.message,\n location: createLocation(start, this.clonePosition()),\n },\n ],\n err: null,\n }\n }\n }\n }\n return this.parseMessage(0, '', false)\n }\n\n private parseMessage(\n nestingLevel: number,\n parentArgType: ArgType,\n expectingCloseTag: boolean\n ): Result {\n let elements: MessageFormatElement[] = []\n\n while (!this.isEOF()) {\n const char = this.char()\n if (char === 123 /* `{` */) {\n const result = this.parseArgument(nestingLevel, expectingCloseTag)\n if (result.err) {\n return result\n }\n elements.push(result.val)\n } else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break\n } else if (\n char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')\n ) {\n const position = this.clonePosition()\n this.bump()\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n })\n } else if (\n char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break\n } else {\n return this.error(\n ErrorKind.UNMATCHED_CLOSING_TAG,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n } else if (\n char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)\n ) {\n const result = this.parseTag(nestingLevel, parentArgType)\n if (result.err) {\n return result\n }\n elements.push(result.val)\n } else {\n const result = this.parseLiteral(nestingLevel, parentArgType)\n if (result.err) {\n return result\n }\n elements.push(result.val)\n }\n }\n\n return {val: elements, err: null}\n }\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n private parseTag(\n nestingLevel: number,\n parentArgType: ArgType\n ): Result {\n const startPosition = this.clonePosition()\n this.bump() // `<`\n\n const tagName = this.parseTagName()\n this.bumpSpace()\n\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: `<${tagName}/>`,\n location: createLocation(startPosition, this.clonePosition()),\n } as LiteralElement,\n err: null,\n }\n } else if (this.bumpIf('>')) {\n const childrenResult = this.parseMessage(\n nestingLevel + 1,\n parentArgType,\n true\n )\n if (childrenResult.err) {\n return childrenResult\n }\n const children = childrenResult.val\n\n // Expecting a close tag\n const endTagStartPosition = this.clonePosition()\n\n if (this.bumpIf('')) {\n return this.error(\n ErrorKind.INVALID_TAG,\n createLocation(endTagStartPosition, this.clonePosition())\n )\n }\n\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n }\n } else {\n return this.error(\n ErrorKind.UNCLOSED_TAG,\n createLocation(startPosition, this.clonePosition())\n )\n }\n } else {\n return this.error(\n ErrorKind.INVALID_TAG,\n createLocation(startPosition, this.clonePosition())\n )\n }\n }\n\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n private parseTagName(): string {\n const startOffset = this.offset()\n\n this.bump() // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump()\n }\n return this.message.slice(startOffset, this.offset())\n }\n\n private parseLiteral(\n nestingLevel: number,\n parentArgType: ArgType\n ): Result {\n const start = this.clonePosition()\n\n let value = ''\n while (true) {\n const parseQuoteResult = this.tryParseQuote(parentArgType)\n if (parseQuoteResult) {\n value += parseQuoteResult\n continue\n }\n\n const parseUnquotedResult = this.tryParseUnquoted(\n nestingLevel,\n parentArgType\n )\n if (parseUnquotedResult) {\n value += parseUnquotedResult\n continue\n }\n\n const parseLeftAngleResult = this.tryParseLeftAngleBracket()\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult\n continue\n }\n\n break\n }\n\n const location = createLocation(start, this.clonePosition())\n return {\n val: {type: TYPE.literal, value, location},\n err: null,\n }\n }\n\n tryParseLeftAngleBracket(): string | null {\n if (\n !this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))\n ) {\n this.bump() // `<`\n return '<'\n }\n return null\n }\n\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n private tryParseQuote(parentArgType: ArgType): string | null {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null\n }\n\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump()\n this.bump()\n return \"'\"\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break\n }\n return null\n default:\n return null\n }\n\n this.bump() // apostrophe\n const codePoints = [this.char()] // escaped char\n this.bump()\n\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n const ch = this.char()\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39)\n // Bump one more time because we need to skip 2 characters.\n this.bump()\n } else {\n // Optional closing apostrophe.\n this.bump()\n break\n }\n } else {\n codePoints.push(ch)\n }\n this.bump()\n }\n\n return String.fromCodePoint(...codePoints)\n }\n\n private tryParseUnquoted(\n nestingLevel: number,\n parentArgType: ArgType\n ): string | null {\n if (this.isEOF()) {\n return null\n }\n const ch = this.char()\n\n if (\n ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)\n ) {\n return null\n } else {\n this.bump()\n return String.fromCodePoint(ch)\n }\n }\n\n private parseArgument(\n nestingLevel: number,\n expectingCloseTag: boolean\n ): Result {\n const openingBracePosition = this.clonePosition()\n this.bump() // `{`\n\n this.bumpSpace()\n\n if (this.isEOF()) {\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n\n if (this.char() === 125 /* `}` */) {\n this.bump()\n return this.error(\n ErrorKind.EMPTY_ARGUMENT,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n\n // argument name\n let value = this.parseIdentifierIfPossible().value\n if (!value) {\n return this.error(\n ErrorKind.MALFORMED_ARGUMENT,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n\n this.bumpSpace()\n\n if (this.isEOF()) {\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump() // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value,\n location: createLocation(\n openingBracePosition,\n this.clonePosition()\n ),\n },\n err: null,\n }\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump() // `,`\n this.bumpSpace()\n\n if (this.isEOF()) {\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n\n return this.parseArgumentOptions(\n nestingLevel,\n expectingCloseTag,\n value,\n openingBracePosition\n )\n }\n default:\n return this.error(\n ErrorKind.MALFORMED_ARGUMENT,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n }\n\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n private parseIdentifierIfPossible(): {value: string; location: Location} {\n const startingPosition = this.clonePosition()\n\n const startOffset = this.offset()\n const value = matchIdentifierAtIndex(this.message, startOffset)\n const endOffset = startOffset + value.length\n\n this.bumpTo(endOffset)\n\n const endPosition = this.clonePosition()\n const location = createLocation(startingPosition, endPosition)\n\n return {value, location}\n }\n\n private parseArgumentOptions(\n nestingLevel: number,\n expectingCloseTag: boolean,\n value: string,\n openingBracePosition: Position\n ): Result {\n // Parse this range:\n // {name, type, style}\n // ^---^\n let typeStartPosition = this.clonePosition()\n let argType = this.parseIdentifierIfPossible().value\n let typeEndPosition = this.clonePosition()\n\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_TYPE,\n createLocation(typeStartPosition, typeEndPosition)\n )\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace()\n let styleAndLocation: {\n style: string\n styleLocation: Location\n } | null = null\n\n if (this.bumpIf(',')) {\n this.bumpSpace()\n\n const styleStartPosition = this.clonePosition()\n const result = this.parseSimpleArgStyleIfPossible()\n if (result.err) {\n return result\n }\n const style = trimEnd(result.val)\n\n if (style.length === 0) {\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_STYLE,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n\n const styleLocation = createLocation(\n styleStartPosition,\n this.clonePosition()\n )\n styleAndLocation = {style, styleLocation}\n }\n\n const argCloseResult = this.tryParseArgumentClose(openingBracePosition)\n if (argCloseResult.err) {\n return argCloseResult\n }\n\n const location = createLocation(\n openingBracePosition,\n this.clonePosition()\n )\n\n // Extract style or skeleton\n if (styleAndLocation && styleAndLocation.style.startsWith('::')) {\n // Skeleton starts with `::`.\n let skeleton = trimStart(styleAndLocation.style.slice(2))\n\n if (argType === 'number') {\n const result = this.parseNumberSkeletonFromString(\n skeleton,\n styleAndLocation.styleLocation\n )\n if (result.err) {\n return result\n }\n return {\n val: {type: TYPE.number, value, location, style: result.val},\n err: null,\n }\n } else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location)\n }\n\n let dateTimePattern = skeleton\n\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale)\n }\n\n const style: DateTimeSkeleton = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n }\n\n const type = argType === 'date' ? TYPE.date : TYPE.time\n return {\n val: {type, value, location, style},\n err: null,\n }\n }\n }\n\n // Regular style or no style.\n return {\n val: {\n type:\n argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value,\n location,\n style: styleAndLocation?.style ?? null,\n },\n err: null,\n }\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n const typeEndPosition = this.clonePosition()\n this.bumpSpace()\n\n if (!this.bumpIf(',')) {\n return this.error(\n ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS,\n createLocation(typeEndPosition, {...typeEndPosition})\n )\n }\n this.bumpSpace()\n\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n let identifierAndLocation = this.parseIdentifierIfPossible()\n\n let pluralOffset = 0\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(\n ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n this.bumpSpace()\n const result = this.tryParseDecimalInteger(\n ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,\n ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\n )\n if (result.err) {\n return result\n }\n\n // Parse another identifier for option parsing\n this.bumpSpace()\n identifierAndLocation = this.parseIdentifierIfPossible()\n\n pluralOffset = result.val\n }\n\n const optionsResult = this.tryParsePluralOrSelectOptions(\n nestingLevel,\n argType,\n expectingCloseTag,\n identifierAndLocation\n )\n if (optionsResult.err) {\n return optionsResult\n }\n\n const argCloseResult = this.tryParseArgumentClose(openingBracePosition)\n if (argCloseResult.err) {\n return argCloseResult\n }\n\n const location = createLocation(\n openingBracePosition,\n this.clonePosition()\n )\n\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value,\n options: fromEntries(optionsResult.val),\n location,\n },\n err: null,\n }\n } else {\n return {\n val: {\n type: TYPE.plural,\n value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location,\n },\n err: null,\n }\n }\n }\n default:\n return this.error(\n ErrorKind.INVALID_ARGUMENT_TYPE,\n createLocation(typeStartPosition, typeEndPosition)\n )\n }\n }\n\n private tryParseArgumentClose(\n openingBracePosition: Position\n ): Result {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(\n ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,\n createLocation(openingBracePosition, this.clonePosition())\n )\n }\n this.bump() // `}`\n return {val: true, err: null}\n }\n\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n private parseSimpleArgStyleIfPossible(): Result {\n let nestedBraces = 0\n\n const startPosition = this.clonePosition()\n while (!this.isEOF()) {\n const ch = this.char()\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump()\n let apostrophePosition = this.clonePosition()\n\n if (!this.bumpUntil(\"'\")) {\n return this.error(\n ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,\n createLocation(apostrophePosition, this.clonePosition())\n )\n }\n this.bump()\n break\n }\n case 123 /* `{` */: {\n nestedBraces += 1\n this.bump()\n break\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1\n } else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n }\n }\n break\n }\n default:\n this.bump()\n break\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n }\n }\n\n private parseNumberSkeletonFromString(\n skeleton: string,\n location: Location\n ): Result {\n let tokens: NumberSkeletonToken[] = []\n try {\n tokens = parseNumberSkeletonFromString(skeleton)\n } catch {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location)\n }\n\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens,\n location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n }\n }\n\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n private tryParsePluralOrSelectOptions(\n nestingLevel: number,\n parentArgType: ArgType,\n expectCloseTag: boolean,\n parsedFirstIdentifier: {value: string; location: Location}\n ): Result<[string, PluralOrSelectOption][], ParserError> {\n let hasOtherClause = false\n const options: [string, PluralOrSelectOption][] = []\n const parsedSelectors = new Set()\n let {value: selector, location: selectorLocation} = parsedFirstIdentifier\n\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n const startPosition = this.clonePosition()\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n const result = this.tryParseDecimalInteger(\n ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR,\n ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR\n )\n if (result.err) {\n return result\n }\n selectorLocation = createLocation(startPosition, this.clonePosition())\n selector = this.message.slice(startPosition.offset, this.offset())\n } else {\n break\n }\n }\n\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(\n parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,\n selectorLocation\n )\n }\n\n if (selector === 'other') {\n hasOtherClause = true\n }\n\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace()\n const openingBracePosition = this.clonePosition()\n if (!this.bumpIf('{')) {\n return this.error(\n parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n\n const fragmentResult = this.parseMessage(\n nestingLevel + 1,\n parentArgType,\n expectCloseTag\n )\n if (fragmentResult.err) {\n return fragmentResult\n }\n const argCloseResult = this.tryParseArgumentClose(openingBracePosition)\n if (argCloseResult.err) {\n return argCloseResult\n }\n\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ])\n // Keep track of the existing selectors\n parsedSelectors.add(selector)\n\n // Prep next selector clause.\n this.bumpSpace()\n ;({value: selector, location: selectorLocation} =\n this.parseIdentifierIfPossible())\n }\n\n if (options.length === 0) {\n return this.error(\n parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(\n ErrorKind.MISSING_OTHER_CLAUSE,\n createLocation(this.clonePosition(), this.clonePosition())\n )\n }\n\n return {val: options, err: null}\n }\n\n private tryParseDecimalInteger(\n expectNumberError: ErrorKind,\n invalidNumberError: ErrorKind\n ): Result {\n let sign = 1\n const startingPosition = this.clonePosition()\n\n if (this.bumpIf('+')) {\n } else if (this.bumpIf('-')) {\n sign = -1\n }\n\n let hasDigits = false\n let decimal = 0\n while (!this.isEOF()) {\n const ch = this.char()\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true\n decimal = decimal * 10 + (ch - 48)\n this.bump()\n } else {\n break\n }\n }\n\n const location = createLocation(startingPosition, this.clonePosition())\n\n if (!hasDigits) {\n return this.error(expectNumberError, location)\n }\n\n decimal *= sign\n if (!Number.isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location)\n }\n\n return {val: decimal, err: null}\n }\n\n private offset(): number {\n return this.position.offset\n }\n\n private isEOF(): boolean {\n return this.offset() === this.message.length\n }\n\n private clonePosition(): Position {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n }\n }\n\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n private char(): number {\n const offset = this.position.offset\n if (offset >= this.message.length) {\n throw Error('out of bound')\n }\n const code = this.message.codePointAt(offset)\n if (code === undefined) {\n throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`)\n }\n return code\n }\n\n private error(\n kind: ErrorKind,\n location: Location\n ): Result {\n return {\n val: null,\n err: {\n kind,\n message: this.message,\n location,\n },\n }\n }\n\n /** Bump the parser to the next UTF-16 code unit. */\n private bump(): void {\n if (this.isEOF()) {\n return\n }\n const code = this.char()\n if (code === 10 /* '\\n' */) {\n this.position.line += 1\n this.position.column = 1\n this.position.offset += 1\n } else {\n this.position.column += 1\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2\n }\n }\n\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n private bumpIf(prefix: string): boolean {\n if (this.message.startsWith(prefix, this.offset())) {\n for (let i = 0; i < prefix.length; i++) {\n this.bump()\n }\n return true\n }\n return false\n }\n\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n private bumpUntil(pattern: string): boolean {\n const currentOffset = this.offset()\n const index = this.message.indexOf(pattern, currentOffset)\n if (index >= 0) {\n this.bumpTo(index)\n return true\n } else {\n this.bumpTo(this.message.length)\n return false\n }\n }\n\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n private bumpTo(targetOffset: number) {\n if (this.offset() > targetOffset) {\n throw Error(\n `targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`\n )\n }\n\n targetOffset = Math.min(targetOffset, this.message.length)\n while (true) {\n const offset = this.offset()\n if (offset === targetOffset) {\n break\n }\n if (offset > targetOffset) {\n throw Error(\n `targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`\n )\n }\n\n this.bump()\n if (this.isEOF()) {\n break\n }\n }\n }\n\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n private bumpSpace() {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump()\n }\n }\n\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n private peek(): number | null {\n if (this.isEOF()) {\n return null\n }\n const code = this.char()\n const offset = this.offset()\n const nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1))\n return nextCode ?? null\n }\n}\n\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint: number): boolean {\n return (\n (codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90)\n )\n}\n\nfunction _isAlphaOrSlash(codepoint: number): boolean {\n return _isAlpha(codepoint) || codepoint === 47 /* '/' */\n}\n\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c: number): boolean {\n return (\n c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff)\n )\n}\n\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c: number) {\n return (\n (c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029\n )\n}\n","import {\n isArgumentElement,\n isDateElement,\n isNumberElement,\n isPluralElement,\n isPoundElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type MessageFormatElement,\n type PluralElement,\n type PluralOrSelectOption,\n type SelectElement,\n TYPE,\n} from '#packages/icu-messageformat-parser/types.js'\n\nfunction cloneDeep(obj: T): T {\n if (Array.isArray(obj)) {\n // @ts-expect-error meh\n return obj.map(cloneDeep)\n }\n if (obj !== null && typeof obj === 'object') {\n // @ts-expect-error meh\n return Object.keys(obj).reduce((cloned, k) => {\n // @ts-expect-error meh\n cloned[k] = cloneDeep(obj[k])\n return cloned\n }, {})\n }\n return obj\n}\n\n/**\n * Replace pound elements with number elements referencing the given variable.\n * This is needed when nesting plurals - the # in the outer plural should become\n * an explicit variable reference when nested inside another plural.\n * GH #4202\n */\nfunction replacePoundWithArgument(\n ast: MessageFormatElement[],\n variableName: string\n): MessageFormatElement[] {\n return ast.map(el => {\n if (isPoundElement(el)) {\n // Replace # with {variableName, number}\n return {\n type: TYPE.number,\n value: variableName,\n style: null,\n location: el.location,\n }\n }\n if (isPluralElement(el) || isSelectElement(el)) {\n // Recursively process options\n const newOptions: Record = {}\n for (const key of Object.keys(el.options)) {\n newOptions[key] = {\n value: replacePoundWithArgument(el.options[key].value, variableName),\n }\n }\n return {...el, options: newOptions}\n }\n if (isTagElement(el)) {\n return {\n ...el,\n children: replacePoundWithArgument(el.children, variableName),\n }\n }\n return el\n })\n}\n\nfunction hoistPluralOrSelectElement(\n ast: MessageFormatElement[],\n el: PluralElement | SelectElement,\n positionToInject: number\n) {\n // pull this out of the ast and move it to the top\n const cloned = cloneDeep(el)\n const {options} = cloned\n\n // GH #4202: Check if there are other plural/select elements after this one\n const afterElements = ast.slice(positionToInject + 1)\n const hasSubsequentPluralOrSelect = afterElements.some(\n isPluralOrSelectElement\n )\n\n cloned.options = Object.keys(options).reduce(\n (all: Record, k) => {\n let optionValue = options[k].value\n\n // GH #4202: If there are subsequent plurals/selects and this is a plural,\n // replace # with explicit variable reference to avoid ambiguity\n if (hasSubsequentPluralOrSelect && isPluralElement(el)) {\n optionValue = replacePoundWithArgument(optionValue, el.value)\n }\n\n const newValue = hoistSelectors([\n ...ast.slice(0, positionToInject),\n ...optionValue,\n ...afterElements,\n ])\n all[k] = {\n value: newValue,\n }\n return all\n },\n {}\n )\n return cloned\n}\n\nfunction isPluralOrSelectElement(\n el: MessageFormatElement\n): el is PluralElement | SelectElement {\n return isPluralElement(el) || isSelectElement(el)\n}\n\nfunction findPluralOrSelectElement(ast: MessageFormatElement[]): boolean {\n return !!ast.find(el => {\n if (isPluralOrSelectElement(el)) {\n return true\n }\n if (isTagElement(el)) {\n return findPluralOrSelectElement(el.children)\n }\n return false\n })\n}\n\n/**\n * Hoist all selectors to the beginning of the AST & flatten the\n * resulting options. E.g:\n * \"I have {count, plural, one{a dog} other{many dogs}}\"\n * becomes \"{count, plural, one{I have a dog} other{I have many dogs}}\".\n * If there are multiple selectors, the order of which one is hoisted 1st\n * is non-deterministic.\n * The goal is to provide as many full sentences as possible since fragmented\n * sentences are not translator-friendly\n * @param ast AST\n */\nexport function hoistSelectors(\n ast: MessageFormatElement[]\n): MessageFormatElement[] {\n for (let i = 0; i < ast.length; i++) {\n const el = ast[i]\n if (isPluralOrSelectElement(el)) {\n return [hoistPluralOrSelectElement(ast, el, i)]\n }\n if (isTagElement(el) && findPluralOrSelectElement([el])) {\n throw new Error(\n 'Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option'\n )\n }\n }\n return ast\n}\n\n/**\n * Collect all variables in an AST to Record\n * @param ast AST to collect variables from\n * @param vars Record of variable name to variable type\n */\nfunction collectVariables(\n ast: MessageFormatElement[],\n vars: Map = new Map()\n): void {\n ast.forEach(el => {\n if (\n isArgumentElement(el) ||\n isDateElement(el) ||\n isTimeElement(el) ||\n isNumberElement(el)\n ) {\n // If the variable was already registered as a plural/select, it's normal\n // for it to also appear inside as number/date/time/argument — not a conflict.\n if (vars.has(el.value)) {\n const existingType = vars.get(el.value)!\n if (\n existingType !== el.type &&\n existingType !== TYPE.plural &&\n existingType !== TYPE.select\n ) {\n throw new Error(`Variable ${el.value} has conflicting types`)\n }\n } else {\n vars.set(el.value, el.type)\n }\n }\n\n if (isPluralElement(el) || isSelectElement(el)) {\n vars.set(el.value, el.type)\n Object.keys(el.options).forEach(k => {\n collectVariables(el.options[k].value, vars)\n })\n }\n\n if (isTagElement(el)) {\n vars.set(el.value, el.type)\n collectVariables(el.children, vars)\n }\n })\n}\n\ninterface IsStructurallySameResult {\n error?: Error\n success: boolean\n}\n\n/**\n * Check if 2 ASTs are structurally the same. This primarily means that\n * they have the same variables with the same type\n * @param a\n * @param b\n * @returns\n */\nexport function isStructurallySame(\n a: MessageFormatElement[],\n b: MessageFormatElement[]\n): IsStructurallySameResult {\n const aVars = new Map()\n const bVars = new Map()\n collectVariables(a, aVars)\n collectVariables(b, bVars)\n\n if (aVars.size !== bVars.size) {\n return {\n success: false,\n error: new Error(\n `Different number of variables: [${Array.from(aVars.keys()).join(', ')}] vs [${Array.from(bVars.keys()).join(', ')}]`\n ),\n }\n }\n\n return Array.from(aVars.entries()).reduce(\n (result, [key, type]) => {\n if (!result.success) {\n return result\n }\n const bType = bVars.get(key)\n if (bType == null) {\n return {\n success: false,\n error: new Error(`Missing variable ${key} in message`),\n }\n }\n if (bType !== type) {\n return {\n success: false,\n error: new Error(\n `Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`\n ),\n }\n }\n return result\n },\n {success: true}\n )\n}\n","import {ErrorKind} from '#packages/icu-messageformat-parser/error.js'\nimport {\n Parser,\n type ParserOptions,\n} from '#packages/icu-messageformat-parser/parser.js'\nimport {\n isDateElement,\n isDateTimeSkeleton,\n isNumberElement,\n isNumberSkeleton,\n isPluralElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type MessageFormatElement,\n} from '#packages/icu-messageformat-parser/types.js'\n\nfunction pruneLocation(els: MessageFormatElement[]): void {\n els.forEach(el => {\n delete el.location\n if (isSelectElement(el) || isPluralElement(el)) {\n for (const k in el.options) {\n delete el.options[k].location\n pruneLocation(el.options[k].value)\n }\n } else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location\n } else if (\n (isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)\n ) {\n delete el.style.location\n } else if (isTagElement(el)) {\n pruneLocation(el.children)\n }\n })\n}\n\nexport function parse(\n message: string,\n opts: ParserOptions = {}\n): MessageFormatElement[] {\n opts = {\n shouldParseSkeletons: true,\n requiresOtherClause: true,\n ...opts,\n }\n const result = new Parser(message, opts).parse()\n if (result.err) {\n const error = SyntaxError(ErrorKind[result.err.kind])\n // @ts-expect-error Assign to error object\n error.location = result.err.location\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message\n throw error\n }\n\n if (!opts?.captureLocation) {\n pruneLocation(result.val)\n }\n return result.val\n}\nexport * from '#packages/icu-messageformat-parser/types.js'\nexport type {ParserOptions}\n// only for testing\nexport const _Parser: typeof Parser = Parser\nexport {isStructurallySame} from '#packages/icu-messageformat-parser/manipulator.js'\n"],"x_google_ignoreList":[2,3],"mappings":"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MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,MAAM,GAAG;CAChB,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,MAAM,GAAG;CAChB,MAAM,CAAC,GAAG;CACV,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,GAAG;CACV,MAAM,CAAC,GAAG;CACV,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,GAAG;CACf,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM,CAAC,KAAK,GAAG;CACf,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,IAAI;CAChB,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM;EACL;EACA;EACA;EACA;CACD;CACA,MAAM,CAAC,KAAK,GAAG;CACf,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,UAAU;EACT;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,UAAU;EACT;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS,CAAC,KAAK,IAAI;CACnB,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;CACD;CACA,SAAS;EACR;EACA;EACA;EACA;CACD;AACD;;;;;;;;;;ACnoCA,SAAgB,eAAe,UAAkB,QAA6B;CAC5E,IAAI,eAAe;CACnB,KAAK,IAAI,aAAa,GAAG,aAAa,SAAS,QAAQ,cAAc;EACnE,MAAM,cAAc,SAAS,OAAO,UAAU;EAE9C,IAAI,gBAAgB,KAAK;GACvB,IAAI,cAAc;GAClB,OACE,aAAa,IAAI,SAAS,UAC1B,SAAS,OAAO,aAAa,CAAC,MAAM,aACpC;IACA;IACA;GACF;GAEA,IAAI,UAAU,KAAK,cAAc;GACjC,IAAI,eAAe,cAAc,IAAI,IAAI,KAAK,eAAe;GAC7D,I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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae5bf2606d51d5f098ad966f488b1514fd4a3f1d --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts @@ -0,0 +1,175 @@ +import { NumberSkeletonToken } from "@formatjs/icu-skeleton-parser"; +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/icu-messageformat-parser/types.d.ts +interface ExtendedNumberFormatOptions extends NumberFormatOptions { + scale?: number; +} +declare enum TYPE { + /** + * Raw text + */ + literal = 0, + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + argument = 1, + /** + * Variable w/ number format + */ + number = 2, + /** + * Variable w/ date format + */ + date = 3, + /** + * Variable w/ time format + */ + time = 4, + /** + * Variable w/ select format + */ + select = 5, + /** + * Variable w/ plural format + */ + plural = 6, + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + pound = 7, + /** + * XML-like tag + */ + tag = 8 +} +declare enum SKELETON_TYPE { + number = 0, + dateTime = 1 +} +interface LocationDetails { + offset: number; + line: number; + column: number; +} +interface Location { + start: LocationDetails; + end: LocationDetails; +} +interface BaseElement { + type: T; + value: string; + location?: Location; +} +type LiteralElement = BaseElement; +type ArgumentElement = BaseElement; +interface TagElement extends BaseElement { + children: MessageFormatElement[]; +} +interface SimpleFormatElement extends BaseElement { + style?: string | S | null; +} +type NumberElement = SimpleFormatElement; +type DateElement = SimpleFormatElement; +type TimeElement = SimpleFormatElement; +type ValidPluralRule = "zero" | "one" | "two" | "few" | "many" | "other" | string; +interface PluralOrSelectOption { + value: MessageFormatElement[]; + location?: Location; +} +interface SelectElement extends BaseElement { + options: Record; +} +interface PluralElement extends BaseElement { + options: Record; + offset: number; + pluralType: Intl.PluralRulesOptions["type"]; +} +interface PoundElement { + type: TYPE.pound; + location?: Location; +} +type MessageFormatElement = ArgumentElement | DateElement | LiteralElement | NumberElement | PluralElement | PoundElement | SelectElement | TagElement | TimeElement; +interface NumberSkeleton { + type: SKELETON_TYPE.number; + tokens: NumberSkeletonToken[]; + location?: Location; + parsedOptions: ExtendedNumberFormatOptions; +} +interface DateTimeSkeleton { + type: SKELETON_TYPE.dateTime; + pattern: string; + location?: Location; + parsedOptions: Intl.DateTimeFormatOptions; +} +type Skeleton = NumberSkeleton | DateTimeSkeleton; +//#endregion +//#region packages/icu-messageformat-parser/manipulator.d.ts +/** + * Hoist all selectors to the beginning of the AST & flatten the + * resulting options. E.g: + * "I have {count, plural, one{a dog} other{many dogs}}" + * becomes "{count, plural, one{I have a dog} other{I have many dogs}}". + * If there are multiple selectors, the order of which one is hoisted 1st + * is non-deterministic. + * The goal is to provide as many full sentences as possible since fragmented + * sentences are not translator-friendly + * @param ast AST + */ +export declare function hoistSelectors(ast: MessageFormatElement[]): MessageFormatElement[]; +interface IsStructurallySameResult { + error?: Error; + success: boolean; +} +/** + * Check if 2 ASTs are structurally the same. This primarily means that + * they have the same variables with the same type + * @param a + * @param b + * @returns + */ +export declare function isStructurallySame(a: MessageFormatElement[], b: MessageFormatElement[]): IsStructurallySameResult; +//#endregion +//# sourceMappingURL=manipulator.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js new file mode 100644 index 0000000000000000000000000000000000000000..d47aa632b6bde3086d5bdfa570f4249fc073b7cf --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js @@ -0,0 +1,209 @@ +//#region packages/icu-messageformat-parser/types.ts +let TYPE = /* @__PURE__ */ function(TYPE) { + /** + * Raw text + */ + TYPE[TYPE["literal"] = 0] = "literal"; + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + TYPE[TYPE["argument"] = 1] = "argument"; + /** + * Variable w/ number format + */ + TYPE[TYPE["number"] = 2] = "number"; + /** + * Variable w/ date format + */ + TYPE[TYPE["date"] = 3] = "date"; + /** + * Variable w/ time format + */ + TYPE[TYPE["time"] = 4] = "time"; + /** + * Variable w/ select format + */ + TYPE[TYPE["select"] = 5] = "select"; + /** + * Variable w/ plural format + */ + TYPE[TYPE["plural"] = 6] = "plural"; + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + TYPE[TYPE["pound"] = 7] = "pound"; + /** + * XML-like tag + */ + TYPE[TYPE["tag"] = 8] = "tag"; + return TYPE; +}({}); +function isArgumentElement(el) { + return el.type === 1; +} +function isNumberElement(el) { + return el.type === 2; +} +function isDateElement(el) { + return el.type === 3; +} +function isTimeElement(el) { + return el.type === 4; +} +function isSelectElement(el) { + return el.type === 5; +} +function isPluralElement(el) { + return el.type === 6; +} +function isPoundElement(el) { + return el.type === 7; +} +function isTagElement(el) { + return el.type === 8; +} +//#endregion +//#region packages/icu-messageformat-parser/manipulator.ts +function cloneDeep(obj) { + if (Array.isArray(obj)) return obj.map(cloneDeep); + if (obj !== null && typeof obj === "object") return Object.keys(obj).reduce((cloned, k) => { + cloned[k] = cloneDeep(obj[k]); + return cloned; + }, {}); + return obj; +} +/** +* Replace pound elements with number elements referencing the given variable. +* This is needed when nesting plurals - the # in the outer plural should become +* an explicit variable reference when nested inside another plural. +* GH #4202 +*/ +function replacePoundWithArgument(ast, variableName) { + return ast.map((el) => { + if (isPoundElement(el)) return { + type: 2, + value: variableName, + style: null, + location: el.location + }; + if (isPluralElement(el) || isSelectElement(el)) { + const newOptions = {}; + for (const key of Object.keys(el.options)) newOptions[key] = { value: replacePoundWithArgument(el.options[key].value, variableName) }; + return { + ...el, + options: newOptions + }; + } + if (isTagElement(el)) return { + ...el, + children: replacePoundWithArgument(el.children, variableName) + }; + return el; + }); +} +function hoistPluralOrSelectElement(ast, el, positionToInject) { + const cloned = cloneDeep(el); + const { options } = cloned; + const afterElements = ast.slice(positionToInject + 1); + const hasSubsequentPluralOrSelect = afterElements.some(isPluralOrSelectElement); + cloned.options = Object.keys(options).reduce((all, k) => { + let optionValue = options[k].value; + if (hasSubsequentPluralOrSelect && isPluralElement(el)) optionValue = replacePoundWithArgument(optionValue, el.value); + all[k] = { value: hoistSelectors([ + ...ast.slice(0, positionToInject), + ...optionValue, + ...afterElements + ]) }; + return all; + }, {}); + return cloned; +} +function isPluralOrSelectElement(el) { + return isPluralElement(el) || isSelectElement(el); +} +function findPluralOrSelectElement(ast) { + return !!ast.find((el) => { + if (isPluralOrSelectElement(el)) return true; + if (isTagElement(el)) return findPluralOrSelectElement(el.children); + return false; + }); +} +/** +* Hoist all selectors to the beginning of the AST & flatten the +* resulting options. E.g: +* "I have {count, plural, one{a dog} other{many dogs}}" +* becomes "{count, plural, one{I have a dog} other{I have many dogs}}". +* If there are multiple selectors, the order of which one is hoisted 1st +* is non-deterministic. +* The goal is to provide as many full sentences as possible since fragmented +* sentences are not translator-friendly +* @param ast AST +*/ +function hoistSelectors(ast) { + for (let i = 0; i < ast.length; i++) { + const el = ast[i]; + if (isPluralOrSelectElement(el)) return [hoistPluralOrSelectElement(ast, el, i)]; + if (isTagElement(el) && findPluralOrSelectElement([el])) throw new Error("Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option"); + } + return ast; +} +/** +* Collect all variables in an AST to Record +* @param ast AST to collect variables from +* @param vars Record of variable name to variable type +*/ +function collectVariables(ast, vars = /* @__PURE__ */ new Map()) { + ast.forEach((el) => { + if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el)) { + if (vars.has(el.value)) { + const existingType = vars.get(el.value); + if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error(`Variable ${el.value} has conflicting types`); + } else vars.set(el.value, el.type); + } + if (isPluralElement(el) || isSelectElement(el)) { + vars.set(el.value, el.type); + Object.keys(el.options).forEach((k) => { + collectVariables(el.options[k].value, vars); + }); + } + if (isTagElement(el)) { + vars.set(el.value, el.type); + collectVariables(el.children, vars); + } + }); +} +/** +* Check if 2 ASTs are structurally the same. This primarily means that +* they have the same variables with the same type +* @param a +* @param b +* @returns +*/ +function isStructurallySame(a, b) { + const aVars = /* @__PURE__ */ new Map(); + const bVars = /* @__PURE__ */ new Map(); + collectVariables(a, aVars); + collectVariables(b, bVars); + if (aVars.size !== bVars.size) return { + success: false, + error: /* @__PURE__ */ new Error(`Different number of variables: [${Array.from(aVars.keys()).join(", ")}] vs [${Array.from(bVars.keys()).join(", ")}]`) + }; + return Array.from(aVars.entries()).reduce((result, [key, type]) => { + if (!result.success) return result; + const bType = bVars.get(key); + if (bType == null) return { + success: false, + error: /* @__PURE__ */ new Error(`Missing variable ${key} in message`) + }; + if (bType !== type) return { + success: false, + error: /* @__PURE__ */ new Error(`Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`) + }; + return result; + }, { success: true }); +} +//#endregion +export { hoistSelectors, isStructurallySame }; + +//# sourceMappingURL=manipulator.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ab4291230f264600f3faeb79a296a0939fc45da2 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"manipulator.js","names":[],"sources":["../types.ts","../manipulator.ts"],"sourcesContent":["import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {type NumberSkeletonToken} from '@formatjs/icu-skeleton-parser'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\n\nexport enum TYPE {\n /**\n * Raw text\n */\n literal,\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n argument,\n /**\n * Variable w/ number format\n */\n number,\n /**\n * Variable w/ date format\n */\n date,\n /**\n * Variable w/ time format\n */\n time,\n /**\n * Variable w/ select format\n */\n select,\n /**\n * Variable w/ plural format\n */\n plural,\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n pound,\n /**\n * XML-like tag\n */\n tag,\n}\n\nexport enum SKELETON_TYPE {\n number,\n dateTime,\n}\n\nexport interface LocationDetails {\n offset: number\n line: number\n column: number\n}\nexport interface Location {\n start: LocationDetails\n end: LocationDetails\n}\n\nexport interface BaseElement {\n type: T\n value: string\n location?: Location\n}\n\nexport type LiteralElement = BaseElement\nexport type ArgumentElement = BaseElement\nexport interface TagElement extends BaseElement {\n children: MessageFormatElement[]\n}\n\nexport interface SimpleFormatElement<\n T extends TYPE,\n S extends Skeleton,\n> extends BaseElement {\n style?: string | S | null\n}\n\nexport type NumberElement = SimpleFormatElement\nexport type DateElement = SimpleFormatElement\nexport type TimeElement = SimpleFormatElement\n\nexport type ValidPluralRule =\n | 'zero'\n | 'one'\n | 'two'\n | 'few'\n | 'many'\n | 'other'\n | string\n\nexport interface PluralOrSelectOption {\n value: MessageFormatElement[]\n location?: Location\n}\n\nexport interface SelectElement extends BaseElement {\n options: Record\n}\n\nexport interface PluralElement extends BaseElement {\n options: Record\n offset: number\n pluralType: Intl.PluralRulesOptions['type']\n}\n\nexport interface PoundElement {\n type: TYPE.pound\n location?: Location\n}\n\nexport type MessageFormatElement =\n | ArgumentElement\n | DateElement\n | LiteralElement\n | NumberElement\n | PluralElement\n | PoundElement\n | SelectElement\n | TagElement\n | TimeElement\n\nexport interface NumberSkeleton {\n type: SKELETON_TYPE.number\n tokens: NumberSkeletonToken[]\n location?: Location\n parsedOptions: ExtendedNumberFormatOptions\n}\n\nexport interface DateTimeSkeleton {\n type: SKELETON_TYPE.dateTime\n pattern: string\n location?: Location\n parsedOptions: Intl.DateTimeFormatOptions\n}\n\nexport type Skeleton = NumberSkeleton | DateTimeSkeleton\n\n/**\n * Type Guards\n */\nexport function isLiteralElement(\n el: MessageFormatElement\n): el is LiteralElement {\n return el.type === TYPE.literal\n}\nexport function isArgumentElement(\n el: MessageFormatElement\n): el is ArgumentElement {\n return el.type === TYPE.argument\n}\nexport function isNumberElement(el: MessageFormatElement): el is NumberElement {\n return el.type === TYPE.number\n}\nexport function isDateElement(el: MessageFormatElement): el is DateElement {\n return el.type === TYPE.date\n}\nexport function isTimeElement(el: MessageFormatElement): el is TimeElement {\n return el.type === TYPE.time\n}\nexport function isSelectElement(el: MessageFormatElement): el is SelectElement {\n return el.type === TYPE.select\n}\nexport function isPluralElement(el: MessageFormatElement): el is PluralElement {\n return el.type === TYPE.plural\n}\nexport function isPoundElement(el: MessageFormatElement): el is PoundElement {\n return el.type === TYPE.pound\n}\nexport function isTagElement(el: MessageFormatElement): el is TagElement {\n return el.type === TYPE.tag\n}\nexport function isNumberSkeleton(\n el: NumberElement['style'] | Skeleton\n): el is NumberSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number)\n}\nexport function isDateTimeSkeleton(\n el?: DateElement['style'] | TimeElement['style'] | Skeleton\n): el is DateTimeSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime)\n}\n\nexport function createLiteralElement(value: string): LiteralElement {\n return {\n type: TYPE.literal,\n value,\n }\n}\n\nexport function createNumberElement(\n value: string,\n style?: string | null\n): NumberElement {\n return {\n type: TYPE.number,\n value,\n style,\n }\n}\n","import {\n isArgumentElement,\n isDateElement,\n isNumberElement,\n isPluralElement,\n isPoundElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type MessageFormatElement,\n type PluralElement,\n type PluralOrSelectOption,\n type SelectElement,\n TYPE,\n} from '#packages/icu-messageformat-parser/types.js'\n\nfunction cloneDeep(obj: T): T {\n if (Array.isArray(obj)) {\n // @ts-expect-error meh\n return obj.map(cloneDeep)\n }\n if (obj !== null && typeof obj === 'object') {\n // @ts-expect-error meh\n return Object.keys(obj).reduce((cloned, k) => {\n // @ts-expect-error meh\n cloned[k] = cloneDeep(obj[k])\n return cloned\n }, {})\n }\n return obj\n}\n\n/**\n * Replace pound elements with number elements referencing the given variable.\n * This is needed when nesting plurals - the # in the outer plural should become\n * an explicit variable reference when nested inside another plural.\n * GH #4202\n */\nfunction replacePoundWithArgument(\n ast: MessageFormatElement[],\n variableName: string\n): MessageFormatElement[] {\n return ast.map(el => {\n if (isPoundElement(el)) {\n // Replace # with {variableName, number}\n return {\n type: TYPE.number,\n value: variableName,\n style: null,\n location: el.location,\n }\n }\n if (isPluralElement(el) || isSelectElement(el)) {\n // Recursively process options\n const newOptions: Record = {}\n for (const key of Object.keys(el.options)) {\n newOptions[key] = {\n value: replacePoundWithArgument(el.options[key].value, variableName),\n }\n }\n return {...el, options: newOptions}\n }\n if (isTagElement(el)) {\n return {\n ...el,\n children: replacePoundWithArgument(el.children, variableName),\n }\n }\n return el\n })\n}\n\nfunction hoistPluralOrSelectElement(\n ast: MessageFormatElement[],\n el: PluralElement | SelectElement,\n positionToInject: number\n) {\n // pull this out of the ast and move it to the top\n const cloned = cloneDeep(el)\n const {options} = cloned\n\n // GH #4202: Check if there are other plural/select elements after this one\n const afterElements = ast.slice(positionToInject + 1)\n const hasSubsequentPluralOrSelect = afterElements.some(\n isPluralOrSelectElement\n )\n\n cloned.options = Object.keys(options).reduce(\n (all: Record, k) => {\n let optionValue = options[k].value\n\n // GH #4202: If there are subsequent plurals/selects and this is a plural,\n // replace # with explicit variable reference to avoid ambiguity\n if (hasSubsequentPluralOrSelect && isPluralElement(el)) {\n optionValue = replacePoundWithArgument(optionValue, el.value)\n }\n\n const newValue = hoistSelectors([\n ...ast.slice(0, positionToInject),\n ...optionValue,\n ...afterElements,\n ])\n all[k] = {\n value: newValue,\n }\n return all\n },\n {}\n )\n return cloned\n}\n\nfunction isPluralOrSelectElement(\n el: MessageFormatElement\n): el is PluralElement | SelectElement {\n return isPluralElement(el) || isSelectElement(el)\n}\n\nfunction findPluralOrSelectElement(ast: MessageFormatElement[]): boolean {\n return !!ast.find(el => {\n if (isPluralOrSelectElement(el)) {\n return true\n }\n if (isTagElement(el)) {\n return findPluralOrSelectElement(el.children)\n }\n return false\n })\n}\n\n/**\n * Hoist all selectors to the beginning of the AST & flatten the\n * resulting options. E.g:\n * \"I have {count, plural, one{a dog} other{many dogs}}\"\n * becomes \"{count, plural, one{I have a dog} other{I have many dogs}}\".\n * If there are multiple selectors, the order of which one is hoisted 1st\n * is non-deterministic.\n * The goal is to provide as many full sentences as possible since fragmented\n * sentences are not translator-friendly\n * @param ast AST\n */\nexport function hoistSelectors(\n ast: MessageFormatElement[]\n): MessageFormatElement[] {\n for (let i = 0; i < ast.length; i++) {\n const el = ast[i]\n if (isPluralOrSelectElement(el)) {\n return [hoistPluralOrSelectElement(ast, el, i)]\n }\n if (isTagElement(el) && findPluralOrSelectElement([el])) {\n throw new Error(\n 'Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option'\n )\n }\n }\n return ast\n}\n\n/**\n * Collect all variables in an AST to Record\n * @param ast AST to collect variables from\n * @param vars Record of variable name to variable type\n */\nfunction collectVariables(\n ast: MessageFormatElement[],\n vars: Map = new Map()\n): void {\n ast.forEach(el => {\n if (\n isArgumentElement(el) ||\n isDateElement(el) ||\n isTimeElement(el) ||\n isNumberElement(el)\n ) {\n // If the variable was already registered as a plural/select, it's normal\n // for it to also appear inside as number/date/time/argument — not a conflict.\n if (vars.has(el.value)) {\n const existingType = vars.get(el.value)!\n if (\n existingType !== el.type &&\n existingType !== TYPE.plural &&\n existingType !== TYPE.select\n ) {\n throw new Error(`Variable ${el.value} has conflicting types`)\n }\n } else {\n vars.set(el.value, el.type)\n }\n }\n\n if (isPluralElement(el) || isSelectElement(el)) {\n vars.set(el.value, el.type)\n Object.keys(el.options).forEach(k => {\n collectVariables(el.options[k].value, vars)\n })\n }\n\n if (isTagElement(el)) {\n vars.set(el.value, el.type)\n collectVariables(el.children, vars)\n }\n })\n}\n\ninterface IsStructurallySameResult {\n error?: Error\n success: boolean\n}\n\n/**\n * Check if 2 ASTs are structurally the same. This primarily means that\n * they have the same variables with the same type\n * @param a\n * @param b\n * @returns\n */\nexport function isStructurallySame(\n a: MessageFormatElement[],\n b: MessageFormatElement[]\n): IsStructurallySameResult {\n const aVars = new Map()\n const bVars = new Map()\n collectVariables(a, aVars)\n collectVariables(b, bVars)\n\n if (aVars.size !== bVars.size) {\n return {\n success: false,\n error: new Error(\n `Different number of variables: [${Array.from(aVars.keys()).join(', ')}] vs [${Array.from(bVars.keys()).join(', ')}]`\n ),\n }\n }\n\n return Array.from(aVars.entries()).reduce(\n (result, [key, type]) => {\n if (!result.success) {\n return result\n }\n const bType = bVars.get(key)\n if (bType == null) {\n return {\n success: false,\n error: new Error(`Missing variable ${key} in message`),\n }\n }\n if (bType !== type) {\n return {\n success: false,\n error: new Error(\n `Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`\n ),\n }\n }\n return result\n },\n {success: true}\n )\n}\n"],"mappings":"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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d4aca4a6fc31e94eb716f7bc16cc0eaa4575a0c --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts @@ -0,0 +1,183 @@ +import { NumberSkeletonToken } from "@formatjs/icu-skeleton-parser"; +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/icu-messageformat-parser/types.d.ts +export interface ExtendedNumberFormatOptions extends NumberFormatOptions { + scale?: number; +} +export declare enum TYPE { + /** + * Raw text + */ + literal = 0, + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + argument = 1, + /** + * Variable w/ number format + */ + number = 2, + /** + * Variable w/ date format + */ + date = 3, + /** + * Variable w/ time format + */ + time = 4, + /** + * Variable w/ select format + */ + select = 5, + /** + * Variable w/ plural format + */ + plural = 6, + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + pound = 7, + /** + * XML-like tag + */ + tag = 8 +} +export declare enum SKELETON_TYPE { + number = 0, + dateTime = 1 +} +export interface LocationDetails { + offset: number; + line: number; + column: number; +} +export interface Location { + start: LocationDetails; + end: LocationDetails; +} +export interface BaseElement { + type: T; + value: string; + location?: Location; +} +export type LiteralElement = BaseElement; +export type ArgumentElement = BaseElement; +export interface TagElement extends BaseElement { + children: MessageFormatElement[]; +} +export interface SimpleFormatElement extends BaseElement { + style?: string | S | null; +} +export type NumberElement = SimpleFormatElement; +export type DateElement = SimpleFormatElement; +export type TimeElement = SimpleFormatElement; +export type ValidPluralRule = "zero" | "one" | "two" | "few" | "many" | "other" | string; +export interface PluralOrSelectOption { + value: MessageFormatElement[]; + location?: Location; +} +export interface SelectElement extends BaseElement { + options: Record; +} +export interface PluralElement extends BaseElement { + options: Record; + offset: number; + pluralType: Intl.PluralRulesOptions["type"]; +} +export interface PoundElement { + type: TYPE.pound; + location?: Location; +} +export type MessageFormatElement = ArgumentElement | DateElement | LiteralElement | NumberElement | PluralElement | PoundElement | SelectElement | TagElement | TimeElement; +export interface NumberSkeleton { + type: SKELETON_TYPE.number; + tokens: NumberSkeletonToken[]; + location?: Location; + parsedOptions: ExtendedNumberFormatOptions; +} +export interface DateTimeSkeleton { + type: SKELETON_TYPE.dateTime; + pattern: string; + location?: Location; + parsedOptions: Intl.DateTimeFormatOptions; +} +export type Skeleton = NumberSkeleton | DateTimeSkeleton; +/** + * Type Guards + */ +export declare function isLiteralElement(el: MessageFormatElement): el is LiteralElement; +export declare function isArgumentElement(el: MessageFormatElement): el is ArgumentElement; +export declare function isNumberElement(el: MessageFormatElement): el is NumberElement; +export declare function isDateElement(el: MessageFormatElement): el is DateElement; +export declare function isTimeElement(el: MessageFormatElement): el is TimeElement; +export declare function isSelectElement(el: MessageFormatElement): el is SelectElement; +export declare function isPluralElement(el: MessageFormatElement): el is PluralElement; +export declare function isPoundElement(el: MessageFormatElement): el is PoundElement; +export declare function isTagElement(el: MessageFormatElement): el is TagElement; +export declare function isNumberSkeleton(el: NumberElement["style"] | Skeleton): el is NumberSkeleton; +export declare function isDateTimeSkeleton(el?: DateElement["style"] | TimeElement["style"] | Skeleton): el is DateTimeSkeleton; +export declare function createLiteralElement(value: string): LiteralElement; +export declare function createNumberElement(value: string, style?: string | null): NumberElement; +//#endregion +//#region packages/icu-messageformat-parser/manipulator.d.ts +interface IsStructurallySameResult { + error?: Error; + success: boolean; +} +/** + * Check if 2 ASTs are structurally the same. This primarily means that + * they have the same variables with the same type + * @param a + * @param b + * @returns + */ +export declare function isStructurallySame(a: MessageFormatElement[], b: MessageFormatElement[]): IsStructurallySameResult; +//#endregion +//#region packages/icu-messageformat-parser/no-parser.d.ts +export declare function parse(): void; +export declare const _Parser: undefined; +//#endregion +//# sourceMappingURL=no-parser.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js new file mode 100644 index 0000000000000000000000000000000000000000..c9ac2aaad60076981f6b2c44a3ab2e95d3277c4b --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js @@ -0,0 +1,162 @@ +//#region packages/icu-messageformat-parser/types.ts +let TYPE = /* @__PURE__ */ function(TYPE) { + /** + * Raw text + */ + TYPE[TYPE["literal"] = 0] = "literal"; + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + TYPE[TYPE["argument"] = 1] = "argument"; + /** + * Variable w/ number format + */ + TYPE[TYPE["number"] = 2] = "number"; + /** + * Variable w/ date format + */ + TYPE[TYPE["date"] = 3] = "date"; + /** + * Variable w/ time format + */ + TYPE[TYPE["time"] = 4] = "time"; + /** + * Variable w/ select format + */ + TYPE[TYPE["select"] = 5] = "select"; + /** + * Variable w/ plural format + */ + TYPE[TYPE["plural"] = 6] = "plural"; + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + TYPE[TYPE["pound"] = 7] = "pound"; + /** + * XML-like tag + */ + TYPE[TYPE["tag"] = 8] = "tag"; + return TYPE; +}({}); +let SKELETON_TYPE = /* @__PURE__ */ function(SKELETON_TYPE) { + SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number"; + SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime"; + return SKELETON_TYPE; +}({}); +/** +* Type Guards +*/ +function isLiteralElement(el) { + return el.type === 0; +} +function isArgumentElement(el) { + return el.type === 1; +} +function isNumberElement(el) { + return el.type === 2; +} +function isDateElement(el) { + return el.type === 3; +} +function isTimeElement(el) { + return el.type === 4; +} +function isSelectElement(el) { + return el.type === 5; +} +function isPluralElement(el) { + return el.type === 6; +} +function isPoundElement(el) { + return el.type === 7; +} +function isTagElement(el) { + return el.type === 8; +} +function isNumberSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 0); +} +function isDateTimeSkeleton(el) { + return !!(el && typeof el === "object" && el.type === 1); +} +function createLiteralElement(value) { + return { + type: 0, + value + }; +} +function createNumberElement(value, style) { + return { + type: 2, + value, + style + }; +} +//#endregion +//#region packages/icu-messageformat-parser/manipulator.ts +/** +* Collect all variables in an AST to Record +* @param ast AST to collect variables from +* @param vars Record of variable name to variable type +*/ +function collectVariables(ast, vars = /* @__PURE__ */ new Map()) { + ast.forEach((el) => { + if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el)) { + if (vars.has(el.value)) { + const existingType = vars.get(el.value); + if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error(`Variable ${el.value} has conflicting types`); + } else vars.set(el.value, el.type); + } + if (isPluralElement(el) || isSelectElement(el)) { + vars.set(el.value, el.type); + Object.keys(el.options).forEach((k) => { + collectVariables(el.options[k].value, vars); + }); + } + if (isTagElement(el)) { + vars.set(el.value, el.type); + collectVariables(el.children, vars); + } + }); +} +/** +* Check if 2 ASTs are structurally the same. This primarily means that +* they have the same variables with the same type +* @param a +* @param b +* @returns +*/ +function isStructurallySame(a, b) { + const aVars = /* @__PURE__ */ new Map(); + const bVars = /* @__PURE__ */ new Map(); + collectVariables(a, aVars); + collectVariables(b, bVars); + if (aVars.size !== bVars.size) return { + success: false, + error: /* @__PURE__ */ new Error(`Different number of variables: [${Array.from(aVars.keys()).join(", ")}] vs [${Array.from(bVars.keys()).join(", ")}]`) + }; + return Array.from(aVars.entries()).reduce((result, [key, type]) => { + if (!result.success) return result; + const bType = bVars.get(key); + if (bType == null) return { + success: false, + error: /* @__PURE__ */ new Error(`Missing variable ${key} in message`) + }; + if (bType !== type) return { + success: false, + error: /* @__PURE__ */ new Error(`Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`) + }; + return result; + }, { success: true }); +} +//#endregion +//#region packages/icu-messageformat-parser/no-parser.ts +function parse() { + throw new Error("You're trying to format an uncompiled message with react-intl without parser, please import from 'react-intl' instead"); +} +const _Parser = void 0; +//#endregion +export { SKELETON_TYPE, TYPE, _Parser, createLiteralElement, createNumberElement, isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isStructurallySame, isTagElement, isTimeElement, parse }; + +//# sourceMappingURL=no-parser.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map new file mode 100644 index 0000000000000000000000000000000000000000..8787bb47fa8412de367ea6ebf1540f159f364829 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"no-parser.js","names":[],"sources":["../types.ts","../manipulator.ts","../no-parser.ts"],"sourcesContent":["import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {type NumberSkeletonToken} from '@formatjs/icu-skeleton-parser'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\n\nexport enum TYPE {\n /**\n * Raw text\n */\n literal,\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n argument,\n /**\n * Variable w/ number format\n */\n number,\n /**\n * Variable w/ date format\n */\n date,\n /**\n * Variable w/ time format\n */\n time,\n /**\n * Variable w/ select format\n */\n select,\n /**\n * Variable w/ plural format\n */\n plural,\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n pound,\n /**\n * XML-like tag\n */\n tag,\n}\n\nexport enum SKELETON_TYPE {\n number,\n dateTime,\n}\n\nexport interface LocationDetails {\n offset: number\n line: number\n column: number\n}\nexport interface Location {\n start: LocationDetails\n end: LocationDetails\n}\n\nexport interface BaseElement {\n type: T\n value: string\n location?: Location\n}\n\nexport type LiteralElement = BaseElement\nexport type ArgumentElement = BaseElement\nexport interface TagElement extends BaseElement {\n children: MessageFormatElement[]\n}\n\nexport interface SimpleFormatElement<\n T extends TYPE,\n S extends Skeleton,\n> extends BaseElement {\n style?: string | S | null\n}\n\nexport type NumberElement = SimpleFormatElement\nexport type DateElement = SimpleFormatElement\nexport type TimeElement = SimpleFormatElement\n\nexport type ValidPluralRule =\n | 'zero'\n | 'one'\n | 'two'\n | 'few'\n | 'many'\n | 'other'\n | string\n\nexport interface PluralOrSelectOption {\n value: MessageFormatElement[]\n location?: Location\n}\n\nexport interface SelectElement extends BaseElement {\n options: Record\n}\n\nexport interface PluralElement extends BaseElement {\n options: Record\n offset: number\n pluralType: Intl.PluralRulesOptions['type']\n}\n\nexport interface PoundElement {\n type: TYPE.pound\n location?: Location\n}\n\nexport type MessageFormatElement =\n | ArgumentElement\n | DateElement\n | LiteralElement\n | NumberElement\n | PluralElement\n | PoundElement\n | SelectElement\n | TagElement\n | TimeElement\n\nexport interface NumberSkeleton {\n type: SKELETON_TYPE.number\n tokens: NumberSkeletonToken[]\n location?: Location\n parsedOptions: ExtendedNumberFormatOptions\n}\n\nexport interface DateTimeSkeleton {\n type: SKELETON_TYPE.dateTime\n pattern: string\n location?: Location\n parsedOptions: Intl.DateTimeFormatOptions\n}\n\nexport type Skeleton = NumberSkeleton | DateTimeSkeleton\n\n/**\n * Type Guards\n */\nexport function isLiteralElement(\n el: MessageFormatElement\n): el is LiteralElement {\n return el.type === TYPE.literal\n}\nexport function isArgumentElement(\n el: MessageFormatElement\n): el is ArgumentElement {\n return el.type === TYPE.argument\n}\nexport function isNumberElement(el: MessageFormatElement): el is NumberElement {\n return el.type === TYPE.number\n}\nexport function isDateElement(el: MessageFormatElement): el is DateElement {\n return el.type === TYPE.date\n}\nexport function isTimeElement(el: MessageFormatElement): el is TimeElement {\n return el.type === TYPE.time\n}\nexport function isSelectElement(el: MessageFormatElement): el is SelectElement {\n return el.type === TYPE.select\n}\nexport function isPluralElement(el: MessageFormatElement): el is PluralElement {\n return el.type === TYPE.plural\n}\nexport function isPoundElement(el: MessageFormatElement): el is PoundElement {\n return el.type === TYPE.pound\n}\nexport function isTagElement(el: MessageFormatElement): el is TagElement {\n return el.type === TYPE.tag\n}\nexport function isNumberSkeleton(\n el: NumberElement['style'] | Skeleton\n): el is NumberSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number)\n}\nexport function isDateTimeSkeleton(\n el?: DateElement['style'] | TimeElement['style'] | Skeleton\n): el is DateTimeSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime)\n}\n\nexport function createLiteralElement(value: string): LiteralElement {\n return {\n type: TYPE.literal,\n value,\n }\n}\n\nexport function createNumberElement(\n value: string,\n style?: string | null\n): NumberElement {\n return {\n type: TYPE.number,\n value,\n style,\n }\n}\n","import {\n isArgumentElement,\n isDateElement,\n isNumberElement,\n isPluralElement,\n isPoundElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type MessageFormatElement,\n type PluralElement,\n type PluralOrSelectOption,\n type SelectElement,\n TYPE,\n} from '#packages/icu-messageformat-parser/types.js'\n\nfunction cloneDeep(obj: T): T {\n if (Array.isArray(obj)) {\n // @ts-expect-error meh\n return obj.map(cloneDeep)\n }\n if (obj !== null && typeof obj === 'object') {\n // @ts-expect-error meh\n return Object.keys(obj).reduce((cloned, k) => {\n // @ts-expect-error meh\n cloned[k] = cloneDeep(obj[k])\n return cloned\n }, {})\n }\n return obj\n}\n\n/**\n * Replace pound elements with number elements referencing the given variable.\n * This is needed when nesting plurals - the # in the outer plural should become\n * an explicit variable reference when nested inside another plural.\n * GH #4202\n */\nfunction replacePoundWithArgument(\n ast: MessageFormatElement[],\n variableName: string\n): MessageFormatElement[] {\n return ast.map(el => {\n if (isPoundElement(el)) {\n // Replace # with {variableName, number}\n return {\n type: TYPE.number,\n value: variableName,\n style: null,\n location: el.location,\n }\n }\n if (isPluralElement(el) || isSelectElement(el)) {\n // Recursively process options\n const newOptions: Record = {}\n for (const key of Object.keys(el.options)) {\n newOptions[key] = {\n value: replacePoundWithArgument(el.options[key].value, variableName),\n }\n }\n return {...el, options: newOptions}\n }\n if (isTagElement(el)) {\n return {\n ...el,\n children: replacePoundWithArgument(el.children, variableName),\n }\n }\n return el\n })\n}\n\nfunction hoistPluralOrSelectElement(\n ast: MessageFormatElement[],\n el: PluralElement | SelectElement,\n positionToInject: number\n) {\n // pull this out of the ast and move it to the top\n const cloned = cloneDeep(el)\n const {options} = cloned\n\n // GH #4202: Check if there are other plural/select elements after this one\n const afterElements = ast.slice(positionToInject + 1)\n const hasSubsequentPluralOrSelect = afterElements.some(\n isPluralOrSelectElement\n )\n\n cloned.options = Object.keys(options).reduce(\n (all: Record, k) => {\n let optionValue = options[k].value\n\n // GH #4202: If there are subsequent plurals/selects and this is a plural,\n // replace # with explicit variable reference to avoid ambiguity\n if (hasSubsequentPluralOrSelect && isPluralElement(el)) {\n optionValue = replacePoundWithArgument(optionValue, el.value)\n }\n\n const newValue = hoistSelectors([\n ...ast.slice(0, positionToInject),\n ...optionValue,\n ...afterElements,\n ])\n all[k] = {\n value: newValue,\n }\n return all\n },\n {}\n )\n return cloned\n}\n\nfunction isPluralOrSelectElement(\n el: MessageFormatElement\n): el is PluralElement | SelectElement {\n return isPluralElement(el) || isSelectElement(el)\n}\n\nfunction findPluralOrSelectElement(ast: MessageFormatElement[]): boolean {\n return !!ast.find(el => {\n if (isPluralOrSelectElement(el)) {\n return true\n }\n if (isTagElement(el)) {\n return findPluralOrSelectElement(el.children)\n }\n return false\n })\n}\n\n/**\n * Hoist all selectors to the beginning of the AST & flatten the\n * resulting options. E.g:\n * \"I have {count, plural, one{a dog} other{many dogs}}\"\n * becomes \"{count, plural, one{I have a dog} other{I have many dogs}}\".\n * If there are multiple selectors, the order of which one is hoisted 1st\n * is non-deterministic.\n * The goal is to provide as many full sentences as possible since fragmented\n * sentences are not translator-friendly\n * @param ast AST\n */\nexport function hoistSelectors(\n ast: MessageFormatElement[]\n): MessageFormatElement[] {\n for (let i = 0; i < ast.length; i++) {\n const el = ast[i]\n if (isPluralOrSelectElement(el)) {\n return [hoistPluralOrSelectElement(ast, el, i)]\n }\n if (isTagElement(el) && findPluralOrSelectElement([el])) {\n throw new Error(\n 'Cannot hoist plural/select within a tag element. Please put the tag element inside each plural/select option'\n )\n }\n }\n return ast\n}\n\n/**\n * Collect all variables in an AST to Record\n * @param ast AST to collect variables from\n * @param vars Record of variable name to variable type\n */\nfunction collectVariables(\n ast: MessageFormatElement[],\n vars: Map = new Map()\n): void {\n ast.forEach(el => {\n if (\n isArgumentElement(el) ||\n isDateElement(el) ||\n isTimeElement(el) ||\n isNumberElement(el)\n ) {\n // If the variable was already registered as a plural/select, it's normal\n // for it to also appear inside as number/date/time/argument — not a conflict.\n if (vars.has(el.value)) {\n const existingType = vars.get(el.value)!\n if (\n existingType !== el.type &&\n existingType !== TYPE.plural &&\n existingType !== TYPE.select\n ) {\n throw new Error(`Variable ${el.value} has conflicting types`)\n }\n } else {\n vars.set(el.value, el.type)\n }\n }\n\n if (isPluralElement(el) || isSelectElement(el)) {\n vars.set(el.value, el.type)\n Object.keys(el.options).forEach(k => {\n collectVariables(el.options[k].value, vars)\n })\n }\n\n if (isTagElement(el)) {\n vars.set(el.value, el.type)\n collectVariables(el.children, vars)\n }\n })\n}\n\ninterface IsStructurallySameResult {\n error?: Error\n success: boolean\n}\n\n/**\n * Check if 2 ASTs are structurally the same. This primarily means that\n * they have the same variables with the same type\n * @param a\n * @param b\n * @returns\n */\nexport function isStructurallySame(\n a: MessageFormatElement[],\n b: MessageFormatElement[]\n): IsStructurallySameResult {\n const aVars = new Map()\n const bVars = new Map()\n collectVariables(a, aVars)\n collectVariables(b, bVars)\n\n if (aVars.size !== bVars.size) {\n return {\n success: false,\n error: new Error(\n `Different number of variables: [${Array.from(aVars.keys()).join(', ')}] vs [${Array.from(bVars.keys()).join(', ')}]`\n ),\n }\n }\n\n return Array.from(aVars.entries()).reduce(\n (result, [key, type]) => {\n if (!result.success) {\n return result\n }\n const bType = bVars.get(key)\n if (bType == null) {\n return {\n success: false,\n error: new Error(`Missing variable ${key} in message`),\n }\n }\n if (bType !== type) {\n return {\n success: false,\n error: new Error(\n `Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`\n ),\n }\n }\n return result\n },\n {success: true}\n )\n}\n","export function parse(): void {\n throw new Error(\n \"You're trying to format an uncompiled message with react-intl without parser, please import from 'react-intl' instead\"\n )\n}\nexport * from '#packages/icu-messageformat-parser/types.js'\nexport const _Parser = undefined\nexport {isStructurallySame} from '#packages/icu-messageformat-parser/manipulator.js'\n"],"mappings":"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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/package.json b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6af9d0fd6c9b10046563004c8bbc81dbca1249db --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/package.json @@ -0,0 +1,21 @@ +{ + "name": "@formatjs/icu-messageformat-parser", + "version": "3.5.18", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/formatjs/formatjs.git", + "directory": "packages/icu-messageformat-parser" + }, + "type": "module", + "types": "index.d.ts", + "exports": { + ".": "./index.js", + "./manipulator.js": "./manipulator.js", + "./no-parser.js": "./no-parser.js", + "./printer.js": "./printer.js" + }, + "dependencies": { + "@formatjs/icu-skeleton-parser": "2.1.11" + } +} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9357c684f9290820ec8f5696b45501b9da34404 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts @@ -0,0 +1,154 @@ +import { NumberSkeletonToken } from "@formatjs/icu-skeleton-parser"; +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/icu-messageformat-parser/types.d.ts +interface ExtendedNumberFormatOptions extends NumberFormatOptions { + scale?: number; +} +declare enum TYPE { + /** + * Raw text + */ + literal = 0, + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + argument = 1, + /** + * Variable w/ number format + */ + number = 2, + /** + * Variable w/ date format + */ + date = 3, + /** + * Variable w/ time format + */ + time = 4, + /** + * Variable w/ select format + */ + select = 5, + /** + * Variable w/ plural format + */ + plural = 6, + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + pound = 7, + /** + * XML-like tag + */ + tag = 8 +} +declare enum SKELETON_TYPE { + number = 0, + dateTime = 1 +} +interface LocationDetails { + offset: number; + line: number; + column: number; +} +interface Location { + start: LocationDetails; + end: LocationDetails; +} +interface BaseElement { + type: T; + value: string; + location?: Location; +} +type LiteralElement = BaseElement; +type ArgumentElement = BaseElement; +interface TagElement extends BaseElement { + children: MessageFormatElement[]; +} +interface SimpleFormatElement extends BaseElement { + style?: string | S | null; +} +type NumberElement = SimpleFormatElement; +type DateElement = SimpleFormatElement; +type TimeElement = SimpleFormatElement; +type ValidPluralRule = "zero" | "one" | "two" | "few" | "many" | "other" | string; +interface PluralOrSelectOption { + value: MessageFormatElement[]; + location?: Location; +} +interface SelectElement extends BaseElement { + options: Record; +} +interface PluralElement extends BaseElement { + options: Record; + offset: number; + pluralType: Intl.PluralRulesOptions["type"]; +} +interface PoundElement { + type: TYPE.pound; + location?: Location; +} +type MessageFormatElement = ArgumentElement | DateElement | LiteralElement | NumberElement | PluralElement | PoundElement | SelectElement | TagElement | TimeElement; +interface NumberSkeleton { + type: SKELETON_TYPE.number; + tokens: NumberSkeletonToken[]; + location?: Location; + parsedOptions: ExtendedNumberFormatOptions; +} +interface DateTimeSkeleton { + type: SKELETON_TYPE.dateTime; + pattern: string; + location?: Location; + parsedOptions: Intl.DateTimeFormatOptions; +} +type Skeleton = NumberSkeleton | DateTimeSkeleton; +//#endregion +//#region packages/icu-messageformat-parser/printer.d.ts +export declare function printAST(ast: MessageFormatElement[]): string; +export declare function doPrintAST(ast: MessageFormatElement[], isInPlural: boolean): string; +export declare function printDateTimeSkeleton(style: DateTimeSkeleton): string; +//#endregion +//# sourceMappingURL=printer.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js new file mode 100644 index 0000000000000000000000000000000000000000..f9068eb454fdd5bddb94d49f72112503ab5591d7 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js @@ -0,0 +1,224 @@ +//#region packages/icu-messageformat-parser/types.ts +let TYPE = /* @__PURE__ */ function(TYPE) { + /** + * Raw text + */ + TYPE[TYPE["literal"] = 0] = "literal"; + /** + * Variable w/o any format, e.g `var` in `this is a {var}` + */ + TYPE[TYPE["argument"] = 1] = "argument"; + /** + * Variable w/ number format + */ + TYPE[TYPE["number"] = 2] = "number"; + /** + * Variable w/ date format + */ + TYPE[TYPE["date"] = 3] = "date"; + /** + * Variable w/ time format + */ + TYPE[TYPE["time"] = 4] = "time"; + /** + * Variable w/ select format + */ + TYPE[TYPE["select"] = 5] = "select"; + /** + * Variable w/ plural format + */ + TYPE[TYPE["plural"] = 6] = "plural"; + /** + * Only possible within plural argument. + * This is the `#` symbol that will be substituted with the count. + */ + TYPE[TYPE["pound"] = 7] = "pound"; + /** + * XML-like tag + */ + TYPE[TYPE["tag"] = 8] = "tag"; + return TYPE; +}({}); +/** +* Type Guards +*/ +function isLiteralElement(el) { + return el.type === 0; +} +function isArgumentElement(el) { + return el.type === 1; +} +function isNumberElement(el) { + return el.type === 2; +} +function isDateElement(el) { + return el.type === 3; +} +function isTimeElement(el) { + return el.type === 4; +} +function isSelectElement(el) { + return el.type === 5; +} +function isPluralElement(el) { + return el.type === 6; +} +function isPoundElement(el) { + return el.type === 7; +} +function isTagElement(el) { + return el.type === 8; +} +//#endregion +//#region packages/icu-messageformat-parser/printer.ts +function printAST(ast) { + return doPrintAST(ast, false); +} +function doPrintAST(ast, isInPlural) { + return ast.map((el, i) => { + if (isLiteralElement(el)) return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1); + if (isArgumentElement(el)) return printArgumentElement(el); + if (isDateElement(el) || isTimeElement(el) || isNumberElement(el)) return printSimpleFormatElement(el); + if (isPluralElement(el)) return printPluralElement(el); + if (isSelectElement(el)) return printSelectElement(el); + if (isPoundElement(el)) return "#"; + if (isTagElement(el)) return printTagElement(el, isInPlural); + }).join(""); +} +function printTagElement(el, isInPlural) { + return `<${el.value}>${doPrintAST(el.children, isInPlural)}`; +} +function quoteSyntaxToken(token) { + return `'${token.split("'").join("''")}'`; +} +function isAlpha(ch) { + if (!ch) return false; + const code = ch.charCodeAt(0); + return code >= 65 && code <= 90 || code >= 97 && code <= 122; +} +function isTagSyntaxStart(message, index) { + if (message[index] !== "<") return false; + const next = message[index + 1]; + return next === "/" || isAlpha(next); +} +function findTagSyntaxEnd(message, index) { + const closingIndex = message.indexOf(">", index + 1); + return closingIndex === -1 ? message.length : closingIndex + 1; +} +function findBraceSyntaxEnd(message, index) { + const closingIndex = message.indexOf("}", index + 1); + return closingIndex === -1 ? index + 1 : closingIndex + 1; +} +function printEscapedMessage(message, isInPlural = false) { + let result = ""; + let literalStart = 0; + let quotedStart = -1; + let quotedEnd = -1; + function flushQuotedToken() { + if (quotedStart === -1) return; + const literal = message.slice(literalStart, quotedStart); + result += literal; + if (literal.endsWith("'")) result += "'"; + result += quoteSyntaxToken(message.slice(quotedStart, quotedEnd)); + literalStart = quotedEnd; + quotedStart = -1; + } + function quoteToken(start, end) { + if (quotedStart !== -1 && start === quotedEnd) { + quotedEnd = end; + return; + } + flushQuotedToken(); + quotedStart = start; + quotedEnd = end; + } + for (let i = 0; i < message.length; i++) { + const ch = message[i]; + if (ch === "{") { + const end = findBraceSyntaxEnd(message, i); + quoteToken(i, end); + i = end - 1; + } else if (ch === "}") quoteToken(i, i + 1); + else if (isTagSyntaxStart(message, i)) { + const end = findTagSyntaxEnd(message, i); + quoteToken(i, end); + i = end - 1; + } else if (isInPlural && ch === "#") quoteToken(i, i + 1); + } + flushQuotedToken(); + return result + message.slice(literalStart); +} +function printLiteralElement({ value }, isInPlural, isFirstEl, isLastEl) { + let escaped = value; + if (!isFirstEl && escaped[0] === `'`) escaped = `''${escaped.slice(1)}`; + if (!isLastEl && escaped[escaped.length - 1] === `'`) escaped = `${escaped.slice(0, escaped.length - 1)}''`; + return printEscapedMessage(escaped, isInPlural); +} +function printArgumentElement({ value }) { + return `{${value}}`; +} +function printSimpleFormatElement(el) { + return `{${el.value}, ${TYPE[el.type]}${el.style ? `, ${printArgumentStyle(el.style)}` : ""}}`; +} +function printNumberSkeletonToken(token) { + const { stem, options } = token; + return options.length === 0 ? stem : `${stem}${options.map((o) => `/${o}`).join("")}`; +} +function printArgumentStyle(style) { + if (typeof style === "string") return printEscapedMessage(style); + else if (style.type === 1) return `::${printDateTimeSkeleton(style)}`; + else return `::${style.tokens.map(printNumberSkeletonToken).join(" ")}`; +} +function printDateTimeSkeleton(style) { + return style.pattern; +} +function compareCodePoints(a, b) { + const aIter = a[Symbol.iterator](); + const bIter = b[Symbol.iterator](); + while (true) { + const aNext = aIter.next(); + const bNext = bIter.next(); + if (aNext.done || bNext.done) return aNext.done === bNext.done ? 0 : aNext.done ? -1 : 1; + const diff = aNext.value.codePointAt(0) - bNext.value.codePointAt(0); + if (diff !== 0) return diff; + } +} +function printSelectElement(el) { + const keys = Object.keys(el.options).sort(compareCodePoints); + return `{${[ + el.value, + "select", + keys.map((id) => `${id}{${doPrintAST(el.options[id].value, false)}}`).join(" ") + ].join(",")}}`; +} +const PLURAL_RULE_ORDER = { + zero: 0, + one: 1, + two: 2, + few: 3, + many: 4, + other: 5 +}; +function getPluralRuleSortOrder(rule) { + const categoryOrder = PLURAL_RULE_ORDER[rule]; + if (categoryOrder !== void 0) return [categoryOrder, 0]; + const exactRule = rule.replace(/^=+/, ""); + return [6, /^[+-]?\d+$/.test(exactRule) ? Number(exactRule) : 0]; +} +function printPluralElement(el) { + const type = el.pluralType === "cardinal" ? "plural" : "selectordinal"; + const keys = Object.keys(el.options).sort((a, b) => { + const [pa, sa] = getPluralRuleSortOrder(a); + const [pb, sb] = getPluralRuleSortOrder(b); + return pa - pb || sa - sb; + }); + return `{${[ + el.value, + type, + [el.offset ? `offset:${el.offset}` : "", ...keys.map((id) => `${id}{${doPrintAST(el.options[id].value, true)}}`)].filter(Boolean).join(" ") + ].join(",")}}`; +} +//#endregion +export { doPrintAST, printAST, printDateTimeSkeleton }; + +//# sourceMappingURL=printer.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js.map b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js.map new file mode 100644 index 0000000000000000000000000000000000000000..0bdc1417993eca0b3b17a44e34710b80970fa622 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-messageformat-parser/printer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"printer.js","names":[],"sources":["../types.ts","../printer.ts"],"sourcesContent":["import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {type NumberSkeletonToken} from '@formatjs/icu-skeleton-parser'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\n\nexport enum TYPE {\n /**\n * Raw text\n */\n literal,\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n argument,\n /**\n * Variable w/ number format\n */\n number,\n /**\n * Variable w/ date format\n */\n date,\n /**\n * Variable w/ time format\n */\n time,\n /**\n * Variable w/ select format\n */\n select,\n /**\n * Variable w/ plural format\n */\n plural,\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n pound,\n /**\n * XML-like tag\n */\n tag,\n}\n\nexport enum SKELETON_TYPE {\n number,\n dateTime,\n}\n\nexport interface LocationDetails {\n offset: number\n line: number\n column: number\n}\nexport interface Location {\n start: LocationDetails\n end: LocationDetails\n}\n\nexport interface BaseElement {\n type: T\n value: string\n location?: Location\n}\n\nexport type LiteralElement = BaseElement\nexport type ArgumentElement = BaseElement\nexport interface TagElement extends BaseElement {\n children: MessageFormatElement[]\n}\n\nexport interface SimpleFormatElement<\n T extends TYPE,\n S extends Skeleton,\n> extends BaseElement {\n style?: string | S | null\n}\n\nexport type NumberElement = SimpleFormatElement\nexport type DateElement = SimpleFormatElement\nexport type TimeElement = SimpleFormatElement\n\nexport type ValidPluralRule =\n | 'zero'\n | 'one'\n | 'two'\n | 'few'\n | 'many'\n | 'other'\n | string\n\nexport interface PluralOrSelectOption {\n value: MessageFormatElement[]\n location?: Location\n}\n\nexport interface SelectElement extends BaseElement {\n options: Record\n}\n\nexport interface PluralElement extends BaseElement {\n options: Record\n offset: number\n pluralType: Intl.PluralRulesOptions['type']\n}\n\nexport interface PoundElement {\n type: TYPE.pound\n location?: Location\n}\n\nexport type MessageFormatElement =\n | ArgumentElement\n | DateElement\n | LiteralElement\n | NumberElement\n | PluralElement\n | PoundElement\n | SelectElement\n | TagElement\n | TimeElement\n\nexport interface NumberSkeleton {\n type: SKELETON_TYPE.number\n tokens: NumberSkeletonToken[]\n location?: Location\n parsedOptions: ExtendedNumberFormatOptions\n}\n\nexport interface DateTimeSkeleton {\n type: SKELETON_TYPE.dateTime\n pattern: string\n location?: Location\n parsedOptions: Intl.DateTimeFormatOptions\n}\n\nexport type Skeleton = NumberSkeleton | DateTimeSkeleton\n\n/**\n * Type Guards\n */\nexport function isLiteralElement(\n el: MessageFormatElement\n): el is LiteralElement {\n return el.type === TYPE.literal\n}\nexport function isArgumentElement(\n el: MessageFormatElement\n): el is ArgumentElement {\n return el.type === TYPE.argument\n}\nexport function isNumberElement(el: MessageFormatElement): el is NumberElement {\n return el.type === TYPE.number\n}\nexport function isDateElement(el: MessageFormatElement): el is DateElement {\n return el.type === TYPE.date\n}\nexport function isTimeElement(el: MessageFormatElement): el is TimeElement {\n return el.type === TYPE.time\n}\nexport function isSelectElement(el: MessageFormatElement): el is SelectElement {\n return el.type === TYPE.select\n}\nexport function isPluralElement(el: MessageFormatElement): el is PluralElement {\n return el.type === TYPE.plural\n}\nexport function isPoundElement(el: MessageFormatElement): el is PoundElement {\n return el.type === TYPE.pound\n}\nexport function isTagElement(el: MessageFormatElement): el is TagElement {\n return el.type === TYPE.tag\n}\nexport function isNumberSkeleton(\n el: NumberElement['style'] | Skeleton\n): el is NumberSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number)\n}\nexport function isDateTimeSkeleton(\n el?: DateElement['style'] | TimeElement['style'] | Skeleton\n): el is DateTimeSkeleton {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime)\n}\n\nexport function createLiteralElement(value: string): LiteralElement {\n return {\n type: TYPE.literal,\n value,\n }\n}\n\nexport function createNumberElement(\n value: string,\n style?: string | null\n): NumberElement {\n return {\n type: TYPE.number,\n value,\n style,\n }\n}\n","import {type NumberSkeletonToken} from '@formatjs/icu-skeleton-parser'\nimport {\n type ArgumentElement,\n type DateElement,\n type DateTimeSkeleton,\n isArgumentElement,\n isDateElement,\n isLiteralElement,\n isNumberElement,\n isPluralElement,\n isPoundElement,\n isSelectElement,\n isTagElement,\n isTimeElement,\n type LiteralElement,\n type MessageFormatElement,\n type NumberElement,\n type PluralElement,\n type SelectElement,\n type Skeleton,\n SKELETON_TYPE,\n type TagElement,\n type TimeElement,\n TYPE,\n} from '#packages/icu-messageformat-parser/types.js'\n\nexport function printAST(ast: MessageFormatElement[]): string {\n return doPrintAST(ast, false)\n}\n\nexport function doPrintAST(\n ast: MessageFormatElement[],\n isInPlural: boolean\n): string {\n const printedNodes = ast.map((el, i) => {\n if (isLiteralElement(el)) {\n return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1)\n }\n\n if (isArgumentElement(el)) {\n return printArgumentElement(el)\n }\n if (isDateElement(el) || isTimeElement(el) || isNumberElement(el)) {\n return printSimpleFormatElement(el)\n }\n\n if (isPluralElement(el)) {\n return printPluralElement(el)\n }\n\n if (isSelectElement(el)) {\n return printSelectElement(el)\n }\n\n if (isPoundElement(el)) {\n return '#'\n }\n if (isTagElement(el)) {\n return printTagElement(el, isInPlural)\n }\n })\n\n return printedNodes.join('')\n}\n\nfunction printTagElement(el: TagElement, isInPlural: boolean): string {\n return `<${el.value}>${doPrintAST(el.children, isInPlural)}`\n}\n\nfunction quoteSyntaxToken(token: string): string {\n return `'${token.split(\"'\").join(\"''\")}'`\n}\n\nfunction isAlpha(ch: string | undefined): boolean {\n if (!ch) {\n return false\n }\n const code = ch.charCodeAt(0)\n return (code >= 65 && code <= 90) || (code >= 97 && code <= 122)\n}\n\nfunction isTagSyntaxStart(message: string, index: number): boolean {\n if (message[index] !== '<') {\n return false\n }\n const next = message[index + 1]\n return next === '/' || isAlpha(next)\n}\n\nfunction findTagSyntaxEnd(message: string, index: number): number {\n const closingIndex = message.indexOf('>', index + 1)\n return closingIndex === -1 ? message.length : closingIndex + 1\n}\n\nfunction findBraceSyntaxEnd(message: string, index: number): number {\n const closingIndex = message.indexOf('}', index + 1)\n return closingIndex === -1 ? index + 1 : closingIndex + 1\n}\n\nfunction printEscapedMessage(message: string, isInPlural = false): string {\n let result = ''\n let literalStart = 0\n let quotedStart = -1\n let quotedEnd = -1\n\n function flushQuotedToken() {\n if (quotedStart === -1) {\n return\n }\n\n const literal = message.slice(literalStart, quotedStart)\n result += literal\n if (literal.endsWith(\"'\")) {\n result += \"'\"\n }\n result += quoteSyntaxToken(message.slice(quotedStart, quotedEnd))\n literalStart = quotedEnd\n quotedStart = -1\n }\n\n function quoteToken(start: number, end: number) {\n if (quotedStart !== -1 && start === quotedEnd) {\n quotedEnd = end\n return\n }\n\n flushQuotedToken()\n quotedStart = start\n quotedEnd = end\n }\n\n for (let i = 0; i < message.length; i++) {\n const ch = message[i]\n if (ch === '{') {\n const end = findBraceSyntaxEnd(message, i)\n quoteToken(i, end)\n i = end - 1\n } else if (ch === '}') {\n quoteToken(i, i + 1)\n } else if (isTagSyntaxStart(message, i)) {\n const end = findTagSyntaxEnd(message, i)\n quoteToken(i, end)\n i = end - 1\n } else if (isInPlural && ch === '#') {\n quoteToken(i, i + 1)\n }\n }\n\n flushQuotedToken()\n return result + message.slice(literalStart)\n}\n\nfunction printLiteralElement(\n {value}: LiteralElement,\n isInPlural: boolean,\n isFirstEl: boolean,\n isLastEl: boolean\n) {\n let escaped = value\n // If this literal starts with a ' and its not the 1st node, this means the node before it is non-literal\n // and the `'` needs to be unescaped\n if (!isFirstEl && escaped[0] === `'`) {\n escaped = `''${escaped.slice(1)}`\n }\n // Same logic but for last el\n if (!isLastEl && escaped[escaped.length - 1] === `'`) {\n escaped = `${escaped.slice(0, escaped.length - 1)}''`\n }\n return printEscapedMessage(escaped, isInPlural)\n}\n\nfunction printArgumentElement({value}: ArgumentElement) {\n return `{${value}}`\n}\n\nfunction printSimpleFormatElement(\n el: DateElement | TimeElement | NumberElement\n) {\n return `{${el.value}, ${TYPE[el.type]}${\n el.style ? `, ${printArgumentStyle(el.style)}` : ''\n }}`\n}\n\nfunction printNumberSkeletonToken(token: NumberSkeletonToken): string {\n const {stem, options} = token\n return options.length === 0\n ? stem\n : `${stem}${options.map(o => `/${o}`).join('')}`\n}\n\nfunction printArgumentStyle(style: string | Skeleton) {\n if (typeof style === 'string') {\n return printEscapedMessage(style)\n } else if (style.type === SKELETON_TYPE.dateTime) {\n return `::${printDateTimeSkeleton(style)}`\n } else {\n return `::${style.tokens.map(printNumberSkeletonToken).join(' ')}`\n }\n}\n\nexport function printDateTimeSkeleton(style: DateTimeSkeleton): string {\n return style.pattern\n}\n\n// Rust string ordering is UTF-8 lexicographic, which matches code point order.\nfunction compareCodePoints(a: string, b: string): number {\n const aIter = a[Symbol.iterator]()\n const bIter = b[Symbol.iterator]()\n\n while (true) {\n const aNext = aIter.next()\n const bNext = bIter.next()\n if (aNext.done || bNext.done) {\n return aNext.done === bNext.done ? 0 : aNext.done ? -1 : 1\n }\n\n const diff = aNext.value.codePointAt(0)! - bNext.value.codePointAt(0)!\n if (diff !== 0) {\n return diff\n }\n }\n}\n\nfunction printSelectElement(el: SelectElement) {\n const keys = Object.keys(el.options).sort(compareCodePoints)\n const msg = [\n el.value,\n 'select',\n keys\n .map(id => `${id}{${doPrintAST(el.options[id].value, false)}}`)\n .join(' '),\n ].join(',')\n return `{${msg}}`\n}\n\nconst PLURAL_RULE_ORDER: Record = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 4,\n other: 5,\n}\n\nfunction getPluralRuleSortOrder(rule: string): [number, number] {\n const categoryOrder = PLURAL_RULE_ORDER[rule]\n if (categoryOrder !== undefined) {\n return [categoryOrder, 0]\n }\n\n const exactRule = rule.replace(/^=+/, '')\n const exactValue = /^[+-]?\\d+$/.test(exactRule) ? Number(exactRule) : 0\n return [6, exactValue]\n}\n\nfunction printPluralElement(el: PluralElement) {\n const type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal'\n const keys = Object.keys(el.options).sort((a, b) => {\n const [pa, sa] = getPluralRuleSortOrder(a)\n const [pb, sb] = getPluralRuleSortOrder(b)\n return pa - pb || sa - sb\n })\n const msg = [\n el.value,\n type,\n [\n el.offset ? `offset:${el.offset}` : '',\n ...keys.map(id => `${id}{${doPrintAST(el.options[id].value, true)}}`),\n ]\n .filter(Boolean)\n .join(' '),\n ].join(',')\n return `{${msg}}`\n}\n"],"mappings":"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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..479ee16faa726e67271b765e8c71a28f6063993e --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2023 FormatJS + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/README.md b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f50682f5e593ec542df54c098049df6c39294d2a --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/README.md @@ -0,0 +1 @@ +# icu-skeleton-parser diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.d.ts b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..251ae9846155c10a7c10435666df980f0ab8b3ec --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.d.ts @@ -0,0 +1,68 @@ +//#region packages/icu-skeleton-parser/date-time.d.ts +/** +* Parse Date time skeleton into Intl.DateTimeFormatOptions +* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +* @public +* @param skeleton skeleton string +*/ +declare function parseDateTimeSkeleton(skeleton: string): Intl.DateTimeFormatOptions; +//#endregion +//#region packages/ecma402-abstract/types/number.d.ts +type NumberFormatNotation = "standard" | "scientific" | "engineering" | "compact"; +type RoundingPriorityType = "auto" | "morePrecision" | "lessPrecision"; +type RoundingModeType = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; +type UseGroupingType = "min2" | "auto" | "always" | boolean; +interface NumberFormatDigitOptions { + minimumIntegerDigits?: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + minimumFractionDigits?: number; + maximumFractionDigits?: number; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + trailingZeroDisplay?: TrailingZeroDisplay; +} +type NumberFormatOptionsLocaleMatcher = "lookup" | "best fit"; +type NumberFormatOptionsStyle = "decimal" | "percent" | "currency" | "unit"; +type NumberFormatOptionsCompactDisplay = "short" | "long"; +type NumberFormatOptionsCurrencyDisplay = "symbol" | "code" | "name" | "narrowSymbol"; +type NumberFormatOptionsCurrencySign = "standard" | "accounting"; +type NumberFormatOptionsNotation = NumberFormatNotation; +type NumberFormatOptionsSignDisplay = "auto" | "always" | "never" | "exceptZero" | "negative"; +type NumberFormatOptionsUnitDisplay = "long" | "short" | "narrow"; +type TrailingZeroDisplay = "auto" | "stripIfInteger"; +type NumberFormatOptions = Omit & NumberFormatDigitOptions & { + localeMatcher?: NumberFormatOptionsLocaleMatcher; + style?: NumberFormatOptionsStyle; + compactDisplay?: NumberFormatOptionsCompactDisplay; + currencyDisplay?: NumberFormatOptionsCurrencyDisplay; + currencySign?: NumberFormatOptionsCurrencySign; + notation?: NumberFormatOptionsNotation; + signDisplay?: NumberFormatOptionsSignDisplay; + unit?: string; + unitDisplay?: NumberFormatOptionsUnitDisplay; + numberingSystem?: string; + trailingZeroDisplay?: TrailingZeroDisplay; + roundingPriority?: RoundingPriorityType; + roundingIncrement?: number; + roundingMode?: RoundingModeType; + useGrouping?: UseGroupingType; +}; +//#endregion +//#region packages/icu-skeleton-parser/number.d.ts +interface ExtendedNumberFormatOptions extends NumberFormatOptions { + scale?: number; +} +interface NumberSkeletonToken { + stem: string; + options: string[]; +} +declare function parseNumberSkeletonFromString(skeleton: string): NumberSkeletonToken[]; +/** +* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options +*/ +declare function parseNumberSkeleton(tokens: NumberSkeletonToken[]): ExtendedNumberFormatOptions; +//#endregion +export { ExtendedNumberFormatOptions, NumberSkeletonToken, parseDateTimeSkeleton, parseNumberSkeleton, parseNumberSkeletonFromString }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..93049a268abb73f4003c26d273b3ac686e50f657 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js @@ -0,0 +1,380 @@ +//#region packages/icu-skeleton-parser/date-time.ts +/** +* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js +* with some tweaks +*/ +const DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; +/** +* Parse Date time skeleton into Intl.DateTimeFormatOptions +* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table +* @public +* @param skeleton skeleton string +*/ +function parseDateTimeSkeleton(skeleton) { + const result = {}; + skeleton.replace(DATE_TIME_REGEX, (match) => { + const len = match.length; + switch (match[0]) { + case "G": + result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; + break; + case "y": + result.year = len === 2 ? "2-digit" : "numeric"; + break; + case "Y": + case "u": + case "U": + case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); + case "q": + case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported"); + case "M": + case "L": + result.month = [ + "numeric", + "2-digit", + "short", + "long", + "narrow" + ][len - 1]; + break; + case "w": + case "W": throw new RangeError("`w/W` (week) patterns are not supported"); + case "d": + result.day = ["numeric", "2-digit"][len - 1]; + break; + case "D": + case "F": + case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); + case "E": + result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; + break; + case "e": + if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); + result.weekday = [ + "short", + "long", + "narrow", + "short" + ][len - 3]; + break; + case "c": + if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); + result.weekday = [ + "short", + "long", + "narrow", + "short" + ][len - 3]; + break; + case "a": + result.hour12 = true; + break; + case "b": + case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); + case "h": + result.hourCycle = "h12"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "H": + result.hourCycle = "h23"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "K": + result.hourCycle = "h11"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "k": + result.hourCycle = "h24"; + result.hour = ["numeric", "2-digit"][len - 1]; + break; + case "j": + case "J": + case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); + case "m": + result.minute = ["numeric", "2-digit"][len - 1]; + break; + case "s": + result.second = ["numeric", "2-digit"][len - 1]; + break; + case "S": + case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); + case "z": + result.timeZoneName = len < 4 ? "short" : "long"; + break; + case "Z": + case "O": + case "v": + case "V": + case "X": + case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); + } + return ""; + }); + return result; +} +//#endregion +//#region node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js +const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +//#endregion +//#region packages/icu-skeleton-parser/number.ts +function parseNumberSkeletonFromString(skeleton) { + if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty"); + const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0); + const tokens = []; + for (const stringToken of stringTokens) { + let stemAndOptions = stringToken.split("/"); + if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton"); + const [stem, ...options] = stemAndOptions; + for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton"); + tokens.push({ + stem, + options + }); + } + return tokens; +} +function icuUnitToEcma(unit) { + return unit.replace(/^(.*?)-/, ""); +} +const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; +const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; +const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; +const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; +function parseSignificantPrecision(str) { + const result = {}; + if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision"; + else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision"; + str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) { + if (typeof g2 !== "string") { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length; + } else if (g2 === "+") result.minimumSignificantDigits = g1.length; + else if (g1[0] === "#") result.maximumSignificantDigits = g1.length; + else { + result.minimumSignificantDigits = g1.length; + result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0); + } + return ""; + }); + return result; +} +function parseSign(str) { + switch (str) { + case "sign-auto": return { signDisplay: "auto" }; + case "sign-accounting": + case "()": return { currencySign: "accounting" }; + case "sign-always": + case "+!": return { signDisplay: "always" }; + case "sign-accounting-always": + case "()!": return { + signDisplay: "always", + currencySign: "accounting" + }; + case "sign-except-zero": + case "+?": return { signDisplay: "exceptZero" }; + case "sign-accounting-except-zero": + case "()?": return { + signDisplay: "exceptZero", + currencySign: "accounting" + }; + case "sign-never": + case "+_": return { signDisplay: "never" }; + } +} +function parseConciseScientificAndEngineeringStem(stem) { + let result; + if (stem[0] === "E" && stem[1] === "E") { + result = { notation: "engineering" }; + stem = stem.slice(2); + } else if (stem[0] === "E") { + result = { notation: "scientific" }; + stem = stem.slice(1); + } + if (result) { + const signDisplay = stem.slice(0, 2); + if (signDisplay === "+!") { + result.signDisplay = "always"; + stem = stem.slice(2); + } else if (signDisplay === "+?") { + result.signDisplay = "exceptZero"; + stem = stem.slice(2); + } + if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation"); + result.minimumIntegerDigits = stem.length; + } + return result; +} +function parseNotationOptions(opt) { + const result = {}; + const signOpts = parseSign(opt); + if (signOpts) return signOpts; + return result; +} +/** +* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options +*/ +function parseNumberSkeleton(tokens) { + let result = {}; + for (const token of tokens) { + switch (token.stem) { + case "percent": + case "%": + result.style = "percent"; + continue; + case "%x100": + result.style = "percent"; + result.scale = 100; + continue; + case "currency": + result.style = "currency"; + result.currency = token.options[0]; + continue; + case "group-off": + case ",_": + result.useGrouping = false; + continue; + case "precision-integer": + case ".": + result.maximumFractionDigits = 0; + continue; + case "measure-unit": + case "unit": + result.style = "unit"; + result.unit = icuUnitToEcma(token.options[0]); + continue; + case "compact-short": + case "K": + result.notation = "compact"; + result.compactDisplay = "short"; + continue; + case "compact-long": + case "KK": + result.notation = "compact"; + result.compactDisplay = "long"; + continue; + case "scientific": + result = { + ...result, + notation: "scientific", + ...token.options.reduce((all, opt) => ({ + ...all, + ...parseNotationOptions(opt) + }), {}) + }; + continue; + case "engineering": + result = { + ...result, + notation: "engineering", + ...token.options.reduce((all, opt) => ({ + ...all, + ...parseNotationOptions(opt) + }), {}) + }; + continue; + case "notation-simple": + result.notation = "standard"; + continue; + case "unit-width-narrow": + result.currencyDisplay = "narrowSymbol"; + result.unitDisplay = "narrow"; + continue; + case "unit-width-short": + result.currencyDisplay = "code"; + result.unitDisplay = "short"; + continue; + case "unit-width-full-name": + result.currencyDisplay = "name"; + result.unitDisplay = "long"; + continue; + case "unit-width-iso-code": + result.currencyDisplay = "symbol"; + continue; + case "scale": + result.scale = parseFloat(token.options[0]); + continue; + case "rounding-mode-floor": + result.roundingMode = "floor"; + continue; + case "rounding-mode-ceiling": + result.roundingMode = "ceil"; + continue; + case "rounding-mode-down": + result.roundingMode = "trunc"; + continue; + case "rounding-mode-up": + result.roundingMode = "expand"; + continue; + case "rounding-mode-half-even": + result.roundingMode = "halfEven"; + continue; + case "rounding-mode-half-down": + result.roundingMode = "halfTrunc"; + continue; + case "rounding-mode-half-up": + result.roundingMode = "halfExpand"; + continue; + case "integer-width": + if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); + token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) { + if (g1) result.minimumIntegerDigits = g2.length; + else if (g3 && g4) throw new Error("We currently do not support maximum integer digits"); + else if (g5) throw new Error("We currently do not support exact integer digits"); + return ""; + }); + continue; + } + if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { + result.minimumIntegerDigits = token.stem.length; + continue; + } + if (FRACTION_PRECISION_REGEX.test(token.stem)) { + if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); + token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) { + if (g2 === "*") result.minimumFractionDigits = g1.length; + else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length; + else if (g4 && g5) { + result.minimumFractionDigits = g4.length; + result.maximumFractionDigits = g4.length + g5.length; + } else { + result.minimumFractionDigits = g1.length; + result.maximumFractionDigits = g1.length; + } + return ""; + }); + const opt = token.options[0]; + if (opt === "w") result = { + ...result, + trailingZeroDisplay: "stripIfInteger" + }; + else if (opt) result = { + ...result, + ...parseSignificantPrecision(opt) + }; + continue; + } + if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { + result = { + ...result, + ...parseSignificantPrecision(token.stem) + }; + continue; + } + const signOpts = parseSign(token.stem); + if (signOpts) result = { + ...result, + ...signOpts + }; + const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); + if (conciseScientificAndEngineeringOpts) result = { + ...result, + ...conciseScientificAndEngineeringOpts + }; + } + return result; +} +//#endregion +export { parseDateTimeSkeleton, parseNumberSkeleton, parseNumberSkeletonFromString }; + +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js.map b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..7346b9b98905514d4aac301522feb02427445b75 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":[],"sources":["../date-time.ts","../../../node_modules/.aspect_rules_js/@formatjs_generated+unicode@0.0.0/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js","../number.ts"],"sourcesContent":["/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nconst DATE_TIME_REGEX =\n /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g\n\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(\n skeleton: string\n): Intl.DateTimeFormatOptions {\n const result: Intl.DateTimeFormatOptions = {}\n skeleton.replace(DATE_TIME_REGEX, match => {\n const len = match.length\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'\n break\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric'\n break\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError(\n '`Y/u/U/r` (year) patterns are not supported, use `y` instead'\n )\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported')\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][\n len - 1\n ] as 'numeric'\n break\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported')\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError(\n '`D/F/g` (day) patterns are not supported, use `d` instead'\n )\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'\n break\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported')\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][\n len - 3\n ] as 'short'\n break\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported')\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][\n len - 3\n ] as 'short'\n break\n\n // Period\n case 'a': // AM, PM\n result.hour12 = true\n break\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError(\n '`b/B` (period) patterns are not supported, use `a` instead'\n )\n // Hour\n case 'h':\n result.hourCycle = 'h12'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'H':\n result.hourCycle = 'h23'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'K':\n result.hourCycle = 'h11'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'k':\n result.hourCycle = 'h24'\n result.hour = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError(\n '`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead'\n )\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1] as 'numeric'\n break\n case 'S':\n case 'A':\n throw new RangeError(\n '`S/A` (second) patterns are not supported, use `s` instead'\n )\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long'\n break\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError(\n '`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead'\n )\n }\n return ''\n })\n return result\n}\n","// @generated from regex-gen.ts\nexport const WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import type {NumberFormatOptions} from '#packages/ecma402-abstract/types/number.js'\nimport {WHITE_SPACE_REGEX} from '@formatjs_generated/unicode/icu-skeleton-parser-regex.js'\n\nexport interface ExtendedNumberFormatOptions extends NumberFormatOptions {\n scale?: number\n}\nexport interface NumberSkeletonToken {\n stem: string\n options: string[]\n}\n\nexport function parseNumberSkeletonFromString(\n skeleton: string\n): NumberSkeletonToken[] {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty')\n }\n // Parse the skeleton\n const stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(x => x.length > 0)\n\n const tokens: NumberSkeletonToken[] = []\n for (const stringToken of stringTokens) {\n let stemAndOptions = stringToken.split('/')\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton')\n }\n\n const [stem, ...options] = stemAndOptions\n for (const option of options) {\n if (option.length === 0) {\n throw new Error('Invalid number skeleton')\n }\n }\n\n tokens.push({stem, options})\n }\n return tokens\n}\n\nfunction icuUnitToEcma(unit: string): ExtendedNumberFormatOptions['unit'] {\n return unit.replace(/^(.*?)-/, '') as ExtendedNumberFormatOptions['unit']\n}\n\nconst FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g\nconst SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g\nconst INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g\nconst CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/\n\nfunction parseSignificantPrecision(str: string): ExtendedNumberFormatOptions {\n const result: ExtendedNumberFormatOptions = {}\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision'\n } else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision'\n }\n str.replace(\n SIGNIFICANT_PRECISION_REGEX,\n function (_: string, g1: string, g2: string | number) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length\n result.maximumSignificantDigits = g1.length\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0)\n }\n return ''\n }\n )\n return result\n}\n\nfunction parseSign(str: string): ExtendedNumberFormatOptions | undefined {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n }\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n }\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n }\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n }\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n }\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n }\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n }\n }\n}\n\nfunction parseConciseScientificAndEngineeringStem(\n stem: string\n): ExtendedNumberFormatOptions | undefined {\n // Engineering\n let result: ExtendedNumberFormatOptions | undefined\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n }\n stem = stem.slice(2)\n } else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n }\n stem = stem.slice(1)\n }\n if (result) {\n const signDisplay = stem.slice(0, 2)\n if (signDisplay === '+!') {\n result.signDisplay = 'always'\n stem = stem.slice(2)\n } else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero'\n stem = stem.slice(2)\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation')\n }\n result.minimumIntegerDigits = stem.length\n }\n return result\n}\n\nfunction parseNotationOptions(opt: string): ExtendedNumberFormatOptions {\n const result: ExtendedNumberFormatOptions = {}\n const signOpts = parseSign(opt)\n if (signOpts) {\n return signOpts\n }\n return result\n}\n\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(\n tokens: NumberSkeletonToken[]\n): ExtendedNumberFormatOptions {\n let result: ExtendedNumberFormatOptions = {}\n for (const token of tokens) {\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent'\n continue\n case '%x100':\n result.style = 'percent'\n result.scale = 100\n continue\n case 'currency':\n result.style = 'currency'\n result.currency = token.options[0]\n continue\n case 'group-off':\n case ',_':\n result.useGrouping = false\n continue\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0\n continue\n case 'measure-unit':\n case 'unit':\n result.style = 'unit'\n result.unit = icuUnitToEcma(token.options[0])\n continue\n case 'compact-short':\n case 'K':\n result.notation = 'compact'\n result.compactDisplay = 'short'\n continue\n case 'compact-long':\n case 'KK':\n result.notation = 'compact'\n result.compactDisplay = 'long'\n continue\n case 'scientific':\n result = {\n ...result,\n notation: 'scientific',\n ...token.options.reduce(\n (all, opt) => ({...all, ...parseNotationOptions(opt)}),\n {}\n ),\n }\n continue\n case 'engineering':\n result = {\n ...result,\n notation: 'engineering',\n ...token.options.reduce(\n (all, opt) => ({...all, ...parseNotationOptions(opt)}),\n {}\n ),\n }\n continue\n case 'notation-simple':\n result.notation = 'standard'\n continue\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol'\n result.unitDisplay = 'narrow'\n continue\n case 'unit-width-short':\n result.currencyDisplay = 'code'\n result.unitDisplay = 'short'\n continue\n case 'unit-width-full-name':\n result.currencyDisplay = 'name'\n result.unitDisplay = 'long'\n continue\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol'\n continue\n case 'scale':\n result.scale = parseFloat(token.options[0])\n continue\n case 'rounding-mode-floor':\n result.roundingMode = 'floor'\n continue\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil'\n continue\n case 'rounding-mode-down':\n result.roundingMode = 'trunc'\n continue\n case 'rounding-mode-up':\n result.roundingMode = 'expand'\n continue\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven'\n continue\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc'\n continue\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand'\n continue\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError(\n 'integer-width stems only accept a single optional option'\n )\n }\n token.options[0].replace(\n INTEGER_WIDTH_REGEX,\n function (\n _: string,\n g1: string,\n g2: string,\n g3: string,\n g4: string,\n g5: string\n ) {\n if (g1) {\n result.minimumIntegerDigits = g2.length\n } else if (g3 && g4) {\n throw new Error(\n 'We currently do not support maximum integer digits'\n )\n } else if (g5) {\n throw new Error(\n 'We currently do not support exact integer digits'\n )\n }\n return ''\n }\n )\n continue\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length\n continue\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError(\n 'Fraction-precision stems only accept a single optional option'\n )\n }\n token.stem.replace(\n FRACTION_PRECISION_REGEX,\n function (\n _: string,\n g1: string,\n g2: string | number,\n g3: string,\n g4: string,\n g5: string\n ) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length\n result.maximumFractionDigits = g4.length + g5.length\n } else {\n result.minimumFractionDigits = g1.length\n result.maximumFractionDigits = g1.length\n }\n return ''\n }\n )\n\n const opt = token.options[0]\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = {...result, trailingZeroDisplay: 'stripIfInteger'}\n } else if (opt) {\n result = {...result, ...parseSignificantPrecision(opt)}\n }\n continue\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = {...result, ...parseSignificantPrecision(token.stem)}\n continue\n }\n const signOpts = parseSign(token.stem)\n if (signOpts) {\n result = {...result, ...signOpts}\n }\n const conciseScientificAndEngineeringOpts =\n parseConciseScientificAndEngineeringStem(token.stem)\n if (conciseScientificAndEngineeringOpts) {\n result = {...result, ...conciseScientificAndEngineeringOpts}\n }\n }\n return result\n}\n"],"x_google_ignoreList":[1],"mappings":"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"} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/package.json b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a52f30320afcd7fd6f2616d6b3df270358514bf0 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/node_modules/@formatjs/icu-skeleton-parser/package.json @@ -0,0 +1,15 @@ +{ + "name": "@formatjs/icu-skeleton-parser", + "version": "2.1.11", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/formatjs/formatjs.git", + "directory": "packages/icu-skeleton-parser" + }, + "type": "module", + "types": "index.d.ts", + "exports": { + ".": "./index.js" + } +} \ No newline at end of file diff --git a/e-commerce/node_modules/intl-messageformat/package.json b/e-commerce/node_modules/intl-messageformat/package.json new file mode 100644 index 0000000000000000000000000000000000000000..260a40eb183abbca9a6f274c715a40a47e1f1d66 --- /dev/null +++ b/e-commerce/node_modules/intl-messageformat/package.json @@ -0,0 +1,40 @@ +{ + "name": "intl-messageformat", + "version": "11.2.15", + "description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.", + "keywords": [ + "globalization", + "i18n", + "icu", + "internationalization", + "intl", + "localization", + "messageformat", + "parser", + "plural" + ], + "homepage": "https://github.com/formatjs/formatjs", + "bugs": "https://github.com/formatjs/formatjs/issues", + "license": "BSD-3-Clause", + "author": "Eric Ferraiuolo ", + "contributors": [ + "Anthony Pipkin ", + "Caridy Patino ", + "Drew Folta ", + "Long Ho " + ], + "repository": { + "type": "git", + "url": "git@github.com:formatjs/formatjs.git" + }, + "type": "module", + "sideEffects": false, + "types": "index.d.ts", + "exports": { + ".": "./index.js" + }, + "dependencies": { + "@formatjs/fast-memoize": "3.1.7", + "@formatjs/icu-messageformat-parser": "3.5.18" + } +} \ No newline at end of file diff --git a/e-commerce/node_modules/is-extglob/LICENSE b/e-commerce/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..842218cf09a20282e926305e01162174ab371a52 --- /dev/null +++ b/e-commerce/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/e-commerce/node_modules/is-extglob/README.md b/e-commerce/node_modules/is-extglob/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0416af5c326983f8817331b7a08f1cbbe22490e5 --- /dev/null +++ b/e-commerce/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/e-commerce/node_modules/is-extglob/index.js b/e-commerce/node_modules/is-extglob/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c1d986fc5120301c654f87ee329241190b6e1987 --- /dev/null +++ b/e-commerce/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/e-commerce/node_modules/is-extglob/package.json b/e-commerce/node_modules/is-extglob/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7a908369d39f558028f5345dd89b27c62d4d693c --- /dev/null +++ b/e-commerce/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/e-commerce/node_modules/is-glob/LICENSE b/e-commerce/node_modules/is-glob/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3f2eca18f1bc0f3117748e2cea9251e5182db2f7 --- /dev/null +++ b/e-commerce/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/e-commerce/node_modules/is-glob/README.md b/e-commerce/node_modules/is-glob/README.md new file mode 100644 index 0000000000000000000000000000000000000000..740724b276e289aec14ee6ce99d42ab9a6eb4b48 --- /dev/null +++ b/e-commerce/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/e-commerce/node_modules/is-glob/index.js b/e-commerce/node_modules/is-glob/index.js new file mode 100644 index 0000000000000000000000000000000000000000..620f563eccf081ce0d2db2dda5c9989baf778183 --- /dev/null +++ b/e-commerce/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; diff --git a/e-commerce/node_modules/is-glob/package.json b/e-commerce/node_modules/is-glob/package.json new file mode 100644 index 0000000000000000000000000000000000000000..858af0378e9d36813353b51271aec88ee0d3328b --- /dev/null +++ b/e-commerce/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/e-commerce/node_modules/jiti/LICENSE b/e-commerce/node_modules/jiti/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e739abce461d8b2899aaec6529a4af24a417e0fc --- /dev/null +++ b/e-commerce/node_modules/jiti/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pooya Parsa + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/e-commerce/node_modules/jiti/README.md b/e-commerce/node_modules/jiti/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b3af4838b8a4e583c266a318422aa5755065d862 --- /dev/null +++ b/e-commerce/node_modules/jiti/README.md @@ -0,0 +1,258 @@ +# jiti + + + +[![npm version](https://img.shields.io/npm/v/jiti?color=F0DB4F)](https://npmjs.com/package/jiti) +[![npm downloads](https://img.shields.io/npm/dm/jiti?color=F0DB4F)](https://npmjs.com/package/jiti) +[![bundle size](https://img.shields.io/bundlephobia/minzip/jiti?color=F0DB4F)](https://bundlephobia.com/package/jiti) + + + +> This is the active development branch. Check out [jiti/v1](https://github.com/unjs/jiti/tree/v1) for legacy v1 docs and code. + +## 🌟 Used in + +[Docusaurus](https://docusaurus.io/), [ESLint](https://github.com/eslint/eslint), [FormKit](https://formkit.com/), [Histoire](https://histoire.dev/), [Knip](https://knip.dev/), [Nitro](https://nitro.unjs.io/), [Nuxt](https://nuxt.com/), [PostCSS loader](https://github.com/webpack-contrib/postcss-loader), [Rsbuild](https://rsbuild.dev/), [Size Limit](https://github.com/ai/size-limit), [Slidev](https://sli.dev/), [Tailwindcss](https://tailwindcss.com/), [Tokenami](https://github.com/tokenami/tokenami), [UnoCSS](https://unocss.dev/), [WXT](https://wxt.dev/), [Winglang](https://www.winglang.io/), [Graphql code generator](https://the-guild.dev/graphql/codegen), [Lingui](https://lingui.dev/), [Scaffdog](https://scaff.dog/), [Storybook](https://storybook.js.org), [...UnJS ecosystem](https://unjs.io/), [...60M+ npm monthly downloads](https://npm.chart.dev/jiti), [...6M+ public repositories](https://github.com/unjs/jiti/network/dependents). + +## ✅ Features + +- Seamless TypeScript and ESM syntax support for Node.js +- Seamless interoperability between ESM and CommonJS +- Asynchronous API to replace `import()` +- Synchronous API to replace `require()` (deprecated) +- Super slim and zero dependency +- Custom resolve aliases +- Smart syntax detection to avoid extra transforms +- Node.js native `require.cache` integration +- Filesystem transpile with hard disk caches +- ESM Loader support +- JSX support (opt-in) + +> [!IMPORTANT] +> To enhance compatibility, jiti `>=2.1` enabled [`interopDefault`](#interopdefault) using a new Proxy method. If you migrated to `2.0.0` earlier, this might have caused behavior changes. In case of any issues during the upgrade, please [report](https://github.com/unjs/jiti/issues) so we can investigate to solve them. 🙏🏼 + +## 💡 Usage + +### CLI + +You can use `jiti` CLI to quickly run any script with TypeScript and native ESM support! + +```bash +npx jiti ./index.ts +``` + +### Programmatic + +Initialize a jiti instance: + +```js +// ESM +import { createJiti } from "jiti"; +const jiti = createJiti(import.meta.url); + +// CommonJS (deprecated) +const { createJiti } = require("jiti"); +const jiti = createJiti(__filename); +``` + +Import (async) and resolve with ESM compatibility: + +```js +// jiti.import(id) is similar to import(id) +const mod = await jiti.import("./path/to/file.ts"); + +// jiti.esmResolve(id) is similar to import.meta.resolve(id) +const resolvedPath = jiti.esmResolve("./src"); +``` + +If you need the default export of module, you can use `jiti.import(id, { default: true })` as shortcut to `mod?.default ?? mod`. + +```js +// shortcut to mod?.default ?? mod +const modDefault = await jiti.import("./path/to/file.ts", { default: true }); +``` + +CommonJS (sync & deprecated): + +```js +// jiti() is similar to require(id) +const mod = jiti("./path/to/file.ts"); + +// jiti.resolve() is similar to require.resolve(id) +const resolvedPath = jiti.resolve("./src"); +``` + +You can also pass options as the second argument: + +```js +const jiti = createJiti(import.meta.url, { debug: true }); +``` + +### Register global ESM loader + +You can globally register jiti using [global hooks](https://nodejs.org/api/module.html#initialize). (Important: Requires Node.js > 20) + +```js +import "jiti/register"; +``` + +Or: + +```bash +node --import jiti/register index.ts +``` + +## 🎈 `jiti/native` + +You can alias `jiti` to `jiti/native` to directly depend on runtime's [`import.meta.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve) and dynamic [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) support. This allows easing up the ecosystem transition to runtime native support by giving the same API of jiti. + +## ⚙️ Options + +### `debug` + +- Type: Boolean +- Default: `false` +- Environment variable: `JITI_DEBUG` + +Enable verbose logging. You can use `JITI_DEBUG=1 ` to enable it. + +### `fsCache` + +- Type: Boolean | String +- Default: `true` +- Environment variable: `JITI_FS_CACHE` + +Filesystem source cache (enabled by default) + +By default (when is `true`), jiti uses `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/jiti`. + +**Note:** It is recommended that this option be enabled for better performance. + +### `rebuildFsCache` + +- Type: Boolean +- Default: `false` +- Environment variable: `JITI_REBUILD_FS_CACHE` + +Rebuild filesystem source cache created by `fsCache`. + +### `moduleCache` + +- Type: String +- Default: `true` +- Environment variable: `JITI_MODULE_CACHE` + +Runtime module cache (enabled by default). + +Disabling allows editing code and importing the same module multiple times. + +When enabled, jiti integrates with Node.js native CommonJS cache-store. + +### `transform` + +- Type: Function +- Default: Babel (lazy loaded) + +Transform function. See [src/babel](./src/babel.ts) for more details + +### `sourceMaps` + +- Type: Boolean +- Default `false` +- Environment variable: `JITI_SOURCE_MAPS` + +Add inline source map to transformed source for better debugging. + +### `interopDefault` + +- Type: Boolean +- Default: `true` +- Environment variable: `JITI_INTEROP_DEFAULT` + +Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105). + +> [!WARNING] +> This option wraps **all imported modules** in a Proxy, which adds ~25-50ns overhead per property access. For performance-critical hot paths where you access module exports very frequently, consider setting `interopDefault: false` or `JITI_INTEROP_DEFAULT=false`. + +### `alias` + +- Type: Object +- Default: - +- Environment variable: `JITI_ALIAS` + +You can also pass an object to the environment variable for inline config. Example: `JITI_ALIAS='{"~/*": "./src/*"}' jiti ...`. + +Custom alias map used to resolve IDs. + +### `tsconfigPaths` + +- Type: Boolean | String +- Default: `false` +- Environment variable: `JITI_TSCONFIG_PATHS` + +Enable TypeScript [`paths`](https://www.typescriptlang.org/tsconfig/#paths) resolution using [`get-tsconfig`](https://github.com/privatenumber/get-tsconfig). + +- `true`: Auto-discover `tsconfig.json` by walking up from the jiti instance's parent path. +- `string`: Explicit path to a `tsconfig.json` file. +- `false` (default): Disabled. + +### `nativeModules` + +- Type: Array +- Default: ['typescript'] +- Environment variable: `JITI_NATIVE_MODULES` + +List of modules (within `node_modules`) to always use native `require()` for them. + +### `transformModules` + +- Type: Array +- Default: [] +- Environment variable: `JITI_TRANSFORM_MODULES` + +List of modules (within `node_modules`) to transform them regardless of syntax. + +### `importMeta` + +Parent module's [`import.meta`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) context to use for ESM resolution. (only used for `jiti/native` import). + +### `tryNative` + +- Type: Boolean +- Default: Enabled if bun is detected +- Environment variable: `JITI_TRY_NATIVE` + +Try to use native require and import without jiti transformations first. + +### `jsx` + +- Type: Boolean | {options} +- Default: `false` +- Environment Variable: `JITI_JSX` + +Enable JSX support using [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/babel-plugin-transform-react-jsx). + +See [`test/fixtures/jsx`](./test/fixtures/jsx) for framework integration examples. + +## Development + +- Clone this repository +- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` +- Install dependencies using `pnpm install` +- Run `pnpm dev` +- Run `pnpm jiti ./test/path/to/file.ts` + +## License + + + +Published under the [MIT](https://github.com/unjs/jiti/blob/main/LICENSE) license. +Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/jiti/graphs/contributors) 💛 +

+
+ + + + + + diff --git a/e-commerce/node_modules/jiti/dist/babel.cjs b/e-commerce/node_modules/jiti/dist/babel.cjs new file mode 100644 index 0000000000000000000000000000000000000000..1e6b684f9f1586231c56a19aaebeacccda2aad4d --- /dev/null +++ b/e-commerce/node_modules/jiti/dist/babel.cjs @@ -0,0 +1,257 @@ +(()=>{var e={"./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files lazy recursive"(e){function webpackEmptyAsyncContext(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files lazy recursive",e.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files sync recursive"(e){function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.29.0/node_modules/@babel/core/lib/config/files sync recursive",e.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.29.0/node_modules/@babel/plugin-syntax-class-properties/lib/index.js"(e,t,r){"use strict";t.A=void 0;var n=(0,r("./node_modules/.pnpm/@babel+helper-plugin-utils@7.28.6/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)(e=>(e.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(e,t){t.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}}));t.A=n},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"(e,t,r){var n;!function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/sourcemap-codec"(e,r){r.exports=t}}),c=__commonJS({"umd:@jridgewell/trace-mapping"(e,t){t.exports=r}}),u={};__export(u,{GenMapping:()=>E,addMapping:()=>addMapping,addSegment:()=>addSegment,allMappings:()=>allMappings,fromMap:()=>fromMap,maybeAddMapping:()=>maybeAddMapping,maybeAddSegment:()=>maybeAddSegment,setIgnore:()=>setIgnore,setSourceContent:()=>setSourceContent,toDecodedMap:()=>toDecodedMap,toEncodedMap:()=>toEncodedMap}),e.exports=__toCommonJS(u);var d=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function cast(e){return e}function get(e,t){return cast(e)._indexes[t]}function put(e,t){const r=get(e,t);if(void 0!==r)return r;const{array:n,_indexes:s}=cast(e),i=n.push(t);return s[t]=i-1}function remove(e,t){const r=get(e,t);if(void 0===r)return;const{array:n,_indexes:s}=cast(e);for(let e=r+1;eaddSegmentInternal(!0,e,t,r,n,s,i,o,a),maybeAddMapping=(e,t)=>addMappingInternal(!0,e,t);function setSourceContent(e,t,r){const{_sources:n,_sourcesContent:s}=cast2(e);s[put(n,t)]=r}function setIgnore(e,t,r=!0){const{_sources:n,_sourcesContent:s,_ignoreList:i}=cast2(e),o=put(n,t);o===s.length&&(s[o]=null),r?put(i,o):remove(i,o)}function toDecodedMap(e){const{_mappings:t,_sources:r,_sourcesContent:n,_names:s,_ignoreList:i}=cast2(e);return removeEmptyFinalLines(t),{version:3,file:e.file||void 0,names:s.array,sourceRoot:e.sourceRoot||void 0,sources:r.array,sourcesContent:n,mappings:t,ignoreList:i.array}}function toEncodedMap(e){const t=toDecodedMap(e);return Object.assign({},t,{mappings:(0,h.encode)(t.mappings)})}function fromMap(e){const t=new m.TraceMap(e),r=new E({file:t.file,sourceRoot:t.sourceRoot});return putAll(cast2(r)._names,t.names),putAll(cast2(r)._sources,t.sources),cast2(r)._sourcesContent=t.sourcesContent||t.sources.map(()=>null),cast2(r)._mappings=(0,m.decodedMappings)(t),t.ignoreList&&putAll(cast2(r)._ignoreList,t.ignoreList),r}function allMappings(e){const t=[],{_mappings:r,_sources:n,_names:s}=cast2(e);for(let e=0;e=0&&!(t>=e[n][f]);r=n--);return r}function insert(e,t,r){for(let r=e.length;r>t;r--)e[r]=e[r-1];e[t]=r}function removeEmptyFinalLines(e){const{length:t}=e;let r=t;for(let t=r-1;t>=0&&!(e[t].length>0);r=t,t--);rfunction(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/trace-mapping"(e,t){t.exports=r}}),c=__commonJS({"umd:@jridgewell/gen-mapping"(e,r){r.exports=t}}),u={};__export(u,{default:()=>remapping}),e.exports=__toCommonJS(u);var d=__toESM(p()),h=__toESM(c()),m=__toESM(p()),f=SegmentObject("",-1,-1,"",null,!1),y=[];function SegmentObject(e,t,r,n,s,i){return{source:e,line:t,column:r,name:n,content:s,ignore:i}}function Source(e,t,r,n,s){return{map:e,sources:t,source:r,content:n,ignore:s}}function MapSource(e,t){return Source(e,t,"",null,!1)}function OriginalSource(e,t,r){return Source(null,y,e,t,r)}function traceMappings(e){const t=new h.GenMapping({file:e.map.file}),{sources:r,map:n}=e,s=n.names,i=(0,m.decodedMappings)(n);for(let e=0;enew d.TraceMap(e,"")),n=r.pop();for(let e=0;e1)throw new Error(`Transformation map ${e} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let s=build(n,t,"",0);for(let e=r.length-1;e>=0;e--)s=MapSource(r[e],[s]);return s}function build(e,t,r,n){const{resolvedSources:s,sourcesContent:i,ignoreList:o}=e,a=n+1;return MapSource(e,s.map((e,n)=>{const s={importer:r,depth:a,source:e||"",content:void 0,ignore:void 0},l=t(s.source,s),{source:p,content:c,ignore:u}=s;return l?build(new d.TraceMap(l,p),t,p,a):OriginalSource(p,void 0!==c?c:i?i[n]:null,void 0!==u?u:!!o&&o.includes(n))}))}var b=__toESM(c()),g=class{constructor(e,t){const r=t.decodedMappings?(0,b.toDecodedMap)(e):(0,b.toEncodedMap)(e);this.version=r.version,this.file=r.file,this.mappings=r.mappings,this.names=r.names,this.ignoreList=r.ignoreList,this.sourceRoot=r.sourceRoot,this.sources=r.sources,t.excludeContent||(this.sourcesContent=r.sourcesContent)}toString(){return JSON.stringify(this)}};function remapping(e,t,r){const n="object"==typeof r?r:{excludeContent:!!r,decodedMappings:!1},s=buildSourceMapTree(e,t);return new g(traceMappings(s),n)}}(e=r.nmd(e),r("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"),r("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js")),e.exports="default"in(n=e).exports?n.exports.default:n.exports},"./node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(e){e.exports=function(){"use strict";const e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,r=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function isAbsoluteUrl(t){return e.test(t)}function isSchemeRelativeUrl(e){return e.startsWith("//")}function isAbsolutePath(e){return e.startsWith("/")}function isFileUrl(e){return e.startsWith("file:")}function isRelative(e){return/^[.?#]/.test(e)}function parseAbsoluteUrl(e){const r=t.exec(e);return makeUrl(r[1],r[2]||"",r[3],r[4]||"",r[5]||"/",r[6]||"",r[7]||"")}function parseFileUrl(e){const t=r.exec(e),n=t[2];return makeUrl("file:","",t[1]||"","",isAbsolutePath(n)?n:"/"+n,t[3]||"",t[4]||"")}function makeUrl(e,t,r,n,s,i,o){return{scheme:e,user:t,host:r,port:n,path:s,query:i,hash:o,type:7}}function parseUrl(e){if(isSchemeRelativeUrl(e)){const t=parseAbsoluteUrl("http:"+e);return t.scheme="",t.type=6,t}if(isAbsolutePath(e)){const t=parseAbsoluteUrl("http://foo.com"+e);return t.scheme="",t.host="",t.type=5,t}if(isFileUrl(e))return parseFileUrl(e);if(isAbsoluteUrl(e))return parseAbsoluteUrl(e);const t=parseAbsoluteUrl("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}function stripPathFilename(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function mergePaths(e,t){normalizePath(t,t.type),"/"===e.path?e.path=t.path:e.path=stripPathFilename(t.path)+e.path}function normalizePath(e,t){const r=t<=4,n=e.path.split("/");let s=1,i=0,o=!1;for(let e=1;en&&(n=s)}normalizePath(r,n);const s=r.query+r.hash;switch(n){case 2:case 3:return s;case 4:{const n=r.path.slice(1);return n?isRelative(t||e)&&!isRelative(n)?"./"+n+s:n+s:s||"."}case 5:return r.path+s;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+s}}return resolve}()},"./node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(e,t,r){var n;!function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,__copyProps=(e,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of n(i))s.call(e,l)||l===o||t(e,l,{get:()=>i[l],enumerable:!(a=r(i,l))||a.enumerable});return e},__toCommonJS=e=>__copyProps(t({},"__esModule",{value:!0}),e),i={};((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(i,{decode:()=>decode,decodeGeneratedRanges:()=>decodeGeneratedRanges,decodeOriginalScopes:()=>decodeOriginalScopes,encode:()=>encode,encodeGeneratedRanges:()=>encodeGeneratedRanges,encodeOriginalScopes:()=>encodeOriginalScopes}),e.exports=__toCommonJS(i);var o=",".charCodeAt(0),a=";".charCodeAt(0),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=new Uint8Array(64),c=new Uint8Array(128);for(let e=0;e>>=1,i&&(r=-2147483648|-r),t+r}function encodeInteger(e,t,r){let n=t-r;n=n<0?-n<<1|1:n<<1;do{let t=31&n;n>>>=5,n>0&&(t|=32),e.write(p[t])}while(n>0);return t}function hasMoreVlq(e,t){return!(e.pos>=t)&&e.peek()!==o}var u=16384,d="undefined"!=typeof TextDecoder?new TextDecoder:"undefined"!=typeof Buffer?{decode:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}:{decode(e){let t="";for(let r=0;r0?t+d.decode(e.subarray(0,r)):t}},m=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){const{buffer:t,pos:r}=this,n=t.indexOf(e,r);return-1===n?t.length:n}},f=[];function decodeOriginalScopes(e){const{length:t}=e,r=new m(e),n=[],s=[];let i=0;for(;r.pos0&&r.write(o),n[0]=encodeInteger(r,i,n[0]),encodeInteger(r,a,0),encodeInteger(r,c,0),encodeInteger(r,6===s.length?1:0,0),6===s.length&&encodeInteger(r,s[5],0);for(const e of u)encodeInteger(r,e,0);for(t++;tl||i===l&&o>=p)break;t=_encodeOriginalScopes(e,t,r,n)}return r.write(o),n[0]=encodeInteger(r,l,n[0]),encodeInteger(r,p,0),t}function decodeGeneratedRanges(e){const{length:t}=e,r=new m(e),n=[],s=[];let i=0,o=0,a=0,l=0,p=0,c=0,u=0,d=0;do{const e=r.indexOf(";");let t=0;for(;r.pose;t--){const e=u;u=decodeInteger(r,u),d=decodeInteger(r,u===e?d:0);const t=decodeInteger(r,0);n.push([t,u,d])}}else n=[[e]];x.push(n)}while(hasMoreVlq(r,e))}b.bindings=x,n.push(b),s.push(b)}i++,r.pos=e+1}while(r.pos0&&r.write(o),n[1]=encodeInteger(r,s[1],n[1]),encodeInteger(r,(6===s.length?1:0)|(u?2:0)|(c?4:0),0),6===s.length){const{4:e,5:t}=s;e!==n[2]&&(n[3]=0),n[2]=encodeInteger(r,e,n[2]),n[3]=encodeInteger(r,t,n[3])}if(u){const{0:e,1:t,2:i}=s.callsite;e!==n[4]?(n[5]=0,n[6]=0):t!==n[5]&&(n[6]=0),n[4]=encodeInteger(r,e,n[4]),n[5]=encodeInteger(r,t,n[5]),n[6]=encodeInteger(r,i,n[6])}if(d)for(const e of d){e.length>1&&encodeInteger(r,-e.length,0),encodeInteger(r,e[0][0],0);let t=i,n=a;for(let s=1;sl||i===l&&o>=p)break;t=_encodeGeneratedRanges(e,t,r,n)}return n[0]0&&t.write(a),0===p.length)continue;let c=0;for(let e=0;e0&&t.write(o),c=encodeInteger(t,a[0],c),1!==a.length&&(r=encodeInteger(t,a[1],r),n=encodeInteger(t,a[2],n),s=encodeInteger(t,a[3],s),4!==a.length&&(i=encodeInteger(t,a[4],i)))}}return t.flush()}}(e=r.nmd(e)),e.exports="default"in(n=e).exports?n.exports.default:n.exports},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(e,t,r){var n;!function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of o(t))l.call(e,a)||a===r||s(e,a,{get:()=>t[a],enumerable:!(n=i(t,a))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?n(a(e)):{},__copyProps(!t&&e&&e.__esModule?r:s(r,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(s({},"__esModule",{value:!0}),e),p=__commonJS({"umd:@jridgewell/sourcemap-codec"(e,t){t.exports=r}}),c=__commonJS({"umd:@jridgewell/resolve-uri"(e,r){r.exports=t}}),u={};__export(u,{AnyMap:()=>FlattenMap,FlattenMap:()=>FlattenMap,GREATEST_LOWER_BOUND:()=>_,LEAST_UPPER_BOUND:()=>P,TraceMap:()=>A,allGeneratedPositionsFor:()=>allGeneratedPositionsFor,decodedMap:()=>decodedMap,decodedMappings:()=>decodedMappings,eachMapping:()=>eachMapping,encodedMap:()=>encodedMap,encodedMappings:()=>encodedMappings,generatedPositionFor:()=>generatedPositionFor,isIgnored:()=>isIgnored,originalPositionFor:()=>originalPositionFor,presortedDecodedMap:()=>presortedDecodedMap,sourceContentFor:()=>sourceContentFor,traceSegment:()=>traceSegment}),e.exports=__toCommonJS(u);var d=__toESM(p()),h=__toESM(c());function stripFilename(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}function resolver(e,t){const r=stripFilename(e),n=t?t+"/":"";return e=>(0,h.default)(n+(e||""),r)}var m=0,f=1,y=2,b=3,g=4,x=1,v=2;function maybeSort(e,t){const r=nextUnsortedSegmentLine(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n[]);for(let t=0;t>1),i=e[s][m]-t;if(0===i)return E=!0,s;i<0?r=s+1:n=s-1}return E=!1,r-1}function upperBound(e,t,r){for(let n=r+1;n=0&&e[n][m]===t;r=n--);return r}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function memoizedBinarySearch(e,t,r,n){const{lastKey:s,lastNeedle:i,lastIndex:o}=r;let a=0,l=e.length-1;if(n===s){if(t===i)return E=-1!==o&&e[o][m]===t,o;t>=i?a=-1===o?0:o:l=o}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=binarySearch(e,t,a,l)}function parse(e){return"string"==typeof e?JSON.parse(e):e}var FlattenMap=function(e,t){const r=parse(e);if(!("sections"in r))return new A(r,t);const n=[],s=[],i=[],o=[],a=[];return recurse(r,t,n,s,i,o,a,0,0,1/0,1/0),presortedDecodedMap({version:3,file:r.file,names:o,sources:s,sourcesContent:i,mappings:n,ignoreList:a})};function recurse(e,t,r,n,s,i,o,a,l,p,c){const{sections:u}=e;for(let e=0;ep)return;const n=getLine(r,t),s=0===e?l:0,i=v[e];for(let e=0;e=c)return;if(1===r.length){n.push([o]);continue}const a=h+r[f],l=r[y],u=r[b];n.push(4===r.length?[o,a,l,u]:[o,a,l,u,x+r[g]])}}}function append(e,t){for(let r=0;r=n.length)return null;const s=n[t],i=traceSegmentInternal(s,cast(e)._decodedMemo,t,r,_);return-1===i?null:s[i]}function originalPositionFor(e,t){let{line:r,column:n,bias:s}=t;if(r--,r<0)throw new Error(T);if(n<0)throw new Error(S);const i=decodedMappings(e);if(r>=i.length)return OMapping(null,null,null,null);const o=i[r],a=traceSegmentInternal(o,cast(e)._decodedMemo,r,n,s||_);if(-1===a)return OMapping(null,null,null,null);const l=o[a];if(1===l.length)return OMapping(null,null,null,null);const{names:p,resolvedSources:c}=e;return OMapping(c[l[f]],l[y]+1,l[b],5===l.length?p[l[g]]:null)}function generatedPositionFor(e,t){const{source:r,line:n,column:s,bias:i}=t;return generatedPosition(e,r,n,s,i||_,!1)}function allGeneratedPositionsFor(e,t){const{source:r,line:n,column:s,bias:i}=t;return generatedPosition(e,r,n,s,i||P,!0)}function eachMapping(e,t){const r=decodedMappings(e),{names:n,resolvedSources:s}=e;for(let e=0;e{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},"./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(e,t,r){e.exports=function(e){function createDebug(e){let t,r,n,s=null;function debug(...e){if(!debug.enabled)return;const r=debug,n=Number(new Date),s=n-(t||n);r.diff=s,r.prev=t,r.curr=n,t=n,e[0]=createDebug.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if("%%"===t)return"%";i++;const s=createDebug.formatters[n];if("function"==typeof s){const n=e[i];t=s.call(r,n),e.splice(i,1),i--}return t}),createDebug.formatArgs.call(r,e);(r.log||createDebug.log).apply(r,e)}return debug.namespace=e,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(e),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(r!==createDebug.namespaces&&(r=createDebug.namespaces,n=createDebug.enabled(e)),n),set:e=>{s=e}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(e,t){const r=createDebug(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function matchesTemplate(e,t){let r=0,n=0,s=-1,i=0;for(;r"-"+e)].join(",");return createDebug.enable(""),e},createDebug.enable=function(e){createDebug.save(e),createDebug.namespaces=e,createDebug.names=[],createDebug.skips=[];const t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t)"-"===e[0]?createDebug.skips.push(e.slice(1)):createDebug.names.push(e)},createDebug.enabled=function(e){for(const t of createDebug.skips)if(matchesTemplate(e,t))return!1;for(const t of createDebug.names)if(matchesTemplate(e,t))return!0;return!1},createDebug.humanize=r("./node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"),createDebug.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(t=>{createDebug[t]=e[t]}),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(e){let t=0;for(let r=0;r{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r("./node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js")(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js"(e){"use strict";const t=Symbol.for("gensync:v1:start"),r=Symbol.for("gensync:v1:suspend"),n="GENSYNC_OPTIONS_ERROR",s="GENSYNC_RACE_NONEMPTY",i="GENSYNC_ERRBACK_NO_CALLBACK";function assertTypeof(e,t,r,s){if(typeof r===e||s&&void 0===r)return;let i;throw i=s?`Expected opts.${t} to be either a ${e}, or undefined.`:`Expected opts.${t} to be a ${e}.`,makeError(i,n)}function makeError(e,t){return Object.assign(new Error(e),{code:t})}function buildOperation({name:e,arity:n,sync:s,async:i}){return setFunctionMetadata(e,n,function*(...e){const n=yield t;if(!n){return s.call(this,e)}let o;try{i.call(this,e,e=>{o||(o={value:e},n())},e=>{o||(o={err:e},n())})}catch(e){o={err:e},n()}if(yield r,o.hasOwnProperty("err"))throw o.err;return o.value})}function evaluateSync(e){let t;for(;!({value:t}=e.next()).done;)assertStart(t,e);return t}function evaluateAsync(e,t,r){!function step(){try{let r;for(;!({value:r}=e.next()).done;){assertStart(r,e);let t=!0,n=!1;const s=e.next(()=>{t?n=!0:step()});if(t=!1,assertSuspend(s,e),!n)return}return t(r)}catch(e){return r(e)}}()}function assertStart(e,r){e!==t&&throwError(r,makeError(`Got unexpected yielded value in gensync generator: ${JSON.stringify(e)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,"GENSYNC_EXPECTED_START"))}function assertSuspend({value:e,done:t},n){(t||e!==r)&&throwError(n,makeError(t?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(e)}. If you get this, it is probably a gensync bug.`,"GENSYNC_EXPECTED_SUSPEND"))}function throwError(e,t){throw e.throw&&e.throw(t),t}function setFunctionMetadata(e,t,r){if("string"==typeof e){const t=Object.getOwnPropertyDescriptor(r,"name");t&&!t.configurable||Object.defineProperty(r,"name",Object.assign(t||{},{configurable:!0,value:e}))}if("number"==typeof t){const e=Object.getOwnPropertyDescriptor(r,"length");e&&!e.configurable||Object.defineProperty(r,"length",Object.assign(e||{},{configurable:!0,value:t}))}return r}e.exports=Object.assign(function(e){let t=e;return t="function"!=typeof e?function({name:e,arity:t,sync:r,async:s,errback:i}){if(assertTypeof("string","name",e,!0),assertTypeof("number","arity",t,!0),assertTypeof("function","sync",r),assertTypeof("function","async",s,!0),assertTypeof("function","errback",i,!0),s&&i)throw makeError("Expected one of either opts.async or opts.errback, but got _both_.",n);if("string"!=typeof e){let t;i&&i.name&&"errback"!==i.name&&(t=i.name),s&&s.name&&"async"!==s.name&&(t=s.name.replace(/Async$/,"")),r&&r.name&&"sync"!==r.name&&(t=r.name.replace(/Sync$/,"")),"string"==typeof t&&(e=t)}"number"!=typeof t&&(t=r.length);return buildOperation({name:e,arity:t,sync:function(e){return r.apply(this,e)},async:function(e,t,n){s?s.apply(this,e).then(t,n):i?i.call(this,...e,(e,r)=>{null==e?t(r):n(e)}):t(r.apply(this,e))}})}(e):function(e){return setFunctionMetadata(e.name,e.length,function(...t){return e.apply(this,t)})}(e),Object.assign(t,function(e){const t={sync:function(...t){return evaluateSync(e.apply(this,t))},async:function(...t){return new Promise((r,n)=>{evaluateAsync(e.apply(this,t),r,n)})},errback:function(...t){const r=t.pop();if("function"!=typeof r)throw makeError("Asynchronous function called without callback",i);let n;try{n=e.apply(this,t)}catch(e){return void r(e)}evaluateAsync(n,e=>r(void 0,e),e=>r(e))}};return t}(t))},{all:buildOperation({name:"all",arity:1,sync:function(e){return Array.from(e[0]).map(e=>evaluateSync(e))},async:function(e,t,r){const n=Array.from(e[0]);if(0===n.length)return void Promise.resolve().then(()=>t([]));let s=0;const i=n.map(()=>{});n.forEach((e,n)=>{evaluateAsync(e,e=>{i[n]=e,s+=1,s===i.length&&t(i)},r)})}}),race:buildOperation({name:"race",arity:1,sync:function(e){const t=Array.from(e[0]);if(0===t.length)throw makeError("Must race at least 1 item",s);return evaluateSync(t[0])},async:function(e,t,r){const n=Array.from(e[0]);if(0===n.length)throw makeError("Must race at least 1 item",s);for(const e of n)evaluateAsync(e,t,r)}})})},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(e){"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n{for(const n in e)r.call(e,n)&&t(n,e[n])},fourHexEscape=e=>"\\u"+("0000"+e).slice(-4),hexadecimal=(e,t)=>{let r=e.toString(16);return t?r:r.toUpperCase()},n=t.toString,s=Array.isArray,isBigInt=e=>"bigint"==typeof e,i={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},o=/[\\\b\f\n\r\t]/,a=/[0-9]/,l=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,p=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,c=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,jsesc=(e,t)=>{const increaseIndentation=()=>{g=b,++t.indentLevel,b=t.indent.repeat(t.indentLevel)},r={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},u=t&&t.json;var d,h;u&&(r.quotes="double",r.wrap=!0),d=r,"single"!=(t=(h=t)?(forOwn(h,(e,t)=>{d[e]=t}),d):d).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");const m="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",f=t.compact,y=t.lowercaseHex;let b=t.indent.repeat(t.indentLevel),g="";const x=t.__inline1__,v=t.__inline2__,E=f?"":"\n";let T,S=!0;const P="binary"==t.numbers,_="octal"==t.numbers,A="decimal"==t.numbers,C="hexadecimal"==t.numbers;if(u&&e&&(e=>"function"==typeof e)(e.toJSON)&&(e=e.toJSON()),!(e=>"string"==typeof e||"[object String]"==n.call(e))(e)){if((e=>"[object Map]"==n.call(e))(e))return 0==e.size?"new Map()":(f||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+jsesc(Array.from(e),t)+")");if((e=>"[object Set]"==n.call(e))(e))return 0==e.size?"new Set()":"new Set("+jsesc(Array.from(e),t)+")";if((e=>"function"==typeof Buffer&&Buffer.isBuffer(e))(e))return 0==e.length?"Buffer.from([])":"Buffer.from("+jsesc(Array.from(e),t)+")";if(s(e))return T=[],t.wrap=!0,x&&(t.__inline1__=!1,t.__inline2__=!0),v||increaseIndentation(),((e,t)=>{const r=e.length;let n=-1;for(;++n{S=!1,v&&(t.__inline2__=!1),T.push((f||v?"":b)+jsesc(e,t))}),S?"[]":v?"["+T.join(", ")+"]":"["+E+T.join(","+E)+E+(f?"":g)+"]";if((e=>"number"==typeof e||"[object Number]"==n.call(e))(e)||isBigInt(e)){if(u)return JSON.stringify(Number(e));let t;if(A)t=String(e);else if(C){let r=e.toString(16);y||(r=r.toUpperCase()),t="0x"+r}else P?t="0b"+e.toString(2):_&&(t="0o"+e.toString(8));return isBigInt(e)?t+"n":t}return isBigInt(e)?u?JSON.stringify(Number(e)):e+"n":(e=>"[object Object]"==n.call(e))(e)?(T=[],t.wrap=!0,increaseIndentation(),forOwn(e,(e,r)=>{S=!1,T.push((f?"":b)+jsesc(e,t)+":"+(f?"":" ")+jsesc(r,t))}),S?"{}":"{"+E+T.join(","+E)+E+(f?"":g)+"}"):u?JSON.stringify(e)||"null":String(e)}const w=t.escapeEverything?p:c;return T=e.replace(w,(e,r,n,s,p,c)=>{if(r){if(t.minimal)return r;const e=r.charCodeAt(0),n=r.charCodeAt(1);if(t.es6){return"\\u{"+hexadecimal(1024*(e-55296)+n-56320+65536,y)+"}"}return fourHexEscape(hexadecimal(e,y))+fourHexEscape(hexadecimal(n,y))}if(n)return fourHexEscape(hexadecimal(n.charCodeAt(0),y));if("\0"==e&&!u&&!a.test(c.charAt(p+1)))return"\\0";if(s)return s==m||t.escapeEverything?"\\"+s:s;if(o.test(e))return i[e];if(t.minimal&&!l.test(e))return e;const d=hexadecimal(e.charCodeAt(0),y);return u||d.length>2?fourHexEscape(d):"\\x"+("00"+d).slice(-2)}),"`"==m&&(T=T.replace(/\$\{/g,"\\${")),t.isScriptContext&&(T=T.replace(/<\/(script|style)/gi,"<\\/$1").replace(/