fix(products): fix breadcrumbs and product filtering (backport from main)
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1 @@
{"version":3,"file":"ca.d.ts","sourceRoot":"","sources":["../../../src/exports/i18n/ca.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,uCAAuC,CAAA"}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/plugin.spec.ts"],"sourcesContent":["import type { Transporter } from 'nodemailer'\nimport { describe, beforeEach, it, expect, Mock, vitest } from 'vitest'\n\nimport nodemailer from 'nodemailer'\n\nimport type { NodemailerAdapterArgs } from './index.js'\n\nimport { nodemailerAdapter } from './index.js'\n\nconst defaultArgs: NodemailerAdapterArgs = {\n defaultFromAddress: 'test@test.com',\n defaultFromName: 'Test',\n}\n\ndescribe('email-nodemailer', () => {\n describe('transport verification', () => {\n let mockedVerify: Mock<Transporter['verify']>\n let mockTransport: Transporter\n\n beforeEach(() => {\n mockedVerify = vitest.fn()\n mockTransport = nodemailer.createTransport({\n name: 'existing-transport',\n // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-misused-promises\n send: async (mail) => {\n // eslint-disable-next-line no-console\n console.log('mock send', mail)\n },\n verify: mockedVerify,\n version: '0.0.1',\n })\n })\n\n it('should be invoked when skipVerify = false', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: false,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(1)\n })\n\n it('should be invoked when skipVerify is undefined', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: false,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(1)\n })\n\n it('should not be invoked when skipVerify = true', async () => {\n await nodemailerAdapter({\n ...defaultArgs,\n skipVerify: true,\n transport: mockTransport,\n })\n\n expect(mockedVerify.mock.calls).toHaveLength(0)\n })\n })\n})\n"],"names":["describe","beforeEach","it","expect","vitest","nodemailer","nodemailerAdapter","defaultArgs","defaultFromAddress","defaultFromName","mockedVerify","mockTransport","fn","createTransport","name","send","mail","console","log","verify","version","skipVerify","transport","mock","calls","toHaveLength"],"mappings":"AACA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,EAAE,EAAEC,MAAM,EAAQC,MAAM,QAAQ,SAAQ;AAEvE,OAAOC,gBAAgB,aAAY;AAInC,SAASC,iBAAiB,QAAQ,aAAY;AAE9C,MAAMC,cAAqC;IACzCC,oBAAoB;IACpBC,iBAAiB;AACnB;AAEAT,SAAS,oBAAoB;IAC3BA,SAAS,0BAA0B;QACjC,IAAIU;QACJ,IAAIC;QAEJV,WAAW;YACTS,eAAeN,OAAOQ,EAAE;YACxBD,gBAAgBN,WAAWQ,eAAe,CAAC;gBACzCC,MAAM;gBACN,oGAAoG;gBACpGC,MAAM,OAAOC;oBACX,sCAAsC;oBACtCC,QAAQC,GAAG,CAAC,aAAaF;gBAC3B;gBACAG,QAAQT;gBACRU,SAAS;YACX;QACF;QAEAlB,GAAG,6CAA6C;YAC9C,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;QAEAvB,GAAG,kDAAkD;YACnD,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;QAEAvB,GAAG,gDAAgD;YACjD,MAAMI,kBAAkB;gBACtB,GAAGC,WAAW;gBACdc,YAAY;gBACZC,WAAWX;YACb;YAEAR,OAAOO,aAAaa,IAAI,CAACC,KAAK,EAAEC,YAAY,CAAC;QAC/C;IACF;AACF"}
@@ -0,0 +1 @@
{"version":3,"file":"fa.d.ts","sourceRoot":"","sources":["../../src/languages/fa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBAinB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}
@@ -0,0 +1,29 @@
import { toDate } from "./toDate.mjs";
/**
* @name isLeapYear
* @category Year Helpers
* @summary Is the given date in the leap year?
*
* @description
* Is the given date in the leap year?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is in the leap year
*
* @example
* // Is 1 September 2012 in the leap year?
* const result = isLeapYear(new Date(2012, 8, 1))
* //=> true
*/
export function isLeapYear(date) {
const _date = toDate(date);
const year = _date.getFullYear();
return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
}
// Fallback for modularized imports:
export default isLeapYear;
@@ -0,0 +1,668 @@
# DataLoader
DataLoader is a generic utility to be used as part of your application's data
fetching layer to provide a simplified and consistent API over various remote
data sources such as databases or web services via batching and caching.
[![Build Status](https://github.com/graphql/dataloader/actions/workflows/validation.yml/badge.svg)](https://github.com/graphql/dataloader/actions/workflows/validation.yml)
[![Coverage Status](https://coveralls.io/repos/graphql/dataloader/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql/dataloader?branch=main)
A port of the "Loader" API originally developed by [@schrockn][] at Facebook in
2010 as a simplifying force to coalesce the sundry key-value store back-end
APIs which existed at the time. At Facebook, "Loader" became one of the
implementation details of the "Ent" framework, a privacy-aware data entity
loading and caching layer within web server product code. This ultimately became
the underpinning for Facebook's GraphQL server implementation and type
definitions.
DataLoader is a simplified version of this original idea implemented in
JavaScript for Node.js services. DataLoader is often used when implementing a
[graphql-js][] service, though it is also broadly useful in other situations.
This mechanism of batching and caching data requests is certainly not unique to
Node.js or JavaScript, it is also the primary motivation for
[Haxl](https://github.com/facebook/Haxl), Facebook's data loading library
for Haskell. More about how Haxl works can be read in this [blog post](https://code.facebook.com/posts/302060973291128/open-sourcing-haxl-a-library-for-haskell/).
DataLoader is provided so that it may be useful not just to build GraphQL
services for Node.js but also as a publicly available reference implementation
of this concept in the hopes that it can be ported to other languages. If you
port DataLoader to another language, please open an issue to include a link from
this repository.
## Getting Started
First, install DataLoader using npm.
```sh
npm install --save dataloader
```
To get started, create a `DataLoader`. Each `DataLoader` instance represents a
unique cache. Typically instances are created per request when used within a
web-server like [express][] if different users can see different things.
> Note: DataLoader assumes a JavaScript environment with global ES6 `Promise`
> and `Map` classes, available in all supported versions of Node.js.
## Batching
Batching is not an advanced feature, it's DataLoader's primary feature.
Create loaders by providing a batch loading function.
```js
const DataLoader = require('dataloader');
const userLoader = new DataLoader(keys => myBatchGetUsers(keys));
```
A batch loading function accepts an Array of keys, and returns a Promise which
resolves to an Array of values[<sup>\*</sup>](#batch-function).
Then load individual values from the loader. DataLoader will coalesce all
individual loads which occur within a single frame of execution (a single tick
of the event loop) and then call your batch function with all requested keys.
```js
const user = await userLoader.load(1);
const invitedBy = await userLoader.load(user.invitedByID);
console.log(`User 1 was invited by ${invitedBy}`);
// Elsewhere in your application
const user = await userLoader.load(2);
const lastInvited = await userLoader.load(user.lastInvitedID);
console.log(`User 2 last invited ${lastInvited}`);
```
A naive application may have issued four round-trips to a backend for the
required information, but with DataLoader this application will make at most
two.
DataLoader allows you to decouple unrelated parts of your application without
sacrificing the performance of batch data-loading. While the loader presents an
API that loads individual values, all concurrent requests will be coalesced and
presented to your batch loading function. This allows your application to safely
distribute data fetching requirements throughout your application and maintain
minimal outgoing data requests.
#### Batch Function
A batch loading function accepts an Array of keys, and returns a Promise which
resolves to an Array of values or Error instances. The loader itself is provided
as the `this` context.
```js
async function batchFunction(keys) {
const results = await db.fetchAllKeys(keys);
return keys.map(key => results[key] || new Error(`No result for ${key}`));
}
const loader = new DataLoader(batchFunction);
```
There are a few constraints this function must uphold:
- The Array of values must be the same length as the Array of keys.
- Each index in the Array of values must correspond to the same index in the Array of keys.
For example, if your batch function was provided the Array of keys: `[ 2, 9, 6, 1 ]`,
and loading from a back-end service returned the values:
```js
{ id: 9, name: 'Chicago' }
{ id: 1, name: 'New York' }
{ id: 2, name: 'San Francisco' }
```
Our back-end service returned results in a different order than we requested, likely
because it was more efficient for it to do so. Also, it omitted a result for key `6`,
which we can interpret as no value existing for that key.
To uphold the constraints of the batch function, it must return an Array of values
the same length as the Array of keys, and re-order them to ensure each index aligns
with the original keys `[ 2, 9, 6, 1 ]`:
```js
[
{ id: 2, name: 'San Francisco' },
{ id: 9, name: 'Chicago' },
null, // or perhaps `new Error()`
{ id: 1, name: 'New York' },
];
```
#### Batch Scheduling
By default DataLoader will coalesce all individual loads which occur within a
single frame of execution before calling your batch function with all requested
keys. This ensures no additional latency while capturing many related requests
into a single batch. In fact, this is the same behavior used in Facebook's
original PHP implementation in 2010. See `enqueuePostPromiseJob` in the
[source code][] for more details about how this works.
However sometimes this behavior is not desirable or optimal. Perhaps you expect
requests to be spread out over a few subsequent ticks because of an existing use
of `setTimeout`, or you just want manual control over dispatching regardless of
the run loop. DataLoader allows providing a custom batch scheduler to provide
these or any other behaviors.
A custom scheduler is provided as `batchScheduleFn` in options. It must be a
function which is passed a callback and is expected to call that callback in the
immediate future to execute the batch request.
As an example, here is a batch scheduler which collects all requests over a
100ms window of time (and as a consequence, adds 100ms of latency):
```js
const myLoader = new DataLoader(myBatchFn, {
batchScheduleFn: callback => setTimeout(callback, 100),
});
```
As another example, here is a manually dispatched batch scheduler:
```js
function createScheduler() {
let callbacks = [];
return {
schedule(callback) {
callbacks.push(callback);
},
dispatch() {
callbacks.forEach(callback => callback());
callbacks = [];
},
};
}
const { schedule, dispatch } = createScheduler();
const myLoader = new DataLoader(myBatchFn, { batchScheduleFn: schedule });
myLoader.load(1);
myLoader.load(2);
dispatch();
```
## Caching
DataLoader provides a memoization cache for all loads which occur in a single
request to your application. After `.load()` is called once with a given key,
the resulting value is cached to eliminate redundant loads.
#### Caching Per-Request
DataLoader caching _does not_ replace Redis, Memcache, or any other shared
application-level cache. DataLoader is first and foremost a data loading mechanism,
and its cache only serves the purpose of not repeatedly loading the same data in
the context of a single request to your Application. To do this, it maintains a
simple in-memory memoization cache (more accurately: `.load()` is a memoized function).
Avoid multiple requests from different users using the DataLoader instance, which
could result in cached data incorrectly appearing in each request. Typically,
DataLoader instances are created when a Request begins, and are not used once the
Request ends.
For example, when using with [express][]:
```js
function createLoaders(authToken) {
return {
users: new DataLoader(ids => genUsers(authToken, ids)),
};
}
const app = express();
app.get('/', function (req, res) {
const authToken = authenticateUser(req);
const loaders = createLoaders(authToken);
res.send(renderPage(req, loaders));
});
app.listen();
```
#### Caching and Batching
Subsequent calls to `.load()` with the same key will result in that key not
appearing in the keys provided to your batch function. _However_, the resulting
Promise will still wait on the current batch to complete. This way both cached
and uncached requests will resolve at the same time, allowing DataLoader
optimizations for subsequent dependent loads.
In the example below, User `1` happens to be cached. However, because User `1`
and `2` are loaded in the same tick, they will resolve at the same time. This
means both `user.bestFriendID` loads will also happen in the same tick which
results in two total requests (the same as if User `1` had not been cached).
```js
userLoader.prime(1, { bestFriend: 3 });
async function getBestFriend(userID) {
const user = await userLoader.load(userID);
return await userLoader.load(user.bestFriendID);
}
// In one part of your application
getBestFriend(1);
// Elsewhere
getBestFriend(2);
```
Without this optimization, if the cached User `1` resolved immediately, this
could result in three total requests since each `user.bestFriendID` load would
happen at different times.
#### Clearing Cache
In certain uncommon cases, clearing the request cache may be necessary.
The most common example when clearing the loader's cache is necessary is after
a mutation or update within the same request, when a cached value could be out of
date and future loads should not use any possibly cached value.
Here's a simple example using SQL UPDATE to illustrate.
```js
// Request begins...
const userLoader = new DataLoader(...);
// And a value happens to be loaded (and cached).
const user = await userLoader.load(4);
// A mutation occurs, invalidating what might be in cache.
await sqlRun('UPDATE users WHERE id=4 SET username="zuck"');
userLoader.clear(4);
// Later the value load is loaded again so the mutated data appears.
const user = await userLoader.load(4);
// Request completes.
```
#### Caching Errors
If a batch load fails (that is, a batch function throws or returns a rejected
Promise), then the requested values will not be cached. However if a batch
function returns an `Error` instance for an individual value, that `Error` will
be cached to avoid frequently loading the same `Error`.
In some circumstances you may wish to clear the cache for these individual Errors:
```js
try {
const user = await userLoader.load(1);
} catch (error) {
if (/* determine if the error should not be cached */) {
userLoader.clear(1);
}
throw error
}
```
#### Disabling Cache
In certain uncommon cases, a DataLoader which _does not_ cache may be desirable.
Calling `new DataLoader(myBatchFn, { cache: false })` will ensure that every
call to `.load()` will produce a _new_ Promise, and requested keys will not be
saved in memory.
However, when the memoization cache is disabled, your batch function will
receive an array of keys which may contain duplicates! Each key will be
associated with each call to `.load()`. Your batch loader should provide a value
for each instance of the requested key.
For example:
```js
const myLoader = new DataLoader(
keys => {
console.log(keys);
return someBatchLoadFn(keys);
},
{ cache: false },
);
myLoader.load('A');
myLoader.load('B');
myLoader.load('A');
// > [ 'A', 'B', 'A' ]
```
More complex cache behavior can be achieved by calling `.clear()` or `.clearAll()`
rather than disabling the cache completely. For example, this DataLoader will
provide unique keys to a batch function due to the memoization cache being
enabled, but will immediately clear its cache when the batch function is called
so later requests will load new values.
```js
const myLoader = new DataLoader(keys => {
myLoader.clearAll();
return someBatchLoadFn(keys);
});
```
#### Custom Cache
As mentioned above, DataLoader is intended to be used as a per-request cache.
Since requests are short-lived, DataLoader uses an infinitely growing [Map][] as
a memoization cache. This should not pose a problem as most requests are
short-lived and the entire cache can be discarded after the request completes.
However this memoization caching strategy isn't safe when using a long-lived
DataLoader, since it could consume too much memory. If using DataLoader in this
way, you can provide a custom Cache instance with whatever behavior you prefer,
as long as it follows the same API as [Map][].
The example below uses an LRU (least recently used) cache to limit total memory
to hold at most 100 cached values via the [lru_map][] npm package.
```js
import { LRUMap } from 'lru_map';
const myLoader = new DataLoader(someBatchLoadFn, {
cacheMap: new LRUMap(100),
});
```
More specifically, any object that implements the methods `get()`, `set()`,
`delete()` and `clear()` methods can be provided. This allows for custom Maps
which implement various [cache algorithms][] to be provided.
## API
#### class DataLoader
DataLoader creates a public API for loading data from a particular
data back-end with unique keys such as the `id` column of a SQL table or
document name in a MongoDB database, given a batch loading function.
Each `DataLoader` instance contains a unique memoized cache. Use caution when
used in long-lived applications or those which serve many users with different
access permissions and consider creating a new instance per web request.
##### `new DataLoader(batchLoadFn [, options])`
Create a new `DataLoader` given a batch loading function and options.
- _batchLoadFn_: A function which accepts an Array of keys, and returns a
Promise which resolves to an Array of values.
- _options_: An optional object of options:
| Option Key | Type | Default | Description |
| ----------------- | -------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `batch` | Boolean | `true` | Set to `false` to disable batching, invoking `batchLoadFn` with a single load key. This is equivalent to setting `maxBatchSize` to `1`. |
| `maxBatchSize` | Number | `Infinity` | Limits the number of items that get passed in to the `batchLoadFn`. May be set to `1` to disable batching. |
| `batchScheduleFn` | Function | See [Batch scheduling](#batch-scheduling) | A function to schedule the later execution of a batch. The function is expected to call the provided callback in the immediate future. |
| `cache` | Boolean | `true` | Set to `false` to disable memoization caching, creating a new Promise and new key in the `batchLoadFn` for every load of the same key. This is equivalent to setting `cacheMap` to `null`. |
| `cacheKeyFn` | Function | `key => key` | Produces cache key for a given load key. Useful when objects are keys and two objects should be considered equivalent. |
| `cacheMap` | Object | `new Map()` | Instance of [Map][] (or an object with a similar API) to be used as cache. May be set to `null` to disable caching. |
| `name` | String | `null` | The name given to this `DataLoader` instance. Useful for APM tools. |
##### `load(key)`
Loads a key, returning a `Promise` for the value represented by that key.
- _key_: A key value to load.
##### `loadMany(keys)`
Loads multiple keys, promising an array of values:
```js
const [a, b] = await myLoader.loadMany(['a', 'b']);
```
This is similar to the more verbose:
```js
const [a, b] = await Promise.all([myLoader.load('a'), myLoader.load('b')]);
```
However it is different in the case where any load fails. Where
Promise.all() would reject, loadMany() always resolves, however each result
is either a value or an Error instance.
```js
var [a, b, c] = await myLoader.loadMany(['a', 'b', 'badkey']);
// c instanceof Error
```
- _keys_: An array of key values to load.
##### `clear(key)`
Clears the value at `key` from the cache, if it exists. Returns itself for
method chaining.
- _key_: A key value to clear.
##### `clearAll()`
Clears the entire cache. To be used when some event results in unknown
invalidations across this particular `DataLoader`. Returns itself for
method chaining.
##### `prime(key, value)`
Primes the cache with the provided key and value. If the key already exists, no
change is made. (To forcefully prime the cache, clear the key first with
`loader.clear(key).prime(key, value)`.) Returns itself for method chaining.
To prime the cache with an error at a key, provide an Error instance.
## Using with GraphQL
DataLoader pairs nicely well with [GraphQL][graphql-js]. GraphQL fields are
designed to be stand-alone functions. Without a caching or batching mechanism,
it's easy for a naive GraphQL server to issue new database requests each time a
field is resolved.
Consider the following GraphQL request:
```
{
me {
name
bestFriend {
name
}
friends(first: 5) {
name
bestFriend {
name
}
}
}
}
```
Naively, if `me`, `bestFriend` and `friends` each need to request the backend,
there could be at most 13 database requests!
When using DataLoader, we could define the `User` type using the
[SQLite](examples/SQL.md) example with clearer code and at most 4 database requests,
and possibly fewer if there are cache hits.
```js
const UserType = new GraphQLObjectType({
name: 'User',
fields: () => ({
name: { type: GraphQLString },
bestFriend: {
type: UserType,
resolve: user => userLoader.load(user.bestFriendID),
},
friends: {
args: {
first: { type: GraphQLInt },
},
type: new GraphQLList(UserType),
resolve: async (user, { first }) => {
const rows = await queryLoader.load([
'SELECT toID FROM friends WHERE fromID=? LIMIT ?',
user.id,
first,
]);
return rows.map(row => userLoader.load(row.toID));
},
},
}),
});
```
## Common Patterns
### Creating a new DataLoader per request.
In many applications, a web server using DataLoader serves requests to many
different users with different access permissions. It may be dangerous to use
one cache across many users, and is encouraged to create a new DataLoader
per request:
```js
function createLoaders(authToken) {
return {
users: new DataLoader(ids => genUsers(authToken, ids)),
cdnUrls: new DataLoader(rawUrls => genCdnUrls(authToken, rawUrls)),
stories: new DataLoader(keys => genStories(authToken, keys)),
};
}
// When handling an incoming web request:
const loaders = createLoaders(request.query.authToken);
// Then, within application logic:
const user = await loaders.users.load(4);
const pic = await loaders.cdnUrls.load(user.rawPicUrl);
```
Creating an object where each key is a `DataLoader` is one common pattern which
provides a single value to pass around to code which needs to perform
data loading, such as part of the `rootValue` in a [graphql-js][] request.
### Loading by alternative keys.
Occasionally, some kind of value can be accessed in multiple ways. For example,
perhaps a "User" type can be loaded not only by an "id" but also by a "username"
value. If the same user is loaded by both keys, then it may be useful to fill
both caches when a user is loaded from either source:
```js
const userByIDLoader = new DataLoader(async ids => {
const users = await genUsersByID(ids);
for (let user of users) {
usernameLoader.prime(user.username, user);
}
return users;
});
const usernameLoader = new DataLoader(async names => {
const users = await genUsernames(names);
for (let user of users) {
userByIDLoader.prime(user.id, user);
}
return users;
});
```
### Freezing results to enforce immutability
Since DataLoader caches values, it's typically assumed these values will be
treated as if they were immutable. While DataLoader itself doesn't enforce
this, you can create a higher-order function to enforce immutability
with Object.freeze():
```js
function freezeResults(batchLoader) {
return keys => batchLoader(keys).then(values => values.map(Object.freeze));
}
const myLoader = new DataLoader(freezeResults(myBatchLoader));
```
### Batch functions which return Objects instead of Arrays
DataLoader expects batch functions which return an Array of the same length as
the provided keys. However this is not always a common return format from other
libraries. A DataLoader higher-order function can convert from one format to another. The example below converts a `{ key: value }` result to the format
DataLoader expects.
```js
function objResults(batchLoader) {
return keys =>
batchLoader(keys).then(objValues =>
keys.map(key => objValues[key] || new Error(`No value for ${key}`)),
);
}
const myLoader = new DataLoader(objResults(myBatchLoader));
```
## Common Back-ends
Looking to get started with a specific back-end? Try the [loaders in the examples directory](/examples).
## Other Implementations
Listed in alphabetical order
- Elixir
- [dataloader](https://github.com/absinthe-graphql/dataloader)
- Golang
- [Dataloader](https://github.com/nicksrandall/dataloader)
- Java
- [java-dataloader](https://github.com/graphql-java/java-dataloader)
- .Net
- [GraphQL .NET DataLoader](https://graphql-dotnet.github.io/docs/guides/dataloader/)
- [Green Donut](https://github.com/ChilliCream/graphql-platform?tab=readme-ov-file#green-donut)
- Perl
- [perl-DataLoader](https://github.com/richardjharris/perl-DataLoader)
- PHP
- [DataLoaderPHP](https://github.com/overblog/dataloader-php)
- Python
- [aiodataloader](https://github.com/syrusakbary/aiodataloader)
- ReasonML
- [bs-dataloader](https://github.com/ulrikstrid/bs-dataloader)
- Ruby
- [BatchLoader](https://github.com/exaspark/batch-loader)
- [Dataloader](https://github.com/sheerun/dataloader)
- [GraphQL Batch](https://github.com/Shopify/graphql-batch)
- Rust
- [Dataloader](https://github.com/cksac/dataloader-rs)
- Swift
- [SwiftDataLoader](https://github.com/kimdv/SwiftDataLoader)
- C++
- [cppdataloader](https://github.com/jafarlihi/cppdataloader)
## Video Source Code Walkthrough
**DataLoader Source Code Walkthrough (YouTube):**
A walkthrough of the DataLoader v1 source code. While the source has changed
since this video was made, it is still a good overview of the rationale of
DataLoader and how it works.
<a href="https://youtu.be/OQTnXNCDywA" target="_blank" alt="DataLoader Source Code Walkthrough"><img src="https://img.youtube.com/vi/OQTnXNCDywA/0.jpg" /></a>
[@schrockn]: https://github.com/schrockn
[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
[graphql-js]: https://github.com/graphql/graphql-js
[cache algorithms]: https://en.wikipedia.org/wiki/Cache_algorithms
[express]: http://expressjs.com/
[babel/polyfill]: https://babeljs.io/docs/usage/polyfill/
[lru_map]: https://github.com/rsms/js-lru
[source code]: https://github.com/graphql/dataloader/blob/main/src/index.js
# Contributing to this repo
This repository is managed by EasyCLA. Project participants must sign the free ([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org).
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join).
@@ -0,0 +1,10 @@
"use strict";
exports.quartersToYears = void 0;
var _index = require("../quartersToYears.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const quartersToYears = (exports.quartersToYears = (0, _index2.convertToFP)(
_index.quartersToYears,
1,
));
@@ -0,0 +1,50 @@
import { constructFrom } from "./constructFrom.js";
import { toDate } from "./toDate.js";
/**
* The {@link min} function options.
*/
/**
* @name min
* @category Common Helpers
* @summary Returns the earliest of the given dates.
*
* @description
* Returns the earliest of the given dates.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param dates - The dates to compare
*
* @returns The earliest of the dates
*
* @example
* // Which of these dates is the earliest?
* const result = min([
* new Date(1989, 6, 10),
* new Date(1987, 1, 11),
* new Date(1995, 6, 2),
* new Date(1990, 0, 1)
* ])
* //=> Wed Feb 11 1987 00:00:00
*/
export function min(dates, options) {
let result;
let context = options?.in;
dates.forEach((date) => {
// Use the first date object as the context function
if (!context && typeof date === "object")
context = constructFrom.bind(null, date);
const date_ = toDate(date, context);
if (!result || result > date_ || isNaN(+date_)) result = date_;
});
return constructFrom(context, result || NaN);
}
// Fallback for modularized imports:
export default min;
@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";var r=require("react"),e=require("react/jsx-runtime");function t(r){var e=Object.create(null);if(r)for(var t in r)e[t]=r[t];return e.default=r,e}var n=t(r);function o(r,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},o(r,e)}var a={error:null},i=function(r){var e,t;function i(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=r.call.apply(r,[this].concat(n))||this).state=a,e.resetErrorBoundary=function(){for(var r,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];null==e.props.onReset||(r=e.props).onReset.apply(r,n),e.reset()},e}t=r,(e=i).prototype=Object.create(t.prototype),e.prototype.constructor=e,o(e,t),i.getDerivedStateFromError=function(r){return{error:r}};var s=i.prototype;return s.reset=function(){this.setState(a)},s.componentDidCatch=function(r,e){var t,n;null==(t=(n=this.props).onError)||t.call(n,r,e)},s.componentDidUpdate=function(r,e){var t,n,o,a,i=this.state.error,s=this.props.resetKeys;null!==i&&null!==e.error&&(void 0===(o=r.resetKeys)&&(o=[]),void 0===(a=s)&&(a=[]),o.length!==a.length||o.some((function(r,e){return!Object.is(r,a[e])})))&&(null==(t=(n=this.props).onResetKeysChange)||t.call(n,r.resetKeys,s),this.reset())},s.render=function(){var r=this.state.error,e=this.props,t=e.fallbackRender,o=e.FallbackComponent,a=e.fallback;if(null!==r){var i={error:r,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(a))return a;if("function"==typeof t)return t(i);if(o)return n.createElement(o,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},i}(n.Component);exports.LexicalErrorBoundary=function({children:r,onError:t}){return e.jsx(i,{fallback:e.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:r})};
@@ -0,0 +1,154 @@
"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, {
GelDbPreparedQuery: () => GelDbPreparedQuery,
GelDbSession: () => GelDbSession,
GelDbTransaction: () => GelDbTransaction
});
module.exports = __toCommonJS(session_exports);
var import_core = require("../cache/core/index.cjs");
var import_entity = require("../entity.cjs");
var import_session = require("../gel-core/session.cjs");
var import_logger = require("../logger.cjs");
var import_sql = require("../sql/sql.cjs");
var import_tracing = require("../tracing.cjs");
var import_utils = require("../utils.cjs");
class GelDbPreparedQuery extends import_session.GelPreparedQuery {
constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, _isResponseInArrayMode, customResultMapper, transaction = false) {
super({ sql: queryString, params }, cache, queryMetadata, cacheConfig);
this.client = client;
this.queryString = queryString;
this.params = params;
this.logger = logger;
this.fields = fields;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
this.transaction = transaction;
}
static [import_entity.entityKind] = "GelPreparedQuery";
async execute(placeholderValues = {}) {
return import_tracing.tracer.startActiveSpan("drizzle.execute", async () => {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
this.logger.logQuery(this.queryString, params);
const { fields, queryString: query, client, joinsNotNullableMap, customResultMapper } = this;
if (!fields && !customResultMapper) {
return import_tracing.tracer.startActiveSpan("drizzle.driver.execute", async (span) => {
span?.setAttributes({
"drizzle.query.text": query,
"drizzle.query.params": JSON.stringify(params)
});
return await this.queryWithCache(query, params, async () => {
return await client.querySQL(query, params.length ? params : void 0);
});
});
}
const result = await import_tracing.tracer.startActiveSpan("drizzle.driver.execute", async (span) => {
span?.setAttributes({
"drizzle.query.text": query,
"drizzle.query.params": JSON.stringify(params)
});
return await this.queryWithCache(query, params, async () => {
return await client.withSQLRowMode("array").querySQL(query, params.length ? params : void 0);
});
});
return import_tracing.tracer.startActiveSpan("drizzle.mapResponse", () => {
return customResultMapper ? customResultMapper(result) : result.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap));
});
});
}
async all(placeholderValues = {}) {
return await import_tracing.tracer.startActiveSpan("drizzle.execute", async () => {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
this.logger.logQuery(this.queryString, params);
return await import_tracing.tracer.startActiveSpan("drizzle.driver.execute", async (span) => {
span?.setAttributes({
"drizzle.query.text": this.queryString,
"drizzle.query.params": JSON.stringify(params)
});
return await this.queryWithCache(this.queryString, params, async () => {
return await this.client.withSQLRowMode("array").querySQL(
this.queryString,
params.length ? params : void 0
).then((result) => result);
});
});
});
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
class GelDbSession extends import_session.GelSession {
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] = "GelDbSession";
logger;
cache;
prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
return new GelDbPreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
isResponseInArrayMode,
customResultMapper
);
}
async transaction(transaction) {
return await this.client.transaction(async (clientTx) => {
const session = new GelDbSession(clientTx, this.dialect, this.schema, this.options);
const tx = new GelDbTransaction(this.dialect, session, this.schema);
return await transaction(tx);
});
}
async count(sql) {
const res = await this.execute(sql);
return Number(res[0]["count"]);
}
}
class GelDbTransaction extends import_session.GelTransaction {
static [import_entity.entityKind] = "GelDbTransaction";
async transaction(transaction) {
const tx = new GelDbTransaction(
this.dialect,
this.session,
this.schema
);
return await transaction(tx);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GelDbPreparedQuery,
GelDbSession,
GelDbTransaction
});
//# sourceMappingURL=session.cjs.map
@@ -0,0 +1,66 @@
var stream = require('stream')
var pump = require('./index')
var rs = new stream.Readable()
var ws = new stream.Writable()
rs._read = function (size) {
this.push(Buffer(size).fill('abc'))
}
ws._write = function (chunk, encoding, cb) {
setTimeout(function () {
cb()
}, 100)
}
var toHex = function () {
var reverse = new (require('stream').Transform)()
reverse._transform = function (chunk, enc, callback) {
reverse.push(chunk.toString('hex'))
callback()
}
return reverse
}
var wsClosed = false
var rsClosed = false
var callbackCalled = false
var check = function () {
if (wsClosed && rsClosed && callbackCalled) {
console.log('test-browser.js passes')
clearTimeout(timeout)
}
}
ws.on('finish', function () {
wsClosed = true
check()
})
rs.on('end', function () {
rsClosed = true
check()
})
var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
callbackCalled = true
check()
})
if (res !== ws) {
throw new Error('should return last stream')
}
setTimeout(function () {
rs.push(null)
rs.emit('close')
}, 1000)
var timeout = setTimeout(function () {
check()
throw new Error('timeout')
}, 5000)
@@ -0,0 +1 @@
Prism.languages.idris=Prism.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,builtin:void 0}),Prism.languages.insertBefore("idris","keyword",{"import-statement":{pattern:/(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0,inside:{punctuation:/\./}}}),Prism.languages.idr=Prism.languages.idris;
@@ -0,0 +1 @@
{"version":3,"file":"between-horizontal-end.js","sources":["../../../src/icons/between-horizontal-end.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BetweenHorizontalEnd\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTMiIGhlaWdodD0iNyIgeD0iMyIgeT0iMyIgcng9IjEiIC8+CiAgPHBhdGggZD0ibTIyIDE1LTMtMyAzLTMiIC8+CiAgPHJlY3Qgd2lkdGg9IjEzIiBoZWlnaHQ9IjciIHg9IjMiIHk9IjE0IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/between-horizontal-end\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BetweenHorizontalEnd = createLucideIcon('BetweenHorizontalEnd', [\n ['rect', { width: '13', height: '7', x: '3', y: '3', rx: '1', key: '11xb64' }],\n ['path', { d: 'm22 15-3-3 3-3', key: '26chmm' }],\n ['rect', { width: '13', height: '7', x: '3', y: '14', rx: '1', key: 'k6ky7n' }],\n]);\n\nexport default BetweenHorizontalEnd;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
{
"name": "dom-helpers/scrollLeft",
"private": true,
"main": "../cjs/scrollLeft.js",
"module": "../esm/scrollLeft.js",
"types": "../esm/scrollLeft.d.ts"
}
@@ -0,0 +1,27 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.dereference = void 0;
const json_schema_ref_parser_1 = require("@apidevtools/json-schema-ref-parser");
const utils_1 = require("./utils");
function dereference(schema_1, _a) {
return __awaiter(this, arguments, void 0, function* (schema, { cwd, $refOptions }) {
(0, utils_1.log)('green', 'dereferencer', 'Dereferencing input schema:', cwd, schema);
const parser = new json_schema_ref_parser_1.$RefParser();
const dereferencedPaths = new WeakMap();
const dereferencedSchema = (yield parser.dereference(cwd, schema, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema) {
dereferencedPaths.set(schema, $ref);
} }) }))); // TODO: fix types
return { dereferencedPaths, dereferencedSchema };
});
}
exports.dereference = dereference;
//# sourceMappingURL=resolver.js.map
@@ -0,0 +1 @@
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../src/resolvers/collections/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAI/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,MAAM,MAAM,QAAQ,GAAG,CACrB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE;IACJ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,KAAK,CAAA;CACb,EACD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,kBAAkB,KACrB,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAEhC,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAyCrE"}
@@ -0,0 +1 @@
{"version":3,"file":"semconvStability.js","sourceRoot":"","sources":["../../src/semconvStability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,6CAA6C;IAC7C,2DAAY,CAAA;IACZ,0CAA0C;IAC1C,qDAAS,CAAA;IACT,qDAAqD;IACrD,iEAAqB,CAAA;AACvB,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,uBAAuB,CACrC,SAAoC,EACpC,GAAuB;IAEvB,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC;IAE5C,yEAAyE;IACzE,MAAM,OAAO,GAAG,GAAG;QACjB,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,OAAO,IAAI,EAAE,EAAE;QACjC,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,SAAS,GAAG,MAAM,EAAE;YAC9C,sCAAsC;YACtC,gBAAgB,GAAG,gBAAgB,CAAC,SAAS,CAAC;YAC9C,MAAM;SACP;aAAM,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;YAC5C,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC;SAC5C;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum SemconvStability {\n /** Emit only stable semantic conventions. */\n STABLE = 0x1,\n /** Emit only old semantic conventions. */\n OLD = 0x2,\n /** Emit both stable and old semantic conventions. */\n DUPLICATE = 0x1 | 0x2,\n}\n\n// Common namespaces mentioned in semantic-conventions docs, but allow\n// other custom strings.\ntype SemConvStabilityNamespace =\n | 'http'\n | 'messaging'\n | 'database'\n | 'k8s'\n | (string & {});\n\n/**\n * Determine the appropriate semconv stability for the given namespace.\n *\n * This will parse the given string of comma-separated values (often\n * `process.env.OTEL_SEMCONV_STABILITY_OPT_IN`) looking for the `${namespace}`\n * or `${namespace}/dup` tokens. This is a pattern defined by a number of\n * non-normative semconv documents.\n *\n * For example:\n * - namespace 'http': https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * - namespace 'database': https://opentelemetry.io/docs/specs/semconv/non-normative/database-migration/\n * - namespace 'k8s': https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/\n *\n * Usage:\n *\n * import {SemconvStability, semconvStabilityFromStr} from '@opentelemetry/instrumentation';\n *\n * export class FooInstrumentation extends InstrumentationBase<FooInstrumentationConfig> {\n * private _semconvStability: SemconvStability;\n * constructor(config: FooInstrumentationConfig = {}) {\n * super('@opentelemetry/instrumentation-foo', VERSION, config);\n *\n * // When supporting the OTEL_SEMCONV_STABILITY_OPT_IN envvar\n * this._semconvStability = semconvStabilityFromStr(\n * 'http',\n * process.env.OTEL_SEMCONV_STABILITY_OPT_IN\n * );\n *\n * // or when supporting a `semconvStabilityOptIn` config option (e.g. for\n * // the web where there are no envvars).\n * this._semconvStability = semconvStabilityFromStr(\n * 'http',\n * config?.semconvStabilityOptIn\n * );\n * }\n * }\n *\n * // Then, to apply semconv, use the following or similar:\n * if (this._semconvStability & SemconvStability.OLD) {\n * // ...\n * }\n * if (this._semconvStability & SemconvStability.STABLE) {\n * // ...\n * }\n *\n */\nexport function semconvStabilityFromStr(\n namespace: SemConvStabilityNamespace,\n str: string | undefined\n) {\n let semconvStability = SemconvStability.OLD;\n\n // The same parsing of `str` as `getStringListFromEnv` from the core pkg.\n const entries = str\n ?.split(',')\n .map(v => v.trim())\n .filter(s => s !== '');\n for (const entry of entries ?? []) {\n if (entry.toLowerCase() === namespace + '/dup') {\n // DUPLICATE takes highest precedence.\n semconvStability = SemconvStability.DUPLICATE;\n break;\n } else if (entry.toLowerCase() === namespace) {\n semconvStability = SemconvStability.STABLE;\n }\n }\n\n return semconvStability;\n}\n"]}
@@ -0,0 +1,25 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export interface YearParserValue {
year: number;
isTwoDigitYear: boolean;
}
export declare class YearParser extends Parser<YearParserValue> {
priority: number;
incompatibleTokens: string[];
parse(
dateString: string,
token: string,
match: Match,
): ParseResult<YearParserValue>;
validate<DateType extends Date>(
_date: DateType,
value: YearParserValue,
): boolean;
set<DateType extends Date>(
date: DateType,
flags: ParseFlags,
value: YearParserValue,
): DateType;
}
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { subMinutes as fn } from "../subMinutes.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const subMinutes = convertToFP(fn, 2);
// Fallback for modularized imports:
export default subMinutes;
@@ -0,0 +1,240 @@
Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens)
========
A regex that tokenizes JavaScript.
```js
var jsTokens = require("js-tokens").default
var jsString = "var foo=opts.foo;\n..."
jsString.match(jsTokens)
// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...]
```
Installation
============
`npm install js-tokens`
```js
import jsTokens from "js-tokens"
// or:
var jsTokens = require("js-tokens").default
```
Usage
=====
### `jsTokens` ###
A regex with the `g` flag that matches JavaScript tokens.
The regex _always_ matches, even invalid JavaScript and the empty string.
The next match is always directly after the previous.
### `var token = matchToToken(match)` ###
```js
import {matchToToken} from "js-tokens"
// or:
var matchToToken = require("js-tokens").matchToToken
```
Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type:
String, value: String}` object. The following types are available:
- string
- comment
- regex
- number
- name
- punctuator
- whitespace
- invalid
Multi-line comments and strings also have a `closed` property indicating if the
token was closed or not (see below).
Comments and strings both come in several flavors. To distinguish them, check if
the token starts with `//`, `/*`, `'`, `"` or `` ` ``.
Names are ECMAScript IdentifierNames, that is, including both identifiers and
keywords. You may use [is-keyword-js] to tell them apart.
Whitespace includes both line terminators and other whitespace.
[is-keyword-js]: https://github.com/crissdev/is-keyword-js
ECMAScript support
==================
The intention is to always support the latest ECMAScript version whose feature
set has been finalized.
If adding support for a newer version requires changes, a new version with a
major verion bump will be released.
Currently, ECMAScript 2018 is supported.
Invalid code handling
=====================
Unterminated strings are still matched as strings. JavaScript strings cannot
contain (unescaped) newlines, so unterminated strings simply end at the end of
the line. Unterminated template strings can contain unescaped newlines, though,
so they go on to the end of input.
Unterminated multi-line comments are also still matched as comments. They
simply go on to the end of the input.
Unterminated regex literals are likely matched as division and whatever is
inside the regex.
Invalid ASCII characters have their own capturing group.
Invalid non-ASCII characters are treated as names, to simplify the matching of
names (except unicode spaces which are treated as whitespace). Note: See also
the [ES2018](#es2018) section.
Regex literals may contain invalid regex syntax. They are still matched as
regex literals. They may also contain repeated regex flags, to keep the regex
simple.
Strings may contain invalid escape sequences.
Limitations
===========
Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be
perfect. But that’s not the point either.
You may compare jsTokens with [esprima] by using `esprima-compare.js`.
See `npm run esprima-compare`!
[esprima]: http://esprima.org/
### Template string interpolation ###
Template strings are matched as single tokens, from the starting `` ` `` to the
ending `` ` ``, including interpolations (whose tokens are not matched
individually).
Matching template string interpolations requires recursive balancing of `{` and
`}`—something that JavaScript regexes cannot do. Only one level of nesting is
supported.
### Division and regex literals collision ###
Consider this example:
```js
var g = 9.82
var number = bar / 2/g
var regex = / 2/g
```
A human can easily understand that in the `number` line we’re dealing with
division, and in the `regex` line we’re dealing with a regex literal. How come?
Because humans can look at the whole code to put the `/` characters in context.
A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also
look backwards. See the [ES2018](#es2018) section).
When the `jsTokens` regex scans throught the above, it will see the following
at the end of both the `number` and `regex` rows:
```js
/ 2/g
```
It is then impossible to know if that is a regex literal, or part of an
expression dealing with division.
Here is a similar case:
```js
foo /= 2/g
foo(/= 2/g)
```
The first line divides the `foo` variable with `2/g`. The second line calls the
`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only
sees forwards, it cannot tell the two cases apart.
There are some cases where we _can_ tell division and regex literals apart,
though.
First off, we have the simple cases where there’s only one slash in the line:
```js
var foo = 2/g
foo /= 2
```
Regex literals cannot contain newlines, so the above cases are correctly
identified as division. Things are only problematic when there are more than
one non-comment slash in a single line.
Secondly, not every character is a valid regex flag.
```js
var number = bar / 2/e
```
The above example is also correctly identified as division, because `e` is not a
valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*`
(any letter) as flags, but it is not worth it since it increases the amount of
ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are
allowed. This means that the above example will be identified as division as
long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6
characters long.
Lastly, we can look _forward_ for information.
- If the token following what looks like a regex literal is not valid after a
regex literal, but is valid in a division expression, then the regex literal
is treated as division instead. For example, a flagless regex cannot be
followed by a string, number or name, but all of those three can be the
denominator of a division.
- Generally, if what looks like a regex literal is followed by an operator, the
regex literal is treated as division instead. This is because regexes are
seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division
could likely be part of such an expression.
Please consult the regex source and the test cases for precise information on
when regex or division is matched (should you need to know). In short, you
could sum it up as:
If the end of a statement looks like a regex literal (even if it isn’t), it
will be treated as one. Otherwise it should work as expected (if you write sane
code).
### ES2018 ###
ES2018 added some nice regex improvements to the language.
- [Unicode property escapes] should allow telling names and invalid non-ASCII
characters apart without blowing up the regex size.
- [Lookbehind assertions] should allow matching telling division and regex
literals apart in more cases.
- [Named capture groups] might simplify some things.
These things would be nice to do, but are not critical. They probably have to
wait until the oldest maintained Node.js LTS release supports those features.
[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html
[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html
[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html
License
=======
[MIT](LICENSE).
@@ -0,0 +1 @@
module.exports={C:{"115":0.0179,"121":0.00358,"131":0.08948,"135":0.00358,"139":0.00358,"140":0.02505,"143":0.00716,"144":0.00716,"145":1.0737,"146":0.82675,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 122 123 124 125 126 127 128 129 130 132 133 134 136 137 138 141 142 147 148 149 3.5 3.6"},D:{"65":0.01432,"69":0.00716,"76":0.00716,"88":0.00358,"99":0.00358,"103":0.07158,"104":0.00716,"105":0.01074,"106":0.00716,"108":0.11095,"109":0.13242,"114":0.00716,"117":0.00358,"119":0.0179,"120":0.0179,"121":0.04653,"124":0.00358,"125":0.08232,"126":0.16106,"127":0.00716,"128":0.03579,"129":0.00716,"130":0.00716,"132":0.01074,"133":0.01074,"134":0.00716,"135":0.02147,"136":0.03579,"138":0.05369,"139":0.00716,"140":0.16463,"141":0.18253,"142":5.47229,"143":6.40283,"144":0.02147,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 66 67 68 70 71 72 73 74 75 77 78 79 80 81 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 100 101 102 107 110 111 112 113 115 116 118 122 123 131 137 145 146"},F:{"93":0.15032,"114":0.01432,"123":0.00358,"124":2.33351,"125":0.21474,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"13":0.03579,"16":0.01074,"17":0.02863,"84":0.0179,"90":0.00358,"92":0.03937,"102":0.00358,"118":0.0179,"122":0.00716,"125":0.00716,"129":0.02147,"131":0.0179,"132":0.00358,"135":0.00716,"136":0.0179,"137":0.03579,"138":0.10379,"139":0.02147,"140":0.03937,"141":0.03221,"142":1.57834,"143":3.53963,_:"12 14 15 18 79 80 81 83 85 86 87 88 89 91 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 119 120 121 123 124 126 127 128 130 133 134"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.5 18.0 18.2 18.4 26.0 26.3","11.1":0.01432,"13.1":0.02863,"14.1":0.03579,"15.6":0.00358,"16.6":0.00716,"17.1":0.00716,"17.3":0.0179,"17.4":0.00358,"17.6":0.05011,"18.1":0.00358,"18.3":0.00716,"18.5-18.6":0.00716,"26.1":0.08948,"26.2":0.02147},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00046,"5.0-5.1":0,"6.0-6.1":0.00092,"7.0-7.1":0.00069,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00183,"10.0-10.2":0.00023,"10.3":0.00321,"11.0-11.2":0.03942,"11.3-11.4":0.00115,"12.0-12.1":0.00092,"12.2-12.5":0.01031,"13.0-13.1":0.00023,"13.2":0.0016,"13.3":0.00046,"13.4-13.7":0.0016,"14.0-14.4":0.00321,"14.5-14.8":0.00344,"15.0-15.1":0.00367,"15.2-15.3":0.00275,"15.4":0.00298,"15.5":0.00321,"15.6-15.8":0.04974,"16.0":0.00573,"16.1":0.011,"16.2":0.00573,"16.3":0.01031,"16.4":0.00252,"16.5":0.00435,"16.6-16.7":0.06463,"17.0":0.00367,"17.1":0.00596,"17.2":0.00435,"17.3":0.00665,"17.4":0.01123,"17.5":0.022,"17.6-17.7":0.05088,"18.0":0.01146,"18.1":0.02384,"18.2":0.01261,"18.3":0.04103,"18.4":0.02109,"18.5-18.7":1.51406,"26.0":0.02957,"26.1":0.24593,"26.2":0.04676,"26.3":0.00206},P:{"4":0.01031,"23":0.17535,"24":0.0722,"25":0.04126,"26":0.06189,"27":0.06189,"28":0.66013,"29":1.03146,_:"20 21 22 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 17.0 18.0","7.2-7.4":0.03094,"13.0":0.02063,"19.0":0.01031},I:{"0":0.01923,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},A:{"11":0.03579,_:"6 7 8 9 10 5.5"},K:{"0":0.76682,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.08988},O:{"0":1.33536},H:{"0":0.01},L:{"0":68.56232},R:{_:"0"},M:{"0":0.0963}};
@@ -0,0 +1 @@
module.exports={C:{"5":0.01002,"57":0.00334,"58":0.01002,"72":0.00334,"85":0.00334,"94":0.01002,"112":0.00334,"115":0.00668,"121":0.00668,"127":0.01002,"129":0.00334,"136":0.00334,"138":0.00668,"139":0.01002,"140":0.02339,"142":0.00668,"143":0.03341,"144":0.01002,"145":0.5947,"146":0.37753,"147":0.01336,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 86 87 88 89 90 91 92 93 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 122 123 124 125 126 128 130 131 132 133 134 135 137 141 148 149 3.5 3.6"},D:{"32":0.00334,"47":0.00334,"48":0.00334,"54":0.00334,"57":0.00334,"58":0.00334,"59":0.01671,"64":0.00668,"67":0.00334,"68":0.00334,"69":0.01671,"70":0.00668,"71":0.00334,"75":0.00334,"76":0.00334,"77":0.00334,"78":0.01002,"79":0.00334,"80":0.01002,"81":0.00334,"92":0.00668,"93":0.01002,"94":0.01002,"95":0.00334,"96":0.00334,"98":0.01671,"103":0.0735,"104":0.00668,"105":0.02005,"106":0.01002,"107":0.37753,"108":0.00668,"109":0.12362,"110":0.01002,"111":0.05012,"112":0.00668,"113":0.00334,"114":0.00334,"116":0.03341,"117":0.00668,"119":0.02005,"120":0.06348,"122":0.01002,"124":0.03007,"125":0.04009,"126":0.10691,"127":0.01002,"128":0.03341,"129":0.04677,"130":0.01002,"131":0.07684,"132":0.08018,"133":0.02339,"134":0.0568,"135":0.03675,"136":0.06682,"137":0.04677,"138":0.23387,"139":0.2606,"140":0.07016,"141":0.24723,"142":3.30425,"143":3.11381,"144":0.01002,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 46 49 50 51 52 53 55 56 60 61 62 63 65 66 72 73 74 83 84 85 86 87 88 89 90 91 97 99 100 101 102 115 118 121 123 145 146"},F:{"37":0.00334,"54":0.00334,"63":0.00334,"67":0.00334,"79":0.00334,"90":0.01336,"91":0.00334,"92":0.03675,"93":0.22385,"95":0.01002,"108":0.01336,"113":0.00334,"119":0.00668,"122":0.00334,"123":0.01671,"124":0.30737,"125":0.17707,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 60 62 64 65 66 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 94 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 114 115 116 117 118 120 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00668,"13":0.00334,"14":0.00334,"16":0.01671,"17":0.01671,"18":0.13698,"84":0.00668,"90":0.08353,"92":0.17373,"100":0.03007,"109":0.01002,"111":0.01002,"112":0.00334,"114":0.00668,"120":0.00334,"122":0.04343,"125":0.00334,"126":0.01002,"129":0.01002,"130":0.00334,"132":0.00334,"133":0.00668,"134":0.00668,"135":0.00334,"136":0.01002,"137":0.03341,"138":0.02005,"139":0.02339,"140":0.02673,"141":0.06014,"142":0.93882,"143":2.08478,_:"15 79 80 81 83 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 113 115 116 117 118 119 121 123 124 127 128 131"},E:{"12":0.00334,_:"0 4 5 6 7 8 9 10 11 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.5 16.0 16.2 16.4 16.5 17.0 17.2 17.3 17.4 18.0 18.2 26.3","11.1":0.00334,"13.1":0.01336,"14.1":0.00334,"15.1":0.00334,"15.2-15.3":0.00668,"15.4":0.01336,"15.6":0.11359,"16.1":0.01002,"16.3":0.00334,"16.6":0.0735,"17.1":0.00334,"17.5":0.00334,"17.6":0.26728,"18.1":0.00334,"18.3":0.00668,"18.4":0.00668,"18.5-18.6":0.01336,"26.0":0.00668,"26.1":0.0735,"26.2":0.0735},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00094,"5.0-5.1":0,"6.0-6.1":0.00188,"7.0-7.1":0.00141,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00377,"10.0-10.2":0.00047,"10.3":0.00659,"11.0-11.2":0.08098,"11.3-11.4":0.00235,"12.0-12.1":0.00188,"12.2-12.5":0.02119,"13.0-13.1":0.00047,"13.2":0.0033,"13.3":0.00094,"13.4-13.7":0.0033,"14.0-14.4":0.00659,"14.5-14.8":0.00706,"15.0-15.1":0.00753,"15.2-15.3":0.00565,"15.4":0.00612,"15.5":0.00659,"15.6-15.8":0.10216,"16.0":0.01177,"16.1":0.0226,"16.2":0.01177,"16.3":0.02119,"16.4":0.00518,"16.5":0.00895,"16.6-16.7":0.13276,"17.0":0.00753,"17.1":0.01224,"17.2":0.00895,"17.3":0.01365,"17.4":0.02307,"17.5":0.0452,"17.6-17.7":0.10452,"18.0":0.02354,"18.1":0.04896,"18.2":0.02589,"18.3":0.08427,"18.4":0.04331,"18.5-18.7":3.11005,"26.0":0.06073,"26.1":0.50516,"26.2":0.09604,"26.3":0.00424},P:{"24":0.03072,"25":0.03072,"26":0.04096,"27":0.14336,"28":0.24577,"29":0.60418,_:"4 20 21 22 23 5.0-5.4 6.2-6.4 8.2 10.1 12.0 14.0 15.0 17.0 18.0","7.2-7.4":0.01024,"9.2":0.03072,"11.1-11.2":0.01024,"13.0":0.01024,"16.0":0.0512,"19.0":0.01024},I:{"0":0.03324,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},A:{"10":0.02673,_:"6 7 8 9 11 5.5"},K:{"0":2.92467,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{"2.5":0.01998,_:"3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.21975},H:{"0":4.6},L:{"0":70.2367},R:{_:"0"},M:{"0":0.05993}};
@@ -0,0 +1 @@
{"version":3,"file":"consoleLogger.js","sourceRoot":"","sources":["../../../src/diag/consoleLogger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,MAAM,UAAU,GAAiD;IAC/D,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B;QACE,SAAS,YAAY,CAAC,QAAwB;YAC5C,OAAO,UAAU,GAAG,IAAI;gBACtB,IAAI,OAAO,EAAE;oBACX,mFAAmF;oBACnF,sCAAsC;oBACtC,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAChC,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,6CAA6C;wBAC7C,sCAAsC;wBACtC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;qBACvB;oBAED,uBAAuB;oBACvB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;qBACrC;iBACF;YACH,CAAC,CAAC;QACJ,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;IACH,CAAC;CAkCF;AA3DD,8CA2DC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagLogger, DiagLogFunction } from './types';\n\ntype ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';\nconst consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nexport class DiagConsoleLogger implements DiagLogger {\n constructor() {\n function _consoleFunc(funcName: ConsoleMapKeys): DiagLogFunction {\n return function (...args) {\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n let theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n }\n };\n }\n\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n\n /** Log an error scenario that was not expected and caused the requested operation to fail. */\n public error!: DiagLogFunction;\n\n /**\n * Log a warning scenario to inform the developer of an issues that should be investigated.\n * The requested operation may or may not have succeeded or completed.\n */\n public warn!: DiagLogFunction;\n\n /**\n * Log a general informational message, this should not affect functionality.\n * This is also the default logging level so this should NOT be used for logging\n * debugging level information.\n */\n public info!: DiagLogFunction;\n\n /**\n * Log a general debug message that can be useful for identifying a failure.\n * Information logged at this level may include diagnostic details that would\n * help identify a failure scenario. Useful scenarios would be to log the execution\n * order of async operations\n */\n public debug!: DiagLogFunction;\n\n /**\n * Log a detailed (verbose) trace level logging that can be used to identify failures\n * where debug level logging would be insufficient, this level of tracing can include\n * input and output parameters and as such may include PII information passing through\n * the API. As such it is recommended that this level of tracing should not be enabled\n * in a production environment.\n */\n public verbose!: DiagLogFunction;\n}\n"]}
@@ -0,0 +1,67 @@
function con(b) {
if ((b & 0xc0) === 0x80) {
return b & 0x3f;
} else {
throw new Error("invalid UTF-8 encoding");
}
}
function code(min, n) {
if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) {
throw new Error("invalid UTF-8 encoding");
} else {
return n;
}
}
export function decode(bytes) {
return _decode(bytes).map(function (x) {
return String.fromCharCode(x);
}).join("");
}
function _decode(bytes) {
var result = [];
while (bytes.length > 0) {
var b1 = bytes[0];
if (b1 < 0x80) {
result.push(code(0x0, b1));
bytes = bytes.slice(1);
continue;
}
if (b1 < 0xc0) {
throw new Error("invalid UTF-8 encoding");
}
var b2 = bytes[1];
if (b1 < 0xe0) {
result.push(code(0x80, ((b1 & 0x1f) << 6) + con(b2)));
bytes = bytes.slice(2);
continue;
}
var b3 = bytes[2];
if (b1 < 0xf0) {
result.push(code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3)));
bytes = bytes.slice(3);
continue;
}
var b4 = bytes[3];
if (b1 < 0xf8) {
result.push(code(0x10000, (((b1 & 0x07) << 18) + con(b2) << 12) + (con(b3) << 6) + con(b4)));
bytes = bytes.slice(4);
continue;
}
throw new Error("invalid UTF-8 encoding");
}
return result;
}
@@ -0,0 +1,220 @@
"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, {
D1PreparedQuery: () => D1PreparedQuery,
D1Transaction: () => D1Transaction,
SQLiteD1Session: () => SQLiteD1Session
});
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 SQLiteD1Session extends import_session.SQLiteSession {
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] = "SQLiteD1Session";
logger;
cache;
prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
const stmt = this.client.prepare(query.sql);
return new D1PreparedQuery(
stmt,
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);
if (builtQuery.params.length > 0) {
builtQueries.push(preparedQuery.stmt.bind(...builtQuery.params));
} else {
const builtQuery2 = preparedQuery.getQuery();
builtQueries.push(
this.client.prepare(builtQuery2.sql).bind(...builtQuery2.params)
);
}
}
const batchResults = await this.client.batch(builtQueries);
return batchResults.map((result, i) => preparedQueries[i].mapResult(result, true));
}
extractRawAllValueFromBatchResult(result) {
return result.results;
}
extractRawGetValueFromBatchResult(result) {
return result.results[0];
}
extractRawValuesValueFromBatchResult(result) {
return d1ToRawMapping(result.results);
}
async transaction(transaction, config) {
const tx = new D1Transaction("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;
}
}
}
class D1Transaction extends import_sqlite_core.SQLiteTransaction {
static [import_entity.entityKind] = "D1Transaction";
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex}`;
const tx = new D1Transaction("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;
}
}
}
function d1ToRawMapping(results) {
const rows = [];
for (const row of results) {
const entry = Object.keys(row).map((k) => row[k]);
rows.push(entry);
}
return rows;
}
class D1PreparedQuery extends import_session.SQLitePreparedQuery {
constructor(stmt, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
super("async", executeMethod, query, cache, queryMetadata, cacheConfig);
this.logger = logger;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
this.fields = fields;
this.stmt = stmt;
}
static [import_entity.entityKind] = "D1PreparedQuery";
/** @internal */
customResultMapper;
/** @internal */
fields;
/** @internal */
stmt;
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 this.stmt.bind(...params).run();
});
}
async all(placeholderValues) {
const { fields, query, logger, stmt, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = (0, import_sql.fillPlaceholders)(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return await this.queryWithCache(query.sql, params, async () => {
return stmt.bind(...params).all().then(({ results }) => this.mapAllResult(results));
});
}
const rows = await this.values(placeholderValues);
return this.mapAllResult(rows);
}
mapAllResult(rows, isFromBatch) {
if (isFromBatch) {
rows = d1ToRawMapping(rows.results);
}
if (!this.fields && !this.customResultMapper) {
return rows;
}
if (this.customResultMapper) {
return this.customResultMapper(rows);
}
return rows.map((row) => (0, import_utils.mapResultRow)(this.fields, row, this.joinsNotNullableMap));
}
async get(placeholderValues) {
const { fields, joinsNotNullableMap, query, logger, stmt, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = (0, import_sql.fillPlaceholders)(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return await this.queryWithCache(query.sql, params, async () => {
return stmt.bind(...params).all().then(({ results }) => results[0]);
});
}
const rows = await this.values(placeholderValues);
if (!rows[0]) {
return void 0;
}
if (customResultMapper) {
return customResultMapper(rows);
}
return (0, import_utils.mapResultRow)(fields, rows[0], joinsNotNullableMap);
}
mapGetResult(result, isFromBatch) {
if (isFromBatch) {
result = d1ToRawMapping(result.results)[0];
}
if (!this.fields && !this.customResultMapper) {
return result;
}
if (this.customResultMapper) {
return this.customResultMapper([result]);
}
return (0, import_utils.mapResultRow)(this.fields, result, this.joinsNotNullableMap);
}
async values(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 this.stmt.bind(...params).raw();
});
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
D1PreparedQuery,
D1Transaction,
SQLiteD1Session
});
//# sourceMappingURL=session.cjs.map
@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalHashtag.dev.mjs') : import('./LexicalHashtag.prod.mjs'));
export const $createHashtagNode = mod.$createHashtagNode;
export const $isHashtagNode = mod.$isHashtagNode;
export const HashtagNode = mod.HashtagNode;
@@ -0,0 +1 @@
{"version":3,"file":"debug-ids.d.ts","sourceRoot":"","sources":["../../../src/utils/debug-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAY7D;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAKxC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsExF;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,GACpC,UAAU,EAAE,CAoBd"}
@@ -0,0 +1,71 @@
import { normalizeInterval } from "./_lib/normalizeInterval.js";
import { constructFrom } from "./constructFrom.js";
/**
* The {@link eachYearOfInterval} function options.
*/
/**
* The {@link eachYearOfInterval} function result type. It resolves the proper data type.
* It uses the first argument date object type, starting from the date argument,
* then the start interval date, and finally the end interval date. If
* a context function is passed, it uses the context function return type.
*/
/**
* @name eachYearOfInterval
* @category Interval Helpers
* @summary Return the array of yearly timestamps within the specified time interval.
*
* @description
* Return the array of yearly timestamps within the specified time interval.
*
* @typeParam IntervalType - Interval type.
* @typeParam Options - Options type.
*
* @param interval - The interval.
* @param options - An object with options.
*
* @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end
*
* @example
* // Each year between 6 February 2014 and 10 August 2017:
* const result = eachYearOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2017, 7, 10)
* })
* //=> [
* // Wed Jan 01 2014 00:00:00,
* // Thu Jan 01 2015 00:00:00,
* // Fri Jan 01 2016 00:00:00,
* // Sun Jan 01 2017 00:00:00
* // ]
*/
export function eachYearOfInterval(interval, options) {
const { start, end } = normalizeInterval(options?.in, interval);
let reversed = +start > +end;
const endTime = reversed ? +start : +end;
const date = reversed ? end : start;
date.setHours(0, 0, 0, 0);
date.setMonth(0, 1);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+date <= endTime) {
dates.push(constructFrom(start, date));
date.setFullYear(date.getFullYear() + step);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
export default eachYearOfInterval;
@@ -0,0 +1,236 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const api = require('@opentelemetry/api');
const instrumentation = require('@opentelemetry/instrumentation');
const core = require('@sentry/core');
const constants = require('./constants.js');
const PACKAGE_NAME = '@sentry/instrumentation-hono';
const PACKAGE_VERSION = '0.0.1';
/**
* Hono instrumentation for OpenTelemetry
*/
class HonoInstrumentation extends instrumentation.InstrumentationBase {
constructor(config = {}) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
}
/**
* Initialize the instrumentation.
*/
init() {
return [
new instrumentation.InstrumentationNodeModuleDefinition('hono', ['>=4.0.0 <5'], moduleExports => this._patch(moduleExports)),
];
}
/**
* Patches the module exports to instrument Hono.
*/
_patch(moduleExports) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
class WrappedHono extends moduleExports.Hono {
constructor(...args) {
super(...args);
instrumentation._wrap(this, 'get', instrumentation._patchHandler());
instrumentation._wrap(this, 'post', instrumentation._patchHandler());
instrumentation._wrap(this, 'put', instrumentation._patchHandler());
instrumentation._wrap(this, 'delete', instrumentation._patchHandler());
instrumentation._wrap(this, 'options', instrumentation._patchHandler());
instrumentation._wrap(this, 'patch', instrumentation._patchHandler());
instrumentation._wrap(this, 'all', instrumentation._patchHandler());
instrumentation._wrap(this, 'on', instrumentation._patchOnHandler());
instrumentation._wrap(this, 'use', instrumentation._patchMiddlewareHandler());
}
}
try {
moduleExports.Hono = WrappedHono;
} catch {
// This is a workaround for environments where direct assignment is not allowed.
return { ...moduleExports, Hono: WrappedHono };
}
return moduleExports;
}
/**
* Patches the route handler to instrument it.
*/
_patchHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
if (typeof args[0] === 'string') {
const path = args[0];
if (args.length === 1) {
return original.apply(this, [path]);
}
const handlers = args.slice(1);
return original.apply(this, [
path,
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
}
return original.apply(
this,
args.map(handler => instrumentation._wrapHandler(handler )),
);
};
};
}
/**
* Patches the 'on' handler to instrument it.
*/
_patchOnHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
const handlers = args.slice(2);
return original.apply(this, [
...args.slice(0, 2),
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
};
};
}
/**
* Patches the middleware handler to instrument it.
*/
_patchMiddlewareHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
if (typeof args[0] === 'string') {
const path = args[0];
if (args.length === 1) {
return original.apply(this, [path]);
}
const handlers = args.slice(1);
return original.apply(this, [
path,
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
}
return original.apply(
this,
args.map(handler => instrumentation._wrapHandler(handler )),
);
};
};
}
/**
* Wraps a handler or middleware handler to apply instrumentation.
*/
_wrapHandler(handler) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function ( c, next) {
if (!instrumentation.isEnabled()) {
return handler.apply(this, [c, next]);
}
const path = c.req.path;
const span = instrumentation.tracer.startSpan(path);
return api.context.with(api.trace.setSpan(api.context.active(), span), () => {
return instrumentation._safeExecute(
() => {
const result = handler.apply(this, [c, next]);
if (core.isThenable(result)) {
return result.then(result => {
const type = instrumentation._determineHandlerType(result);
span.setAttributes({
[constants.AttributeNames.HONO_TYPE]: type,
[constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
});
instrumentation.getConfig().responseHook?.(span);
return result;
});
} else {
const type = instrumentation._determineHandlerType(result);
span.setAttributes({
[constants.AttributeNames.HONO_TYPE]: type,
[constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
});
instrumentation.getConfig().responseHook?.(span);
return result;
}
},
() => span.end(),
error => {
instrumentation._handleError(span, error);
span.end();
},
);
});
};
}
/**
* Safely executes a function and handles errors.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
_safeExecute(execute, onSuccess, onFailure) {
try {
const result = execute();
if (core.isThenable(result)) {
result.then(
() => onSuccess(),
(error) => onFailure(error),
);
} else {
onSuccess();
}
return result;
} catch (error) {
onFailure(error);
throw error;
}
}
/**
* Determines the handler type based on the result.
* @param result
* @private
*/
_determineHandlerType(result) {
return result === undefined ? constants.HonoTypes.MIDDLEWARE : constants.HonoTypes.REQUEST_HANDLER;
}
/**
* Handles errors by setting the span status and recording the exception.
*/
_handleError(span, error) {
if (error instanceof Error) {
span.setStatus({
code: api.SpanStatusCode.ERROR,
message: error.message,
});
span.recordException(error);
}
}
}
exports.HonoInstrumentation = HonoInstrumentation;
//# sourceMappingURL=instrumentation.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../src/migrateFresh.ts"],"sourcesContent":["import {\n commitTransaction,\n createLocalReq,\n initTransaction,\n killTransaction,\n readMigrationFiles,\n} from 'payload'\nimport prompts from 'prompts'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { getTransaction } from './utilities/getTransaction.js'\nimport { parseError } from './utilities/parseError.js'\n\n/**\n * Drop the current database and run all migrate up functions\n */\nexport async function migrateFresh(\n this: DrizzleAdapter,\n { forceAcceptWarning = false },\n): Promise<void> {\n const { payload } = this\n\n if (forceAcceptWarning === false) {\n const { confirm: acceptWarning } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message: `WARNING: This will drop your database and run all migrations. Are you sure you want to proceed?`,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n if (!acceptWarning) {\n process.exit(0)\n }\n }\n\n payload.logger.info({\n msg: `Dropping database.`,\n })\n\n await this.dropDatabase({ adapter: this })\n\n const migrationFiles = await readMigrationFiles({ payload })\n payload.logger.debug({\n msg: `Found ${migrationFiles.length} migration files.`,\n })\n\n const req = await createLocalReq({}, payload)\n\n if ('createExtensions' in this && typeof this.createExtensions === 'function') {\n await this.createExtensions()\n }\n\n // Run all migrate up\n for (const migration of migrationFiles) {\n payload.logger.info({ msg: `Migrating: ${migration.name}` })\n try {\n const start = Date.now()\n await initTransaction(req)\n const db = await getTransaction(this, req)\n await migration.up({ db, payload, req })\n await payload.create({\n collection: 'payload-migrations',\n data: {\n name: migration.name,\n batch: 1,\n },\n req,\n })\n await commitTransaction(req)\n\n payload.logger.info({ msg: `Migrated: ${migration.name} (${Date.now() - start}ms)` })\n } catch (err: unknown) {\n await killTransaction(req)\n payload.logger.error({\n err,\n msg: parseError(err, `Error running migration ${migration.name}. Rolling back`),\n })\n process.exit(1)\n }\n }\n}\n"],"names":["commitTransaction","createLocalReq","initTransaction","killTransaction","readMigrationFiles","prompts","getTransaction","parseError","migrateFresh","forceAcceptWarning","payload","confirm","acceptWarning","name","type","initial","message","onCancel","process","exit","logger","info","msg","dropDatabase","adapter","migrationFiles","debug","length","req","createExtensions","migration","start","Date","now","db","up","create","collection","data","batch","err","error"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,eAAe,EACfC,kBAAkB,QACb,UAAS;AAChB,OAAOC,aAAa,UAAS;AAI7B,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,UAAU,QAAQ,4BAA2B;AAEtD;;CAEC,GACD,OAAO,eAAeC,aAEpB,EAAEC,qBAAqB,KAAK,EAAE;IAE9B,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI;IAExB,IAAID,uBAAuB,OAAO;QAChC,MAAM,EAAEE,SAASC,aAAa,EAAE,GAAG,MAAMP,QACvC;YACEQ,MAAM;YACNC,MAAM;YACNC,SAAS;YACTC,SAAS,CAAC,+FAA+F,CAAC;QAC5G,GACA;YACEC,UAAU;gBACRC,QAAQC,IAAI,CAAC;YACf;QACF;QAGF,IAAI,CAACP,eAAe;YAClBM,QAAQC,IAAI,CAAC;QACf;IACF;IAEAT,QAAQU,MAAM,CAACC,IAAI,CAAC;QAClBC,KAAK,CAAC,kBAAkB,CAAC;IAC3B;IAEA,MAAM,IAAI,CAACC,YAAY,CAAC;QAAEC,SAAS,IAAI;IAAC;IAExC,MAAMC,iBAAiB,MAAMrB,mBAAmB;QAAEM;IAAQ;IAC1DA,QAAQU,MAAM,CAACM,KAAK,CAAC;QACnBJ,KAAK,CAAC,MAAM,EAAEG,eAAeE,MAAM,CAAC,iBAAiB,CAAC;IACxD;IAEA,MAAMC,MAAM,MAAM3B,eAAe,CAAC,GAAGS;IAErC,IAAI,sBAAsB,IAAI,IAAI,OAAO,IAAI,CAACmB,gBAAgB,KAAK,YAAY;QAC7E,MAAM,IAAI,CAACA,gBAAgB;IAC7B;IAEA,qBAAqB;IACrB,KAAK,MAAMC,aAAaL,eAAgB;QACtCf,QAAQU,MAAM,CAACC,IAAI,CAAC;YAAEC,KAAK,CAAC,WAAW,EAAEQ,UAAUjB,IAAI,EAAE;QAAC;QAC1D,IAAI;YACF,MAAMkB,QAAQC,KAAKC,GAAG;YACtB,MAAM/B,gBAAgB0B;YACtB,MAAMM,KAAK,MAAM5B,eAAe,IAAI,EAAEsB;YACtC,MAAME,UAAUK,EAAE,CAAC;gBAAED;gBAAIxB;gBAASkB;YAAI;YACtC,MAAMlB,QAAQ0B,MAAM,CAAC;gBACnBC,YAAY;gBACZC,MAAM;oBACJzB,MAAMiB,UAAUjB,IAAI;oBACpB0B,OAAO;gBACT;gBACAX;YACF;YACA,MAAM5B,kBAAkB4B;YAExBlB,QAAQU,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAK,CAAC,WAAW,EAAEQ,UAAUjB,IAAI,CAAC,EAAE,EAAEmB,KAAKC,GAAG,KAAKF,MAAM,GAAG,CAAC;YAAC;QACtF,EAAE,OAAOS,KAAc;YACrB,MAAMrC,gBAAgByB;YACtBlB,QAAQU,MAAM,CAACqB,KAAK,CAAC;gBACnBD;gBACAlB,KAAKf,WAAWiC,KAAK,CAAC,wBAAwB,EAAEV,UAAUjB,IAAI,CAAC,cAAc,CAAC;YAChF;YACAK,QAAQC,IAAI,CAAC;QACf;IACF;AACF"}
@@ -0,0 +1,34 @@
{
"name": "caniuse-lite",
"version": "1.0.30001769",
"description": "A smaller version of caniuse-db, with only the essentials!",
"main": "dist/unpacker/index.js",
"files": [
"data",
"dist"
],
"keywords": [
"support"
],
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"repository": "browserslist/caniuse-lite",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0"
}
@@ -0,0 +1,97 @@
{
"name": "@payloadcms/db-postgres",
"version": "3.77.0",
"description": "The officially supported Postgres database adapter for Payload",
"homepage": "https://payloadcms.com",
"repository": {
"type": "git",
"url": "https://github.com/payloadcms/payload.git",
"directory": "packages/db-postgres"
},
"license": "MIT",
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
"maintainers": [
{
"name": "Payload",
"email": "info@payloadcms.com",
"url": "https://payloadcms.com"
}
],
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./types": {
"import": "./dist/exports/types-deprecated.js",
"types": "./dist/exports/types-deprecated.d.ts",
"default": "./dist/exports/types-deprecated.js"
},
"./migration-utils": {
"import": "./dist/exports/migration-utils.js",
"types": "./dist/exports/migration-utils.d.ts",
"default": "./dist/exports/migration-utils.js"
},
"./drizzle": {
"import": "./dist/drizzle-proxy/index.js",
"types": "./dist/drizzle-proxy/index.d.ts",
"default": "./dist/drizzle-proxy/index.js"
},
"./drizzle/pg-core": {
"import": "./dist/drizzle-proxy/pg-core.js",
"types": "./dist/drizzle-proxy/pg-core.d.ts",
"default": "./dist/drizzle-proxy/pg-core.js"
},
"./drizzle/node-postgres": {
"import": "./dist/drizzle-proxy/node-postgres.js",
"types": "./dist/drizzle-proxy/node-postgres.d.ts",
"default": "./dist/drizzle-proxy/node-postgres.js"
},
"./drizzle/relations": {
"import": "./dist/drizzle-proxy/relations.js",
"types": "./dist/drizzle-proxy/relations.d.ts",
"default": "./dist/drizzle-proxy/relations.js"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"mock.js"
],
"dependencies": {
"@types/pg": "8.10.2",
"console-table-printer": "2.12.1",
"drizzle-kit": "0.31.7",
"drizzle-orm": "0.44.7",
"pg": "8.16.3",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
"uuid": "10.0.0",
"@payloadcms/drizzle": "3.77.0"
},
"devDependencies": {
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
"@types/to-snake-case": "1.0.0",
"esbuild": "0.27.1",
"@payloadcms/eslint-config": "3.28.0",
"payload": "3.77.0"
},
"peerDependencies": {
"payload": "3.77.0"
},
"scripts": {
"build": "rimraf .dist && rimraf tsconfig.tsbuildinfo && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm renamePredefinedMigrations",
"build:debug": "pnpm build",
"build:esbuild": "echo skipping esbuild",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
"clean": "rimraf -g {dist,*.tsbuildinfo}",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"renamePredefinedMigrations": "node --no-deprecation --import @swc-node/register/esm-register ./scripts/renamePredefinedMigrations.ts"
}
}
@@ -0,0 +1,16 @@
type RequestInfo = {
path: string;
method: string;
headers: Record<string, string | string[] | undefined>;
};
type ErrorContext = {
routerKind: string;
routePath: string;
routeType: string;
};
/**
* Reports errors passed to the the Next.js `onRequestError` instrumentation hook.
*/
export declare function captureRequestError(error: unknown, request: RequestInfo, errorContext: ErrorContext): void;
export {};
//# sourceMappingURL=captureRequestError.d.ts.map
@@ -0,0 +1,21 @@
/**
* @license React
* react-dom-test-utils.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("react"),
didWarnAboutUsingAct = !1;
exports.act = function (callback) {
!1 === didWarnAboutUsingAct &&
((didWarnAboutUsingAct = !0),
console.error(
"`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info."
));
return React.act(callback);
};
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _taggedTemplateLiteral;
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
}
//# sourceMappingURL=taggedTemplateLiteral.js.map
@@ -0,0 +1,33 @@
var createWrap = require('./_createWrap'),
flatRest = require('./_flatRest');
/** Used to compose bitmasks for function metadata. */
var WRAP_REARG_FLAG = 256;
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function(func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
module.exports = rearg;
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE, y. 'gada' d. MMMM",
long: "y. 'gada' d. MMMM",
medium: "dd.MM.y.",
short: "dd.MM.y.",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'plkst.' {{time}}",
long: "{{date}} 'plkst.' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getSiblingData.ts"],"sourcesContent":["import type { Data, FormState } from '../admin/types.js'\n\nimport { reduceFieldsToValues } from './reduceFieldsToValues.js'\nimport { unflatten } from './unflatten.js'\n\nexport const getSiblingData = (fields: FormState, path: string): Data => {\n if (!fields) {\n return null!\n }\n\n if (path.indexOf('.') === -1) {\n return reduceFieldsToValues(fields, true)\n }\n\n const siblingFields: Record<string, any> = {}\n\n // Determine if the last segment of the path is an array-based row\n const pathSegments = path.split('.')\n const lastSegment = pathSegments[pathSegments.length - 1]\n const lastSegmentIsRowIndex = !Number.isNaN(Number(lastSegment))\n\n let parentFieldPath: string\n\n if (lastSegmentIsRowIndex) {\n // If the last segment is a row index,\n // the sibling data is that row's contents\n // so create a parent field path that will\n // retrieve all contents of that row index only\n parentFieldPath = `${path}.`\n } else {\n // Otherwise, the last path segment is a field name\n // and it should be removed\n parentFieldPath = path.substring(0, path.lastIndexOf('.') + 1)\n }\n\n Object.keys(fields).forEach((fieldKey) => {\n if (!fields[fieldKey]?.disableFormData && fieldKey.indexOf(parentFieldPath) === 0) {\n siblingFields[fieldKey.replace(parentFieldPath, '')] = fields[fieldKey]?.value\n }\n })\n\n return unflatten(siblingFields)\n}\n"],"names":["reduceFieldsToValues","unflatten","getSiblingData","fields","path","indexOf","siblingFields","pathSegments","split","lastSegment","length","lastSegmentIsRowIndex","Number","isNaN","parentFieldPath","substring","lastIndexOf","Object","keys","forEach","fieldKey","disableFormData","replace","value"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,SAAS,QAAQ,iBAAgB;AAE1C,OAAO,MAAMC,iBAAiB,CAACC,QAAmBC;IAChD,IAAI,CAACD,QAAQ;QACX,OAAO;IACT;IAEA,IAAIC,KAAKC,OAAO,CAAC,SAAS,CAAC,GAAG;QAC5B,OAAOL,qBAAqBG,QAAQ;IACtC;IAEA,MAAMG,gBAAqC,CAAC;IAE5C,kEAAkE;IAClE,MAAMC,eAAeH,KAAKI,KAAK,CAAC;IAChC,MAAMC,cAAcF,YAAY,CAACA,aAAaG,MAAM,GAAG,EAAE;IACzD,MAAMC,wBAAwB,CAACC,OAAOC,KAAK,CAACD,OAAOH;IAEnD,IAAIK;IAEJ,IAAIH,uBAAuB;QACzB,sCAAsC;QACtC,0CAA0C;QAC1C,0CAA0C;QAC1C,+CAA+C;QAC/CG,kBAAkB,GAAGV,KAAK,CAAC,CAAC;IAC9B,OAAO;QACL,mDAAmD;QACnD,2BAA2B;QAC3BU,kBAAkBV,KAAKW,SAAS,CAAC,GAAGX,KAAKY,WAAW,CAAC,OAAO;IAC9D;IAEAC,OAAOC,IAAI,CAACf,QAAQgB,OAAO,CAAC,CAACC;QAC3B,IAAI,CAACjB,MAAM,CAACiB,SAAS,EAAEC,mBAAmBD,SAASf,OAAO,CAACS,qBAAqB,GAAG;YACjFR,aAAa,CAACc,SAASE,OAAO,CAACR,iBAAiB,IAAI,GAAGX,MAAM,CAACiB,SAAS,EAAEG;QAC3E;IACF;IAEA,OAAOtB,UAAUK;AACnB,EAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/forms/Form/rows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,KAAK,MAAM,GAAG;IACZ,eAAe,EAAE,SAAS,CAAA;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,YAAY,SAAU,MAAM,UAAU,SAAS,KAAG,MAuB9D,CAAA;AAED,eAAO,MAAM,WAAW,SAAU,MAAM,QAAQ,SAAS,EAAE,KAAG,SAa7D,CAAA"}
@@ -0,0 +1,62 @@
import { SEMATTRS_HTTP_TARGET } from '@opentelemetry/semantic-conventions';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, GLOBAL_OBJ } from '@sentry/core';
import { isSentryRequestSpan } from '@sentry/opentelemetry';
import { ATTR_NEXT_SPAN_TYPE } from '../nextSpanAttributes.js';
import { TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION } from '../span-attributes-with-logic-attached.js';
const globalWithInjectedValues = GLOBAL_OBJ
;
/**
* Drops spans for tunnel requests from middleware or fetch instrumentation.
* This catches both:
* 1. Requests to the local tunnel route (before rewrite)
* 2. Requests to Sentry ingest (after rewrite)
*/
function dropMiddlewareTunnelRequests(span, attrs) {
// Only filter middleware spans or HTTP fetch spans
const isMiddleware = attrs?.[ATTR_NEXT_SPAN_TYPE] === 'Middleware.execute';
// The fetch span could be originating from rewrites re-writing a tunnel request
// So we want to filter it out
const isFetchSpan = attrs?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.http.otel.node_fetch';
// If the span is not a middleware span or a fetch span, return
if (!isMiddleware && !isFetchSpan) {
return;
}
// Check if this is either a tunnel route request or a Sentry ingest request
const isTunnel = isTunnelRouteSpan(attrs || {});
const isSentry = isSentryRequestSpan(span);
if (isTunnel || isSentry) {
// Mark the span to be dropped
span.setAttribute(TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION, true);
}
}
/**
* Checks if a span's HTTP target matches the tunnel route.
*/
function isTunnelRouteSpan(spanAttributes) {
const tunnelPath = globalWithInjectedValues._sentryRewritesTunnelPath || process.env._sentryRewritesTunnelPath;
if (!tunnelPath) {
return false;
}
// eslint-disable-next-line deprecation/deprecation
const httpTarget = spanAttributes[SEMATTRS_HTTP_TARGET];
if (typeof httpTarget === 'string') {
// Extract pathname from the target (e.g., "/tunnel?o=123&p=456" -> "/tunnel")
const pathname = httpTarget.split('?')[0] || '';
return pathname.startsWith(tunnelPath);
}
return false;
}
export { dropMiddlewareTunnelRequests };
//# sourceMappingURL=dropMiddlewareTunnelRequests.js.map
@@ -0,0 +1,32 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
const beforeBenchmarkDate = new Date(2022, 10, 4);
const benchmarkDate = new Date(2022, 10, 5);
const afterBenchmarkDate = new Date(2022, 10, 6);
const minCheck = z.date().min(benchmarkDate);
const maxCheck = z.date().max(benchmarkDate);
test("passing validations", () => {
minCheck.parse(benchmarkDate);
minCheck.parse(afterBenchmarkDate);
maxCheck.parse(benchmarkDate);
maxCheck.parse(beforeBenchmarkDate);
});
test("failing validations", () => {
expect(() => minCheck.parse(beforeBenchmarkDate)).toThrow();
expect(() => maxCheck.parse(afterBenchmarkDate)).toThrow();
});
test("min max getters", () => {
expect(minCheck.minDate).toEqual(benchmarkDate);
expect(minCheck.min(afterBenchmarkDate).minDate).toEqual(afterBenchmarkDate);
expect(maxCheck.maxDate).toEqual(benchmarkDate);
expect(maxCheck.max(beforeBenchmarkDate).maxDate).toEqual(beforeBenchmarkDate);
});
@@ -0,0 +1,69 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.naturalCompare = naturalCompare;
/**
* Returns a number indicating whether a reference string comes before, or after,
* or is the same as the given string in natural sort order.
*
* See: https://en.wikipedia.org/wiki/Natural_sort_order
*
*/
function naturalCompare(aStr, bStr) {
let aIndex = 0;
let bIndex = 0;
while (aIndex < aStr.length && bIndex < bStr.length) {
let aChar = aStr.charCodeAt(aIndex);
let bChar = bStr.charCodeAt(bIndex);
if (isDigit(aChar) && isDigit(bChar)) {
let aNum = 0;
do {
++aIndex;
aNum = aNum * 10 + aChar - DIGIT_0;
aChar = aStr.charCodeAt(aIndex);
} while (isDigit(aChar) && aNum > 0);
let bNum = 0;
do {
++bIndex;
bNum = bNum * 10 + bChar - DIGIT_0;
bChar = bStr.charCodeAt(bIndex);
} while (isDigit(bChar) && bNum > 0);
if (aNum < bNum) {
return -1;
}
if (aNum > bNum) {
return 1;
}
} else {
if (aChar < bChar) {
return -1;
}
if (aChar > bChar) {
return 1;
}
++aIndex;
++bIndex;
}
}
return aStr.length - bStr.length;
}
const DIGIT_0 = 48;
const DIGIT_9 = 57;
function isDigit(code) {
return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;
}
@@ -0,0 +1,179 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { extractID } from 'payload/shared';
import React, { Fragment } from 'react';
import { toast } from 'sonner';
import { DeleteMany_v4 } from '../../../elements/DeleteMany/index.js';
import { EditMany_v4 } from '../../../elements/EditMany/index.js';
import { EditFolderAction } from '../../../elements/FolderView/Drawers/EditFolderAction/index.js';
import { MoveItemsToFolderDrawer } from '../../../elements/FolderView/Drawers/MoveToFolder/index.js';
import { ListSelection_v4, ListSelectionButton } from '../../../elements/ListSelection/index.js';
import { PublishMany_v4 } from '../../../elements/PublishMany/index.js';
import { UnpublishMany_v4 } from '../../../elements/UnpublishMany/index.js';
import { useConfig } from '../../../providers/Config/index.js';
import { useFolder } from '../../../providers/Folders/index.js';
import { useRouteCache } from '../../../providers/RouteCache/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
const moveToFolderDrawerSlug = 'move-to-folder--list';
export const ListSelection = t0 => {
const $ = _c(17);
const {
disableBulkDelete,
disableBulkEdit,
folderAssignedCollections
} = t0;
const {
clearSelections,
currentFolder,
folderCollectionSlug,
folderFieldName,
folderID,
getSelectedItems,
moveToFolder
} = useFolder();
const {
clearRouteCache
} = useRouteCache();
const {
config
} = useConfig();
const {
t
} = useTranslation();
const {
closeModal,
openModal
} = useModal();
let t1;
let t2;
if ($[0] !== clearRouteCache || $[1] !== clearSelections || $[2] !== closeModal || $[3] !== config || $[4] !== currentFolder?.value?._folderOrDocumentTitle || $[5] !== disableBulkDelete || $[6] !== disableBulkEdit || $[7] !== folderAssignedCollections || $[8] !== folderCollectionSlug || $[9] !== folderFieldName || $[10] !== folderID || $[11] !== getSelectedItems || $[12] !== moveToFolder || $[13] !== openModal || $[14] !== t) {
t2 = Symbol.for("react.early_return_sentinel");
bb0: {
const items = getSelectedItems();
const groupedSelections = items.reduce(_temp, {});
const count = items.length;
const singleNonFolderCollectionSelected = Object.keys(groupedSelections).length === 1 && Object.keys(groupedSelections)[0] !== folderCollectionSlug;
const collectionConfig = singleNonFolderCollectionSelected ? config.collections.find(collection => collection.slug === Object.keys(groupedSelections)[0]) : null;
if (count === 0) {
t2 = null;
break bb0;
}
const ids = singleNonFolderCollectionSelected ? groupedSelections[Object.keys(groupedSelections)[0]]?.ids || [] : [];
t1 = _jsx(ListSelection_v4, {
count,
ListActions: [count > 0 && _jsx(ListSelectionButton, {
onClick: () => clearSelections(),
children: t("general:clearAll")
}, "clear-all")].filter(Boolean),
SelectionActions: [!disableBulkEdit && ids.length && _jsxs(Fragment, {
children: [_jsx(EditMany_v4, {
collection: collectionConfig,
count,
ids,
selectAll: false
}), _jsx(PublishMany_v4, {
collection: collectionConfig,
count,
ids,
selectAll: false
}), _jsx(UnpublishMany_v4, {
collection: collectionConfig,
count,
ids,
selectAll: false
})]
}, "bulk-actions"), count === 1 && !singleNonFolderCollectionSelected && _jsx(EditFolderAction, {
folderCollectionSlug,
id: groupedSelections[folderCollectionSlug].ids[0]
}, "edit-folder-action"), count > 0 ? _jsxs(React.Fragment, {
children: [_jsx(ListSelectionButton, {
onClick: () => {
openModal(moveToFolderDrawerSlug);
},
type: "button",
children: t("general:move")
}), _jsx(MoveItemsToFolderDrawer, {
action: "moveItemsToFolder",
drawerSlug: moveToFolderDrawerSlug,
folderAssignedCollections,
folderCollectionSlug,
folderFieldName,
fromFolderID: folderID,
fromFolderName: currentFolder?.value?._folderOrDocumentTitle,
itemsToMove: getSelectedItems(),
onConfirm: async t3 => {
const {
id,
name
} = t3;
await moveToFolder({
itemsToMove: getSelectedItems(),
toFolderID: id
});
if (id) {
toast.success(t("folder:itemsMovedToFolder", {
folderName: `"${name}"`,
title: `${count} ${count > 1 ? t("general:items") : t("general:item")}`
}));
} else {
toast.success(t("folder:itemsMovedToRoot", {
title: `${count} ${count > 1 ? t("general:items") : t("general:item")}`
}));
}
clearRouteCache();
closeModal(moveToFolderDrawerSlug);
}
})]
}, moveToFolderDrawerSlug) : null, !disableBulkDelete && _jsx(DeleteMany_v4, {
afterDelete: () => {
clearRouteCache();
clearSelections();
},
selections: groupedSelections
}, "bulk-delete")].filter(Boolean)
});
}
$[0] = clearRouteCache;
$[1] = clearSelections;
$[2] = closeModal;
$[3] = config;
$[4] = currentFolder?.value?._folderOrDocumentTitle;
$[5] = disableBulkDelete;
$[6] = disableBulkEdit;
$[7] = folderAssignedCollections;
$[8] = folderCollectionSlug;
$[9] = folderFieldName;
$[10] = folderID;
$[11] = getSelectedItems;
$[12] = moveToFolder;
$[13] = openModal;
$[14] = t;
$[15] = t1;
$[16] = t2;
} else {
t1 = $[15];
t2 = $[16];
}
if (t2 !== Symbol.for("react.early_return_sentinel")) {
return t2;
}
return t1;
};
function _temp(acc, item) {
if (item) {
if (acc[item.relationTo]) {
acc[item.relationTo].ids.push(extractID(item.value));
acc[item.relationTo].totalCount = acc[item.relationTo].totalCount + 1;
} else {
acc[item.relationTo] = {
ids: [extractID(item.value)],
totalCount: 1
};
}
}
return acc;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/unlock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACX,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AAcjE,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACxD,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAA;IACvD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,GAAU,KAAK,SAAS,kBAAkB,QAC9D,SAAS,CAAC,KAAK,CAAC,KACrB,OAAO,CAAC,OAAO,CAqHjB,CAAA"}
@@ -0,0 +1,62 @@
import type { Client, Integration, Options } from '@sentry/core';
import type { BrowserOptions } from './client';
/** Get the default integrations for the browser SDK. */
export declare function getDefaultIntegrations(_options: Options): Integration[];
/**
* The Sentry Browser SDK Client.
*
* To use this SDK, call the {@link init} function as early as possible when
* loading the web page. To set context information or send manual events, use
* the provided methods.
*
* @example
*
* ```
*
* import { init } from '@sentry/browser';
*
* init({
* dsn: '__DSN__',
* // ...
* });
* ```
*
* @example
* ```
*
* import { addBreadcrumb } from '@sentry/browser';
* addBreadcrumb({
* message: 'My Breadcrumb',
* // ...
* });
* ```
*
* @example
*
* ```
*
* import * as Sentry from '@sentry/browser';
* Sentry.captureMessage('Hello, world!');
* Sentry.captureException(new Error('Good bye'));
* Sentry.captureEvent({
* message: 'Manual',
* stacktrace: [
* // ...
* ],
* });
* ```
*
* @see {@link BrowserOptions} for documentation on configuration options.
*/
export declare function init(options?: BrowserOptions): Client | undefined;
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
export declare function forceLoad(): void;
/**
* This function is here to be API compatible with the loader.
* @hidden
*/
export declare function onLoad(callback: () => void): void;
//# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAA;AA6B7D,OAAO,cAAc,CAAA;AA6erB,eAAO,MAAM,WAAW;;;;+EAAsC,CAAA"}
@@ -0,0 +1,51 @@
// Copyright 2017 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
'use strict';
const fs = require('fs');
const LDD_PATH = '/usr/bin/ldd';
const SELF_PATH = '/proc/self/exe';
const MAX_LENGTH = 2048;
/**
* Read the content of a file synchronous
*
* @param {string} path
* @returns {Buffer}
*/
const readFileSync = (path) => {
const fd = fs.openSync(path, 'r');
const buffer = Buffer.alloc(MAX_LENGTH);
const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0);
fs.close(fd, () => {});
return buffer.subarray(0, bytesRead);
};
/**
* Read the content of a file
*
* @param {string} path
* @returns {Promise<Buffer>}
*/
const readFile = (path) => new Promise((resolve, reject) => {
fs.open(path, 'r', (err, fd) => {
if (err) {
reject(err);
} else {
const buffer = Buffer.alloc(MAX_LENGTH);
fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
resolve(buffer.subarray(0, bytesRead));
fs.close(fd, () => {});
});
}
});
});
module.exports = {
LDD_PATH,
SELF_PATH,
readFileSync,
readFile
};
@@ -0,0 +1 @@
{"version":3,"file":"generateUniqueID.d.ts","sourceRoot":"","sources":["../../../../../src/metrics/web-vitals/lib/generateUniqueID.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAE5B,CAAC"}
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/database/queryValidation/types.ts"],"sourcesContent":["import type { CollectionPermission, GlobalPermission } from '../../auth/index.js'\nimport type { FlattenedField } from '../../fields/config/types.js'\n\n// TODO: Rename to EntityPermissions in 4.0\nexport type EntityPolicies = {\n collections?: {\n [collectionSlug: string]: CollectionPermission\n }\n globals?: {\n [globalSlug: string]: GlobalPermission\n }\n}\n\nexport type PathToQuery = {\n collectionSlug?: string\n complete: boolean\n field: FlattenedField\n fields?: FlattenedField[]\n globalSlug?: string\n invalid?: boolean\n /**\n * @todo make required in v4.0\n */\n parentIsLocalized: boolean\n path: string\n}\n"],"names":[],"mappings":"AAaA,WAYC"}
@@ -0,0 +1,2 @@
export { it } from '@payloadcms/translations/languages/it';
//# sourceMappingURL=it.d.ts.map
@@ -0,0 +1,171 @@
import * as net from 'node:net';
import * as tls from 'node:tls';
import { debug } from '@sentry/core';
import { Agent } from './base.js';
import { parseProxyResponse } from './parse-proxy-response.js';
function debugLog(...args) {
debug.log('[https-proxy-agent]', ...args);
}
/**
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
*
* Outgoing HTTP requests are first tunneled through the proxy server using the
* `CONNECT` HTTP request method to establish a connection to the proxy server,
* and then the proxy server connects to the destination target and issues the
* HTTP request from the proxy server.
*
* `https:` requests have their socket connection upgraded to TLS once
* the connection to the proxy server has been established.
*/
class HttpsProxyAgent extends Agent {
static __initStatic() {this.protocols = ['http', 'https']; }
constructor(proxy, opts) {
super(opts);
this.options = {};
this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
this.proxyHeaders = opts?.headers ?? {};
debugLog('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
// Trim off the brackets from IPv6 addresses
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === 'https:' ? 443 : 80;
this.connectOpts = {
// Attempt to negotiate http/1.1 for proxy servers that support http/2
ALPNProtocols: ['http/1.1'],
...(opts ? omit(opts, 'headers') : null),
host,
port,
};
}
/**
* Called when the node-core HTTP client library is creating a
* new HTTP request.
*/
async connect(req, opts) {
const { proxy } = this;
if (!opts.host) {
throw new TypeError('No "host" provided');
}
// Create a socket connection to the proxy server.
let socket;
if (proxy.protocol === 'https:') {
debugLog('Creating `tls.Socket`: %o', this.connectOpts);
const servername = this.connectOpts.servername || this.connectOpts.host;
socket = tls.connect({
...this.connectOpts,
servername: servername && net.isIP(servername) ? undefined : servername,
});
} else {
debugLog('Creating `net.Socket`: %o', this.connectOpts);
socket = net.connect(this.connectOpts);
}
const headers =
typeof this.proxyHeaders === 'function' ? this.proxyHeaders() : { ...this.proxyHeaders };
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
// Inject the `Proxy-Authorization` header if necessary.
if (proxy.username || proxy.password) {
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
}
headers.Host = `${host}:${opts.port}`;
if (!headers['Proxy-Connection']) {
headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
}
for (const name of Object.keys(headers)) {
payload += `${name}: ${headers[name]}\r\n`;
}
const proxyResponsePromise = parseProxyResponse(socket);
socket.write(`${payload}\r\n`);
const { connect, buffered } = await proxyResponsePromise;
req.emit('proxyConnect', connect);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Not EventEmitter in Node types
this.emit('proxyConnect', connect, req);
if (connect.statusCode === 200) {
req.once('socket', resume);
if (opts.secureEndpoint) {
// The proxy is connecting to a TLS server, so upgrade
// this socket connection to a TLS connection.
debugLog('Upgrading socket connection to TLS');
const servername = opts.servername || opts.host;
return tls.connect({
...omit(opts, 'host', 'path', 'port'),
socket,
servername: net.isIP(servername) ? undefined : servername,
});
}
return socket;
}
// Some other status code that's not 200... need to re-play the HTTP
// header "data" events onto the socket once the HTTP machinery is
// attached so that the node core `http` can parse and handle the
// error status code.
// Close the original socket, and a new "fake" socket is returned
// instead, so that the proxy doesn't get the HTTP request
// written to it (which may contain `Authorization` headers or other
// sensitive data).
//
// See: https://hackerone.com/reports/541502
socket.destroy();
const fakeSocket = new net.Socket({ writable: false });
fakeSocket.readable = true;
// Need to wait for the "socket" event to re-play the "data" events.
req.once('socket', (s) => {
debugLog('Replaying proxy buffer for failed request');
// Replay the "buffered" Buffer onto the fake `socket`, since at
// this point the HTTP module machinery has been hooked up for
// the user.
s.push(buffered);
s.push(null);
});
return fakeSocket;
}
} HttpsProxyAgent.__initStatic();
function resume(socket) {
socket.resume();
}
function omit(
obj,
...keys
)
{
const ret = {}
;
let key;
for (key in obj) {
if (!keys.includes(key)) {
ret[key] = obj[key];
}
}
return ret;
}
export { HttpsProxyAgent };
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/globals/endpoints/findVersionByID.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestGlobal } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { isNumber } from '../../utilities/isNumber.js'\nimport { sanitizePopulateParam } from '../../utilities/sanitizePopulateParam.js'\nimport { sanitizeSelectParam } from '../../utilities/sanitizeSelectParam.js'\nimport { findVersionByIDOperation } from '../operations/findVersionByID.js'\n\nexport const findVersionByIDHandler: PayloadHandler = async (req) => {\n const globalConfig = getRequestGlobal(req)\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const result = await findVersionByIDOperation({\n id: req.routeParams!.id as string,\n depth: isNumber(depth) ? Number(depth) : undefined,\n globalConfig,\n populate: sanitizePopulateParam(req.query.populate),\n req,\n select: sanitizeSelectParam(req.query.select),\n })\n\n return Response.json(result, {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["status","httpStatus","getRequestGlobal","headersWithCors","isNumber","sanitizePopulateParam","sanitizeSelectParam","findVersionByIDOperation","findVersionByIDHandler","req","globalConfig","searchParams","depth","get","result","id","routeParams","Number","undefined","populate","query","select","Response","json","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,QAAQ,QAAQ,8BAA6B;AACtD,SAASC,qBAAqB,QAAQ,2CAA0C;AAChF,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,wBAAwB,QAAQ,mCAAkC;AAE3E,OAAO,MAAMC,yBAAyC,OAAOC;IAC3D,MAAMC,eAAeR,iBAAiBO;IACtC,MAAM,EAAEE,YAAY,EAAE,GAAGF;IACzB,MAAMG,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMP,yBAAyB;QAC5CQ,IAAIN,IAAIO,WAAW,CAAED,EAAE;QACvBH,OAAOR,SAASQ,SAASK,OAAOL,SAASM;QACzCR;QACAS,UAAUd,sBAAsBI,IAAIW,KAAK,CAACD,QAAQ;QAClDV;QACAY,QAAQf,oBAAoBG,IAAIW,KAAK,CAACC,MAAM;IAC9C;IAEA,OAAOC,SAASC,IAAI,CAACT,QAAQ;QAC3BU,SAASrB,gBAAgB;YACvBqB,SAAS,IAAIC;YACbhB;QACF;QACAT,QAAQC,WAAWyB,EAAE;IACvB;AACF,EAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"mic.js","sources":["../../../src/icons/mic.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mic\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMmEzIDMgMCAwIDAtMyAzdjdhMyAzIDAgMCAwIDYgMFY1YTMgMyAwIDAgMC0zLTNaIiAvPgogIDxwYXRoIGQ9Ik0xOSAxMHYyYTcgNyAwIDAgMS0xNCAwdi0yIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTkiIHkyPSIyMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/mic\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Mic = createLucideIcon('Mic', [\n ['path', { d: 'M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z', key: '131961' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2', key: '1vc78b' }],\n ['line', { x1: '12', x2: '12', y1: '19', y2: '22', key: 'x3vr5v' }],\n]);\n\nexport default Mic;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAiB,KAAO,CAAA,CAAA,CAAA;AAAA,CAAA,CAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,33 @@
import { entityKind } from "../../entity.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
class SingleStoreJsonBuilder extends SingleStoreColumnBuilder {
static [entityKind] = "SingleStoreJsonBuilder";
constructor(name) {
super(name, "json", "SingleStoreJson");
}
/** @internal */
build(table) {
return new SingleStoreJson(
table,
this.config
);
}
}
class SingleStoreJson extends SingleStoreColumn {
static [entityKind] = "SingleStoreJson";
getSQLType() {
return "json";
}
mapToDriverValue(value) {
return JSON.stringify(value);
}
}
function json(name) {
return new SingleStoreJsonBuilder(name ?? "");
}
export {
SingleStoreJson,
SingleStoreJsonBuilder,
json
};
//# sourceMappingURL=json.js.map
@@ -0,0 +1,27 @@
export type HttpStatusCodeRange = [number, number] | number;
export type HttpRequestTarget = string | RegExp;
interface HttpClientOptions {
/**
* HTTP status codes that should be considered failed.
* This array can contain tuples of `[begin, end]` (both inclusive),
* single status codes, or a combinations of both
*
* Example: [[500, 505], 507]
* Default: [[500, 599]]
*/
failedRequestStatusCodes: HttpStatusCodeRange[];
/**
* Targets to track for failed requests.
* This array can contain strings or regular expressions.
*
* Example: ['http://localhost', /api\/.*\/]
* Default: [/.*\/]
*/
failedRequestTargets: HttpRequestTarget[];
}
/**
* Create events for failed client side HTTP requests.
*/
export declare const httpClientIntegration: (options?: Partial<HttpClientOptions> | undefined) => import("@sentry/core").Integration;
export {};
//# sourceMappingURL=httpclient.d.ts.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { isWithinInterval as fn } from "../isWithinInterval.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const isWithinIntervalWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default isWithinIntervalWithOptions;
@@ -0,0 +1 @@
{"version":3,"file":"emotion-weak-memoize.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -0,0 +1,6 @@
import { VercelCronsConfig } from '../types';
/**
* Wraps a function with Sentry crons instrumentation by automatically sending check-ins for the given Vercel crons config.
*/
export declare function wrapApiHandlerWithSentryVercelCrons<F extends (...args: any[]) => any>(handler: F, vercelCronsConfig: VercelCronsConfig): F;
//# sourceMappingURL=wrapApiHandlerWithSentryVercelCrons.d.ts.map
@@ -0,0 +1,6 @@
/**
* Checks if a given element is currently visible.
*
* @param node the element to check
*/
export default function isVisible(node: HTMLElement | null): boolean;
@@ -0,0 +1,98 @@
import fs from 'fs';
import path from 'path';
/**
* Synchronously walks up parent directories until a condition is met and/or one of the file names within the fileNames array is found.
*/ export function findUpSync({ condition, dir, fileNames }) {
const { root } = path.parse(dir);
while(true){
if (fileNames?.length) {
let found = false;
for (const fileName of fileNames){
const filePath = path.join(dir, fileName);
const exists = pathExistsAndIsAccessibleSync(filePath);
if (exists) {
if (!condition) {
return filePath;
}
found = true;
break;
}
}
if (!found && dir !== root) {
dir = path.dirname(dir); // Move up one directory level.
continue;
}
}
const result = condition?.(dir);
if (result === true) {
return dir;
}
if (typeof result === 'string' && result?.length) {
return result;
}
if (dir === root) {
return null // Reached the root directory without a match.
;
}
dir = path.dirname(dir); // Move up one directory level.
}
}
/**
* Asynchronously walks up parent directories until a condition is met and/or one of the file names within the fileNames array is found.
*/ export async function findUp({ condition, dir, fileNames }) {
const { root } = path.parse(dir);
while(true){
if (fileNames?.length) {
let found = false;
for (const fileName of fileNames){
const filePath = path.resolve(dir, fileName);
const exists = await pathExistsAndIsAccessible(filePath);
if (exists) {
if (!condition) {
return filePath;
}
found = true;
break;
}
}
if (!found && dir !== root) {
dir = path.dirname(dir); // Move up one directory level.
continue;
}
}
const result = await condition?.(dir);
if (result === true) {
return dir;
}
if (typeof result === 'string' && result?.length) {
return result;
}
if (dir === root) {
return null // Reached the root directory without a match.
;
}
dir = path.dirname(dir); // Move up one directory level.
}
}
// From https://github.com/sindresorhus/path-exists/blob/main/index.js
// fs.accessSync is preferred over fs.existsSync as it's usually a good idea
// to check if the process has permission to read/write to a file before doing so.
// Also see https://github.com/nodejs/node/issues/39960
export function pathExistsAndIsAccessibleSync(path) {
try {
fs.accessSync(path);
return true;
} catch {
return false;
}
}
export async function pathExistsAndIsAccessible(path) {
try {
await fs.promises.access(path);
return true;
} catch {
return false;
}
}
//# sourceMappingURL=findUp.js.map
@@ -0,0 +1,124 @@
'use strict'
/** @typedef {`node:${string}`} NodeModuleName */
/** @type {Record<NodeModuleName, () => any>} */
const lazyLoaders = {
__proto__: null,
'node:crypto': () => require('node:crypto'),
'node:sqlite': () => require('node:sqlite'),
'node:worker_threads': () => require('node:worker_threads'),
'node:zlib': () => require('node:zlib')
}
/**
* @param {NodeModuleName} moduleName
* @returns {boolean}
*/
function detectRuntimeFeatureByNodeModule (moduleName) {
try {
lazyLoaders[moduleName]()
return true
} catch (err) {
if (err.code !== 'ERR_UNKNOWN_BUILTIN_MODULE' && err.code !== 'ERR_NO_CRYPTO') {
throw err
}
return false
}
}
/**
* @param {NodeModuleName} moduleName
* @param {string} property
* @returns {boolean}
*/
function detectRuntimeFeatureByExportedProperty (moduleName, property) {
const module = lazyLoaders[moduleName]()
return typeof module[property] !== 'undefined'
}
const runtimeFeaturesByExportedProperty = /** @type {const} */ (['markAsUncloneable', 'zstd'])
/** @type {Record<RuntimeFeatureByExportedProperty, [NodeModuleName, string]>} */
const exportedPropertyLookup = {
markAsUncloneable: ['node:worker_threads', 'markAsUncloneable'],
zstd: ['node:zlib', 'createZstdDecompress']
}
/** @typedef {typeof runtimeFeaturesByExportedProperty[number]} RuntimeFeatureByExportedProperty */
const runtimeFeaturesAsNodeModule = /** @type {const} */ (['crypto', 'sqlite'])
/** @typedef {typeof runtimeFeaturesAsNodeModule[number]} RuntimeFeatureByNodeModule */
const features = /** @type {const} */ ([
...runtimeFeaturesAsNodeModule,
...runtimeFeaturesByExportedProperty
])
/** @typedef {typeof features[number]} Feature */
/**
* @param {Feature} feature
* @returns {boolean}
*/
function detectRuntimeFeature (feature) {
if (runtimeFeaturesAsNodeModule.includes(/** @type {RuntimeFeatureByNodeModule} */ (feature))) {
return detectRuntimeFeatureByNodeModule(`node:${feature}`)
} else if (runtimeFeaturesByExportedProperty.includes(/** @type {RuntimeFeatureByExportedProperty} */ (feature))) {
const [moduleName, property] = exportedPropertyLookup[feature]
return detectRuntimeFeatureByExportedProperty(moduleName, property)
}
throw new TypeError(`unknown feature: ${feature}`)
}
/**
* @class
* @name RuntimeFeatures
*/
class RuntimeFeatures {
/** @type {Map<Feature, boolean>} */
#map = new Map()
/**
* Clears all cached feature detections.
*/
clear () {
this.#map.clear()
}
/**
* @param {Feature} feature
* @returns {boolean}
*/
has (feature) {
return (
this.#map.get(feature) ?? this.#detectRuntimeFeature(feature)
)
}
/**
* @param {Feature} feature
* @param {boolean} value
*/
set (feature, value) {
if (features.includes(feature) === false) {
throw new TypeError(`unknown feature: ${feature}`)
}
this.#map.set(feature, value)
}
/**
* @param {Feature} feature
* @returns {boolean}
*/
#detectRuntimeFeature (feature) {
const result = detectRuntimeFeature(feature)
this.#map.set(feature, result)
return result
}
}
const instance = new RuntimeFeatures()
module.exports.runtimeFeatures = instance
module.exports.default = instance
@@ -0,0 +1,598 @@
import type { Language } from '../types.js';
export declare const getTranslationsByContext: (selectedLanguage: Language, context: "api" | "client") => {
authentication: {
account: string;
accountOfCurrentUser: string;
accountVerified: string;
alreadyActivated: string;
alreadyLoggedIn: string;
apiKey: string;
authenticated: string;
backToLogin: string;
beginCreateFirstUser: string;
changePassword: string;
checkYourEmailForPasswordReset: string;
confirmGeneration: string;
confirmPassword: string;
createFirstUser: string;
emailNotValid: string;
emailOrUsername: string;
emailSent: string;
emailVerified: string;
enableAPIKey: string;
failedToUnlock: string;
forceUnlock: string;
forgotPassword: string;
forgotPasswordEmailInstructions: string;
forgotPasswordUsernameInstructions: string;
usernameNotValid: string;
forgotPasswordQuestion: string;
generate: string;
generateNewAPIKey: string;
generatingNewAPIKeyWillInvalidate: string;
lockUntil: string;
logBackIn: string;
loggedIn: string;
loggedInChangePassword: string;
loggedOutInactivity: string;
loggedOutSuccessfully: string;
loggingOut: string;
login: string;
loginAttempts: string;
loginUser: string;
loginWithAnotherUser: string;
logOut: string;
logout: string;
logoutSuccessful: string;
logoutUser: string;
newAccountCreated: string;
newAPIKeyGenerated: string;
newPassword: string;
passed: string;
passwordResetSuccessfully: string;
resetPassword: string;
resetPasswordExpiration: string;
resetPasswordToken: string;
resetYourPassword: string;
stayLoggedIn: string;
successfullyRegisteredFirstUser: string;
successfullyUnlocked: string;
tokenRefreshSuccessful: string;
unableToVerify: string;
username: string;
verified: string;
verifiedSuccessfully: string;
verify: string;
verifyUser: string;
verifyYourEmail: string;
youAreInactive: string;
youAreReceivingResetPassword: string;
youDidNotRequestPassword: string;
};
dashboard: {
addWidget: string;
deleteWidget: string;
searchWidgets: string;
};
error: {
accountAlreadyActivated: string;
autosaving: string;
correctInvalidFields: string;
deletingFile: string;
deletingTitle: string;
documentNotFound: string;
emailOrPasswordIncorrect: string;
followingFieldsInvalid_one: string;
followingFieldsInvalid_other: string;
incorrectCollection: string;
insufficientClipboardPermissions: string;
invalidClipboardData: string;
invalidFileType: string;
invalidFileTypeValue: string;
invalidRequestArgs: string;
loadingDocument: string;
localesNotSaved_one: string;
localesNotSaved_other: string;
logoutFailed: string;
missingEmail: string;
missingIDOfDocument: string;
missingIDOfVersion: string;
missingRequiredData: string;
noFilesUploaded: string;
noMatchedField: string;
notAllowedToAccessPage: string;
notAllowedToPerformAction: string;
notFound: string;
noUser: string;
previewing: string;
problemUploadingFile: string;
restoringTitle: string;
revertingDocument: string;
tokenInvalidOrExpired: string;
tokenNotProvided: string;
unableToCopy: string;
unableToDeleteCount: string;
unableToReindexCollection: string;
unableToUpdateCount: string;
unauthorized: string;
unauthorizedAdmin: string;
unknown: string;
unPublishingDocument: string;
unspecific: string;
unverifiedEmail: string;
userEmailAlreadyRegistered: string;
userLocked: string;
usernameAlreadyRegistered: string;
usernameOrPasswordIncorrect: string;
valueMustBeUnique: string;
verificationTokenInvalid: string;
};
fields: {
addLabel: string;
addLink: string;
addNew: string;
addNewLabel: string;
addRelationship: string;
addUpload: string;
block: string;
blocks: string;
blockType: string;
chooseBetweenCustomTextOrDocument: string;
chooseDocumentToLink: string;
chooseFromExisting: string;
chooseLabel: string;
collapseAll: string;
customURL: string;
editLabelData: string;
editLink: string;
editRelationship: string;
enterURL: string;
internalLink: string;
itemsAndMore: string;
labelRelationship: string;
latitude: string;
linkedTo: string;
linkType: string;
longitude: string;
newLabel: string;
openInNewTab: string;
passwordsDoNotMatch: string;
relatedDocument: string;
relationTo: string;
removeRelationship: string;
removeUpload: string;
saveChanges: string;
searchForBlock: string;
searchForLanguage: string;
selectExistingLabel: string;
selectFieldsToEdit: string;
showAll: string;
swapRelationship: string;
swapUpload: string;
textToDisplay: string;
toggleBlock: string;
uploadNewLabel: string;
};
folder: {
browseByFolder: string;
byFolder: string;
deleteFolder: string;
folderName: string;
folders: string;
folderTypeDescription: string;
itemHasBeenMoved: string;
itemHasBeenMovedToRoot: string;
itemsMovedToFolder: string;
itemsMovedToRoot: string;
moveFolder: string;
moveItemsToFolderConfirmation: string;
moveItemsToRootConfirmation: string;
moveItemToFolderConfirmation: string;
moveItemToRootConfirmation: string;
movingFromFolder: string;
newFolder: string;
noFolder: string;
renameFolder: string;
searchByNameInFolder: string;
selectFolderForItem: string;
};
general: {
name: string;
aboutToDelete: string;
aboutToDeleteCount_many: string;
aboutToDeleteCount_one: string;
aboutToDeleteCount_other: string;
aboutToPermanentlyDelete: string;
aboutToPermanentlyDeleteTrash: string;
aboutToRestore: string;
aboutToRestoreAsDraft: string;
aboutToRestoreAsDraftCount: string;
aboutToRestoreCount: string;
aboutToTrash: string;
aboutToTrashCount: string;
addBelow: string;
addFilter: string;
adminTheme: string;
all: string;
allCollections: string;
allLocales: string;
and: string;
anotherUser: string;
anotherUserTakenOver: string;
applyChanges: string;
ascending: string;
automatic: string;
backToDashboard: string;
cancel: string;
changesNotSaved: string;
clear: string;
clearAll: string;
close: string;
collapse: string;
collections: string;
columns: string;
columnToSort: string;
confirm: string;
confirmCopy: string;
confirmDeletion: string;
confirmDuplication: string;
confirmMove: string;
confirmReindex: string;
confirmReindexAll: string;
confirmReindexDescription: string;
confirmReindexDescriptionAll: string;
confirmRestoration: string;
copied: string;
copy: string;
copyField: string;
copying: string;
copyRow: string;
copyWarning: string;
create: string;
created: string;
createdAt: string;
createNew: string;
createNewLabel: string;
creating: string;
creatingNewLabel: string;
currentlyEditing: string;
custom: string;
dark: string;
dashboard: string;
delete: string;
deleted: string;
deletedAt: string;
deletedCountSuccessfully: string;
deletedSuccessfully: string;
deleteLabel: string;
deletePermanently: string;
deleting: string;
depth: string;
descending: string;
deselectAllRows: string;
document: string;
documentIsTrashed: string;
documentLocked: string;
documents: string;
duplicate: string;
duplicateWithoutSaving: string;
edit: string;
editAll: string;
editedSince: string;
editing: string;
editingLabel_many: string;
editingLabel_one: string;
editingLabel_other: string;
editingTakenOver: string;
editLabel: string;
email: string;
emailAddress: string;
emptyTrash: string;
emptyTrashLabel: string;
enterAValue: string;
error: string;
errors: string;
exitLivePreview: string;
export: string;
fallbackToDefaultLocale: string;
false: string;
filter: string;
filters: string;
filterWhere: string;
globals: string;
goBack: string;
groupByLabel: string;
import: string;
isEditing: string;
item: string;
items: string;
language: string;
lastModified: string;
layout: string;
leaveAnyway: string;
leaveWithoutSaving: string;
light: string;
livePreview: string;
loading: string;
locale: string;
locales: string;
lock: string;
menu: string;
moreOptions: string;
move: string;
moveConfirm: string;
moveCount: string;
moveDown: string;
moveUp: string;
moving: string;
movingCount: string;
newLabel: string;
newPassword: string;
next: string;
no: string;
noDateSelected: string;
noFiltersSet: string;
noLabel: string;
none: string;
noOptions: string;
noResults: string;
noResultsDescription: string;
noResultsFound: string;
notFound: string;
nothingFound: string;
noTrashResults: string;
noUpcomingEventsScheduled: string;
noValue: string;
of: string;
only: string;
open: string;
or: string;
order: string;
overwriteExistingData: string;
pageNotFound: string;
password: string;
pasteField: string;
pasteRow: string;
payloadSettings: string;
permanentlyDelete: string;
permanentlyDeletedCountSuccessfully: string;
perPage: string;
previous: string;
reindex: string;
reindexingAll: string;
remove: string;
rename: string;
reset: string;
resetPreferences: string;
resetPreferencesDescription: string;
resettingPreferences: string;
restore: string;
restoreAsPublished: string;
restoredCountSuccessfully: string;
restoring: string;
row: string;
rows: string;
save: string;
saveChanges: string;
saving: string;
schedulePublishFor: string;
searchBy: string;
select: string;
selectAll: string;
selectAllRows: string;
selectedCount: string;
selectLabel: string;
selectValue: string;
showAllLabel: string;
sorryNotFound: string;
sort: string;
sortByLabelDirection: string;
stayOnThisPage: string;
submissionSuccessful: string;
submit: string;
submitting: string;
success: string;
successfullyCreated: string;
successfullyDuplicated: string;
successfullyReindexed: string;
takeOver: string;
thisLanguage: string;
time: string;
timezone: string;
titleDeleted: string;
titleRestored: string;
titleTrashed: string;
trash: string;
trashedCountSuccessfully: string;
true: string;
unauthorized: string;
unlock: string;
unsavedChanges: string;
unsavedChangesDuplicate: string;
untitled: string;
upcomingEvents: string;
updatedAt: string;
updatedCountSuccessfully: string;
updatedLabelSuccessfully: string;
updatedSuccessfully: string;
updateForEveryone: string;
updating: string;
uploading: string;
uploadingBulk: string;
user: string;
username: string;
users: string;
value: string;
viewing: string;
viewReadOnly: string;
welcome: string;
yes: string;
};
localization: {
cannotCopySameLocale: string;
copyFrom: string;
copyFromTo: string;
copyTo: string;
copyToLocale: string;
localeToPublish: string;
selectedLocales: string;
selectLocaleToCopy: string;
selectLocaleToDuplicate: string;
};
operators: {
contains: string;
equals: string;
exists: string;
intersects: string;
isGreaterThan: string;
isGreaterThanOrEqualTo: string;
isIn: string;
isLessThan: string;
isLessThanOrEqualTo: string;
isLike: string;
isNotEqualTo: string;
isNotIn: string;
isNotLike: string;
near: string;
within: string;
};
upload: {
addFile: string;
addFiles: string;
bulkUpload: string;
crop: string;
cropToolDescription: string;
download: string;
dragAndDrop: string;
dragAndDropHere: string;
editImage: string;
fileName: string;
fileSize: string;
filesToUpload: string;
fileToUpload: string;
focalPoint: string;
focalPointDescription: string;
height: string;
lessInfo: string;
moreInfo: string;
noFile: string;
pasteURL: string;
previewSizes: string;
selectCollectionToBrowse: string;
selectFile: string;
setCropArea: string;
setFocalPoint: string;
sizes: string;
sizesFor: string;
width: string;
};
validation: {
emailAddress: string;
enterNumber: string;
fieldHasNo: string;
greaterThanMax: string;
invalidBlock: string;
invalidBlocks: string;
invalidInput: string;
invalidSelection: string;
invalidSelections: string;
latitudeOutOfBounds: string;
lessThanMin: string;
limitReached: string;
longerThanMin: string;
longitudeOutOfBounds: string;
notValidDate: string;
required: string;
requiresAtLeast: string;
requiresNoMoreThan: string;
requiresTwoNumbers: string;
shorterThanMax: string;
timezoneRequired: string;
trueOrFalse: string;
username: string;
validUploadID: string;
};
version: {
type: string;
aboutToPublishSelection: string;
aboutToRestore: string;
aboutToRestoreGlobal: string;
aboutToRevertToPublished: string;
aboutToUnpublish: string;
aboutToUnpublishIn: string;
aboutToUnpublishSelection: string;
autosave: string;
autosavedSuccessfully: string;
autosavedVersion: string;
changed: string;
changedFieldsCount_one: string;
changedFieldsCount_other: string;
compareVersion: string;
compareVersions: string;
comparingAgainst: string;
confirmPublish: string;
confirmRevertToSaved: string;
confirmUnpublish: string;
confirmVersionRestoration: string;
currentDocumentStatus: string;
currentDraft: string;
currentlyPublished: string;
currentlyViewing: string;
currentPublishedVersion: string;
draft: string;
draftHasPublishedVersion: string;
draftSavedSuccessfully: string;
lastSavedAgo: string;
modifiedOnly: string;
moreVersions: string;
noFurtherVersionsFound: string;
noLabelGroup: string;
noRowsFound: string;
noRowsSelected: string;
preview: string;
previouslyDraft: string;
previouslyPublished: string;
previousVersion: string;
problemRestoringVersion: string;
publish: string;
publishAllLocales: string;
publishChanges: string;
published: string;
publishIn: string;
publishing: string;
restoreAsDraft: string;
restoredSuccessfully: string;
restoreThisVersion: string;
restoring: string;
reverting: string;
revertToPublished: string;
revertUnsuccessful: string;
saveDraft: string;
scheduledSuccessfully: string;
schedulePublish: string;
selectLocales: string;
selectVersionToCompare: string;
showingVersionsFor: string;
showLocales: string;
specificVersion: string;
status: string;
unpublish: string;
unpublished: string;
unpublishedSuccessfully: string;
unpublishIn: string;
unpublishing: string;
version: string;
versionAgo: string;
versionCount_many: string;
versionCount_none: string;
versionCount_one: string;
versionCount_other: string;
versionID: string;
versions: string;
viewingVersion: string;
viewingVersionGlobal: string;
viewingVersions: string;
viewingVersionsGlobal: string;
};
} | Record<string, unknown>;
//# sourceMappingURL=getTranslationsByContext.d.ts.map
@@ -0,0 +1,31 @@
import { PixelCrop } from '..'
import { canvasPreview } from './canvasPreview'
let previewUrl = ''
function toBlob(canvas: HTMLCanvasElement): Promise<Blob | null> {
return new Promise(resolve => {
canvas.toBlob(resolve)
})
}
// Returns an image source you should set to state and pass
// `{previewSrc && <img alt="Crop preview" src={previewSrc} />}`
export async function imgPreview(image: HTMLImageElement, crop: PixelCrop, scale = 1, rotate = 0) {
const canvas = document.createElement('canvas')
canvasPreview(image, canvas, crop, scale, rotate)
const blob = await toBlob(canvas)
if (!blob) {
console.error('Failed to create blob')
return ''
}
if (previewUrl) {
URL.revokeObjectURL(previewUrl)
}
previewUrl = URL.createObjectURL(blob)
return previewUrl
}
@@ -0,0 +1,33 @@
import { BaseTransportOptions, OfflineTransportOptions, Transport } from '@sentry/core';
type Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/** Create or open an IndexedDb store */
export declare function createStore(dbName: string, storeName: string): Store;
/** Insert into the end of the store */
export declare function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void>;
/** Insert into the front of the store */
export declare function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void>;
/** Pop the oldest value from the store */
export declare function shift(store: Store): Promise<Uint8Array | string | undefined>;
export interface BrowserOfflineTransportOptions extends Pick<OfflineTransportOptions, Exclude<keyof OfflineTransportOptions, 'createStore'>> {
/**
* Name of indexedDb database to store envelopes in
* Default: 'sentry-offline'
*/
dbName?: string;
/**
* Name of indexedDb object store to store envelopes in
* Default: 'queue'
*/
storeName?: string;
/**
* Maximum number of envelopes to store
* Default: 30
*/
maxQueueSize?: number;
}
/**
* Creates a transport that uses IndexedDb to store events when offline.
*/
export declare function makeBrowserOfflineTransport<T extends BaseTransportOptions>(createTransport?: (options: T) => Transport): (options: T & BrowserOfflineTransportOptions) => Transport;
export {};
//# sourceMappingURL=offline.d.ts.map
@@ -0,0 +1,6 @@
export declare class Deferred<T> {
promise: Promise<T>;
resolve: (value: T) => void;
reject: (reason: Error) => void;
constructor();
}
@@ -0,0 +1,36 @@
import { entityKind } from "../../entity.js";
import { GelColumn, GelColumnBuilder } from "./common.js";
class GelDoublePrecisionBuilder extends GelColumnBuilder {
static [entityKind] = "GelDoublePrecisionBuilder";
constructor(name) {
super(name, "number", "GelDoublePrecision");
}
/** @internal */
build(table) {
return new GelDoublePrecision(
table,
this.config
);
}
}
class GelDoublePrecision extends GelColumn {
static [entityKind] = "GelDoublePrecision";
getSQLType() {
return "double precision";
}
mapFromDriverValue(value) {
if (typeof value === "string") {
return Number.parseFloat(value);
}
return value;
}
}
function doublePrecision(name) {
return new GelDoublePrecisionBuilder(name ?? "");
}
export {
GelDoublePrecision,
GelDoublePrecisionBuilder,
doublePrecision
};
//# sourceMappingURL=double-precision.js.map
@@ -0,0 +1,137 @@
import { configToSchema } from '@payloadcms/graphql';
import { createHandler } from 'graphql-http/lib/use/fetch';
import { status as httpStatus } from 'http-status';
import { addDataAndFileToRequest, addLocalesToRequestFromData, createPayloadRequest, headersWithCors, logError, mergeHeaders } from 'payload';
const handleError = async ({
err,
payload,
req
}) => {
const status = err.originalError.status || httpStatus.INTERNAL_SERVER_ERROR;
let errorMessage = err.message;
logError({
err,
payload
});
// Internal server errors can contain anything, including potentially sensitive data.
// Therefore, error details will be hidden from the response unless `config.debug` is `true`
if (!payload.config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {
errorMessage = 'Something went wrong.';
}
let response = {
extensions: {
name: err?.originalError?.name || undefined,
data: err && err.originalError && err.originalError.data || undefined,
stack: payload.config.debug ? err.stack : undefined,
statusCode: status
},
locations: err.locations,
message: errorMessage,
path: err.path
};
await payload.config.hooks.afterError?.reduce(async (promise, hook) => {
await promise;
const result = await hook({
context: req.context,
error: err,
graphqlResult: response,
req
});
if (result) {
response = result.graphqlResult || response;
}
}, Promise.resolve());
return response;
};
let cached = global._payload_graphql;
if (!cached) {
cached = global._payload_graphql = {
graphql: null,
promise: null
};
}
export const getGraphql = async config => {
if (process.env.NODE_ENV === 'development') {
cached = global._payload_graphql = {
graphql: null,
promise: null
};
}
if (cached.graphql) {
return cached.graphql;
}
if (!cached.promise) {
const resolvedConfig = await config;
cached.promise = new Promise(resolve => {
const schema = configToSchema(resolvedConfig);
resolve(cached.graphql || schema);
});
}
try {
cached.graphql = await cached.promise;
} catch (e) {
cached.promise = null;
throw e;
}
return cached.graphql;
};
export const POST = config => async request => {
const originalRequest = request.clone();
const req = await createPayloadRequest({
canSetHeaders: true,
config,
request
});
await addDataAndFileToRequest(req);
addLocalesToRequestFromData(req);
const {
schema,
validationRules
} = await getGraphql(config);
const {
payload
} = req;
const headers = {};
const apiResponse = await createHandler({
context: {
headers,
req
},
onOperation: async (request, args, result) => {
const response = typeof payload.extensions === 'function' ? await payload.extensions({
args,
req: request,
result
}) : result;
if (response.errors) {
const errors = await Promise.all(result.errors.map(error => {
return handleError({
err: error,
payload,
req
});
}));
// errors type should be FormattedGraphQLError[] but onOperation has a return type of ExecutionResult instead of FormattedExecutionResult
return {
...response,
errors
};
}
return response;
},
schema,
validationRules: (_, args, defaultRules) => defaultRules.concat(validationRules(args))
})(originalRequest);
const resHeaders = headersWithCors({
headers: new Headers(apiResponse.headers),
req
});
for (const key in headers) {
resHeaders.append(key, headers[key]);
}
return new Response(apiResponse.body, {
headers: req.responseHeaders ? mergeHeaders(req.responseHeaders, resHeaders) : resHeaders,
status: apiResponse.status
});
};
//# sourceMappingURL=handler.js.map
@@ -0,0 +1,2 @@
import type { UniqueIdentifier } from '@dnd-kit/core';
export declare function itemsEqual(a: UniqueIdentifier[], b: UniqueIdentifier[]): boolean;
@@ -0,0 +1 @@
{"version":3,"file":"chart-line.js","sources":["../../../src/icons/chart-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAzdjE2YTIgMiAwIDAgMCAyIDJoMTYiIC8+CiAgPHBhdGggZD0ibTE5IDktNSA1LTQtNC0zIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chart-line\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChartLine = createLucideIcon('ChartLine', [\n ['path', { d: 'M3 3v16a2 2 0 0 0 2 2h16', key: 'c24i48' }],\n ['path', { d: 'm19 9-5 5-4-4-3 3', key: '2osh9i' }],\n]);\n\nexport default ChartLine;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
"use strict";
exports.isMatchWithOptions = void 0;
var _index = require("../isMatch.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isMatchWithOptions = (exports.isMatchWithOptions = (0,
_index2.convertToFP)(_index.isMatch, 3));
@@ -0,0 +1,32 @@
export declare function resolvedSyncPromise(): PromiseLike<void>;
export declare function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;
/**
* Creates a rejected sync promise.
*
* @param value the value to reject the promise with
* @returns the rejected sync promise
*/
export declare function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T>;
type Executor<T> = (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void;
/**
* Thenable class that behaves like a Promise and follows it's interface
* but is not async internally
*/
export declare class SyncPromise<T> implements PromiseLike<T> {
private _state;
private _handlers;
private _value;
constructor(executor: Executor<T>);
/** @inheritdoc */
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
/** @inheritdoc */
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): PromiseLike<T | TResult>;
/** @inheritdoc */
finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult>;
/** Excute the resolve/reject handlers. */
private _executeHandlers;
/** Run the executor for the SyncPromise. */
private _runExecutor;
}
export {};
//# sourceMappingURL=syncpromise.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"hotel.js","sources":["../../../src/icons/hotel.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Hotel\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMjJ2LTYuNTciIC8+CiAgPHBhdGggZD0iTTEyIDExaC4wMSIgLz4KICA8cGF0aCBkPSJNMTIgN2guMDEiIC8+CiAgPHBhdGggZD0iTTE0IDE1LjQzVjIyIiAvPgogIDxwYXRoIGQ9Ik0xNSAxNmE1IDUgMCAwIDAtNiAwIiAvPgogIDxwYXRoIGQ9Ik0xNiAxMWguMDEiIC8+CiAgPHBhdGggZD0iTTE2IDdoLjAxIiAvPgogIDxwYXRoIGQ9Ik04IDExaC4wMSIgLz4KICA8cGF0aCBkPSJNOCA3aC4wMSIgLz4KICA8cmVjdCB4PSI0IiB5PSIyIiB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHJ4PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/hotel\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Hotel = createLucideIcon('Hotel', [\n ['path', { d: 'M10 22v-6.57', key: '1wmca3' }],\n ['path', { d: 'M12 11h.01', key: 'z322tv' }],\n ['path', { d: 'M12 7h.01', key: '1ivr5q' }],\n ['path', { d: 'M14 15.43V22', key: '1q2vjd' }],\n ['path', { d: 'M15 16a5 5 0 0 0-6 0', key: 'o9wqvi' }],\n ['path', { d: 'M16 11h.01', key: 'xkw8gn' }],\n ['path', { d: 'M16 7h.01', key: '1kdx03' }],\n ['path', { d: 'M8 11h.01', key: '1dfujw' }],\n ['path', { d: 'M8 7h.01', key: '1vti4s' }],\n ['rect', { x: '4', y: '2', width: '16', height: '20', rx: '2', key: '1uxh74' }],\n]);\n\nexport default Hotel;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
export interface TokenSummary {
inputTokens: number;
outputTokens: number;
}
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,569 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/hi/_lib/localize.js
function localeToNumber(locale) {
var enNumber = locale.toString().replace(/[१२३४५६७८९०]/g, function (match) {
return numberValues.number[match];
});
return Number(enNumber);
}
function numberToLocale(enNumber) {
return enNumber.toString().replace(/\d/g, function (match) {
return numberValues.locale[match];
});
}
var numberValues = {
locale: {
1: "\u0967",
2: "\u0968",
3: "\u0969",
4: "\u096A",
5: "\u096B",
6: "\u096C",
7: "\u096D",
8: "\u096E",
9: "\u096F",
0: "\u0966"
},
number: {
"\u0967": "1",
"\u0968": "2",
"\u0969": "3",
"\u096A": "4",
"\u096B": "5",
"\u096C": "6",
"\u096D": "7",
"\u096E": "8",
"\u096F": "9",
"\u0966": "0"
}
};
var eraValues = {
narrow: ["\u0908\u0938\u093E-\u092A\u0942\u0930\u094D\u0935", "\u0908\u0938\u094D\u0935\u0940"],
abbreviated: ["\u0908\u0938\u093E-\u092A\u0942\u0930\u094D\u0935", "\u0908\u0938\u094D\u0935\u0940"],
wide: ["\u0908\u0938\u093E-\u092A\u0942\u0930\u094D\u0935", "\u0908\u0938\u0935\u0940 \u0938\u0928"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["\u0924\u093F1", "\u0924\u093F2", "\u0924\u093F3", "\u0924\u093F4"],
wide: ["\u092A\u0939\u0932\u0940 \u0924\u093F\u092E\u093E\u0939\u0940", "\u0926\u0942\u0938\u0930\u0940 \u0924\u093F\u092E\u093E\u0939\u0940", "\u0924\u0940\u0938\u0930\u0940 \u0924\u093F\u092E\u093E\u0939\u0940", "\u091A\u094C\u0925\u0940 \u0924\u093F\u092E\u093E\u0939\u0940"]
};
var monthValues = {
narrow: [
"\u091C",
"\u092B\u093C",
"\u092E\u093E",
"\u0905",
"\u092E\u0908",
"\u091C\u0942",
"\u091C\u0941",
"\u0905\u0917",
"\u0938\u093F",
"\u0905\u0915\u094D\u091F\u0942",
"\u0928",
"\u0926\u093F"],
abbreviated: [
"\u091C\u0928",
"\u092B\u093C\u0930",
"\u092E\u093E\u0930\u094D\u091A",
"\u0905\u092A\u094D\u0930\u0948\u0932",
"\u092E\u0908",
"\u091C\u0942\u0928",
"\u091C\u0941\u0932",
"\u0905\u0917",
"\u0938\u093F\u0924",
"\u0905\u0915\u094D\u091F\u0942",
"\u0928\u0935",
"\u0926\u093F\u0938"],
wide: [
"\u091C\u0928\u0935\u0930\u0940",
"\u092B\u093C\u0930\u0935\u0930\u0940",
"\u092E\u093E\u0930\u094D\u091A",
"\u0905\u092A\u094D\u0930\u0948\u0932",
"\u092E\u0908",
"\u091C\u0942\u0928",
"\u091C\u0941\u0932\u093E\u0908",
"\u0905\u0917\u0938\u094D\u0924",
"\u0938\u093F\u0924\u0902\u092C\u0930",
"\u0905\u0915\u094D\u091F\u0942\u092C\u0930",
"\u0928\u0935\u0902\u092C\u0930",
"\u0926\u093F\u0938\u0902\u092C\u0930"]
};
var dayValues = {
narrow: ["\u0930", "\u0938\u094B", "\u092E\u0902", "\u092C\u0941", "\u0917\u0941", "\u0936\u0941", "\u0936"],
short: ["\u0930", "\u0938\u094B", "\u092E\u0902", "\u092C\u0941", "\u0917\u0941", "\u0936\u0941", "\u0936"],
abbreviated: ["\u0930\u0935\u093F", "\u0938\u094B\u092E", "\u092E\u0902\u0917\u0932", "\u092C\u0941\u0927", "\u0917\u0941\u0930\u0941", "\u0936\u0941\u0915\u094D\u0930", "\u0936\u0928\u093F"],
wide: [
"\u0930\u0935\u093F\u0935\u093E\u0930",
"\u0938\u094B\u092E\u0935\u093E\u0930",
"\u092E\u0902\u0917\u0932\u0935\u093E\u0930",
"\u092C\u0941\u0927\u0935\u093E\u0930",
"\u0917\u0941\u0930\u0941\u0935\u093E\u0930",
"\u0936\u0941\u0915\u094D\u0930\u0935\u093E\u0930",
"\u0936\u0928\u093F\u0935\u093E\u0930"]
};
var dayPeriodValues = {
narrow: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
},
abbreviated: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
},
wide: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
},
abbreviated: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
},
wide: {
am: "\u092A\u0942\u0930\u094D\u0935\u093E\u0939\u094D\u0928",
pm: "\u0905\u092A\u0930\u093E\u0939\u094D\u0928",
midnight: "\u092E\u0927\u094D\u092F\u0930\u093E\u0924\u094D\u0930\u093F",
noon: "\u0926\u094B\u092A\u0939\u0930",
morning: "\u0938\u0941\u092C\u0939",
afternoon: "\u0926\u094B\u092A\u0939\u0930",
evening: "\u0936\u093E\u092E",
night: "\u0930\u093E\u0924"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return numberToLocale(number);
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/hi/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "\u0967 \u0938\u0947\u0915\u0902\u0921 \u0938\u0947 \u0915\u092E",
other: "{{count}} \u0938\u0947\u0915\u0902\u0921 \u0938\u0947 \u0915\u092E"
},
xSeconds: {
one: "\u0967 \u0938\u0947\u0915\u0902\u0921",
other: "{{count}} \u0938\u0947\u0915\u0902\u0921"
},
halfAMinute: "\u0906\u0927\u093E \u092E\u093F\u0928\u091F",
lessThanXMinutes: {
one: "\u0967 \u092E\u093F\u0928\u091F \u0938\u0947 \u0915\u092E",
other: "{{count}} \u092E\u093F\u0928\u091F \u0938\u0947 \u0915\u092E"
},
xMinutes: {
one: "\u0967 \u092E\u093F\u0928\u091F",
other: "{{count}} \u092E\u093F\u0928\u091F"
},
aboutXHours: {
one: "\u0932\u0917\u092D\u0917 \u0967 \u0918\u0902\u091F\u093E",
other: "\u0932\u0917\u092D\u0917 {{count}} \u0918\u0902\u091F\u0947"
},
xHours: {
one: "\u0967 \u0918\u0902\u091F\u093E",
other: "{{count}} \u0918\u0902\u091F\u0947"
},
xDays: {
one: "\u0967 \u0926\u093F\u0928",
other: "{{count}} \u0926\u093F\u0928"
},
aboutXWeeks: {
one: "\u0932\u0917\u092D\u0917 \u0967 \u0938\u092A\u094D\u0924\u093E\u0939",
other: "\u0932\u0917\u092D\u0917 {{count}} \u0938\u092A\u094D\u0924\u093E\u0939"
},
xWeeks: {
one: "\u0967 \u0938\u092A\u094D\u0924\u093E\u0939",
other: "{{count}} \u0938\u092A\u094D\u0924\u093E\u0939"
},
aboutXMonths: {
one: "\u0932\u0917\u092D\u0917 \u0967 \u092E\u0939\u0940\u0928\u093E",
other: "\u0932\u0917\u092D\u0917 {{count}} \u092E\u0939\u0940\u0928\u0947"
},
xMonths: {
one: "\u0967 \u092E\u0939\u0940\u0928\u093E",
other: "{{count}} \u092E\u0939\u0940\u0928\u0947"
},
aboutXYears: {
one: "\u0932\u0917\u092D\u0917 \u0967 \u0935\u0930\u094D\u0937",
other: "\u0932\u0917\u092D\u0917 {{count}} \u0935\u0930\u094D\u0937"
},
xYears: {
one: "\u0967 \u0935\u0930\u094D\u0937",
other: "{{count}} \u0935\u0930\u094D\u0937"
},
overXYears: {
one: "\u0967 \u0935\u0930\u094D\u0937 \u0938\u0947 \u0905\u0927\u093F\u0915",
other: "{{count}} \u0935\u0930\u094D\u0937 \u0938\u0947 \u0905\u0927\u093F\u0915"
},
almostXYears: {
one: "\u0932\u0917\u092D\u0917 \u0967 \u0935\u0930\u094D\u0937",
other: "\u0932\u0917\u092D\u0917 {{count}} \u0935\u0930\u094D\u0937"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", numberToLocale(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "\u092E\u0947 ";
} else {
return result + " \u092A\u0939\u0932\u0947";
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/hi/_lib/formatLong.js
var dateFormats = {
full: "EEEE, do MMMM, y",
long: "do MMMM, y",
medium: "d MMM, y",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
var dateTimeFormats = {
full: "{{date}} '\u0915\u094B' {{time}}",
long: "{{date}} '\u0915\u094B' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/hi/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "'\u092A\u093F\u091B\u0932\u0947' eeee p",
yesterday: "'\u0915\u0932' p",
today: "'\u0906\u091C' p",
tomorrow: "'\u0915\u0932' p",
nextWeek: "eeee '\u0915\u094B' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/hi/_lib/match.js
var matchOrdinalNumberPattern = /^[०१२३४५६७८९]+/i;
var parseOrdinalNumberPattern = /^[०१२३४५६७८९]+/i;
var matchEraPatterns = {
narrow: /^(ईसा-पूर्व|ईस्वी)/i,
abbreviated: /^(ईसा\.?\s?पूर्व\.?|ईसा\.?)/i,
wide: /^(ईसा-पूर्व|ईसवी पूर्व|ईसवी सन|ईसवी)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^ति[1234]/i,
wide: /^[1234](पहली|दूसरी|तीसरी|चौथी)? तिमाही/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[जफ़माअप्मईजूनजुअगसिअक्तनदि]/i,
abbreviated: /^(जन|फ़र|मार्च|अप्|मई|जून|जुल|अग|सित|अक्तू|नव|दिस)/i,
wide: /^(जनवरी|फ़रवरी|मार्च|अप्रैल|मई|जून|जुलाई|अगस्त|सितंबर|अक्तूबर|नवंबर|दिसंबर)/i
};
var parseMonthPatterns = {
narrow: [
/^ज/i,
/^फ़/i,
/^मा/i,
/^अप्/i,
/^मई/i,
/^जू/i,
/^जु/i,
/^अग/i,
/^सि/i,
/^अक्तू/i,
/^न/i,
/^दि/i],
any: [
/^जन/i,
/^फ़/i,
/^मा/i,
/^अप्/i,
/^मई/i,
/^जू/i,
/^जु/i,
/^अग/i,
/^सि/i,
/^अक्तू/i,
/^नव/i,
/^दिस/i]
};
var matchDayPatterns = {
narrow: /^[रविसोममंगलबुधगुरुशुक्रशनि]/i,
short: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
abbreviated: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
wide: /^(रविवार|सोमवार|मंगलवार|बुधवार|गुरुवार|शुक्रवार|शनिवार)/i
};
var parseDayPatterns = {
narrow: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i],
any: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i]
};
var matchDayPeriodPatterns = {
narrow: /^(पू|अ|म|द.\?|सु|दो|शा|रा)/i,
any: /^(पूर्वाह्न|अपराह्न|म|द.\?|सु|दो|शा|रा)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^पूर्वाह्न/i,
pm: /^अपराह्न/i,
midnight: /^मध्य/i,
noon: /^दो/i,
morning: /सु/i,
afternoon: /दो/i,
evening: /शा/i,
night: /रा/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: localeToNumber
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/hi.js
var hi = {
code: "hi",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 4
}
};
// lib/locale/hi/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
hi: hi }) });
//# debugId=FB9B87E9537E0B2B64756E2164756E21
//# sourceMappingURL=cdn.js.map
})();
@@ -0,0 +1 @@
export default function isWindow(node: Element | Document | Window): Window | false;
@@ -0,0 +1,29 @@
/**
* Very simple, but fast deepMerge implementation. Only deepMerges objects, not arrays and clones everything.
* Do not use this if your object contains any complex objects like React Components, or if you would like to combine Arrays.
* If you only have simple objects and need a fast deepMerge, this is the function for you.
*
* obj2 takes precedence over obj1 - thus if obj2 has a key that obj1 also has, obj2's value will be used.
*
* @param obj1 base object
* @param obj2 object to merge "into" obj1
*/ export function deepMergeSimple(obj1, obj2) {
const output = {
...obj1
};
for(const key in obj2){
if (Object.prototype.hasOwnProperty.call(obj2, key)) {
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
if (typeof obj2[key] === 'object' && !Array.isArray(obj2[key]) && obj1[key]) {
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
output[key] = deepMergeSimple(obj1[key], obj2[key]);
} else {
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
output[key] = obj2[key];
}
}
}
return output;
}
//# sourceMappingURL=deepMergeSimple.js.map
@@ -0,0 +1 @@
{"version":3,"file":"spanOnScope.d.ts","sourceRoot":"","sources":["../../../src/utils/spanOnScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGhD,QAAA,MAAM,gBAAgB,gBAAgB,CAAC;AAEvC,KAAK,kBAAkB,GAAG,KAAK,GAAG;IAChC,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAO3E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAE5E"}
@@ -0,0 +1 @@
module.exports={C:{"5":0.11892,"65":0.00425,"102":0.00425,"115":1.1382,"127":0.00425,"129":0.00425,"133":0.00849,"136":0.01274,"139":0.01699,"140":0.00849,"145":1.39302,"146":1.49494,"147":0.00849,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 128 130 131 132 134 135 137 138 141 142 143 144 148 149 3.5 3.6"},D:{"69":0.12316,"70":0.00425,"73":0.00425,"77":0.00425,"79":0.00425,"81":0.01699,"83":0.00425,"85":0.00425,"86":0.00849,"87":0.00425,"95":0.00425,"96":0.00849,"99":0.00425,"103":0.06371,"104":0.65829,"105":0.02548,"106":0.02548,"107":0.02124,"108":0.02548,"109":0.39072,"110":0.02124,"111":0.15289,"112":0.02124,"113":0.00425,"114":0.00425,"116":0.08069,"117":0.02548,"119":0.00425,"120":0.02548,"122":0.01699,"124":0.02548,"125":0.89612,"126":0.54362,"128":0.02124,"129":0.00425,"130":0.0722,"131":0.08069,"132":0.1444,"133":0.06795,"134":0.00849,"135":0.00849,"136":0.00425,"137":0.08494,"138":0.11892,"139":0.29729,"140":0.03398,"141":0.24633,"142":5.89484,"143":9.82331,"144":0.00849,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 71 72 74 75 76 78 80 84 88 89 90 91 92 93 94 97 98 100 101 102 115 118 121 123 127 145 146"},F:{"93":0.11042,"95":0.00849,"120":0.00425,"122":0.00425,"123":0.01274,"124":0.53088,"125":0.30154,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 121 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.05521,"18":0.00425,"99":0.00849,"109":0.00849,"114":0.00425,"116":0.00425,"122":0.00425,"126":0.00425,"128":0.05096,"133":0.0722,"134":0.00425,"135":0.00425,"138":0.02548,"140":0.00849,"141":0.03398,"142":1.53317,"143":5.10065,_:"12 13 14 15 16 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 100 101 102 103 104 105 106 107 108 110 111 112 113 115 117 118 119 120 121 123 124 125 127 129 130 131 132 136 137 139"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 16.1 16.2 16.4 16.5 17.0 17.2 17.3 17.4 18.2 18.4 26.3","13.1":0.2166,"15.5":0.00849,"15.6":0.1359,"16.0":0.02548,"16.3":0.00425,"16.6":0.16139,"17.1":0.02973,"17.5":0.00425,"17.6":0.0722,"18.0":0.00425,"18.1":0.00425,"18.3":0.05521,"18.5-18.6":0.0722,"26.0":0.04247,"26.1":0.10618,"26.2":0.04247},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0019,"5.0-5.1":0,"6.0-6.1":0.0038,"7.0-7.1":0.00285,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00759,"10.0-10.2":0.00095,"10.3":0.01329,"11.0-11.2":0.16327,"11.3-11.4":0.00475,"12.0-12.1":0.0038,"12.2-12.5":0.04272,"13.0-13.1":0.00095,"13.2":0.00664,"13.3":0.0019,"13.4-13.7":0.00664,"14.0-14.4":0.01329,"14.5-14.8":0.01424,"15.0-15.1":0.01519,"15.2-15.3":0.01139,"15.4":0.01234,"15.5":0.01329,"15.6-15.8":0.20599,"16.0":0.02373,"16.1":0.04556,"16.2":0.02373,"16.3":0.04272,"16.4":0.01044,"16.5":0.01804,"16.6-16.7":0.26769,"17.0":0.01519,"17.1":0.02468,"17.2":0.01804,"17.3":0.02753,"17.4":0.04651,"17.5":0.09113,"17.6-17.7":0.21073,"18.0":0.04746,"18.1":0.09872,"18.2":0.05221,"18.3":0.16991,"18.4":0.08733,"18.5-18.7":6.27071,"26.0":0.12245,"26.1":1.01854,"26.2":0.19365,"26.3":0.00854},P:{"4":0.03082,"21":0.03082,"22":0.0411,"23":0.03082,"24":0.0411,"25":0.10275,"26":0.05137,"27":0.51375,"28":0.3699,"29":3.64759,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.11302,"17.0":0.02055},I:{"0":0.00574,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},A:{"11":0.27181,_:"6 7 8 9 10 5.5"},K:{"0":0.25889,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.22437},O:{"0":0.1956},H:{"0":0},L:{"0":48.92895},R:{_:"0"},M:{"0":0.25313}};
@@ -0,0 +1,31 @@
import js from '@eslint/js';
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
// Browser globals
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
fetch: 'readonly',
Promise: 'readonly',
// ES2020 globals
globalThis: 'readonly',
},
},
rules: {},
},
{
ignores: ['**/spec.js', '**/*.spec.js', 'node_modules/**', 'lib/**'],
},
];
@@ -0,0 +1 @@
{"version":3,"file":"LanguageSelector.js","names":["c","_c","ReactSelect","useTranslation","React","LanguageSelector","props","$","languageOptions","i18n","switchLanguage","t0","option","value","t1","t2","language","_jsx","inputId","isClearable","onChange","options","find"],"sources":["../../../../src/views/Account/Settings/LanguageSelector.tsx"],"sourcesContent":["'use client'\nimport type { AcceptedLanguages } from '@payloadcms/translations'\nimport type { ReactSelectOption } from '@payloadcms/ui'\nimport type { LanguageOptions } from 'payload'\n\nimport { ReactSelect, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nexport const LanguageSelector: React.FC<{\n languageOptions: LanguageOptions\n}> = (props) => {\n const { languageOptions } = props\n\n const { i18n, switchLanguage } = useTranslation()\n\n return (\n <ReactSelect\n inputId=\"language-select\"\n isClearable={false}\n onChange={async (option: ReactSelectOption<AcceptedLanguages>) => {\n await switchLanguage(option.value)\n }}\n options={languageOptions}\n value={languageOptions.find((language) => language.value === i18n.language)}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAKA,SAASC,WAAW,EAAEC,cAAc,QAAQ;AAC5C,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,gBAAA,GAERC,KAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EACH;IAAAO;EAAA,IAA4BF,KAAA;EAE5B;IAAAG,IAAA;IAAAC;EAAA,IAAiCP,cAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAJ,CAAA,QAAAG,cAAA;IAMnBC,EAAA,SAAAC,MAAA;MAAA,MACFF,cAAA,CAAeE,MAAA,CAAAC,KAAY;IAAA;IACnCN,CAAA,MAAAG,cAAA;IAAAH,CAAA,MAAAI,EAAA;EAAA;IAAAA,EAAA,GAAAJ,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAE,IAAA,IAAAF,CAAA,QAAAC,eAAA,IAAAD,CAAA,QAAAI,EAAA;IAAA,IAAAI,EAAA;IAAA,IAAAR,CAAA,QAAAE,IAAA;MAE4BM,EAAA,GAAAC,QAAA,IAAcA,QAAA,CAAAH,KAAA,KAAmBJ,IAAA,CAAAO,QAAa;MAAAT,CAAA,MAAAE,IAAA;MAAAF,CAAA,MAAAQ,EAAA;IAAA;MAAAA,EAAA,GAAAR,CAAA;IAAA;IAP5EO,EAAA,GAAAG,IAAA,CAAAf,WAAA;MAAAgB,OAAA,EACU;MAAAC,WAAA;MAAAC,QAAA,EAEET,EAEV;MAAAU,OAAA,EACSb,eAAA;MAAAK,KAAA,EACFL,eAAA,CAAAc,IAAA,CAAqBP,EAA8C;IAAA,C;;;;;;;;SAP5ED,E;CAUJ","ignoreList":[]}
@@ -0,0 +1,647 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/ta/_lib/formatDistance.mjs
var isPluralType = function isPluralType(val) {
return val.one !== undefined;
};
var formatDistanceLocale = {
lessThanXSeconds: {
one: {
default: "\u0B92\u0BB0\u0BC1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BCD\u0B95\u0BC1 \u0B95\u0BC1\u0BB1\u0BC8\u0BB5\u0BBE\u0B95",
in: "\u0B92\u0BB0\u0BC1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BCD\u0B95\u0BC1\u0BB3\u0BCD",
ago: "\u0B92\u0BB0\u0BC1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0B95\u0BC1\u0BB1\u0BC8\u0BB5\u0BBE\u0B95",
in: "{{count}} \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0BB3\u0BCD",
ago: "{{count}} \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xSeconds: {
one: {
default: "1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF",
in: "1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0BAF\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BB5\u0BBF\u0BA8\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0BB5\u0BBF\u0BA9\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BB5\u0BBF\u0BA8\u0BBE\u0B9F\u0BBF\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
halfAMinute: {
default: "\u0B85\u0BB0\u0BC8 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BAE\u0BCD",
in: "\u0B85\u0BB0\u0BC8 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "\u0B85\u0BB0\u0BC8 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
lessThanXMinutes: {
one: {
default: "\u0B92\u0BB0\u0BC1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1\u0BAE\u0BCD \u0B95\u0BC1\u0BB1\u0BC8\u0BB5\u0BBE\u0B95",
in: "\u0B92\u0BB0\u0BC1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1\u0BB3\u0BCD",
ago: "\u0B92\u0BB0\u0BC1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0BAE\u0BCD \u0B95\u0BC1\u0BB1\u0BC8\u0BB5\u0BBE\u0B95",
in: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0BB3\u0BCD",
ago: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xMinutes: {
one: {
default: "1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BAE\u0BCD",
in: "1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BA8\u0BBF\u0BAE\u0BBF\u0B9F\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
aboutXHours: {
one: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD"
}
},
xHours: {
one: {
default: "1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
in: "1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",
in: "{{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BAE\u0BA3\u0BBF \u0BA8\u0BC7\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xDays: {
one: {
default: "1 \u0BA8\u0BBE\u0BB3\u0BCD",
in: "1 \u0BA8\u0BBE\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BA8\u0BBE\u0BB3\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BA8\u0BBE\u0B9F\u0BCD\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0BA8\u0BBE\u0B9F\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BA8\u0BBE\u0B9F\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
aboutXWeeks: {
one: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BB5\u0BBE\u0BB0\u0BAE\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BB5\u0BBE\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BB5\u0BBE\u0BB0\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xWeeks: {
one: {
default: "1 \u0BB5\u0BBE\u0BB0\u0BAE\u0BCD",
in: "1 \u0BB5\u0BBE\u0BB0\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BB5\u0BBE\u0BB0\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BB5\u0BBE\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
aboutXMonths: {
one: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BBE\u0BA4\u0BAE\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BBE\u0BA4\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BAE\u0BBE\u0BA4\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xMonths: {
one: {
default: "1 \u0BAE\u0BBE\u0BA4\u0BAE\u0BCD",
in: "1 \u0BAE\u0BBE\u0BA4\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BAE\u0BBE\u0BA4\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0BAE\u0BBE\u0BA4\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
aboutXYears: {
one: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0B86\u0BA3\u0BCD\u0B9F\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD 1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",
in: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "\u0B9A\u0BC1\u0BAE\u0BBE\u0BB0\u0BCD {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
xYears: {
one: {
default: "1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD",
in: "1 \u0B86\u0BA3\u0BCD\u0B9F\u0BBF\u0BB2\u0BCD",
ago: "1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",
in: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
overXYears: {
one: {
default: "1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1 \u0BAE\u0BC7\u0BB2\u0BCD",
in: "1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1\u0BAE\u0BCD \u0BAE\u0BC7\u0BB2\u0BBE\u0B95",
ago: "1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0BAE\u0BCD \u0BAE\u0BC7\u0BB2\u0BBE\u0B95",
in: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "{{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
},
almostXYears: {
one: {
default: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F 1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD",
in: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F 1 \u0B86\u0BA3\u0BCD\u0B9F\u0BBF\u0BB2\u0BCD",
ago: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F 1 \u0BB5\u0BB0\u0BC1\u0B9F\u0BAE\u0BCD \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
},
other: {
default: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",
in: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BBF\u0BB2\u0BCD",
ago: "\u0B95\u0BBF\u0B9F\u0BCD\u0B9F\u0BA4\u0BCD\u0BA4\u0B9F\u0BCD\u0B9F {{count}} \u0B86\u0BA3\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD\u0BAA\u0BC1"
}
}
};
var formatDistance = function formatDistance(token, count, options) {
var tense = options !== null && options !== void 0 && options.addSuffix ? options.comparison && options.comparison > 0 ? "in" : "ago" : "default";
var tokenValue = formatDistanceLocale[token];
if (!isPluralType(tokenValue))
return tokenValue[tense];
if (count === 1) {
return tokenValue.one[tense];
} else {
return tokenValue.other[tense].replace("{{count}}", String(count));
}
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/ta/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d MMMM, y",
long: "d MMMM, y",
medium: "d MMM, y",
short: "d/M/yy"
};
var timeFormats = {
full: "a h:mm:ss zzzz",
long: "a h:mm:ss z",
medium: "a h:mm:ss",
short: "a h:mm"
};
var dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/ta/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'\u0B95\u0B9F\u0BA8\u0BCD\u0BA4' eeee p '\u0BAE\u0BA3\u0BBF\u0B95\u0BCD\u0B95\u0BC1'",
yesterday: "'\u0BA8\u0BC7\u0BB1\u0BCD\u0BB1\u0BC1 ' p '\u0BAE\u0BA3\u0BBF\u0B95\u0BCD\u0B95\u0BC1'",
today: "'\u0B87\u0BA9\u0BCD\u0BB1\u0BC1 ' p '\u0BAE\u0BA3\u0BBF\u0B95\u0BCD\u0B95\u0BC1'",
tomorrow: "'\u0BA8\u0BBE\u0BB3\u0BC8 ' p '\u0BAE\u0BA3\u0BBF\u0B95\u0BCD\u0B95\u0BC1'",
nextWeek: "eeee p '\u0BAE\u0BA3\u0BBF\u0B95\u0BCD\u0B95\u0BC1'",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/ta/_lib/localize.mjs
var eraValues = {
narrow: ["\u0B95\u0BBF.\u0BAE\u0BC1.", "\u0B95\u0BBF.\u0BAA\u0BBF."],
abbreviated: ["\u0B95\u0BBF.\u0BAE\u0BC1.", "\u0B95\u0BBF.\u0BAA\u0BBF."],
wide: ["\u0B95\u0BBF\u0BB1\u0BBF\u0BB8\u0BCD\u0BA4\u0BC1\u0BB5\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC1\u0BA9\u0BCD", "\u0B85\u0BA9\u0BCD\u0BA9\u0BCB \u0B9F\u0BCB\u0BAE\u0BBF\u0BA9\u0BBF"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["\u0B95\u0BBE\u0BB2\u0BBE.1", "\u0B95\u0BBE\u0BB2\u0BBE.2", "\u0B95\u0BBE\u0BB2\u0BBE.3", "\u0B95\u0BBE\u0BB2\u0BBE.4"],
wide: [
"\u0B92\u0BA9\u0BCD\u0BB1\u0BBE\u0BAE\u0BCD \u0B95\u0BBE\u0BB2\u0BBE\u0BA3\u0BCD\u0B9F\u0BC1",
"\u0B87\u0BB0\u0BA3\u0BCD\u0B9F\u0BBE\u0BAE\u0BCD \u0B95\u0BBE\u0BB2\u0BBE\u0BA3\u0BCD\u0B9F\u0BC1",
"\u0BAE\u0BC2\u0BA9\u0BCD\u0BB1\u0BBE\u0BAE\u0BCD \u0B95\u0BBE\u0BB2\u0BBE\u0BA3\u0BCD\u0B9F\u0BC1",
"\u0BA8\u0BBE\u0BA9\u0BCD\u0B95\u0BBE\u0BAE\u0BCD \u0B95\u0BBE\u0BB2\u0BBE\u0BA3\u0BCD\u0B9F\u0BC1"]
};
var monthValues = {
narrow: ["\u0B9C", "\u0BAA\u0BBF", "\u0BAE\u0BBE", "\u0B8F", "\u0BAE\u0BC7", "\u0B9C\u0BC2", "\u0B9C\u0BC2", "\u0B86", "\u0B9A\u0BC6", "\u0B85", "\u0BA8", "\u0B9F\u0BBF"],
abbreviated: [
"\u0B9C\u0BA9.",
"\u0BAA\u0BBF\u0BAA\u0BCD.",
"\u0BAE\u0BBE\u0BB0\u0BCD.",
"\u0B8F\u0BAA\u0BCD.",
"\u0BAE\u0BC7",
"\u0B9C\u0BC2\u0BA9\u0BCD",
"\u0B9C\u0BC2\u0BB2\u0BC8",
"\u0B86\u0B95.",
"\u0B9A\u0BC6\u0BAA\u0BCD.",
"\u0B85\u0B95\u0BCD.",
"\u0BA8\u0BB5.",
"\u0B9F\u0BBF\u0B9A."],
wide: [
"\u0B9C\u0BA9\u0BB5\u0BB0\u0BBF",
"\u0BAA\u0BBF\u0BAA\u0BCD\u0BB0\u0BB5\u0BB0\u0BBF",
"\u0BAE\u0BBE\u0BB0\u0BCD\u0B9A\u0BCD",
"\u0B8F\u0BAA\u0BCD\u0BB0\u0BB2\u0BCD",
"\u0BAE\u0BC7",
"\u0B9C\u0BC2\u0BA9\u0BCD",
"\u0B9C\u0BC2\u0BB2\u0BC8",
"\u0B86\u0B95\u0BB8\u0BCD\u0B9F\u0BCD",
"\u0B9A\u0BC6\u0BAA\u0BCD\u0B9F\u0BAE\u0BCD\u0BAA\u0BB0\u0BCD",
"\u0B85\u0B95\u0BCD\u0B9F\u0BCB\u0BAA\u0BB0\u0BCD",
"\u0BA8\u0BB5\u0BAE\u0BCD\u0BAA\u0BB0\u0BCD",
"\u0B9F\u0BBF\u0B9A\u0BAE\u0BCD\u0BAA\u0BB0\u0BCD"]
};
var dayValues = {
narrow: ["\u0B9E\u0BBE", "\u0BA4\u0BBF", "\u0B9A\u0BC6", "\u0BAA\u0BC1", "\u0BB5\u0BBF", "\u0BB5\u0BC6", "\u0B9A"],
short: ["\u0B9E\u0BBE", "\u0BA4\u0BBF", "\u0B9A\u0BC6", "\u0BAA\u0BC1", "\u0BB5\u0BBF", "\u0BB5\u0BC6", "\u0B9A"],
abbreviated: ["\u0B9E\u0BBE\u0BAF\u0BBF.", "\u0BA4\u0BBF\u0B99\u0BCD.", "\u0B9A\u0BC6\u0BB5\u0BCD.", "\u0BAA\u0BC1\u0BA4.", "\u0BB5\u0BBF\u0BAF\u0BBE.", "\u0BB5\u0BC6\u0BB3\u0BCD.", "\u0B9A\u0BA9\u0BBF"],
wide: [
"\u0B9E\u0BBE\u0BAF\u0BBF\u0BB1\u0BC1",
"\u0BA4\u0BBF\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
"\u0B9A\u0BC6\u0BB5\u0BCD\u0BB5\u0BBE\u0BAF\u0BCD",
"\u0BAA\u0BC1\u0BA4\u0BA9\u0BCD",
"\u0BB5\u0BBF\u0BAF\u0BBE\u0BB4\u0BA9\u0BCD",
"\u0BB5\u0BC6\u0BB3\u0BCD\u0BB3\u0BBF",
"\u0B9A\u0BA9\u0BBF"]
};
var dayPeriodValues = {
narrow: {
am: "\u0BAE\u0BC1.\u0BAA",
pm: "\u0BAA\u0BBF.\u0BAA",
midnight: "\u0BA8\u0BB3\u0BCD.",
noon: "\u0BA8\u0BA3\u0BCD.",
morning: "\u0B95\u0BBE.",
afternoon: "\u0BAE\u0BA4\u0BBF.",
evening: "\u0BAE\u0BBE.",
night: "\u0B87\u0BB0."
},
abbreviated: {
am: "\u0BAE\u0BC1\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
pm: "\u0BAA\u0BBF\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
midnight: "\u0BA8\u0BB3\u0BCD\u0BB3\u0BBF\u0BB0\u0BB5\u0BC1",
noon: "\u0BA8\u0BA3\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
morning: "\u0B95\u0BBE\u0BB2\u0BC8",
afternoon: "\u0BAE\u0BA4\u0BBF\u0BAF\u0BAE\u0BCD",
evening: "\u0BAE\u0BBE\u0BB2\u0BC8",
night: "\u0B87\u0BB0\u0BB5\u0BC1"
},
wide: {
am: "\u0BAE\u0BC1\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
pm: "\u0BAA\u0BBF\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
midnight: "\u0BA8\u0BB3\u0BCD\u0BB3\u0BBF\u0BB0\u0BB5\u0BC1",
noon: "\u0BA8\u0BA3\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
morning: "\u0B95\u0BBE\u0BB2\u0BC8",
afternoon: "\u0BAE\u0BA4\u0BBF\u0BAF\u0BAE\u0BCD",
evening: "\u0BAE\u0BBE\u0BB2\u0BC8",
night: "\u0B87\u0BB0\u0BB5\u0BC1"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "\u0BAE\u0BC1.\u0BAA",
pm: "\u0BAA\u0BBF.\u0BAA",
midnight: "\u0BA8\u0BB3\u0BCD.",
noon: "\u0BA8\u0BA3\u0BCD.",
morning: "\u0B95\u0BBE.",
afternoon: "\u0BAE\u0BA4\u0BBF.",
evening: "\u0BAE\u0BBE.",
night: "\u0B87\u0BB0."
},
abbreviated: {
am: "\u0BAE\u0BC1\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
pm: "\u0BAA\u0BBF\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
midnight: "\u0BA8\u0BB3\u0BCD\u0BB3\u0BBF\u0BB0\u0BB5\u0BC1",
noon: "\u0BA8\u0BA3\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
morning: "\u0B95\u0BBE\u0BB2\u0BC8",
afternoon: "\u0BAE\u0BA4\u0BBF\u0BAF\u0BAE\u0BCD",
evening: "\u0BAE\u0BBE\u0BB2\u0BC8",
night: "\u0B87\u0BB0\u0BB5\u0BC1"
},
wide: {
am: "\u0BAE\u0BC1\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
pm: "\u0BAA\u0BBF\u0BB1\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
midnight: "\u0BA8\u0BB3\u0BCD\u0BB3\u0BBF\u0BB0\u0BB5\u0BC1",
noon: "\u0BA8\u0BA3\u0BCD\u0BAA\u0B95\u0BB2\u0BCD",
morning: "\u0B95\u0BBE\u0BB2\u0BC8",
afternoon: "\u0BAE\u0BA4\u0BBF\u0BAF\u0BAE\u0BCD",
evening: "\u0BAE\u0BBE\u0BB2\u0BC8",
night: "\u0B87\u0BB0\u0BB5\u0BC1"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
return String(dirtyNumber);
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/ta/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(வது)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(கி.மு.|கி.பி.)/i,
abbreviated: /^(கி\.?\s?மு\.?|கி\.?\s?பி\.?)/,
wide: /^(கிறிஸ்துவுக்கு\sமுன்|அன்னோ\sடோமினி)/i
};
var parseEraPatterns = {
any: [/கி\.?\s?மு\.?/, /கி\.?\s?பி\.?/]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^காலா.[1234]/i,
wide: /^(ஒன்றாம்|இரண்டாம்|மூன்றாம்|நான்காம்) காலாண்டு/i
};
var parseQuarterPatterns = {
narrow: [/1/i, /2/i, /3/i, /4/i],
any: [
/(1|காலா.1|ஒன்றாம்)/i,
/(2|காலா.2|இரண்டாம்)/i,
/(3|காலா.3|மூன்றாம்)/i,
/(4|காலா.4|நான்காம்)/i]
};
var matchMonthPatterns = {
narrow: /^(ஜ|பி|மா|ஏ|மே|ஜூ|ஆ|செ|அ|ந|டி)$/i,
abbreviated: /^(ஜன.|பிப்.|மார்.|ஏப்.|மே|ஜூன்|ஜூலை|ஆக.|செப்.|அக்.|நவ.|டிச.)/i,
wide: /^(ஜனவரி|பிப்ரவரி|மார்ச்|ஏப்ரல்|மே|ஜூன்|ஜூலை|ஆகஸ்ட்|செப்டம்பர்|அக்டோபர்|நவம்பர்|டிசம்பர்)/i
};
var parseMonthPatterns = {
narrow: [
/^ஜ$/i,
/^பி/i,
/^மா/i,
/^ஏ/i,
/^மே/i,
/^ஜூ/i,
/^ஜூ/i,
/^ஆ/i,
/^செ/i,
/^அ/i,
/^ந/i,
/^டி/i],
any: [
/^ஜன/i,
/^பி/i,
/^மா/i,
/^ஏ/i,
/^மே/i,
/^ஜூன்/i,
/^ஜூலை/i,
/^ஆ/i,
/^செ/i,
/^அ/i,
/^ந/i,
/^டி/i]
};
var matchDayPatterns = {
narrow: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
short: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
abbreviated: /^(ஞாயி.|திங்.|செவ்.|புத.|வியா.|வெள்.|சனி)/i,
wide: /^(ஞாயிறு|திங்கள்|செவ்வாய்|புதன்|வியாழன்|வெள்ளி|சனி)/i
};
var parseDayPatterns = {
narrow: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i],
any: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i]
};
var matchDayPeriodPatterns = {
narrow: /^(மு.ப|பி.ப|நள்|நண்|காலை|மதியம்|மாலை|இரவு)/i,
any: /^(மு.ப|பி.ப|முற்பகல்|பிற்பகல்|நள்ளிரவு|நண்பகல்|காலை|மதியம்|மாலை|இரவு)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^மு/i,
pm: /^பி/i,
midnight: /^நள்/i,
noon: /^நண்/i,
morning: /காலை/i,
afternoon: /மதியம்/i,
evening: /மாலை/i,
night: /இரவு/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/ta.mjs
var ta = {
code: "ta",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/ta/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
ta: ta }) });
//# debugId=5E15C2116A28B73164756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1,493 @@
import { describe, expect, it } from 'vitest';
import { InvalidConfiguration } from '../errors/index.js';
import { validateTimezones } from './validateTimezones.js';
describe('validateTimezones', ()=>{
describe('valid timezones', ()=>{
it('should accept UTC timezone', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'UTC',
value: 'UTC'
}
]
})).not.toThrow();
});
it.each([
'America/New_York',
'America/Los_Angeles',
'America/Chicago',
'Europe/London',
'Europe/Paris',
'Europe/Berlin',
'Asia/Tokyo',
'Asia/Shanghai',
'Asia/Singapore',
'Australia/Sydney',
'Pacific/Auckland'
])('should accept valid IANA timezone: %s', (timezone)=>{
expect(()=>validateTimezones({
timezones: [
{
label: timezone,
value: timezone
}
]
})).not.toThrow();
});
it('should accept multiple valid timezones', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'New York',
value: 'America/New_York'
},
{
label: 'London',
value: 'Europe/London'
},
{
label: 'Tokyo',
value: 'Asia/Tokyo'
}
]
})).not.toThrow();
});
it('should accept empty array', ()=>{
expect(()=>validateTimezones({
timezones: []
})).not.toThrow();
});
it('should accept undefined timezones', ()=>{
expect(()=>validateTimezones({
timezones: undefined
})).not.toThrow();
});
});
describe('invalid timezones', ()=>{
it('should throw for completely invalid timezone', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'Invalid',
value: 'Invalid/Timezone'
}
]
})).toThrow(InvalidConfiguration);
});
it('should throw for made up timezone', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'Fake',
value: 'Fake/Place'
}
]
})).toThrow(InvalidConfiguration);
});
it('should throw for empty string timezone value', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'Empty',
value: ''
}
]
})).toThrow(InvalidConfiguration);
});
it('should throw for random string timezone', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'Random',
value: 'not-a-timezone'
}
]
})).toThrow(InvalidConfiguration);
});
});
describe('misspelled timezones', ()=>{
it.each([
[
'Asian/Tokyo',
'Asia/Tokyo'
],
[
'Asian/Shanghai',
'Asia/Shanghai'
],
[
'Asian/Singapore',
'Asia/Singapore'
],
[
'Asian/Seoul',
'Asia/Seoul'
],
[
'Asian/Bangkok',
'Asia/Bangkok'
]
])('should throw for misspelled "Asian/" instead of "Asia/": %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
[
'Americas/New_York',
'America/New_York'
],
[
'Americas/Los_Angeles',
'America/Los_Angeles'
],
[
'Americas/Chicago',
'America/Chicago'
]
])('should throw for misspelled "Americas/" instead of "America/": %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
[
'Europ/London',
'Europe/London'
],
[
'Euorpe/Paris',
'Europe/Paris'
],
[
'Europa/Berlin',
'Europe/Berlin'
]
])('should throw for misspelled Europe region: %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
[
'Australa/Sydney',
'Australia/Sydney'
],
[
'Austrlia/Melbourne',
'Australia/Melbourne'
]
])('should throw for misspelled Australia region: %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
[
'Pacific/Aukland',
'Pacific/Auckland'
],
[
'Pacfic/Auckland',
'Pacific/Auckland'
]
])('should throw for misspelled Pacific region or city: %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'America/NewYork',
'America/New-York',
'America/newyork'
])('should throw for incorrectly formatted city name: %s', (misspelled)=>{
expect(()=>validateTimezones({
timezones: [
{
label: misspelled,
value: misspelled
}
]
})).toThrow(InvalidConfiguration);
});
// Note: Intl API is case-insensitive, so lowercase versions like 'america/new_york' are valid
it('should accept lowercase timezone (Intl API is case-insensitive)', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'lowercase',
value: 'america/new_york'
}
]
})).not.toThrow();
});
});
describe('error messages', ()=>{
it('should include timezone value in error message', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'Bad',
value: 'Invalid/Zone'
}
]
})).toThrow(/Invalid\/Zone/);
});
it('should include source in error message when provided', ()=>{
expect(()=>validateTimezones({
source: 'admin.timezones.supportedTimezones',
timezones: [
{
label: 'Bad',
value: 'Invalid/Zone'
}
]
})).toThrow(/admin\.timezones\.supportedTimezones/);
});
it('should include field name in source for field-level errors', ()=>{
expect(()=>validateTimezones({
source: 'field "publishedAt" timezone.supportedTimezones',
timezones: [
{
label: 'Bad',
value: 'Asian/Tokyo'
}
]
})).toThrow(/field "publishedAt"/);
});
});
describe('mixed valid and invalid timezones', ()=>{
it('should throw when array contains at least one invalid timezone', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'New York',
value: 'America/New_York'
},
{
label: 'Invalid',
value: 'Asian/Tokyo'
},
{
label: 'London',
value: 'Europe/London'
}
]
})).toThrow(InvalidConfiguration);
});
it('should throw on first invalid timezone encountered', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'First Invalid',
value: 'Fake/First'
},
{
label: 'Second Invalid',
value: 'Fake/Second'
}
]
})).toThrow(/Fake\/First/);
});
});
describe('UTC offset timezones', ()=>{
describe('valid UTC offsets', ()=>{
it.each([
'+00:00',
'-00:00',
'+05:30',
'-08:00',
'+12:00',
'-12:00',
'+14:00',
'+09:30',
'+05:45'
])('should accept valid HH:mm format offset: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `UTC${offset}`,
value: offset
}
]
})).not.toThrow();
});
it('should accept mixed IANA and offset timezones', ()=>{
expect(()=>validateTimezones({
timezones: [
{
label: 'New York',
value: 'America/New_York'
},
{
label: 'UTC+5:30',
value: '+05:30'
},
{
label: 'UTC',
value: 'UTC'
},
{
label: 'UTC-8',
value: '-08:00'
}
]
})).not.toThrow();
});
});
describe('invalid UTC offsets', ()=>{
it.each([
'+0530',
'-0800',
'+0000',
'+1200',
'+00',
'-08',
'+9',
'-5'
])('should throw for non-HH:mm format offset: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Invalid ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'+15:00',
'-13:00',
'+25:00',
'-20:00'
])('should throw for out of range hour offset: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Invalid ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'+05:60',
'-08:99',
'+12:75',
'+00:61'
])('should throw for invalid minutes in offset: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Invalid ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'05:30',
'0800',
'12',
'530'
])('should throw for offset missing sign: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Missing sign ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'++05:30',
'--08:00',
'+-05:30',
'-+08:00'
])('should throw for malformed sign in offset: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Malformed ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'+ 05:30',
'- 08:00',
'+05 :30',
'+05: 30'
])('should throw for offset with spaces: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Spaced ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'+5:',
'+:30',
':',
'+:',
'-:'
])('should throw for incomplete offset format: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `Incomplete ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
it.each([
'+05:30:00',
'+05:30:30',
'-08:00:00'
])('should throw for offset with seconds: %s', (offset)=>{
expect(()=>validateTimezones({
timezones: [
{
label: `With seconds ${offset}`,
value: offset
}
]
})).toThrow(InvalidConfiguration);
});
});
});
});
//# sourceMappingURL=validateTimezones.spec.js.map
@@ -0,0 +1,558 @@
# file-type
> Detect the file type of a Uint8Array/ArrayBuffer
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
This package is for detecting binary-based file formats, not text-based formats like `.txt`, `.csv`, `.svg`, etc.
We accept contributions for commonly used modern file formats, not historical or obscure ones. Open an issue first for discussion.
## Install
```sh
npm install file-type
```
**This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).**
If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
## Usage
#### Node.js
Determine file type from a file:
```js
import {fileTypeFromFile} from 'file-type';
console.log(await fileTypeFromFile('Unicorn.png'));
//=> {ext: 'png', mime: 'image/png'}
```
Determine file type from a Uint8Array/ArrayBuffer, which may be a portion of the beginning of a file:
```js
import {fileTypeFromBuffer} from 'file-type';
import {readChunk} from 'read-chunk';
const buffer = await readChunk('Unicorn.png', {length: 4100});
console.log(await fileTypeFromBuffer(buffer));
//=> {ext: 'png', mime: 'image/png'}
```
Determine file type from a stream:
```js
import fs from 'node:fs';
import {fileTypeFromStream} from 'file-type';
const stream = fs.createReadStream('Unicorn.mp4');
console.log(await fileTypeFromStream(stream));
//=> {ext: 'mp4', mime: 'video/mp4'}
```
The stream method can also be used to read from a remote location:
```js
import got from 'got';
import {fileTypeFromStream} from 'file-type';
const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
const stream = got.stream(url);
console.log(await fileTypeFromStream(stream));
//=> {ext: 'jpg', mime: 'image/jpeg'}
```
Another stream example:
```js
import stream from 'node:stream';
import fs from 'node:fs';
import crypto from 'node:crypto';
import {fileTypeStream} from 'file-type';
const read = fs.createReadStream('encrypted.enc');
const decipher = crypto.createDecipheriv(alg, key, iv);
const streamWithFileType = await fileTypeStream(stream.pipeline(read, decipher));
console.log(streamWithFileType.fileType);
//=> {ext: 'mov', mime: 'video/quicktime'}
const write = fs.createWriteStream(`decrypted.${streamWithFileType.fileType.ext}`);
streamWithFileType.pipe(write);
```
#### Browser
```js
import {fileTypeFromStream} from 'file-type';
const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
const response = await fetch(url);
const fileType = await fileTypeFromStream(response.body);
console.log(fileType);
//=> {ext: 'jpg', mime: 'image/jpeg'}
```
## API
### fileTypeFromBuffer(buffer)
Detect the file type of a `Uint8Array`, or `ArrayBuffer`.
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
If file access is available, it is recommended to use `fileTypeFromFile()` instead.
Returns a `Promise` for an object with the detected file type:
- `ext` - One of the [supported file types](#supported-file-types)
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
Or `undefined` when there is no match.
#### buffer
Type: `Uint8Array | ArrayBuffer`
A buffer representing file data. It works best if the buffer contains the entire file. It may work with a smaller portion as well.
### fileTypeFromFile(filePath)
Detect the file type of a file path.
This is for Node.js only.
To read from a [`File`](https://developer.mozilla.org/docs/Web/API/File), see [`fileTypeFromBlob()`](#filetypefromblobblob).
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
Returns a `Promise` for an object with the detected file type:
- `ext` - One of the [supported file types](#supported-file-types)
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
Or `undefined` when there is no match.
#### filePath
Type: `string`
The file path to parse.
### fileTypeFromStream(stream)
Detect the file type of a [web `ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
If the engine is Node.js, this may also be a [Node.js `stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable).
Direct support for Node.js streams will be dropped in the future, when Node.js streams can be converted to Web streams (see [`toWeb()`](https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options)).
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
Returns a `Promise` for an object with the detected file type:
- `ext` - One of the [supported file types](#supported-file-types)
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
Or `undefined` when there is no match.
#### stream
Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
A readable stream representing file data.
### fileTypeFromBlob(blob)
Detect the file type of a [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob),
[!TIP]
> A [`File` object](https://developer.mozilla.org/docs/Web/API/File) is a `Blob` and can be passed in here.
It will **stream** the underlying Blob, and required a [ReadableStreamBYOBReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader) which **require Node.js ≥ 20**.
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the blob.
Returns a `Promise` for an object with the detected file type:
- `ext` - One of the [supported file types](#supported-file-types)
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
Or `undefined` when there is no match.
```js
import {fileTypeFromBlob} from 'file-type';
const blob = new Blob(['<?xml version="1.0" encoding="ISO-8859-1" ?>'], {
type: 'text/plain',
endings: 'native'
});
console.log(await fileTypeFromBlob(blob));
//=> {ext: 'txt', mime: 'text/plain'}
```
#### blob
Type: [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
### fileTypeFromTokenizer(tokenizer)
Detect the file type from an `ITokenizer` source.
This method is used internally, but can also be used for a special "tokenizer" reader.
A tokenizer propagates the internal read functions, allowing alternative transport mechanisms, to access files, to be implemented and used.
Returns a `Promise` for an object with the detected file type:
- `ext` - One of the [supported file types](#supported-file-types)
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
Or `undefined` when there is no match.
An example is [`@tokenizer/http`](https://github.com/Borewit/tokenizer-http), which requests data using [HTTP-range-requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests). A difference with a conventional stream and the [*tokenizer*](https://github.com/Borewit/strtok3#tokenizer), is that it can *ignore* (seek, fast-forward) in the stream. For example, you may only need and read the first 6 bytes, and the last 128 bytes, which may be an advantage in case reading the entire file would take longer.
```js
import {makeTokenizer} from '@tokenizer/http';
import {fileTypeFromTokenizer} from 'file-type';
const audioTrackUrl = 'https://test-audio.netlify.com/Various%20Artists%20-%202009%20-%20netBloc%20Vol%2024_%20tiuqottigeloot%20%5BMP3-V2%5D/01%20-%20Diablo%20Swing%20Orchestra%20-%20Heroines.mp3';
const httpTokenizer = await makeTokenizer(audioTrackUrl);
const fileType = await fileTypeFromTokenizer(httpTokenizer);
console.log(fileType);
//=> {ext: 'mp3', mime: 'audio/mpeg'}
```
Or use [`@tokenizer/s3`](https://github.com/Borewit/tokenizer-s3) to determine the file type of a file stored on [Amazon S3](https://aws.amazon.com/s3):
```js
import S3 from 'aws-sdk/clients/s3';
import {makeTokenizer} from '@tokenizer/s3';
import {fileTypeFromTokenizer} from 'file-type';
// Initialize the S3 client
const s3 = new S3();
// Initialize the S3 tokenizer.
const s3Tokenizer = await makeTokenizer(s3, {
Bucket: 'affectlab',
Key: '1min_35sec.mp4'
});
// Figure out what kind of file it is.
const fileType = await fileTypeFromTokenizer(s3Tokenizer);
console.log(fileType);
```
Note that only the minimum amount of data required to determine the file type is read (okay, just a bit extra to prevent too many fragmented reads).
#### tokenizer
Type: [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer)
A file source implementing the [tokenizer interface](https://github.com/Borewit/strtok3#tokenizer).
### fileTypeStream(readableStream, options?)
Returns a `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `fileTypeFromFile()`.
This method can be handy to put in between a stream, but it comes with a price.
Internally `stream()` builds up a buffer of `sampleSize` bytes, used as a sample, to determine the file type.
The sample size impacts the file detection resolution.
A smaller sample size will result in lower probability of the best file type detection.
**Note:** This method is only available when using Node.js.
**Note:** Requires Node.js 14 or later.
#### readableStream
Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
#### options
Type: `object`
##### sampleSize
Type: `number`\
Default: `4100`
The sample size in bytes.
#### Example
```js
import got from 'got';
import {fileTypeStream} from 'file-type';
const url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';
const stream1 = got.stream(url);
const stream2 = await fileTypeStream(stream1, {sampleSize: 1024});
if (stream2.fileType?.mime === 'image/jpeg') {
// stream2 can be used to stream the JPEG image (from the very beginning of the stream)
}
```
#### readableStream
Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
The input stream.
### supportedExtensions
Returns a `Set<string>` of supported file extensions.
### supportedMimeTypes
Returns a `Set<string>` of supported MIME types.
## Custom detectors
A custom detector is a function that allows specifying custom detection mechanisms.
An iterable of detectors can be provided via the `fileTypeOptions` argument for the `FileTypeParser` constructor.
In Node.js, you should use `NodeFileTypeParser`, which extends `FileTypeParser` and provides access to Node.js specific functions.
The detectors are called before the default detections in the provided order.
Custom detectors can be used to add new `FileTypeResults` or to modify return behaviour of existing `FileTypeResult` detections.
If the detector returns `undefined`, there are 2 possible scenarios:
1. The detector has not read from the tokenizer, it will be proceeded with the next available detector.
2. The detector has read from the tokenizer (`tokenizer.position` has been increased).
In that case no further detectors will be executed and the final conclusion is that file-type returns undefined.
Note that this an exceptional scenario, as the detector takes the opportunity from any other detector to determine the file type.
Example detector array which can be extended and provided to each public method via the `fileTypeOptions` argument:
```js
import {FileTypeParser} from 'file-type'; // or `NodeFileTypeParser` in Node.js
const customDetectors = [
async tokenizer => {
const unicornHeader = [85, 78, 73, 67, 79, 82, 78]; // 'UNICORN' as decimal string
const buffer = new Uint8Array(7);
await tokenizer.peekBuffer(buffer, {length: unicornHeader.length, mayBeLess: true});
if (unicornHeader.every((value, index) => value === buffer[index])) {
return {ext: 'unicorn', mime: 'application/unicorn'};
}
return undefined;
},
];
const buffer = new Uint8Array(new TextEncoder().encode('UNICORN'));
const parser = new FileTypeParser({customDetectors}); // `NodeFileTypeParser({customDetectors})` in Node.js
const fileType = await parser.fromBuffer(buffer);
console.log(fileType);
```
## Supported file types
- [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services
- [`3gp`](https://en.wikipedia.org/wiki/3GP_and_3G2#3GP) - Multimedia container format defined by the Third Generation Partnership Project (3GPP) for 3G UMTS multimedia services
- [`3mf`](https://en.wikipedia.org/wiki/3D_Manufacturing_Format) - 3D Manufacturing Format
- [`7z`](https://en.wikipedia.org/wiki/7z) - 7-Zip archive
- [`Z`](https://fileinfo.com/extension/z) - Unix Compressed File
- [`aac`](https://en.wikipedia.org/wiki/Advanced_Audio_Coding) - Advanced Audio Coding
- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
- [`ace`](https://en.wikipedia.org/wiki/ACE_(compressed_file_format)) - ACE archive
- [`ai`](https://en.wikipedia.org/wiki/Adobe_Illustrator_Artwork) - Adobe Illustrator Artwork
- [`aif`](https://en.wikipedia.org/wiki/Audio_Interchange_File_Format) - Audio Interchange file
- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file
- [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec) - Adaptive Multi-Rate audio codec
- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
- [`apng`](https://en.wikipedia.org/wiki/APNG) - Animated Portable Network Graphics
- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix)) - Archive file
- [`arj`](https://en.wikipedia.org/wiki/ARJ) - Archive file
- [`arrow`](https://arrow.apache.org) - Columnar format for tables of data
- [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file
- [`asar`](https://github.com/electron/asar#format) - Archive format primarily used to enclose Electron applications
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave) - Audio Video Interleave file
- [`avif`](https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVIF)) - AV1 Image File Format
- [`avro`](https://en.wikipedia.org/wiki/Apache_Avro#Avro_Object_Container_File) - Object container file developed by Apache Avro
- [`blend`](https://wiki.blender.org/index.php/Dev:Source/Architecture/File_Format) - Blender project
- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format) - Bitmap image file
- [`bpg`](https://bellard.org/bpg/) - Better Portable Graphics file
- [`bz2`](https://en.wikipedia.org/wiki/Bzip2) - Archive file
- [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format)) - Cabinet file
- [`cfb`](https://en.wikipedia.org/wiki/Compound_File_Binary_Format) - Compound File Binary Format
- [`chm`](https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help) - Microsoft Compiled HTML Help
- [`class`](https://en.wikipedia.org/wiki/Java_class_file) - Java class file
- [`cpio`](https://en.wikipedia.org/wiki/Cpio) - Cpio archive
- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
- [`crx`](https://developer.chrome.com/extensions/crx) - Google Chrome extension
- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image
- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word document
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
- [`dwg`](https://en.wikipedia.org/wiki/.dwg) - Autodesk CAD file
- [`elf`](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) - Unix Executable and Linkable Format
- [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType) - Embedded OpenType font
- [`eps`](https://en.wikipedia.org/wiki/Encapsulated_PostScript) - Encapsulated PostScript
- [`epub`](https://en.wikipedia.org/wiki/EPUB) - E-book file
- [`exe`](https://en.wikipedia.org/wiki/.exe) - Executable file
- [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player
- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
- [`fbx`](https://en.wikipedia.org/wiki/FBX) - Filmbox is a proprietary file format used to provide interoperability between digital content creation apps.
- [`flac`](https://en.wikipedia.org/wiki/FLAC) - Free Lossless Audio Codec
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format) - Free Lossless Image Format
- [`flv`](https://en.wikipedia.org/wiki/Flash_Video) - Flash video
- [`gif`](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
- [`gz`](https://en.wikipedia.org/wiki/Gzip) - Archive file
- [`heic`](https://nokiatech.github.io/heif/technical.html) - High Efficiency Image File Format
- [`icc`](https://en.wikipedia.org/wiki/ICC_profile) - ICC Profile
- [`icns`](https://en.wikipedia.org/wiki/Apple_Icon_Image_format) - Apple Icon image
- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image
- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jxl`](https://en.wikipedia.org/wiki/JPEG_XL) - JPEG XL image format
- [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR) - Joint Photographic Experts Group extended range
- [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures
- [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut
- [`lz`](https://en.wikipedia.org/wiki/Lzip) - Archive file
- [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive
- [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
- [`m4p`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 files with audio streams encrypted by FairPlay Digital Rights Management as were sold through the iTunes Store
- [`m4v`](https://en.wikipedia.org/wiki/M4V) - Video container format developed by Apple, which is very similar to the MP4 format
- [`macho`](https://en.wikipedia.org/wiki/Mach-O) - Mach-O binary format
- [`mid`](https://en.wikipedia.org/wiki/MIDI) - Musical Instrument Digital Interface file
- [`mie`](https://en.wikipedia.org/wiki/Sidecar_file) - Dedicated meta information format which supports storage of binary as well as textual meta information
- [`mj2`](https://en.wikipedia.org/wiki/Motion_JPEG_2000) - Motion JPEG 2000
- [`mkv`](https://en.wikipedia.org/wiki/Matroska) - Matroska video file
- [`mobi`](https://en.wikipedia.org/wiki/Mobipocket) - Mobipocket
- [`mov`](https://en.wikipedia.org/wiki/QuickTime_File_Format) - QuickTime video file
- [`mp1`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_I) - MPEG-1 Audio Layer I
- [`mp2`](https://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_II) - MPEG-1 Audio Layer II
- [`mp3`](https://en.wikipedia.org/wiki/MP3) - Audio file
- [`mp4`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 Part 14 video file
- [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)
- [`mpg`](https://en.wikipedia.org/wiki/MPEG-1) - MPEG-1 file
- [`mts`](https://en.wikipedia.org/wiki/.m2ts) - MPEG-2 Transport Stream, both raw and Blu-ray Disc Audio-Video (BDAV) versions
- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format) - Material Exchange Format
- [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file
- [`nes`](https://fileinfo.com/extension/nes) - Nintendo NES ROM
- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
- [`odt`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for word processing
- [`oga`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`ogg`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`ogm`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`ogv`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`ogx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format)) - Audio file
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
- [`otf`](https://en.wikipedia.org/wiki/OpenType) - OpenType font
- [`parquet`](https://en.wikipedia.org/wiki/Apache_Parquet) - Apache Parquet
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format) - Portable Document Format
- [`pgp`](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) - Pretty Good Privacy
- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics
- [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Powerpoint document
- [`ps`](https://en.wikipedia.org/wiki/Postscript) - Postscript
- [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format) - Adobe Photoshop document
- [`pst`](https://en.wikipedia.org/wiki/Personal_Storage_Table) - Personal Storage Table file
- [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data
- [`raf`](https://en.wikipedia.org/wiki/Raw_image_format) - Fujifilm RAW image file
- [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format)) - Archive file
- [`rpm`](https://fileinfo.com/extension/rpm) - Red Hat Package Manager file
- [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format) - Rich Text Format
- [`rw2`](https://en.wikipedia.org/wiki/Raw_image_format) - Panasonic RAW image file
- [`s3m`](https://wiki.openmpt.org/Manual:_Module_formats#The_ScreamTracker_3_format_.28.s3m.29) - Audio module format: ScreamTracker 3
- [`shp`](https://en.wikipedia.org/wiki/Shapefile) - Geospatial vector data format
- [`skp`](https://en.wikipedia.org/wiki/SketchUp) - SketchUp
- [`spx`](https://en.wikipedia.org/wiki/Ogg) - Audio file
- [`sqlite`](https://www.sqlite.org/fileformat2.html) - SQLite file
- [`stl`](https://en.wikipedia.org/wiki/STL_(file_format)) - Standard Tesselated Geometry File Format (ASCII only)
- [`swf`](https://en.wikipedia.org/wiki/SWF) - Adobe Flash Player file
- [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format) - Tarball archive file
- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format) - Tagged Image file
- [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font
- [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard
- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File
- [`vsdx`](https://en.wikipedia.org/wiki/Microsoft_Visio) - Microsoft Visio File
- [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format
- [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file
- [`webm`](https://en.wikipedia.org/wiki/WebM) - Web video file
- [`webp`](https://en.wikipedia.org/wiki/WebP) - Web Picture format
- [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
- [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format) - Web Open Font Format
- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel document
- [`xm`](https://wiki.openmpt.org/Manual:_Module_formats#The_FastTracker_2_format_.28.xm.29) - Audio module format: FastTracker 2
- [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language
- [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file
- [`xz`](https://en.wikipedia.org/wiki/Xz) - Compressed file
- [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file
- [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file
*[Pull requests](.github/pull_request_template.md) are welcome for additional commonly used file types.*
The following file types will not be accepted:
- [MS-CFB: Microsoft Compound File Binary File Format based formats](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b), too old and difficult to parse:
- `.doc` - Microsoft Word 97-2003 Document
- `.xls` - Microsoft Excel 97-2003 Document
- `.ppt` - Microsoft PowerPoint97-2003 Document
- `.msi` - Microsoft Windows Installer
- `.csv` - [Reason.](https://github.com/sindresorhus/file-type/issues/264#issuecomment-568439196)
- `.svg` - Detecting it requires a full-blown parser. Check out [`is-svg`](https://github.com/sindresorhus/is-svg) for something that mostly works.
#### tokenizer
Type: [`ITokenizer`](https://github.com/Borewit/strtok3#tokenizer)
Usable as source of the examined file.
#### fileType
Type: `FileTypeResult`
An object having an `ext` (extension) and `mime` (mime type) property.
Detected by the standard detections or a previous custom detection. Undefined if no matching fileTypeResult could be found.
## Related
- [file-type-cli](https://github.com/sindresorhus/file-type-cli) - CLI for this module
- [image-dimensions](https://github.com/sindresorhus/image-dimensions) - Get the dimensions of an image
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Borewit](https://github.com/Borewit)
@@ -0,0 +1 @@
{"version":3,"file":"vercelai.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/vercelai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB,0CAA0C,CAAC"}
@@ -0,0 +1,28 @@
"use strict";
exports.bg = void 0;
var _index = require("./bg/_lib/formatDistance.js");
var _index2 = require("./bg/_lib/formatLong.js");
var _index3 = require("./bg/_lib/formatRelative.js");
var _index4 = require("./bg/_lib/localize.js");
var _index5 = require("./bg/_lib/match.js");
/**
* @category Locales
* @summary Bulgarian locale.
* @language Bulgarian
* @iso-639-2 bul
* @author Nikolay Stoynov [@arvigeus](https://github.com/arvigeus)
* @author Tsvetan Ovedenski [@fintara](https://github.com/fintara)
*/
const bg = (exports.bg = {
code: "bg",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
});
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} 'دە' {{time}}",
long: "{{date}} 'دە' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,6 @@
*.js text eol=lf
*.txt text eol=lf
*.html text eol=lf
*.htm text eol=lf
*.ics -text
*.bin -text
@@ -0,0 +1 @@
{"version":3,"file":"square-bottom-dashed-scissors.js","sources":["../../../src/icons/square-bottom-dashed-scissors.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareBottomDashedScissors\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjE2YTIgMiAwIDAgMS0yIDIiIC8+CiAgPHBhdGggZD0iTTEwIDIySDgiIC8+CiAgPHBhdGggZD0iTTE2IDIyaC0yIiAvPgogIDxjaXJjbGUgY3g9IjgiIGN5PSI4IiByPSIyIiAvPgogIDxwYXRoIGQ9Ik05LjQxNCA5LjQxNCAxMiAxMiIgLz4KICA8cGF0aCBkPSJNMTQuOCAxNC44IDE4IDE4IiAvPgogIDxjaXJjbGUgY3g9IjgiIGN5PSIxNiIgcj0iMiIgLz4KICA8cGF0aCBkPSJtMTggNi04LjU4NiA4LjU4NiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-bottom-dashed-scissors\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SquareBottomDashedScissors = createLucideIcon('SquareBottomDashedScissors', [\n [\n 'path',\n { d: 'M4 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2', key: '1vzg26' },\n ],\n ['path', { d: 'M10 22H8', key: 'euku7a' }],\n ['path', { d: 'M16 22h-2', key: '18d249' }],\n ['circle', { cx: '8', cy: '8', r: '2', key: '14cg06' }],\n ['path', { d: 'M9.414 9.414 12 12', key: 'qz4lzr' }],\n ['path', { d: 'M14.8 14.8 18 18', key: '11flf1' }],\n ['circle', { cx: '8', cy: '16', r: '2', key: '1acxsx' }],\n ['path', { d: 'm18 6-8.586 8.586', key: '11kzk1' }],\n]);\n\nexport default SquareBottomDashedScissors;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,iBAAiB,4BAA8B,CAAA,CAAA,CAAA;AAAA,CAChF,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC9F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'கடந்த' eeee p 'மணிக்கு'",
yesterday: "'நேற்று ' p 'மணிக்கு'",
today: "'இன்று ' p 'மணிக்கு'",
tomorrow: "'நாளை ' p 'மணிக்கு'",
nextWeek: "eeee p 'மணிக்கு'",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;
@@ -0,0 +1,4 @@
import type { DefaultCellComponentProps } from 'payload';
import React from 'react';
export declare const QueryPresetsAccessCell: React.FC<DefaultCellComponentProps>;
//# sourceMappingURL=index.d.ts.map

Some files were not shown because too many files have changed in this diff Show More